]> andersk Git - gssapi-openssh.git/commitdiff
Fix file mode/uid/gid after they've been 'translated' by gsi-ssh setup script.
authorcphillip <cphillip>
Thu, 17 Jan 2002 21:49:28 +0000 (21:49 +0000)
committercphillip <cphillip>
Thu, 17 Jan 2002 21:49:28 +0000 (21:49 +0000)
setup/setup-openssh.pl

index 7789b649958784621e39b4f8c482e07eb5cf8033..ddb7b818dc512287fdacd97705c36ecba276692d 100644 (file)
@@ -93,8 +93,22 @@ sub fixpaths
     for $f (@files)
     {
         $f =~ /(.*\/)*(.*)$/;
+
+        #
+        # we really should create a random filename and make sure that it
+        # doesn't already exist (based off current time_t or something)
+        #
+
         $g = "$f.tmp";
 
+        #
+        # Grab the current mode/uid/gid for use later
+        #
+
+        $mode = (stat($f))[2];
+        $uid = (stat($f))[4];
+        $gid = (stat($f))[5];
+
         $result = system("mv $f $g");
         if ($result != 0)
         {
@@ -121,16 +135,19 @@ sub fixpaths
         {
             die "Failed to remove $g\n";
         }
+
+        #
+        # An attempt to revert the new file back to the original file's
+        # mode/uid/gid
+        #
+
+        chmod($mode, $f);
+        chown($uid, $gid, $f);
     } # for $f
 
     return 0;
 }
 
-sub setperms()
-{
-    $result = system("chmod 755 $bindir/scp");
-}
-
 sub runkeygen
 {
     print "Generating ssh keys (if necessary)...\n";
@@ -168,7 +185,6 @@ sub runkeygen
 }
 
 fixpaths();
-#setperms();
 runkeygen();
 
 my $metadata = new Grid::GPT::Setup(package_name => "gsi-openssh-setup");
This page took 2.457099 seconds and 5 git commands to generate.