From: Geliang Tang <geliangtang@gmail.com>
To: Phillip Lougher <phillip@squashfs.org.uk>,
Jonathan Corbet <corbet@lwn.net>
Cc: Geliang Tang <geliangtang@gmail.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] squashfs-tools: Add posix acl support
Date: Mon, 9 Apr 2018 20:34:04 +0800 [thread overview]
Message-ID: <711ddb81a0b0e58ca6ee1dd515d85e69b0294234.1523277042.git.geliangtang@gmail.com> (raw)
In-Reply-To: <af77c1f80e2725c4cf1bf106d6add820b3b0eed5.1523276963.git.geliangtang@gmail.com>
In-Reply-To: <af77c1f80e2725c4cf1bf106d6add820b3b0eed5.1523276963.git.geliangtang@gmail.com>
Add posix acl (Access Control Lists) support for mksquashfs and
unsquashfs tools.
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
squashfs-tools/read_xattrs.c | 2 ++
squashfs-tools/squashfs_fs.h | 12 +++++++-----
squashfs-tools/unsquashfs_xattr.c | 4 +++-
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c
index 42106f5..8ef8291 100644
--- a/squashfs-tools/read_xattrs.c
+++ b/squashfs-tools/read_xattrs.c
@@ -64,6 +64,8 @@ static long long xattr_table_start;
*/
struct prefix prefix_table[] = {
{ "user.", SQUASHFS_XATTR_USER },
+ { "system.", SQUASHFS_XATTR_POSIX_ACL_ACCESS },
+ { "system.", SQUASHFS_XATTR_POSIX_ACL_DEFAULT },
{ "trusted.", SQUASHFS_XATTR_TRUSTED },
{ "security.", SQUASHFS_XATTR_SECURITY },
{ "", -1 }
diff --git a/squashfs-tools/squashfs_fs.h b/squashfs-tools/squashfs_fs.h
index afca918..040035c 100644
--- a/squashfs-tools/squashfs_fs.h
+++ b/squashfs-tools/squashfs_fs.h
@@ -122,11 +122,13 @@
#define SQUASHFS_LSOCKET_TYPE 14
/* Xattr types */
-#define SQUASHFS_XATTR_USER 0
-#define SQUASHFS_XATTR_TRUSTED 1
-#define SQUASHFS_XATTR_SECURITY 2
-#define SQUASHFS_XATTR_VALUE_OOL 256
-#define SQUASHFS_XATTR_PREFIX_MASK 0xff
+#define SQUASHFS_XATTR_USER 0
+#define SQUASHFS_XATTR_POSIX_ACL_ACCESS 1
+#define SQUASHFS_XATTR_POSIX_ACL_DEFAULT 2
+#define SQUASHFS_XATTR_TRUSTED 3
+#define SQUASHFS_XATTR_SECURITY 4
+#define SQUASHFS_XATTR_VALUE_OOL 256
+#define SQUASHFS_XATTR_PREFIX_MASK 0xff
/* Flag whether block is compressed or uncompressed, bit is set if block is
* uncompressed */
diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c
index 59f4aae..34aae84 100644
--- a/squashfs-tools/unsquashfs_xattr.c
+++ b/squashfs-tools/unsquashfs_xattr.c
@@ -57,7 +57,9 @@ void write_xattr(char *pathname, unsigned int xattr)
if(user_xattrs && prefix != SQUASHFS_XATTR_USER)
continue;
- if(root_process || prefix == SQUASHFS_XATTR_USER) {
+ if(root_process || prefix == SQUASHFS_XATTR_USER
+ || prefix == SQUASHFS_XATTR_POSIX_ACL_ACCESS
+ || prefix == SQUASHFS_XATTR_POSIX_ACL_DEFAULT) {
int res = lsetxattr(pathname, xattr_list[i].full_name,
xattr_list[i].value, xattr_list[i].vsize, 0);
--
2.14.1
next prev parent reply other threads:[~2018-04-09 12:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 12:34 [PATCH] squashfs: " Geliang Tang
2018-04-09 12:34 ` Geliang Tang [this message]
2018-04-09 19:39 ` kbuild test robot
2018-04-09 20:35 ` kbuild test robot
2018-04-10 2:24 ` [PATCH v2] " Geliang Tang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=711ddb81a0b0e58ca6ee1dd515d85e69b0294234.1523277042.git.geliangtang@gmail.com \
--to=geliangtang@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=phillip@squashfs.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®