X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libatalk%2Facl%2Funix.c;h=be422aac38c7498d89e56c0f004f8cbe0374cff2;hb=8ea9eaad323ec8ea180ffc277cd409d713a5895f;hp=e290ff34730eab5b6b464270a26637df9f3f86c3;hpb=4134edb221bbc687a8992587f450078adff0eabe;p=netatalk.git diff --git a/libatalk/acl/unix.c b/libatalk/acl/unix.c index e290ff34..be422aac 100644 --- a/libatalk/acl/unix.c +++ b/libatalk/acl/unix.c @@ -43,13 +43,24 @@ int get_nfsv4_acl(const char *name, ace_t **retAces) *retAces = NULL; /* Only call acl() for regular files and directories, otherwise just return 0 */ - if (lstat(name, &st) != 0) + if (lstat(name, &st) != 0) { + LOG(log_warning, logtype_afpd, "get_nfsv4_acl(\"%s/%s\"): %s", getcwdpath(), name, strerror(errno)); return -1; - if ( ! (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode))) + } + + if (S_ISLNK(st.st_mode)) + /* sorry, no ACLs for symlinks */ + return 0; + + if ( ! (S_ISREG(st.st_mode) || S_ISDIR(st.st_mode))) { + LOG(log_warning, logtype_afpd, "get_nfsv4_acl(\"%s/%s\"): special", getcwdpath(), name); return 0; + } - if ((ace_count = acl(name, ACE_GETACLCNT, 0, NULL)) == 0) + if ((ace_count = acl(name, ACE_GETACLCNT, 0, NULL)) == 0) { + LOG(log_warning, logtype_afpd, "get_nfsv4_acl(\"%s/%s\"): 0 ACEs", getcwdpath(), name); return 0; + } if (ace_count == -1) { LOG(log_error, logtype_afpd, "get_nfsv4_acl: acl('%s/%s', ACE_GETACLCNT): ace_count %i, error: %s",