@@ -3182,7 +3182,7 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp,
p = xdr_reserve_space(xdr, 4);
if (!p)
goto out_resource;
- *p++ = cpu_to_be32(stat.mode & S_IALLUGO);
+ *p++ = cpu_to_be32((stat.mode & (S_IALLUGO | S_IFACL)));
}
if (bmval1 & FATTR4_WORD1_NO_TRUNC) {
p = xdr_reserve_space(xdr, 4);
@@ -20,6 +20,7 @@
#include <linux/uaccess.h>
#include <asm/unistd.h>
+#include <linux/posix_acl.h>
#include "internal.h"
#include "mount.h"
@@ -43,9 +44,15 @@
void generic_fillattr(struct user_namespace *mnt_userns, struct inode *inode,
struct kstat *stat)
{
+ struct posix_acl *pacl = get_acl(inode, ACL_TYPE_ACCESS);
+
stat->dev = inode->i_sb->s_dev;
stat->ino = inode->i_ino;
stat->mode = inode->i_mode;
+ if(pacl){ /* ACL of some kind is present */
+ stat->mode |= S_IFACL;
+ posix_acl_release(pacl);
+ }
stat->nlink = inode->i_nlink;
stat->uid = i_uid_into_mnt(mnt_userns, inode);
stat->gid = i_gid_into_mnt(mnt_userns, inode);
@@ -6,6 +6,7 @@
#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+#define S_IFACL 00200000 /* ACL of some kind is present */
#define S_IFMT 00170000
#define S_IFSOCK 0140000
#define S_IFLNK 0120000