From: abubakarsabir924-cell Date: Sat, 23 May 2026 03:40:06 +0000 (-0400) Subject: Fix review comments: use bool, English comments, collapse else-if X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1577%2Fhead;p=thirdparty%2Fcups.git Fix review comments: use bool, English comments, collapse else-if --- diff --git a/scheduler/auth.c b/scheduler/auth.c index 3cf111009f..2f761c2309 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -2001,7 +2001,7 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ #endif /* HAVE_AUTHORIZATION_H */ - int name_result = 0; // 0=not matched, 1=matched + bool name_result = false; for (name = (char *)cupsArrayFirst(best->names); @@ -2009,23 +2009,23 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ name = (char *)cupsArrayNext(best->names)) { if (!_cups_strcasecmp(name, "@SYSTEM")) - continue; // baad mein check hoga + continue; // check @SYSTEM later if (!_cups_strcasecmp(name, "@OWNER") && owner && ((pw && !strcmp(pw->pw_name, ownername)) || (!pw && type == CUPSD_AUTH_NONE && !_cups_strcasecmp(username, ownername)))) { - name_result = 1; + name_result = true; } else if (name[0] == '@') { if (cupsdCheckGroup(username, pw, name + 1)) - name_result = 1; + name_result = true; } else if (pw && !strcmp(pw->pw_name, name)) - name_result = 1; + name_result = true; else if (!pw && type == CUPSD_AUTH_NONE && !_cups_strcasecmp(username, name)) - name_result = 1; + name_result = true; } // @SYSTEM check @@ -2039,7 +2039,7 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ { if (cupsdCheckGroup(username, pw, SystemGroups[i]) && check_admin_access(con)) { - name_result = 1; + name_result = true; break; } } @@ -2054,9 +2054,8 @@ cupsdIsAuthorized(cupsd_client_t *con, /* I - Connection */ else return (HTTP_STATUS_FORBIDDEN); } - else + else if (name_result) { - if (name_result) return (HTTP_STATUS_OK); } }