Skip to content

Commit fb1defc

Browse files
committed
Merge pull request trusteddomainproject#144 from glts/umask
Add "Umask" parameter trusteddomainproject#144
2 parents a2a8d24 + eb9c668 commit fb1defc

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

openarc/openarc-config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct configdef arcf_config[] =
5252
{ "Syslog", CONFIG_TYPE_BOOLEAN, FALSE },
5353
{ "SyslogFacility", CONFIG_TYPE_STRING, FALSE },
5454
{ "TemporaryDirectory", CONFIG_TYPE_STRING, FALSE },
55+
{ "UMask", CONFIG_TYPE_INTEGER, FALSE },
5556
{ "UserID", CONFIG_TYPE_STRING, FALSE },
5657
{ NULL, (u_int) -1, FALSE }
5758
};

openarc/openarc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4413,6 +4413,8 @@ main(int argc, char **argv)
44134413
sizeof pidfile);
44144414
}
44154415

4416+
(void) config_get(cfg, "UMask", &filemask, sizeof filemask);
4417+
44164418
if (become == NULL)
44174419
{
44184420
(void) config_get(cfg, "Userid", &become,

openarc/openarc.conf.5.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,17 @@ allowed in
240240
.I syslog.conf(5).
241241
The default is "mail".
242242

243+
.TP
244+
.I UMask (integer)
245+
Requests a specific permissions mask to be used for file creation.
246+
This only applies to creation of the socket when
247+
.I Socket
248+
specifies a UNIX domain socket, and to the
249+
.I PidFile
250+
(if any). See
251+
.I umask(2)
252+
for more information.
253+
243254
.TP
244255
.I UserID (string)
245256
Attempts to become the specified userid before starting operations.

openarc/openarc.conf.sample

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,15 @@ Syslog Yes
271271

272272
# TemporaryDirectory /tmp
273273

274+
## UMask mask
275+
## default (none)
276+
##
277+
## Change the process umask for file creation to the specified value.
278+
## The system has its own default which will be used (usually 022).
279+
## See the umask(2) man page for more information.
280+
281+
# UMask 022
282+
274283
## Userid userid
275284
## default (none)
276285
##

0 commit comments

Comments
 (0)