mbox series

[v5,0/2] squashfs/squashfs-tools: Add posix acl support

Message ID cover.1548406694.git.geliangtang@gmail.com (mailing list archive)
Headers show
Series squashfs/squashfs-tools: Add posix acl support | expand

Message

Geliang Tang Jan. 25, 2019, 9:14 a.m. UTC
When we use mksquashfs tool to create a squashfs image from the files which
have POSIX ACLs(Access Control Lists), we get these errors:

Unrecognised xattr prefix system.posix_acl_access
Unrecognised xattr prefix system.posix_acl_default

This patcheset adds posix acl support to squashfs to fix this problem. Patch
#1 for kerenl tree and patch #2 for squashfs-tools tree.

---

Testcase:

$ mkdir root
$ getfacl root
  # file: root
  # owner: tgl
  # group: tgl
  user::rwx
  group::r-x
  other::r-x
$ setfacl -m u:tgl:rw root
$ setfacl -m d:tgl:rw root
$ getfacl root
  # file: root
  # owner: tgl
  # group: tgl
  user::rwx
  user:tgl:rw-
  group::r-x
  mask::rwx
  other::r-x
  default:user::rwx
  default:user:tgl:rw-
  default:group::r-x
  default:mask::rwx
  default:other::r-x
$ getfattr -m . -d root
  # file: root
  system.posix_acl_access=0sAgAAAAEABwD/////AgAGAOgDAAAEAAUA/////xAABwD/////IAAFAP////8=
  system.posix_acl_default=0sAgAAAAEABwD/////AgAGAOgDAAAEAAUA/////xAABwD/////IAAFAP////8=

$ mksquashfs root root.img
$ sudo mount root.img /mnt/squash/

$ cd /mnt
$ getfacl squash
  # file: squash
  # owner: tgl
  # group: tgl
  user::rwx
  user:tgl:rw-
  group::r-x
  mask::rwx
  other::r-x
  default:user::rwx
  default:user:tgl:rw-
  default:group::r-x
  default:mask::rwx
  default:other::r-x
$ getfattr -m . -d squash
  # file: squash
  system.posix_acl_access=0sAgAAAAEABwD/////AgAGAOgDAAAEAAUA/////xAABwD/////IAAFAP////8=
  system.posix_acl_default=0sAgAAAAEABwD/////AgAGAOgDAAAEAAUA/////xAABwD/////IAAFAP////8=

---

Geliang Tang (1):
  squashfs: Add posix acl support

 Documentation/filesystems/squashfs.txt |  2 -
 fs/squashfs/Kconfig                    | 11 +++++
 fs/squashfs/Makefile                   |  1 +
 fs/squashfs/acl.c                      | 56 ++++++++++++++++++++++++++
 fs/squashfs/acl.h                      | 18 +++++++++
 fs/squashfs/inode.c                    |  4 +-
 fs/squashfs/namei.c                    |  6 ++-
 fs/squashfs/squashfs_fs.h              | 12 +++---
 fs/squashfs/super.c                    |  3 ++
 fs/squashfs/symlink.c                  |  6 ++-
 fs/squashfs/xattr.c                    | 31 +++++++++++++-
 fs/squashfs/xattr.h                    |  8 ++++
 12 files changed, 145 insertions(+), 13 deletions(-)
 create mode 100644 fs/squashfs/acl.c
 create mode 100644 fs/squashfs/acl.h

---

Geliang Tang (1):
  squashfs-tools: Add posix acl support

 squashfs-tools/read_xattrs.c |  2 ++
 squashfs-tools/squashfs_fs.h | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)