aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0040-fix-fchown-fallback-on-arches-without-chown-2.patch
blob: bfe3a93ed949c91ce7054d2e607f9f8c7a187809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From 81f4a1200a58a84c83e73da645d4f226a8785bdf Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Sat, 27 May 2017 15:20:01 -0500
Subject: [PATCH] fix fchown fallback on arches without chown(2)

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