Changeset 251

Show
Ignore:
Timestamp:
06/13/07 10:52:02 (1 year ago)
Author:
ludo
Message:

Do not depend on xprobe. chmod of .exe files improved (from r4478)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/webmin/lsc/debian/control

    r227 r251  
    99Section: utils 
    1010Architecture: all 
    11 Depends: webmin, php4, php4-cgi, webmin-lbs-common, php4-mysql, mysql-client (>> 4.0.0) | mysql-client-4.1, xprobe (>> 0.2.0) 
     11Depends: webmin, php4, php4-cgi, webmin-lbs-common, php4-mysql, mysql-client (>> 4.0.0) | mysql-client-4.1 
    1212Recommends: samba-common 
    1313Suggests: lbs 
  • trunk/webmin/lsc/include/copy.inc.php

    r227 r251  
    9292                $basename = trim(basename($f)); 
    9393                debug(2, "LSC_COPY : Dirname : \"".$dirname."\" Basename : \"".trim($basename)."\""); 
     94 
     95                /* 
     96                 * chmod +x on *.bat and *.exe 
     97                 */ 
     98                $chmod_command = "find $path_source -iname '*.exe' -or -iname '*.bat' -exec chmod 755 {} \\;"; 
     99                unset($output); unset($stdout); unset($stderr); unset($return_var); 
     100                lsc_exec($chmod_command, $output, $return_var, $stdout, $stderr); 
     101 
    94102                /* 
    95103                 * Make directory step 
    96                  */ 
    97                  
     104                 */              
    98105                unset($output); unset($return_var); unset($stdout); unset($stderr); 
    99106                $mkdir_command = "test -d '".$path_destination."' || mkdir -p '".$path_destination."'"; 
     
    160167                } 
    161168                debug(1, sprintf("File successfully copied, command is %s", $scp_command)); 
    162                  
    163                 /* 
    164                  * chmod +x on *.bat and *.exe 
    165                  */ 
    166                 $chmod_command = "chmod ugo+x -R \"$path_destination_mount_ssh\"/*.exe"; 
    167                 unset($output); unset($stdout); unset($stderr); unset($return_var); 
    168                 lsc_exec($chmod_command, $output, $return_var, $stdout, $stderr); 
    169  
    170                 $chmod_command = "chmod ugo+x -R \"$path_destination_mount_ssh\"/*.bat"; 
    171                 unset($output); unset($stdout); unset($stderr); unset($return_var); 
    172                 lsc_exec($chmod_command, $output, $return_var, $stdout, $stderr); 
    173169        } 
    174170        return $result; 
  • trunk/webmin/lsc/include/ssh.inc.php

    r250 r251  
    407407                        unset($output); unset($return_var); unset($stdout); unset($stderr); 
    408408                        lsc_exec("./xprobe_safe ".$this->ip, $output, $return_var, $stdout, $stderr); 
    409                         $key = LSC_arrayEreg("Running OS", $output); 
    410                         $type = $output[$key]; 
     409                        $type = join("\n", $output); 
    411410                } else { 
    412411                        $type = $known_type; 
  • trunk/webmin/lsc/xprobe_safe

    r250 r251  
    11#!/usr/bin/perl 
    22 
    3 $pid = open(PIPE, "xprobe2 -M 6 $ARGV[0] 2>&1 |") or die $!; 
     3$pid = open(PIPE, "ssh -tt -o StrictHostKeyChecking=no -o Batchmode=yes root@".$ARGV[0]." 'echo \$OS;uname' |") or die $!; 
    44eval { 
    55    local $SIG{ALRM} = sub { die "TIMEDOUT" }; 
    66    alarm(10); 
    7     while (<PIPE>) { print <PIPE>; }; 
     7    while(<PIPE>) { print $_; }; 
    88    close(PIPE); 
    99    alarm(0);