mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	add sudo support in xdsh and updatenode
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14830 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -1205,15 +1205,25 @@ sub updatenoderunps
 | 
			
		||||
               $runpscmd  =
 | 
			
		||||
                    "$installdir/postscripts/xcatdsklspost $mode -m $snkey '$postscripts' --tftp $tftpdir --installdir $installdir --nfsv4 $nfsv4"
 | 
			
		||||
            }
 | 
			
		||||
  
 | 
			
		||||
            $args1 = [
 | 
			
		||||
            # if non-root userid ask xdsh to use sudo
 | 
			
		||||
            if (defined($::USER)){ # non-root user 
 | 
			
		||||
              $args1 = [
 | 
			
		||||
               "--nodestatus",
 | 
			
		||||
               "--sudo",
 | 
			
		||||
               "-s",
 | 
			
		||||
               "-v",
 | 
			
		||||
               "-e",
 | 
			
		||||
               "$runpscmd"
 | 
			
		||||
              ];
 | 
			
		||||
            } else {   # running as root
 | 
			
		||||
              $args1 = [
 | 
			
		||||
               "--nodestatus",
 | 
			
		||||
               "-s",
 | 
			
		||||
               "-v",
 | 
			
		||||
               "-e",
 | 
			
		||||
               "$runpscmd"
 | 
			
		||||
            ];
 | 
			
		||||
 | 
			
		||||
              ];
 | 
			
		||||
           }
 | 
			
		||||
            # if -l username input
 | 
			
		||||
            if (defined($::USER)){ # need to add the -l username
 | 
			
		||||
              unshift(@$args1, "$::USER");
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user