From 61ab83d19009a8006dd73ebe16d22494b78be4d1 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 17 Apr 2010 13:33:14 +0100 Subject: Improved checking, documentation of modes (RHBZ#582901, RHBZ#582929). chmod: Disallow negative mode, document mode affected by umask. mkdir-mode: Disallow negative mode, document that filesystems may interpret the mode in different ways. mknod: Disallow negative mode, document mode affected by umask. umask: Check the range of umask mask value carefully. --- daemon/umask.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'daemon/umask.c') 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) { -- cgit