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
On Mon Oct 30 15:16 2000 -0600, Mark D. Roth wrote:> I've attached a patch for openssh-SNAP-20001028 which fixes the > following two problems:I haven't gotten any feedback on this patch, but I'd like to see it included in the next release of portable OpenSSH. Perhaphs I should have expanded a bit on why these issues were problems.> 1) I fixed fixpaths to complain instead of failing silently if it > can't write the output file.I keep my source code on an NFS-mounted filesystem so that I can access it from multiple machines. The filesystem is not exported with root permissions, for obvious security reasons. Therefore, I run configure and make as a non-root user with umask 022, followed by su'ing and running make install. Because make install tries to write files to the build directory, it fails. However, since fixpaths doesn't detect the failure, make doesn't bail out until it tries to install the manpages, at which point it complains that the .[01].out files don't exist. As a result, it takes some investigation to determine where the real cause of the failure was.> 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.On most of our Production systems, we run two invokations of sshd. The normal one is invoked as sshd and listens on port 22 for normal user connections. The additional one is invoked using a different name, listens on a different port, allows a different set of authentication mechansisms, and has a different daemon name for TCP wrappers. In this context, it makes sense to use the name that the daemon was invoked as when sending syslog messages, so that you can easily figure out which log messages are from which daemon. I'd appreciate some feedback from the OpenSSH Portability Team as to whether these changes will make it into the next release. Thanks! -- Mark D. Roth <roth at feep.net> http://www.feep.net/~roth/
Hmm..this one fell through the craks. Thanks to someone on #unixhelp for bring it up again. I applied the patch for fixpaths. I'm declining to apply the second patch until Steve and I finish with the rework of __progname (which should be done. Steve just needs to commit it). Grab the progname2.patch from Steve's last posted and let us know if there is still a problem. - Ben On Mon, 30 Oct 2000, Mark D. Roth wrote:> 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/ >