lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon,  4 Dec 2017 22:56:35 +0900
From:   Wang Shilong <wangshilong1991@...il.com>
To:     linux-ext4@...r.kernel.org
Cc:     sihara@....com
Subject: [PATCH] e2p: fix getflags for link file

From: Wang Shilong <wshilong@....com>

Steps to reproduce:

$ touch a
$ lsattr -dp a
 2000 ----------------P a
$ ln -s a b
$ lsattr -dp b
lsattr: Operation not supported While reading flags on b

Link files should be supported, fix it.

Signed-off-by: Wang Shilong <wshilong@....com>
---
 lib/e2p/fgetflags.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/e2p/fgetflags.c b/lib/e2p/fgetflags.c
index 7b93cba..a39cdbd 100644
--- a/lib/e2p/fgetflags.c
+++ b/lib/e2p/fgetflags.c
@@ -73,7 +73,8 @@ int fgetflags (const char * name, unsigned long * flags)
 	int fd, r, f, save_errno = 0;
 
 	if (!lstat(name, &buf) &&
-	    !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode)) {
+	    !S_ISREG(buf.st_mode) && !S_ISDIR(buf.st_mode) &&
+	    !S_ISLNK(buf.st_mode)) {
 		goto notsupp;
 	}
 #if !APPLE_DARWIN
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux - Powered by OpenVZ