/ /home/httpd/perl use strict; my ($bracketed_warning,$run_modify_config); if (open(PIPE,"/bin/su -s /bin/bash -c 'bind -V 2>&1' www |grep enable-bracketed-paste |")) { my $info = <PIPE>; chomp($info); my ($bracketed) = ($info =~ /^\Qenable-bracketed-paste\E\s+is\s+set\s+to\s+\W(on|off)\W$/); close(PIPE); if ($bracketed eq 'on') { my $bash_www_cnf = '/home/www/.inputrc'; if (!-e $bash_www_cnf) { $bracketed_warning = 1; } elsif (open(my $fh,'<',$bash_www_cnf)) { my (%bracketed_paste_on,%bracketed_paste_off,$condition); $condition = ''; while (my $line=<$fh>) { chomp($line); if ($line =~ /^\$if\s+(\w+)\s*$/) { if ($1 eq 'R') { $condition = 'r'; } elsif ($1 eq 'maxima') { $condition = 'maxima'; } else { $condition = 'other'; } } elsif ($line =~ /^\$endif\s*$/) { $condition = ''; } if ($line =~ /^\s*set\s+enable\-bracketed\-paste\s+(off|on)\s*$/) { if ($1 eq 'off') { if ($condition ne '') { $bracketed_paste_off{$condition} = 1; } else { $bracketed_paste_off{all} = 1; } } else { if ($condition ne '') { $bracketed_paste_on{$condition} = 1; } else { $bracketed_paste_on{all} = 1; } } } } close($fh); if ($bracketed_paste_on{r} || !exists($bracketed_paste_off{r})) { $run_modify_config = 1; } } else { print "Unable to check if bracketed paste is set to off for www user's shell for R application (lonr).\n"; } } } else { print "Unable to check if bracketed paste is set to off for www user's shell for R application (lonr).\n"; } if ($bracketed_warning) { print <<'END'; **** ERROR: Problems which include calls to R statistics engine will not work. You need to create a file: /home/www/.inputrc containing the following lines: $if R set enable-bracketed-paste off $endif END } elsif ($run_modify_config) { print <<'END'; **** ERROR: Problems which include calls to R statistics engine will not work. Run /home/httpd/perl/modify_config_files.pl as root so the file /home/www/.inputrc will contain the following: $if R set enable-bracketed-paste off $endif END }