mirror of
git://sourceware.org/git/glibc.git
synced 2025-02-17 13:00:43 +08:00
* io/tst-fchownat.c: Correctly handle _POSIX_CHOWN_RESTRICTED
defined to zero.
This commit is contained in:
parent
72f1012788
commit
c71665ad06
@ -13,6 +13,8 @@
|
||||
Implement __statfs_chown_restricted.
|
||||
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Change
|
||||
_POSIX_CHOWN_RESTRICTED value to zero.
|
||||
* io/tst-fchownat.c: Correctly handle _POSIX_CHOWN_RESTRICTED
|
||||
defined to zero.
|
||||
|
||||
* sysdeps/x86_64/rtld-memset.c: New file.
|
||||
|
||||
|
@ -19,14 +19,17 @@ static int dir_fd;
|
||||
static void
|
||||
prepare (void)
|
||||
{
|
||||
#if _POSIX_CHOWN_RESTRICTED > 0
|
||||
uid_t uid = getuid ();
|
||||
if (uid != 0)
|
||||
{
|
||||
puts ("need root privileges");
|
||||
exit (0);
|
||||
}
|
||||
#if _POSIX_CHOWN_RESTRICTED == 0
|
||||
if (pathconf (test_dir, _PC_CHOWN_RESTRICTED) != 0)
|
||||
#endif
|
||||
{
|
||||
uid_t uid = getuid ();
|
||||
if (uid != 0)
|
||||
{
|
||||
puts ("need root privileges");
|
||||
exit (0);
|
||||
}
|
||||
}
|
||||
|
||||
size_t test_dir_len = strlen (test_dir);
|
||||
static const char dir_name[] = "/tst-fchownat.XXXXXX";
|
||||
|
Loading…
Reference in New Issue
Block a user