Minor fixes for openssh-SNAP-20001028

Mark D. Roth roth at feep.net
Tue Oct 31 08:16:15 EST 2000


I've attached a patch for openssh-SNAP-20001028 which fixes the
following two problems:

1) I fixed fixpaths to complain instead of failing silently if it
   can't write the output file.

2) I changed log-server.c to use av0 as the first argument to
   openlog().  I also made sure it called openlog() before the TCP
   wrapper stuff, because libwrap calls syslog() and winds up using
   the wrong program name.

Please let me know if you have any questions or problems.  Thanks!

-- 
Mark D. Roth <roth at feep.net>
http://www.feep.net/~roth/
-------------- next part --------------
diff -urN openssh-snap20001028/fixpaths /projects/encap-src/common/wsg/openssh-snap20001028/fixpaths
--- openssh-snap20001028/fixpaths	Wed Apr 19 16:33:24 2000
+++ /projects/encap-src/common/wsg/openssh-snap20001028/fixpaths	Mon Oct 30 14:41:31 2000
@@ -37,14 +37,13 @@
   $of = $2.".$ext"; 
 
   open(IN, "<$f")          || die ("$0: input file $f missing!\n");
-  if (open(OUT, ">$of")) {
-    while (<IN>) {
-      for $s (keys(%def)) {
-	s#$s#$def{$s}#;
-      } # for $s
-      print OUT;
-    } # while <IN>
-  } # if (outfile open)
+  open(OUT, ">$of")        || die ("$0: cannot create output file $of: $!\n");
+  while (<IN>) {
+    for $s (keys(%def)) {
+      s#$s#$def{$s}#;
+    } # for $s
+    print OUT;
+  } # while <IN>
 } # for $f
 
 exit 0;
diff -urN openssh-snap20001028/log-server.c /projects/encap-src/common/wsg/openssh-snap20001028/log-server.c
--- openssh-snap20001028/log-server.c	Fri Sep 15 21:29:09 2000
+++ /projects/encap-src/common/wsg/openssh-snap20001028/log-server.c	Mon Oct 30 14:42:31 2000
@@ -46,7 +46,7 @@
 #ifdef HAVE___PROGNAME
 extern char *__progname;
 #else /* HAVE___PROGNAME */
-static const char *__progname = "sshd";
+static const char *__progname = NULL;
 #endif /* HAVE___PROGNAME */
 
 static LogLevel log_level = SYSLOG_LEVEL_INFO;
@@ -118,6 +118,10 @@
 		exit(1);
 	}
 	log_on_stderr = on_stderr;
+	if (__progname == NULL)
+		__progname = av0;
+	if (! log_on_stderr)
+		openlog(__progname, LOG_PID, log_facility);
 }
 
 #define MSGBUFSIZ 1024


More information about the openssh-unix-dev mailing list