|
Lines 1294-1300
sftp_server_usage(void)
Link Here
|
| 1294 |
extern char *__progname; |
1294 |
extern char *__progname; |
| 1295 |
|
1295 |
|
| 1296 |
fprintf(stderr, |
1296 |
fprintf(stderr, |
| 1297 |
"usage: %s [-he] [-l log_level] [-f log_facility]\n", __progname); |
1297 |
"usage: %s [-he] [-l log_level] [-f log_facility] [-u umask]\n", |
|
|
1298 |
__progname); |
| 1298 |
exit(1); |
1299 |
exit(1); |
| 1299 |
} |
1300 |
} |
| 1300 |
|
1301 |
|
|
Lines 1306-1318
sftp_server_main(int argc, char **argv,
Link Here
|
| 1306 |
ssize_t len, olen, set_size; |
1307 |
ssize_t len, olen, set_size; |
| 1307 |
SyslogFacility log_facility = SYSLOG_FACILITY_AUTH; |
1308 |
SyslogFacility log_facility = SYSLOG_FACILITY_AUTH; |
| 1308 |
char *cp, buf[4*4096]; |
1309 |
char *cp, buf[4*4096]; |
|
|
1310 |
const char *errmsg; |
| 1311 |
mode_t mask; |
| 1309 |
|
1312 |
|
| 1310 |
extern char *optarg; |
1313 |
extern char *optarg; |
| 1311 |
extern char *__progname; |
1314 |
extern char *__progname; |
| 1312 |
|
1315 |
|
| 1313 |
log_init(__progname, log_level, log_facility, log_stderr); |
1316 |
log_init(__progname, log_level, log_facility, log_stderr); |
| 1314 |
|
1317 |
|
| 1315 |
while (!skipargs && (ch = getopt(argc, argv, "f:l:che")) != -1) { |
1318 |
while (!skipargs && (ch = getopt(argc, argv, "f:l:u:che")) != -1) { |
| 1316 |
switch (ch) { |
1319 |
switch (ch) { |
| 1317 |
case 'c': |
1320 |
case 'c': |
| 1318 |
/* |
1321 |
/* |
|
Lines 1333-1338
sftp_server_main(int argc, char **argv,
Link Here
|
| 1333 |
log_facility = log_facility_number(optarg); |
1336 |
log_facility = log_facility_number(optarg); |
| 1334 |
if (log_facility == SYSLOG_FACILITY_NOT_SET) |
1337 |
if (log_facility == SYSLOG_FACILITY_NOT_SET) |
| 1335 |
error("Invalid log facility \"%s\"", optarg); |
1338 |
error("Invalid log facility \"%s\"", optarg); |
|
|
1339 |
break; |
| 1340 |
case 'u': |
| 1341 |
mask = (mode_t)strtonum(optarg, 0, 0777, &errmsg); |
| 1342 |
if (cp != NULL) |
| 1343 |
fatal("Invalid umask \"%s\": %s", |
| 1344 |
optarg, errmsg); |
| 1345 |
umask(mask); |
| 1336 |
break; |
1346 |
break; |
| 1337 |
case 'h': |
1347 |
case 'h': |
| 1338 |
default: |
1348 |
default: |