aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2017-07-15 14:01:26 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2017-07-15 14:01:26 +0200
commit53ab5290e0150b60552cfbe0a6aff68abded5ace (patch)
tree98a1ed68a2a9593aabc8109342d1a82b89168ae5
parenta66e5ab45738193ed3a51c99c9a59f415d594114 (diff)
downloadsdn-53ab5290e0150b60552cfbe0a6aff68abded5ace.tar.gz
sdn-53ab5290e0150b60552cfbe0a6aff68abded5ace.tar.xz
sdn-53ab5290e0150b60552cfbe0a6aff68abded5ace.zip
Fix POSIX ACLs detection on symlinks
-rw-r--r--sdn.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/sdn.cpp b/sdn.cpp
index 1ea98de..cb841c8 100644
--- a/sdn.cpp
+++ b/sdn.cpp
@@ -322,13 +322,9 @@ static struct {
fun make_row (const string &filename, const struct stat &info) -> row {
row r;
auto mode = decode_mode (info.st_mode);
- if (auto acl = acl_get_file (filename.c_str (), ACL_TYPE_ACCESS)) {
- mode_t m;
- // This is a Linux-only extension
- if (!acl_equiv_mode (acl, &m) && (m ^ info.st_mode) & 0777)
- mode += L"+";
- acl_free (acl);
- }
+ // This is a Linux-only extension
+ if (acl_extended_file_nofollow (filename.c_str ()) > 0)
+ mode += L"+";
r.cols[row::MODES] = apply_attrs (mode, 0);
auto user = to_wstring (info.st_uid);