diff options
Diffstat (limited to 'sftp-server.c')
-rw-r--r-- | sftp-server.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sftp-server.c b/sftp-server.c index a98ac2b6d..47edcd0aa 100644 --- a/sftp-server.c +++ b/sftp-server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sftp-server.c,v 1.91 2010/01/13 01:40:16 djm Exp $ */ | 1 | /* $OpenBSD: sftp-server.c,v 1.92 2010/11/04 02:45:34 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -1377,8 +1377,7 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw) | |||
1377 | ssize_t len, olen, set_size; | 1377 | ssize_t len, olen, set_size; |
1378 | SyslogFacility log_facility = SYSLOG_FACILITY_AUTH; | 1378 | SyslogFacility log_facility = SYSLOG_FACILITY_AUTH; |
1379 | char *cp, buf[4*4096]; | 1379 | char *cp, buf[4*4096]; |
1380 | const char *errmsg; | 1380 | long mask; |
1381 | mode_t mask; | ||
1382 | 1381 | ||
1383 | extern char *optarg; | 1382 | extern char *optarg; |
1384 | extern char *__progname; | 1383 | extern char *__progname; |
@@ -1412,11 +1411,12 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw) | |||
1412 | error("Invalid log facility \"%s\"", optarg); | 1411 | error("Invalid log facility \"%s\"", optarg); |
1413 | break; | 1412 | break; |
1414 | case 'u': | 1413 | case 'u': |
1415 | mask = (mode_t)strtonum(optarg, 0, 0777, &errmsg); | 1414 | errno = 0; |
1416 | if (errmsg != NULL) | 1415 | mask = strtol(optarg, &cp, 8); |
1417 | fatal("Invalid umask \"%s\": %s", | 1416 | if (mask < 0 || mask > 0777 || *cp != '\0' || |
1418 | optarg, errmsg); | 1417 | cp == optarg || (mask == 0 && errno != 0)) |
1419 | (void)umask(mask); | 1418 | fatal("Invalid umask \"%s\"", optarg); |
1419 | (void)umask((mode_t)mask); | ||
1420 | break; | 1420 | break; |
1421 | case 'h': | 1421 | case 'h': |
1422 | default: | 1422 | default: |