From 8a1fd26292643530761d412e06ddd50a6a782bd1 Mon Sep 17 00:00:00 2001 From: ru Date: Thu, 31 May 2001 11:47:20 +0000 Subject: Fixed the bug from the previous revision. ``chown -h owner symlink'' did not set the symlink's owner if the file the symlink points to already had that owner: # ls -l alink afile -rw-r--r-- 1 nobody ru 0 May 31 14:14 afile lrwxr-xr-x 1 root ru 5 May 31 14:14 alink -> afile # ./chown -h -v nobody alink # ls -l alink afile -rw-r--r-- 1 nobody ru 0 May 31 14:14 afile lrwxr-xr-x 1 root ru 5 May 31 14:14 alink -> afile Similarly for chgrp(1) and chmod(1). --- bin/chmod/chmod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c index 97c9c02..83a31c7d 100644 --- a/bin/chmod/chmod.c +++ b/bin/chmod/chmod.c @@ -148,7 +148,7 @@ done: argv += optind; fts_options |= FTS_LOGICAL; } } else - fts_options = FTS_LOGICAL; + fts_options = hflag ? FTS_PHYSICAL : FTS_LOGICAL; if (hflag) change_mode = lchmod; -- cgit v1.1