summaryrefslogtreecommitdiff
path: root/scheduler/cert.c
diff options
context:
space:
mode:
Diffstat (limited to 'scheduler/cert.c')
-rw-r--r--scheduler/cert.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/scheduler/cert.c b/scheduler/cert.c
index f1ae1c385..a25f3092a 100644
--- a/scheduler/cert.c
+++ b/scheduler/cert.c
@@ -121,6 +121,8 @@ cupsdAddCert(int pid, /* I - Process ID */
* groups can access it...
*/
+ int j; /* Looping var */
+
# ifdef HAVE_MBR_UID_TO_UUID
/*
* On MacOS X, ACLs use UUIDs instead of GIDs...
@@ -134,6 +136,13 @@ cupsdAddCert(int pid, /* I - Process ID */
* Add each group ID to the ACL...
*/
+ for (j = 0; j < i; j ++)
+ if (SystemGroupIDs[j] == SystemGroupIDs[i])
+ break;
+
+ if (j < i)
+ continue; /* Skip duplicate groups */
+
acl_create_entry(&acl, &entry);
acl_get_permset(entry, &permset);
acl_add_perm(permset, ACL_READ_DATA);
@@ -142,6 +151,7 @@ cupsdAddCert(int pid, /* I - Process ID */
acl_set_qualifier(entry, &group);
acl_set_permset(entry, permset);
}
+
# else
/*
* POSIX ACLs need permissions for owner, group, other, and mask
@@ -184,6 +194,13 @@ cupsdAddCert(int pid, /* I - Process ID */
* Add each group ID to the ACL...
*/
+ for (j = 0; j < i; j ++)
+ if (SystemGroupIDs[j] == SystemGroupIDs[i])
+ break;
+
+ if (j < i)
+ continue; /* Skip duplicate groups */
+
acl_create_entry(&acl, &entry);
acl_get_permset(entry, &permset);
acl_add_perm(permset, ACL_READ);
@@ -196,7 +213,6 @@ cupsdAddCert(int pid, /* I - Process ID */
{
char *text, *textptr; /* Temporary string */
-
cupsdLogMessage(CUPSD_LOG_ERROR, "ACL did not validate: %s",
strerror(errno));
text = acl_to_text(acl, NULL);