summaryrefslogtreecommitdiff
path: root/lib/e2p/fsetflags.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2007-10-22 01:36:13 -0400
committerTheodore Ts'o <tytso@mit.edu>2007-10-22 08:05:44 -0400
commit1a4ce9df5884405a7152855b868c3a7bfbeec385 (patch)
tree0af125d3743004b75fd9ac493941f04940d4ba17 /lib/e2p/fsetflags.c
parent042a27f8230804062016194ce151baa6cfff034e (diff)
downloade2fsprogs-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.c2
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;
}