Jan Pechanec
2007-Sep-12 19:38 UTC
PATCH: fix incorrect checking of syslog facility in sftp-server
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