From 24fadd7649889804f7ecb0350fae73f7c10c1b05 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 18 Jan 2009 22:36:06 +0100 Subject: [PATCH] New API function iso_local_set_acl_text() --- libisofs/aaip_0_2.h | 5 +++-- libisofs/libisofs.h | 17 +++++++++++++++-- libisofs/node.c | 16 ++++++++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/libisofs/aaip_0_2.h b/libisofs/aaip_0_2.h index 5c86705..27753c5 100644 --- a/libisofs/aaip_0_2.h +++ b/libisofs/aaip_0_2.h @@ -414,8 +414,9 @@ int aaip_decode_acl(unsigned char *data, size_t num_data, size_t *consumed, @param text The input text (0 terminated, ACL long text form) @param flag Bitfield for control purposes bit0= set default ACL rather than access ACL - @return > 0 ok - -1 failure of system ACL service (see errno) + @return >0 ok + 0 no ACL manipulation adapter available + -1 failure of system ACL service (see errno) */ int aaip_set_acl_text(char *path, char *text, int flag); diff --git a/libisofs/libisofs.h b/libisofs/libisofs.h index 4933ee1..a07bcfb 100644 --- a/libisofs/libisofs.h +++ b/libisofs/libisofs.h @@ -4141,8 +4141,8 @@ int aaip_xinfo_func(void *data, int flag); * bit0= obtain "default" ACL rather than "access" ACL * (Linux directories can have a "default" ACL which influences * the permissions of newly created files.) - * bit4= if no ACL available: return *text == NULL - else: produce ACL from PROSIX permissions + * bit4= if no ACL is available: return *text == NULL + else: produce ACL from POSIX permissions * bit15= free memory and return 1 * @return * 2 ACL produced from POSIX permissions @@ -4155,4 +4155,17 @@ int aaip_xinfo_func(void *data, int flag); int iso_node_get_acl_text(IsoNode *node, char **text, int flag); +/* Set the ACL of the given file in the local filesystem to a given list + in long text form. + @param disk_path Path to the file + @param text The input text (0 terminated, ACL long text form) + @param flag Bitfield for control purposes + bit0= set default ACL rather than access ACL + @return >0 ok + 0 no ACL manipulation adapter available + -1 failure of system ACL service (see errno) +*/ +int iso_local_set_acl_text(char *disk_path, char *text, int flag); + + #endif /*LIBISO_LIBISOFS_H_*/ diff --git a/libisofs/node.c b/libisofs/node.c index e9a608d..df7598a 100644 --- a/libisofs/node.c +++ b/libisofs/node.c @@ -1517,3 +1517,19 @@ bad_decode:; } + +int iso_local_set_acl_text(char *disk_path, char *text, int flag) +{ + +#ifdef Libisofs_with_aaiP + + return aaip_set_acl_text(disk_path, text, flag); + +#else /* Libisofs_with_aaiP */ + + return 0; + +#endif /* ! Libisofs_with_aaiP */ + +} +