Bugzilla – Attachment 1205 Details for
Bug 1229
No way to set default umask for SFTP server
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add -u option to sftp-server
sftp-umask.diff (text/plain), 2.08 KB, created by
Damien Miller
on 2006-11-10 02:50:46 AEDT
(
hide
)
Description:
Add -u option to sftp-server
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2006-11-10 02:50:46 AEDT
Size:
2.08 KB
patch
obsolete
>Index: sftp-server.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sftp-server.c,v >retrieving revision 1.70 >diff -u -p -r1.70 sftp-server.c >--- sftp-server.c 3 Aug 2006 03:34:42 -0000 1.70 >+++ sftp-server.c 9 Nov 2006 15:48:02 -0000 >@@ -1191,6 +1191,7 @@ main(int argc, char **argv) > ssize_t len, olen, set_size; > SyslogFacility log_facility = SYSLOG_FACILITY_AUTH; > char *cp; >+ long mask; > > extern char *optarg; > extern char *__progname; >@@ -1200,7 +1201,7 @@ main(int argc, char **argv) > > log_init(__progname, log_level, log_facility, log_stderr); > >- while (!skipargs && (ch = getopt(argc, argv, "C:f:l:che")) != -1) { >+ while (!skipargs && (ch = getopt(argc, argv, "C:f:l:u:che")) != -1) { > switch (ch) { > case 'c': > /* >@@ -1221,6 +1222,16 @@ main(int argc, char **argv) > log_facility = log_facility_number(optarg); > if (log_level == SYSLOG_FACILITY_NOT_SET) > error("Invalid log facility \"%s\"", optarg); >+ break; >+ case 'u': >+ errno = 0; >+ mask = strtol(optarg, &cp, 8); >+ if (optarg[0] == '\0' || *cp != '\0' || >+ (errno == ERANGE && >+ (mask == LONG_MAX || mask == LONG_MIN)) || >+ mask > 0777 || mask < 0) >+ fatal("Invalid umask \"%s\"", optarg); >+ umask((mode_t)mask); > break; > case 'h': > default: >Index: sftp-server.8 >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/sftp-server.8,v >retrieving revision 1.11 >diff -u -p -r1.11 sftp-server.8 >--- sftp-server.8 6 Jul 2006 10:47:57 -0000 1.11 >+++ sftp-server.8 9 Nov 2006 15:48:02 -0000 >@@ -32,6 +32,7 @@ > .Nm sftp-server > .Op Fl f Ar log_facility > .Op Fl l Ar log_level >+.Op Fl u Ar umask > .Sh DESCRIPTION > .Nm > is a program that speaks the server side of SFTP protocol >@@ -71,6 +72,11 @@ performs on behalf of the client. > DEBUG and DEBUG1 are equivalent. > DEBUG2 and DEBUG3 each specify higher levels of debugging output. > The default is ERROR. >+.It Fl u Ar umask >+Sets a >+.Xr umask 2 >+to be applied to newly-created files and directories, instead of the >+user's default mask. > .El > .Sh SEE ALSO > .Xr sftp 1 ,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1229
:
1205
|
1673