now that we're using fts_open with FTS_CWDFD.
* tests/chgrp/posix-H: Add --preserve-root to an invocation of
chgrp, to exercise the above fix.
2006-10-13 Jim Meyering <jim@meyering.net>
+ * src/chown-core.c (change_file_owner): Use fstatat, not stat,
+ now that we're using fts_open with FTS_CWDFD.
+ * tests/chgrp/posix-H: Add --preserve-root to an invocation of
+ chgrp, to exercise the above fix.
+
* src/du-tests: Clean up a little, though it's still not portable.
* .vg-suppressions: Add 3 more for debian unstable.
stat it to get info on the referent. */
if (S_ISLNK (file_stats->st_mode) && chopt->affect_symlink_referent)
{
- if (stat (file, &stat_buf) != 0)
+ if (fstatat (fts->fts_cwd_fd, file, &stat_buf, 0) != 0)
{
error (0, errno, _("cannot dereference %s"),
quote (file_full_name));
#!/bin/sh
# Test POSIX-mandated -H option.
-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
fail=0
-chgrp -H -R $g2 1s 2 || fail=1
+chgrp --preserve-root -H -R $g2 1s 2 || fail=1
# These must have group $g2.
# =========================