summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--sftp-server.c16
2 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index b58bd9184..27a1a64d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,10 @@
14 - jmc@cvs.openbsd.org 2010/10/28 18:33:28 14 - jmc@cvs.openbsd.org 2010/10/28 18:33:28
15 [scp.1 ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5 sshd.8 sshd_config.5] 15 [scp.1 ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5 sshd.8 sshd_config.5]
16 knock out some "-*- nroff -*-" lines; 16 knock out some "-*- nroff -*-" lines;
17 - djm@cvs.openbsd.org 2010/11/04 02:45:34
18 [sftp-server.c]
19 umask should be parsed as octal. reported by candland AT xmission.com;
20 ok markus@
17 21
1820101025 2220101025
19 - (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with 23 - (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with
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: