Skip to content

Commit

Permalink
Merge pull request trusteddomainproject#144 from glts/umask
Browse files Browse the repository at this point in the history
Add "Umask" parameter

trusteddomainproject#144
  • Loading branch information
futatuki committed Sep 14, 2024
2 parents a2a8d24 + eb9c668 commit fb1defc
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions openarc/openarc-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct configdef arcf_config[] =
{ "Syslog", CONFIG_TYPE_BOOLEAN, FALSE },
{ "SyslogFacility", CONFIG_TYPE_STRING, FALSE },
{ "TemporaryDirectory", CONFIG_TYPE_STRING, FALSE },
{ "UMask", CONFIG_TYPE_INTEGER, FALSE },
{ "UserID", CONFIG_TYPE_STRING, FALSE },
{ NULL, (u_int) -1, FALSE }
};
Expand Down
2 changes: 2 additions & 0 deletions openarc/openarc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4413,6 +4413,8 @@ main(int argc, char **argv)
sizeof pidfile);
}

(void) config_get(cfg, "UMask", &filemask, sizeof filemask);

if (become == NULL)
{
(void) config_get(cfg, "Userid", &become,
Expand Down
11 changes: 11 additions & 0 deletions openarc/openarc.conf.5.in
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,17 @@ allowed in
.I syslog.conf(5).
The default is "mail".

.TP
.I UMask (integer)
Requests a specific permissions mask to be used for file creation.
This only applies to creation of the socket when
.I Socket
specifies a UNIX domain socket, and to the
.I PidFile
(if any). See
.I umask(2)
for more information.

.TP
.I UserID (string)
Attempts to become the specified userid before starting operations.
Expand Down
9 changes: 9 additions & 0 deletions openarc/openarc.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,15 @@ Syslog Yes

# TemporaryDirectory /tmp

## UMask mask
## default (none)
##
## Change the process umask for file creation to the specified value.
## The system has its own default which will be used (usually 022).
## See the umask(2) man page for more information.

# UMask 022

## Userid userid
## default (none)
##
Expand Down

0 comments on commit fb1defc

Please sign in to comment.