From: Zhang Tianci <zhangtianci1@huawei.com>
To: <musl@lists.openwall.com>
Cc: <zhangtianci1@huawei.com>, <yunlong.song@huawei.com>
Subject: [musl] [PATCH] stat: Fix chmod
Date: Wed, 19 Feb 2020 10:32:22 +0800 [thread overview]
Message-ID: <20200219023222.35095-1-zhangtianci1@huawei.com> (raw)
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 <zhangtianci1@huawei.com>
---
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);
#else
- return syscall(SYS_fchmodat, AT_FDCWD, path, mode);
+ return syscall(SYS_fchmodat, AT_FDCWD, path, mode, 0);
#endif
}
--
2.17.1
next reply other threads:[~2020-02-19 2:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-19 2:32 Zhang Tianci [this message]
2020-02-19 3:50 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200219023222.35095-1-zhangtianci1@huawei.com \
--to=zhangtianci1@huawei.com \
--cc=musl@lists.openwall.com \
--cc=yunlong.song@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).