diff options
author | Martin Matuska <mm@FreeBSD.org> | 2012-02-09 10:56:05 +0000 |
---|---|---|
committer | Martin Matuska <mm@FreeBSD.org> | 2012-02-09 10:56:05 +0000 |
commit | bfd7accf016895bfc7c0af369106f52e0ca32e79 (patch) | |
tree | ea9e0ff2a038ff253d22999a64e6a39cdbe6ac86 /libarchive/archive_acl.c | |
parent | 17993d47e9beebea021707962fcdf2387b27cae9 (diff) | |
download | src-bfd7accf016895bfc7c0af369106f52e0ca32e79.tar.gz src-bfd7accf016895bfc7c0af369106f52e0ca32e79.zip |
Notes
Diffstat (limited to 'libarchive/archive_acl.c')
-rw-r--r-- | libarchive/archive_acl.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libarchive/archive_acl.c b/libarchive/archive_acl.c index 4747a4c5a11f..fbf029894436 100644 --- a/libarchive/archive_acl.c +++ b/libarchive/archive_acl.c @@ -52,6 +52,9 @@ static int acl_special(struct archive_acl *acl, int type, int permset, int tag); static struct archive_acl_entry *acl_new_entry(struct archive_acl *acl, int type, int permset, int tag, int id); +static int archive_acl_add_entry_len_l(struct archive_acl *acl, + int type, int permset, int tag, int id, const char *name, + size_t len, struct archive_string_conv *sc); static int isint_w(const wchar_t *start, const wchar_t *end, int *result); static int ismode_w(const wchar_t *start, const wchar_t *end, int *result); static void next_field_w(const wchar_t **wp, const wchar_t **start, @@ -65,7 +68,7 @@ static int isint(const char *start, const char *end, int *result); static int ismode(const char *start, const char *end, int *result); static void next_field(const char **p, const char **start, const char **end, char *sep); -static int prefix(const char *start, const char *end, +static int prefix_c(const char *start, const char *end, const char *test); static void append_entry(char **p, const char *prefix, int tag, const char *name, int perm, int id); @@ -152,7 +155,7 @@ archive_acl_add_entry_w_len(struct archive_acl *acl, return ARCHIVE_OK; } -int +static int archive_acl_add_entry_len_l(struct archive_acl *acl, int type, int permset, int tag, int id, const char *name, size_t len, struct archive_string_conv *sc) @@ -1088,7 +1091,7 @@ archive_acl_parse_l(struct archive_acl *acl, type = default_type; name.start = name.end = NULL; - if (prefix(field[0].start, field[0].end, "user")) { + if (prefix_c(field[0].start, field[0].end, "user")) { if (!ismode(field[2].start, field[2].end, &permset)) return (ARCHIVE_WARN); if (id != -1 || field[1].start < field[1].end) { @@ -1096,7 +1099,7 @@ archive_acl_parse_l(struct archive_acl *acl, name = field[1]; } else tag = ARCHIVE_ENTRY_ACL_USER_OBJ; - } else if (prefix(field[0].start, field[0].end, "group")) { + } else if (prefix_c(field[0].start, field[0].end, "group")) { if (!ismode(field[2].start, field[2].end, &permset)) return (ARCHIVE_WARN); if (id != -1 || field[1].start < field[1].end) { @@ -1104,7 +1107,7 @@ archive_acl_parse_l(struct archive_acl *acl, name = field[1]; } else tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; - } else if (prefix(field[0].start, field[0].end, "other")) { + } else if (prefix_c(field[0].start, field[0].end, "other")) { if (fields == 2 && field[1].start < field[1].end && ismode(field[1].start, field[1].end, &permset)) { @@ -1117,7 +1120,7 @@ archive_acl_parse_l(struct archive_acl *acl, } else return (ARCHIVE_WARN); tag = ARCHIVE_ENTRY_ACL_OTHER; - } else if (prefix(field[0].start, field[0].end, "mask")) { + } else if (prefix_c(field[0].start, field[0].end, "mask")) { if (fields == 2 && field[1].start < field[1].end && ismode(field[1].start, field[1].end, &permset)) { @@ -1246,7 +1249,7 @@ next_field(const char **p, const char **start, * This makes it easy to handle the obvious abbreviations: 'u' for 'user', etc. */ static int -prefix(const char *start, const char *end, const char *test) +prefix_c(const char *start, const char *end, const char *test) { if (start == end) return (0); |