]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libe2p: Use lstat() instead of stat() in fsetflags() and fgetflags()
authorTheodore Ts'o <tytso@mit.edu>
Mon, 22 Oct 2007 05:36:13 +0000 (01:36 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 22 Oct 2007 12:05:44 +0000 (08:05 -0400)
We can't set the flags on symbolic links, so check for them using
lstat().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/e2p/fgetflags.c
lib/e2p/fsetflags.c

index 0aed6c82b133a36ee20f285d86c83b6e463d04ff..372304fb5057e52f87eed3de5d627338c8c6c7e0 100644 (file)
@@ -65,7 +65,7 @@ int fgetflags (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;
        }
index 2f1277fdaf0252c2b72dbdc1182bf1bd434f7956..3a0532403f63edab6c3d2bc7470391ab23c91b46 100644 (file)
@@ -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;
        }