]> andersk Git - gssapi-openssh.git/blobdiff - setup/setup-openssh.pl
o Update version of setup package.
[gssapi-openssh.git] / setup / setup-openssh.pl
index 6df4aa43a19d6b8ff86399a473321d2a2c3edf48..6893130bb3d56673a29b3173895b518920f8f24f 100644 (file)
@@ -67,6 +67,7 @@ my $myname = "setup-openssh.pl";
 $prefix = ${globusdir};
 $exec_prefix = "${prefix}";
 $bindir = "${exec_prefix}/bin";
+$sbindir = "${exec_prefix}/sbin";
 $sysconfdir = "$prefix/etc/ssh";
 $localsshdir = "/etc/ssh";
 $setupdir = "$prefix/setup/gsi_openssh_setup";
@@ -206,8 +207,9 @@ sub determineKeys
 sub runKeyGen
 {
     my($gen_keys) = @_;
+    my $keygen = "$bindir/ssh-keygen";
 
-    if (@$gen_keys)
+    if (@$gen_keys && -x $keygen)
     {
         print "Generating ssh host keys...\n";
 
@@ -234,7 +236,8 @@ sub fixpaths
 
     if ( ! -f "$f" )
     {
-        die("Cannot find $f!");
+        printf("Cannot find $f!\n");
+        return;
     }
 
     #
@@ -264,12 +267,23 @@ sub fixpaths
         # sorry for the whacky regex, but i need to verify a whole line
         #
 
-        if ( /^\s*Subsystem\s+sftp\s+\S+\s*$/ )
+        $line = $_;
+        if ( $line =~ /^\s*Subsystem\s+sftp\s+\S+\s*$/ )
         {
-            $_ = "Subsystem\tsftp\t$gpath/libexec/sftp-server\n";
-            $_ =~ s:/+:/:g;
+            $newline = "Subsystem\tsftp\t$gpath/libexec/sftp-server\n";
+            $newline =~ s:/+:/:g;
         }
-        print OUT "$_";
+        elsif ( $line =~ /^\s*PidFile.*$/ )
+        {
+            $newline = "PidFile\t$gpath/var/sshd.pid\n";
+            $newline =~ s:/+:/:g;
+        }
+        else
+        {
+            $newline = $line;
+        }
+
+        print OUT "$newline";
     } # while <IN>
 
     close(OUT);
@@ -301,17 +315,21 @@ sub alterFileGlobusLocation
 {
     my ($in, $out) = @_;
 
-    if ( ! -e $out )
+    if ( -r $in )
     {
-        $data = readFile($in);
-        $data =~ s|\@GLOBUS_LOCATION\@|$gpath|g;
-        writeFile($out, $data);
+        if ( ( -w $out ) || ( ! -e $out ) )
+        {
+            $data = readFile($in);
+            $data =~ s|\@GLOBUS_LOCATION\@|$gpath|g;
+            writeFile($out, $data);
+            action("chmod 755 $out");
+        }
     }
 }
 
 sub alterFiles
 {
-    alterFileGlobusLocation("$setupdir/SXXsshd.in", "$bindir/SXXsshd");
+    alterFileGlobusLocation("$setupdir/SXXsshd.in", "$sbindir/SXXsshd");
 }
 
 ### readFile( $filename )
This page took 0.03375 seconds and 4 git commands to generate.