diff options
author | Theodore Ts'o <tytso@mit.edu> | 2007-10-22 01:36:13 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2007-10-22 08:05:44 -0400 |
commit | 1a4ce9df5884405a7152855b868c3a7bfbeec385 (patch) | |
tree | 0af125d3743004b75fd9ac493941f04940d4ba17 /lib/e2p/fsetflags.c | |
parent | 042a27f8230804062016194ce151baa6cfff034e (diff) | |
download | e2fsprogs-1a4ce9df5884405a7152855b868c3a7bfbeec385.tar.gz |
libe2p: Use lstat() instead of stat() in fsetflags() and fgetflags()
We can't set the flags on symbolic links, so check for them using
lstat().
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/e2p/fsetflags.c')
-rw-r--r-- | lib/e2p/fsetflags.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c index 2f1277fd..3a053240 100644 --- a/lib/e2p/fsetflags.c +++ b/lib/e2p/fsetflags.c @@ -71,7 +71,7 @@ int fsetflags (const char * name, unsigned long flags) #if HAVE_EXT2_IOCTLS int fd, r, f, save_errno = 0; - if (!stat(name, &buf) && + if (!lstat(name, &buf) && !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) { goto notsupp; } |