PATCH: fix incorrect checking of syslog facility in sftp-server
Jan Pechanec
Jan.Pechanec at Sun.COM
Thu Sep 13 05:38:12 EST 2007
hi, there is a typo like error in sftp-server.c - obviously
"log_facility" should be used in the comparison for '-f' option, not
"log_level". That way the error can't be ever printed because log_level is
always not equal to -1 there. However, using incorrect facility will trigger
"Unrecognized internal syslog level code ..." in log_init() later though so
it will fail eventually as expected.
the incorrect code:
case 'f':
log_facility = log_facility_number(optarg);
if (log_level == SYSLOG_FACILITY_NOT_SET)
error("Invalid log facility \"%s\"", optarg);
break;
--- sftp-server.c Sun May 20 07:09:05 2007
+++ sftp-server.c.new Wed Sep 12 16:25:32 2007
@@ -1244,7 +1244,7 @@
break;
case 'f':
log_facility = log_facility_number(optarg);
- if (log_level == SYSLOG_FACILITY_NOT_SET)
+ if (log_facility == SYSLOG_FACILITY_NOT_SET)
error("Invalid log facility \"%s\"", optarg);
break;
case 'h':
--
Jan Pechanec
More information about the openssh-unix-dev
mailing list