summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/test/test_acl_basic.c
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2007-05-29 01:00:21 +0000
committerkientzle <kientzle@FreeBSD.org>2007-05-29 01:00:21 +0000
commit013be331bc10706807599a452a143f4744398e9f (patch)
tree793787ab8615d768ba51341dfd934a5fb3039728 /lib/libarchive/test/test_acl_basic.c
parentc611006e893ac2bf962cabe02743954e3b3c3314 (diff)
downloadFreeBSD-src-013be331bc10706807599a452a143f4744398e9f.zip
FreeBSD-src-013be331bc10706807599a452a143f4744398e9f.tar.gz
libarchive 2.2.3
* "compression_program" support uses an external program * Portability: no longer uses "struct stat" as a primary data interchange structure internally * Part of the above: refactor archive_entry to separate out copy_stat() and stat() functions * More complete tests for archive_entry * Finish archive_entry_clone() * Isolate major()/minor()/makedev() in archive_entry; remove these from everywhere else. * Bug fix: properly handle decompression look-ahead at end-of-data * Bug fixes to 'ar' support * Fix memory leak in ZIP reader * Portability: better timegm() emulation in iso9660 reader * New write_disk flags to suppress auto dir creation and not overwrite newer files (for future cpio front-end) * Simplify trailing-'/' fixup when writing tar and pax * Test enhancements: fix various compiler warnings, improve portability, add lots of new tests. * Documentation: document new functions, first draft of libarchive_internals.3 MFC after: 14 days Thanks to: Joerg Sonnenberger (compression_program) Thanks to: Kai Wang (ar) Thanks to: Colin Percival (many small fixes) Thanks to: Many others who sent me various patches and problem reports.
Diffstat (limited to 'lib/libarchive/test/test_acl_basic.c')
-rw-r--r--lib/libarchive/test/test_acl_basic.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/libarchive/test/test_acl_basic.c b/lib/libarchive/test/test_acl_basic.c
index 192c12b..e7fb8a9 100644
--- a/lib/libarchive/test/test_acl_basic.c
+++ b/lib/libarchive/test/test_acl_basic.c
@@ -34,14 +34,12 @@ __FBSDID("$FreeBSD$");
* filesystems support ACLs or not.
*/
-static unsigned char buff[16384];
-
struct acl_t {
int type; /* Type of ACL: "access" or "default" */
int permset; /* Permissions for this class of users. */
int tag; /* Owner, User, Owning group, group, other, etc. */
int qual; /* GID or UID of user/group, depending on tag. */
- char *name; /* Name of user/group, depending on tag. */
+ const char *name; /* Name of user/group, depending on tag. */
};
struct acl_t acls0[] = {
@@ -79,7 +77,7 @@ struct acl_t acls2[] = {
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
-void
+static void
set_acls(struct archive_entry *ae, struct acl_t *acls, int n)
{
int i;
@@ -92,7 +90,7 @@ set_acls(struct archive_entry *ae, struct acl_t *acls, int n)
}
}
-int
+static int
acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const char *name)
{
if (type != acl->type)
@@ -120,11 +118,11 @@ acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const cha
return (0 == strcmp(name, acl->name));
}
-void
+static void
compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode)
{
int *marker = malloc(sizeof(marker[0]) * n);
- int marker_i, i;
+ int i;
int r;
int type, permset, tag, qual;
int matched;
@@ -179,8 +177,6 @@ compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode)
DEFINE_TEST(test_acl_basic)
{
- int i;
- struct archive *a;
struct archive_entry *ae;
/* Create a simple archive_entry. */
OpenPOWER on IntegriCloud