Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 19 Feb 2020 10:32:22 +0800
From: Zhang Tianci <>
To: <>
CC: <>, <>
Subject: [PATCH] stat: Fix chmod

chmod misses `flag` argument when calling the syscall fchmodat.
Although Linux does not use `flag` in fchmodat, but in other system,
fchmodat will get a random value and it will cause flag check error.

Signed-off-by: Zhang Tianci <>
 src/stat/chmod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/stat/chmod.c b/src/stat/chmod.c
index d4f53c5..e99a146 100644
--- a/src/stat/chmod.c
+++ b/src/stat/chmod.c
@@ -7,6 +7,6 @@ int chmod(const char *path, mode_t mode)
 #ifdef SYS_chmod
 	return syscall(SYS_chmod, path, mode);
-	return syscall(SYS_fchmodat, AT_FDCWD, path, mode);
+	return syscall(SYS_fchmodat, AT_FDCWD, path, mode, 0);

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.