summaryrefslogtreecommitdiffstats
path: root/daemon/umask.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/umask.c')
-rw-r--r--daemon/umask.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/daemon/umask.c b/daemon/umask.c
index a9ddeab0..db4a2f2f 100644
--- a/daemon/umask.c
+++ b/daemon/umask.c
@@ -35,6 +35,11 @@ do_umask (int mask)
{
int r;
+ if (mask < 0 || mask > 0777) {
+ reply_with_error ("0%o: mask negative or out of range", mask);
+ return -1;
+ }
+
r = umask (mask);
if (r == -1) {