]> git.saurik.com Git - apple/libc.git/blobdiff - posix1e/acl_translate.c
Libc-1439.100.3.tar.gz
[apple/libc.git] / posix1e / acl_translate.c
index 41bbe21b168e410660a7e06d70a154a245b77c07..57cb01f1b1fa410b0ce0207f083c3551a829dc88 100644 (file)
@@ -227,6 +227,7 @@ static struct {
        {ACL_READ_SECURITY,     "readsecurity", ACL_TYPE_FILE | ACL_TYPE_DIR},
        {ACL_WRITE_SECURITY,    "writesecurity", ACL_TYPE_FILE | ACL_TYPE_DIR},
        {ACL_CHANGE_OWNER,      "chown",        ACL_TYPE_FILE | ACL_TYPE_DIR},
+       {ACL_SYNCHRONIZE,       "synchronize",  ACL_TYPE_FILE | ACL_TYPE_DIR},
        {0, NULL, 0}
 };
 
@@ -248,7 +249,6 @@ static struct {
 /*
  * reallocing snprintf with offset
  */
-
 static int
 raosnprintf(char **buf, size_t *size, ssize_t *offset, char *fmt, ...)
 {
@@ -349,7 +349,7 @@ acl_from_text(const char *buf_p)
         */
        field = strsep(&entry, " ");
        errno = 0;
-       if (!*field || strtol(field, NULL, 0) != 1)
+       if (field == NULL || !*field || strtol(field, NULL, 0) != 1)
        {
            error = EINVAL;
            goto exit;
@@ -443,7 +443,7 @@ acl_from_text(const char *buf_p)
        /* field 2: <uuid> */
        if ((field = strsep(&entry, ":")) != NULL && *field)
        {
-           mbr_string_to_uuid(field, *uu);
+           uuid_parse(field, *uu);
            need_tag = 0;
        }
 
@@ -698,8 +698,8 @@ acl_to_text(acl_t acl, ssize_t *len_p)
                }
            }
        }
-       buf[(*len_p)++] = '\n';
-       buf[(*len_p)] = 0;
+
+       if(!raosnprintf(&buf, &bufsize, len_p, "\n")) goto err_nomem;
        return buf;
 
 err_nomem: