X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=scheduler%2Fauth.c;h=14a07ae8135f76a1bc867b961dd87e225e3b9595;hb=57b7b66b58a66426494ec13ffb18f730afeab8b5;hp=9ffc06a5b573876ec7d501fcb0539474873625fd;hpb=681399ba79554f9c209661a8ca55937d798091c1;p=thirdparty%2Fcups.git diff --git a/scheduler/auth.c b/scheduler/auth.c index 9ffc06a5b..14a07ae81 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -11,7 +11,7 @@ * property of Apple Inc. and are protected by Federal copyright * law. Distribution and use rights are outlined in the file "LICENSE.txt" * which should have been included with this file. If this file is - * file is missing or damaged, see the license at "http://www.cups.org/". + * missing or damaged, see the license at "http://www.cups.org/". */ /* @@ -1179,14 +1179,22 @@ cupsdCheckGroup( #ifdef HAVE_GETGROUPLIST if (user) { - int ngroups, /* Number of groups */ - groups[2048]; /* Groups that user belongs to */ + int ngroups; /* Number of groups */ +# ifdef __APPLE__ + int groups[2048]; /* Groups that user belongs to */ +# else + gid_t groups[2048]; /* Groups that user belongs to */ +# endif /* __APPLE__ */ ngroups = (int)(sizeof(groups) / sizeof(groups[0])); +# ifdef __APPLE__ getgrouplist(username, (int)user->pw_gid, groups, &ngroups); +# else + getgrouplist(username, user->pw_gid, groups, &ngroups); +#endif /* __APPLE__ */ for (i = 0; i < ngroups; i ++) - if ((int)group->gr_gid == groups[i]) + if ((int)group->gr_gid == (int)groups[i]) return (1); } #endif /* HAVE_GETGROUPLIST */ @@ -1206,7 +1214,7 @@ cupsdCheckGroup( #ifdef HAVE_MBR_UID_TO_UUID /* - * Check group membership through MacOS X membership API... + * Check group membership through macOS membership API... */ if (user && !mbr_uid_to_uuid(user->pw_uid, useruuid))