* [PATCH] fix fchown fallback on arches without chown(2)
@ 2017-05-27 20:20 Samuel Holland
2017-05-28 2:04 ` Rich Felker
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Holland @ 2017-05-27 20:20 UTC (permalink / raw)
To: musl; +Cc: Samuel Holland
The flags argument was missing, causing uninitalized data to be passed
to fchownat(2). The correct value of flags should match the fallback for
chown(3).
---
src/unistd/fchown.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/unistd/fchown.c b/src/unistd/fchown.c
index 03459849..75075eec 100644
--- a/src/unistd/fchown.c
+++ b/src/unistd/fchown.c
@@ -16,7 +16,7 @@ int fchown(int fd, uid_t uid, gid_t gid)
#ifdef SYS_chown
return syscall(SYS_chown, buf, uid, gid);
#else
- return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid);
+ return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid, 0);
#endif
}
--
2.13.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix fchown fallback on arches without chown(2)
2017-05-27 20:20 [PATCH] fix fchown fallback on arches without chown(2) Samuel Holland
@ 2017-05-28 2:04 ` Rich Felker
0 siblings, 0 replies; 2+ messages in thread
From: Rich Felker @ 2017-05-28 2:04 UTC (permalink / raw)
To: musl
On Sat, May 27, 2017 at 03:20:01PM -0500, Samuel Holland wrote:
> The flags argument was missing, causing uninitalized data to be passed
> to fchownat(2). The correct value of flags should match the fallback for
> chown(3).
> ---
> src/unistd/fchown.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/unistd/fchown.c b/src/unistd/fchown.c
> index 03459849..75075eec 100644
> --- a/src/unistd/fchown.c
> +++ b/src/unistd/fchown.c
> @@ -16,7 +16,7 @@ int fchown(int fd, uid_t uid, gid_t gid)
> #ifdef SYS_chown
> return syscall(SYS_chown, buf, uid, gid);
> #else
> - return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid);
> + return syscall(SYS_fchownat, AT_FDCWD, buf, uid, gid, 0);
> #endif
>
> }
> --
> 2.13.0
Thanks. Applying.
Rich
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-28 2:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-27 20:20 [PATCH] fix fchown fallback on arches without chown(2) Samuel Holland
2017-05-28 2:04 ` Rich Felker
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).