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

Collapse All | Expand All

(-)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 an explicit
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
.Pp
81
.Pp
76
For logging to work,
82
For logging to work,
(-)sftp-server.c (-2 / +12 lines)
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:

Return to bug 1229