View | Details | Raw Unified | Return to bug 1229 | Differences between
and this patch

Collapse All | Expand All

(-)sftp-server.c (-1 / +12 lines)
Lines 1191-1196 main(int argc, char **argv) Link Here
1191
	ssize_t len, olen, set_size;
1191
	ssize_t len, olen, set_size;
1192
	SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;
1192
	SyslogFacility log_facility = SYSLOG_FACILITY_AUTH;
1193
	char *cp;
1193
	char *cp;
1194
	long mask;
1194
1195
1195
	extern char *optarg;
1196
	extern char *optarg;
1196
	extern char *__progname;
1197
	extern char *__progname;
Lines 1200-1206 main(int argc, char **argv) Link Here
1200
1201
1201
	log_init(__progname, log_level, log_facility, log_stderr);
1202
	log_init(__progname, log_level, log_facility, log_stderr);
1202
1203
1203
	while (!skipargs && (ch = getopt(argc, argv, "C:f:l:che")) != -1) {
1204
	while (!skipargs && (ch = getopt(argc, argv, "C:f:l:u:che")) != -1) {
1204
		switch (ch) {
1205
		switch (ch) {
1205
		case 'c':
1206
		case 'c':
1206
			/*
1207
			/*
Lines 1221-1226 main(int argc, char **argv) Link Here
1221
			log_facility = log_facility_number(optarg);
1222
			log_facility = log_facility_number(optarg);
1222
			if (log_level == SYSLOG_FACILITY_NOT_SET)
1223
			if (log_level == SYSLOG_FACILITY_NOT_SET)
1223
				error("Invalid log facility \"%s\"", optarg);
1224
				error("Invalid log facility \"%s\"", optarg);
1225
			break;
1226
		case 'u':
1227
			errno = 0;
1228
			mask = strtol(optarg, &cp, 8);
1229
			if (optarg[0] == '\0' || *cp != '\0' ||
1230
			    (errno == ERANGE &&
1231
			    (mask == LONG_MAX || mask == LONG_MIN)) ||
1232
			    mask > 0777 || mask < 0)
1233
				fatal("Invalid umask \"%s\"", optarg);
1234
			umask((mode_t)mask);
1224
			break;
1235
			break;
1225
		case 'h':
1236
		case 'h':
1226
		default:
1237
		default:
(-)sftp-server.8 (+6 lines)
Lines 32-37 Link Here
32
.Nm sftp-server
32
.Nm sftp-server
33
.Op Fl f Ar log_facility
33
.Op Fl f Ar log_facility
34
.Op Fl l Ar log_level
34
.Op Fl l Ar log_level
35
.Op Fl u Ar umask
35
.Sh DESCRIPTION
36
.Sh DESCRIPTION
36
.Nm
37
.Nm
37
is a program that speaks the server side of SFTP protocol
38
is a program that speaks the server side of SFTP protocol
Lines 71-76 performs on behalf of the client. Link Here
71
DEBUG and DEBUG1 are equivalent.
72
DEBUG and DEBUG1 are equivalent.
72
DEBUG2 and DEBUG3 each specify higher levels of debugging output.
73
DEBUG2 and DEBUG3 each specify higher levels of debugging output.
73
The default is ERROR.
74
The default is ERROR.
75
.It Fl u Ar umask
76
Sets a
77
.Xr umask 2
78
to be applied to newly-created files and directories, instead of the
79
user's default mask.
74
.El
80
.El
75
.Sh SEE ALSO
81
.Sh SEE ALSO
76
.Xr sftp 1 ,
82
.Xr sftp 1 ,

Return to bug 1229