diff options
author | 2016-03-11 13:40:25 -0600 | |
---|---|---|
committer | 2016-03-11 13:40:25 -0600 | |
commit | a6cb08e927ff915ec06c17c1cea2bdbd54637f84 (patch) | |
tree | 4e93c523df3a1f0bc174a658f7f4e374492cc359 | |
parent | 94b157ee1a562321ddbb2654bfa9c6cb7a0f610e (diff) | |
download | pseudo-a6cb08e927ff915ec06c17c1cea2bdbd54637f84.tar.gz pseudo-a6cb08e927ff915ec06c17c1cea2bdbd54637f84.tar.bz2 pseudo-a6cb08e927ff915ec06c17c1cea2bdbd54637f84.zip |
set default umask in server
The pseudo server should probably always run with 022 umask so the
sockets, database files, and such get created with sane modes.
-rw-r--r-- | ChangeLog.txt | 3 | ||||
-rw-r--r-- | pseudo_server.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index a511e27..1c1419f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,6 @@ +2016-03-11: + * (seebs) set sane umask in server, just in case. + 2016-03-10: * (seebs) make bind work (so userspace NFS server can handle pseudo) diff --git a/pseudo_server.c b/pseudo_server.c index 12159e7..65102dd 100644 --- a/pseudo_server.c +++ b/pseudo_server.c @@ -153,6 +153,11 @@ pseudo_server_start(int daemonize) { char *lockpath; struct flock lock_data; + /* we want a sane umask for server operations; this is what + * would control the modes of database files, sockets, and so + * on. + */ + umask(022); /* parent process will wait for child process, or until it gets * SIGUSR1, or until too much time has passed. */ if (daemonize) { |