From: Ulrich Drepper Date: Sat, 8 Mar 2008 05:21:41 +0000 (+0000) Subject: * io/tst-fchownat.c: Correctly handle _POSIX_CHOWN_RESTRICTED X-Git-Tag: cvs/fedora-glibc-20080310T1651~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c71665ad060cd30c99399d7a4fa47566eaf8b961;p=platform%2Fupstream%2Fglibc.git * io/tst-fchownat.c: Correctly handle _POSIX_CHOWN_RESTRICTED defined to zero. --- diff --git a/ChangeLog b/ChangeLog index 10cb787..ea4e62b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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. diff --git a/io/tst-fchownat.c b/io/tst-fchownat.c index fd32ac9..da8fd3b 100644 --- a/io/tst-fchownat.c +++ b/io/tst-fchownat.c @@ -19,14 +19,17 @@ static int dir_fd; static void prepare (void) { -#if _POSIX_CHOWN_RESTRICTED > 0 - uid_t uid = getuid (); - if (uid != 0) +#if _POSIX_CHOWN_RESTRICTED == 0 + if (pathconf (test_dir, _PC_CHOWN_RESTRICTED) != 0) +#endif { - puts ("need root privileges"); - exit (0); + uid_t uid = getuid (); + if (uid != 0) + { + puts ("need root privileges"); + exit (0); + } } -#endif size_t test_dir_len = strlen (test_dir); static const char dir_name[] = "/tst-fchownat.XXXXXX";