- djm@cvs.openbsd.org 2010/11/04 02:45:34
[sftp-server.c] umask should be parsed as octal. reported by candland AT xmission.com; ok markus@
This commit is contained in:
parent
55fa56505b
commit
0733121194
|
@ -14,6 +14,10 @@
|
||||||
- jmc@cvs.openbsd.org 2010/10/28 18:33:28
|
- jmc@cvs.openbsd.org 2010/10/28 18:33:28
|
||||||
[scp.1 ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5 sshd.8 sshd_config.5]
|
[scp.1 ssh-add.1 ssh-keygen.1 ssh.1 ssh_config.5 sshd.8 sshd_config.5]
|
||||||
knock out some "-*- nroff -*-" lines;
|
knock out some "-*- nroff -*-" lines;
|
||||||
|
- djm@cvs.openbsd.org 2010/11/04 02:45:34
|
||||||
|
[sftp-server.c]
|
||||||
|
umask should be parsed as octal. reported by candland AT xmission.com;
|
||||||
|
ok markus@
|
||||||
|
|
||||||
20101025
|
20101025
|
||||||
- (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with
|
- (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $OpenBSD: sftp-server.c,v 1.91 2010/01/13 01:40:16 djm Exp $ */
|
/* $OpenBSD: sftp-server.c,v 1.92 2010/11/04 02:45:34 djm Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
|
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
|
||||||
*
|
*
|
||||||
|
@ -1377,8 +1377,7 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw)
|
||||||
ssize_t len, olen, set_size;
|
ssize_t len, olen, set_size;
|
||||||
SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;
|
SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;
|
||||||
char *cp, buf[4*4096];
|
char *cp, buf[4*4096];
|
||||||
const char *errmsg;
|
long mask;
|
||||||
mode_t mask;
|
|
||||||
|
|
||||||
extern char *optarg;
|
extern char *optarg;
|
||||||
extern char *__progname;
|
extern char *__progname;
|
||||||
|
@ -1412,11 +1411,12 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw)
|
||||||
error("Invalid log facility \"%s\"", optarg);
|
error("Invalid log facility \"%s\"", optarg);
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
mask = (mode_t)strtonum(optarg, 0, 0777, &errmsg);
|
errno = 0;
|
||||||
if (errmsg != NULL)
|
mask = strtol(optarg, &cp, 8);
|
||||||
fatal("Invalid umask \"%s\": %s",
|
if (mask < 0 || mask > 0777 || *cp != '\0' ||
|
||||||
optarg, errmsg);
|
cp == optarg || (mask == 0 && errno != 0))
|
||||||
(void)umask(mask);
|
fatal("Invalid umask \"%s\"", optarg);
|
||||||
|
(void)umask((mode_t)mask);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue