Skip to content

Conversation

@alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Dec 10, 2024


Revisions:

v1b
  • Rebase
$ git range-diff gh/streq..gh/sp streq..sp 
 1:  e07e64d0 =  1:  9a35d316 lib/, src/: Reduce scope of local variables
 2:  8adca7da =  2:  b93dff45 lib/string/strcmp/: strprefix(): Add API
 3:  8f40e0a8 =  3:  2276c5f3 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  8bb3d486 =  4:  da55cf18 lib/, src/: Use strprefix() instead of its pattern
 5:  931e5e1c =  5:  cce5feac lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  b02ba83c !  6:  19b7f8fd lib/: Use strprefix() instead of its pattern
    @@ src/login_nopam.c
      
     @@ src/login_nopam.c: static const char *resolve_hostname (const char *string)
      
    - static bool from_match (const char *tok, const char *string)
    + static bool from_match (char *tok, const char *string)
      {
     -  size_t tok_len;
     -
        /*
         * If a token has the magic value "ALL" the match always succeeds. Return
         * true if the token fully matches the string. If the token is a domain
    -@@ src/login_nopam.c: static bool from_match (const char *tok, const char *string)
    +@@ src/login_nopam.c: static bool from_match (char *tok, const char *string)
        if (string_match (tok, string)) {       /* ALL or exact match */
                return true;
        } else if (tok[0] == '.') {     /* domain: match last fields */
    @@ src/login_nopam.c: static bool from_match (const char *tok, const char *string)
                str_len = strlen (string);
                tok_len = strlen (tok);
                if (   (str_len > tok_len)
    -@@ src/login_nopam.c: static bool from_match (const char *tok, const char *string)
    +@@ src/login_nopam.c: static bool from_match (char *tok, const char *string)
                if (strchr (string, '.') == NULL) {
                        return true;
                }
 7:  1e7bee82 =  7:  e80e4426 lib/: Use !strprefix() instead of its pattern
 8:  0b8ffbaf =  8:  01a6a676 src/check_subid_range.c: main(): Remove local variable
 9:  309cc8f7 !  9:  241144c7 lib/, src/: Use strprefix() instead of its pattern
    @@ src/login_nopam.c: login_access(const char *user, const char *from)
      }
      
      /* list_match - match an item against a list of tokens with exceptions */
    -@@ src/login_nopam.c: static bool user_match (const char *tok, const char *string)
    +@@ src/login_nopam.c: static bool user_match (char *tok, const char *string)
        if (host != NULL) {
                return user_match(tok, string) && from_match(host, myhostname());
      #if HAVE_INNETGR
    @@ src/login_nopam.c: static bool user_match (const char *tok, const char *string)
                return (netgroup_match (tok + 1, NULL, string));
      #endif
        } else if (string_match (tok, string)) {        /* ALL or exact match */
    -@@ src/login_nopam.c: static bool from_match (const char *tok, const char *string)
    +@@ src/login_nopam.c: static bool from_match (char *tok, const char *string)
         * if it matches the head of the string.
         */
      #if HAVE_INNETGR
v1c
  • Rebase
$ git range-diff gh/streq..gh/sp streq..sp 
 1:  9a35d316 =  1:  35bfc827 lib/, src/: Reduce scope of local variables
 2:  b93dff45 =  2:  d0a4432a lib/string/strcmp/: strprefix(): Add API
 3:  2276c5f3 =  3:  77dd8ab9 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  da55cf18 =  4:  f910e231 lib/, src/: Use strprefix() instead of its pattern
 5:  cce5feac =  5:  26492ce2 lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  19b7f8fd =  6:  aeca0e16 lib/: Use strprefix() instead of its pattern
 7:  e80e4426 =  7:  ceb708fe lib/: Use !strprefix() instead of its pattern
 8:  01a6a676 =  8:  cab07b7c src/check_subid_range.c: main(): Remove local variable
 9:  241144c7 =  9:  f9cdbc0e lib/, src/: Use strprefix() instead of its pattern
v1d
  • Rebase
$ git range-diff gh/streq..gh/sp streq..sp 
 1:  35bfc827 =  1:  1b0f6852 lib/, src/: Reduce scope of local variables
 2:  d0a4432a =  2:  ad0e1402 lib/string/strcmp/: strprefix(): Add API
 3:  77dd8ab9 !  3:  12e115e9 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
    @@ src/newgrp.c
     +#include "string/strcmp/strprefix.h"
      #include "string/strdup/xstrdup.h"
      
    - 
    + #include <assert.h>
     @@ src/newgrp.c: static void syslog_sg (const char *name, const char *group)
        }
        if (tty == NULL) {
 4:  f910e231 =  4:  bef01549 lib/, src/: Use strprefix() instead of its pattern
 5:  26492ce2 =  5:  e8605ba1 lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  aeca0e16 =  6:  f93c7a74 lib/: Use strprefix() instead of its pattern
 7:  ceb708fe =  7:  58491ab4 lib/: Use !strprefix() instead of its pattern
 8:  cab07b7c =  8:  b12fa228 src/check_subid_range.c: main(): Remove local variable
 9:  f9cdbc0e !  9:  50537ddc lib/, src/: Use strprefix() instead of its pattern
    @@ src/grpck.c
      
      #ifdef SHADOWGRP
      #include "sgroupio.h"
    -@@ src/grpck.c: static void check_grp_file (int *errors, bool *changed)
    +@@ src/grpck.c: static void check_grp_file (bool *errors, bool *changed)
                 * Skip all NIS entries.
                 */
      
    @@ src/pwck.c
      #ifdef WITH_TCB
      #include "tcbfuncs.h"
      #endif                            /* WITH_TCB */
    -@@ src/pwck.c: static void check_pw_file (int *errors, bool *changed)
    +@@ src/pwck.c: static void check_pw_file (bool *errors, bool *changed)
                 * If this is a NIS line, skip it. You can't "know" what NIS
                 * is going to do without directly asking NIS ...
                 */
    @@ src/pwck.c: static void check_pw_file (int *errors, bool *changed)
                        continue;
                }
      
    -@@ src/pwck.c: static void check_spw_file (int *errors, bool *changed)
    +@@ src/pwck.c: static void check_spw_file (bool *errors, bool *changed)
                 * If this is a NIS line, skip it. You can't "know" what NIS
                 * is going to do without directly asking NIS ...
                 */
v1e
  • Rebase
$ git range-diff gh/streq..gh/sp shadow/master..sp 
 1:  1b0f6852 =  1:  11f97349 lib/, src/: Reduce scope of local variables
 2:  ad0e1402 =  2:  0cb53ee9 lib/string/strcmp/: strprefix(): Add API
 3:  12e115e9 =  3:  416a4dfd lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  bef01549 =  4:  70bfb775 lib/, src/: Use strprefix() instead of its pattern
 5:  e8605ba1 =  5:  8756b3a7 lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  f93c7a74 =  6:  99a02a19 lib/: Use strprefix() instead of its pattern
 7:  58491ab4 =  7:  fe82e6dd lib/: Use !strprefix() instead of its pattern
 8:  b12fa228 =  8:  09a331cd src/check_subid_range.c: main(): Remove local variable
 9:  50537ddc =  9:  0b8d02a4 lib/, src/: Use strprefix() instead of its pattern
v1f
  • Rebase
$ git range-diff master..gh/sp shadow/master..sp 
 1:  11f97349 =  1:  8a4c974e lib/, src/: Reduce scope of local variables
 2:  0cb53ee9 !  2:  1e750fc4 lib/string/strcmp/: strprefix(): Add API
    @@ Commit message
     
      ## lib/Makefile.am ##
     @@ lib/Makefile.am: libshadow_la_SOURCES = \
    -   string/strchr/strrspn.h \
    +   string/strcmp/strcaseeq.h \
        string/strcmp/streq.c \
        string/strcmp/streq.h \
     +  string/strcmp/strprefix.c \
 3:  416a4dfd =  3:  58158d7e lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  70bfb775 =  4:  857d14be lib/, src/: Use strprefix() instead of its pattern
 5:  8756b3a7 =  5:  cc36a401 lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  99a02a19 !  6:  40406868 lib/: Use strprefix() instead of its pattern
    @@ lib/user_busy.c: static int check_status (const char *name, const char *sname, u
     
      ## src/login_nopam.c ##
     @@
    - #include "sizeof.h"
      #include "string/strchr/strrspn.h"
    + #include "string/strcmp/strcaseeq.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
      #include "string/strtok/stpsep.h"
 7:  fe82e6dd =  7:  f871acba lib/: Use !strprefix() instead of its pattern
 8:  09a331cd =  8:  ee9cd934 src/check_subid_range.c: main(): Remove local variable
 9:  0b8d02a4 !  9:  5af8d4be lib/, src/: Use strprefix() instead of its pattern
    @@ lib/encrypt.c
     
      ## lib/getdef.c ##
     @@
    - #include "string/strchr/stpspn.h"
      #include "string/strchr/strrspn.h"
    + #include "string/strcmp/strcaseeq.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
      #include "string/strtok/stpsep.h"
    @@ src/sulogin.c: main(int argc, char *argv[])
     
      ## src/useradd.c ##
     @@
    - #include "string/sprintf/snprintf.h"
      #include "string/sprintf/xasprintf.h"
    + #include "string/strcmp/strcaseeq.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
      #include "string/strdup/xstrdup.h"
v2
$ git range-diff master gh/sp sp 
 1:  8a4c974e =  1:  8a4c974e lib/, src/: Reduce scope of local variables
 2:  1e750fc4 !  2:  df20a84c lib/string/strcmp/: strprefix(): Add API
    @@ lib/string/strcmp/strprefix.h (new)
     +#include "cast.h"
     +
     +
    ++// string prefix
     +#define strprefix(s, prefix)                                          \
     +({                                                                    \
     +  const char  *p_;                                              \
 3:  58158d7e =  3:  42cd7f2b lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  857d14be =  4:  af0fa51f lib/, src/: Use strprefix() instead of its pattern
 5:  cc36a401 =  5:  48fec378 lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  40406868 =  6:  2f0ebeeb lib/: Use strprefix() instead of its pattern
 7:  f871acba =  7:  cd204737 lib/: Use !strprefix() instead of its pattern
 8:  ee9cd934 =  8:  f46d2949 src/check_subid_range.c: main(): Remove local variable
 9:  5af8d4be =  9:  677cd112 lib/, src/: Use strprefix() instead of its pattern
v2b
  • Rebase
$ git range-diff master..gh/sp shadow/master..sp 
 1:  8a4c974e =  1:  4fd15511 lib/, src/: Reduce scope of local variables
 2:  df20a84c =  2:  9fa9f017 lib/string/strcmp/: strprefix(): Add API
 3:  42cd7f2b !  3:  cfcdc80c lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
    @@ lib/console.c: is_listed(const char *cfgin, const char *tty, bool def)
     
      ## lib/limits.c ##
     @@
    + #include "atoi/str2i/str2u.h"
      #include "string/memset/memzero.h"
    - #include "string/strchr/stpspn.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
    + #include "string/strspn/stpspn.h"
      #include "typetraits.h"
      
    - 
     @@ lib/limits.c: void setup_limits (const struct passwd *info)
                        }
                }
    @@ lib/limits.c: void setup_limits (const struct passwd *info)
     
      ## lib/strtoday.c ##
     @@
    + #include "getdate.h"
      #include "prototypes.h"
    - #include "string/strchr/stpspn.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
    + #include "string/strspn/stpspn.h"
      
      
    - /*
     @@ lib/strtoday.c: long strtoday (const char *str)
        /* If a numerical value is provided, this is already a number of
         * days since EPOCH.
 4:  af0fa51f =  4:  722ad1a5 lib/, src/: Use strprefix() instead of its pattern
 5:  48fec378 =  5:  9864770b lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  2f0ebeeb !  6:  a4eb40e4 lib/: Use strprefix() instead of its pattern
    @@ Commit message
     
      ## lib/getdate.y ##
     @@
    + #include "attr.h"
      #include "getdate.h"
    - #include "string/strchr/stpspn.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
    + #include "string/strspn/stpspn.h"
      
      
    - /* Some old versions of bison generate parsers that use bcopy.
     @@ lib/getdate.y: static int LookupWord (char *buff)
          {
            if (abbrev)
    @@ lib/user_busy.c: static int check_status (const char *name, const char *sname, u
     
      ## src/login_nopam.c ##
     @@
    - #include "string/strchr/strrspn.h"
    + #include "sizeof.h"
      #include "string/strcmp/strcaseeq.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
    + #include "string/strspn/stprspn.h"
      #include "string/strtok/stpsep.h"
      
    - 
     @@ src/login_nopam.c: static const char *resolve_hostname (const char *string)
      
      static bool from_match (char *tok, const char *string)
 7:  cd204737 =  7:  31e27622 lib/: Use !strprefix() instead of its pattern
 8:  f46d2949 =  8:  3936a40d src/check_subid_range.c: main(): Remove local variable
 9:  677cd112 !  9:  bfe64147 lib/, src/: Use strprefix() instead of its pattern
    @@ lib/encrypt.c
     
      ## lib/getdef.c ##
     @@
    - #include "string/strchr/strrspn.h"
    + #include "string/sprintf/xasprintf.h"
      #include "string/strcmp/strcaseeq.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
    + #include "string/strspn/stpspn.h"
    + #include "string/strspn/stprspn.h"
      #include "string/strtok/stpsep.h"
    - 
    - 
     @@ lib/getdef.c: static void def_load (void)
                 * Break the line into two fields.
                 */
    @@ lib/limits.c: static int setup_user_limits (const char *uname)
     
      ## lib/nss.c ##
     @@
    + #include "shadowlog.h"
      #include "string/sprintf/snprintf.h"
    - #include "string/strchr/stpspn.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
    + #include "string/strspn/stpspn.h"
      #include "string/strtok/stpsep.h"
      
    - 
     @@ lib/nss.c: nss_init(const char *nsswitch_path) {
        }
        p = NULL;
    @@ lib/port.c: next:
     
      ## lib/setupenv.c ##
     @@
    + #include "shadowlog.h"
      #include "string/sprintf/xasprintf.h"
    - #include "string/strchr/stpspn.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
      #include "string/strdup/xstrdup.h"
    + #include "string/strspn/stpspn.h"
      #include "string/strtok/stpsep.h"
    - 
     @@ lib/setupenv.c: static void read_env_file (const char *filename)
                cp = buf;
                /* ignore whitespace and comments */
    @@ src/login_nopam.c: login_access(const char *user, const char *from)
     +                  if (strprefix(line, "#")) {
                                continue;       /* comment line */
                        }
    -                   stpcpy(strrspn(line, " \t"), "");
    +                   stpcpy(stprspn(line, " \t"), "");
     @@ src/login_nopam.c: login_access(const char *user, const char *from)
                int err = errno;
                SYSLOG ((LOG_ERR, "cannot open %s: %s", TABLE, strerror (err)));
    @@ src/su.c: static void set_environment (struct passwd *pw)
     
      ## src/suauth.c ##
     @@
    - #include "string/strchr/stpspn.h"
    - #include "string/strchr/strrspn.h"
    + #include "defines.h"
    + #include "prototypes.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
    + #include "string/strspn/stpspn.h"
    + #include "string/strspn/stprspn.h"
      #include "string/strtok/stpsep.h"
    - 
    - 
     @@ src/suauth.c: check_su_auth(const char *actual_id, const char *wanted_id, bool su_to_root)
    -           stpcpy(strrspn(temp, " \t"), "");
    +           stpcpy(stprspn(temp, " \t"), "");
      
                p = stpspn(temp, " \t");
     -          if (*p == '#' || streq(p, ""))
v2c
  • Rebase
$ git range-diff master..gh/sp shadow/master..sp 
 1:  4fd15511 =  1:  99c3517e lib/, src/: Reduce scope of local variables
 2:  9fa9f017 =  2:  1ce95714 lib/string/strcmp/: strprefix(): Add API
 3:  cfcdc80c !  3:  b103ceb8 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
    @@ lib/limits.c: void setup_limits (const struct passwd *info)
     
      ## lib/strtoday.c ##
     @@
    - #include "getdate.h"
      #include "prototypes.h"
    + #include "string/ctype/strisascii/strisdigit.h"
      #include "string/strcmp/streq.h"
     +#include "string/strcmp/strprefix.h"
      #include "string/strspn/stpspn.h"
    @@ lib/strtoday.c: long strtoday (const char *str)
     -  }
     +  s = strprefix(s, "-") ?: s;
        s = stpspn(s, " ");
    -   while (isnum && !streq(s, "")) {
    -           if (!isdigit (*s)) {
    +   if (strisdigit(s)) {
    +           long retdate;
     
      ## lib/user_busy.c ##
     @@
 4:  722ad1a5 =  4:  1ac57a50 lib/, src/: Use strprefix() instead of its pattern
 5:  9864770b =  5:  b095b42c lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  a4eb40e4 =  6:  88100802 lib/: Use strprefix() instead of its pattern
 7:  31e27622 =  7:  ac0458ed lib/: Use !strprefix() instead of its pattern
 8:  3936a40d =  8:  dee9e425 src/check_subid_range.c: main(): Remove local variable
 9:  bfe64147 =  9:  222f5a59 lib/, src/: Use strprefix() instead of its pattern
v2d
  • Rebase
$ git range-diff master..gh/sp shadow/master..sp 
 1:  99c3517e =  1:  35198af4 lib/, src/: Reduce scope of local variables
 2:  1ce95714 =  2:  2f2a4269 lib/string/strcmp/: strprefix(): Add API
 3:  b103ceb8 =  3:  61e5ef83 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  1ac57a50 =  4:  fc8fb2b4 lib/, src/: Use strprefix() instead of its pattern
 5:  b095b42c =  5:  1490df3d lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  88100802 =  6:  b7cf26d0 lib/: Use strprefix() instead of its pattern
 7:  ac0458ed =  7:  45f32bd8 lib/: Use !strprefix() instead of its pattern
 8:  dee9e425 =  8:  a3e23f24 src/check_subid_range.c: main(): Remove local variable
 9:  222f5a59 =  9:  8f71db6d lib/, src/: Use strprefix() instead of its pattern
v2e
  • Rebase
$ git range-diff db/master..gh/sp shadow/master..sp
 1:  35198af4 =  1:  abeaf437 lib/, src/: Reduce scope of local variables
 2:  2f2a4269 =  2:  0546fb3d lib/string/strcmp/: strprefix(): Add API
 3:  61e5ef83 =  3:  3f8a6cc5 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  fc8fb2b4 =  4:  1ad5637d lib/, src/: Use strprefix() instead of its pattern
 5:  1490df3d =  5:  731f1a7f lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  b7cf26d0 =  6:  fb5c60f7 lib/: Use strprefix() instead of its pattern
 7:  45f32bd8 =  7:  a0f4fb03 lib/: Use !strprefix() instead of its pattern
 8:  a3e23f24 =  8:  0f710479 src/check_subid_range.c: main(): Remove local variable
 9:  8f71db6d =  9:  7b310d13 lib/, src/: Use strprefix() instead of its pattern
v2f
  • Rebase
$ git rd
 1:  abeaf437 =  1:  7bef2f69 lib/, src/: Reduce scope of local variables
 2:  0546fb3d =  2:  54a5b59c lib/string/strcmp/: strprefix(): Add API
 3:  3f8a6cc5 =  3:  88a833a2 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  1ad5637d =  4:  27a0da2d lib/, src/: Use strprefix() instead of its pattern
 5:  731f1a7f =  5:  cb394216 lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  fb5c60f7 !  6:  367c0a08 lib/: Use strprefix() instead of its pattern
    @@ Commit message
     
         Signed-off-by: Alejandro Colomar <alx@kernel.org>
     
    - ## lib/getdate.y ##
    -@@
    - #include "attr.h"
    - #include "getdate.h"
    - #include "string/strcmp/streq.h"
    -+#include "string/strcmp/strprefix.h"
    - #include "string/strspn/stpspn.h"
    - 
    - 
    -@@ lib/getdate.y: static int LookupWord (char *buff)
    -     {
    -       if (abbrev)
    -   {
    --    if (strncmp (buff, tp->name, 3) == 0)
    -+    if (strprefix(tp->name, buff))
    -       {
    -         yylval.Number = tp->value;
    -         return tp->type;
    -
      ## lib/limits.c ##
     @@ lib/limits.c: void setup_limits (const struct passwd *info)
                        }
 7:  a0f4fb03 =  7:  83413af3 lib/: Use !strprefix() instead of its pattern
 8:  0f710479 =  8:  42abf0c1 src/check_subid_range.c: main(): Remove local variable
 9:  7b310d13 =  9:  bcc306ef lib/, src/: Use strprefix() instead of its pattern
v3
  • Drop removal of local variable. [@hallyn ]
$ git rd
 1:  7bef2f69 =  1:  7bef2f69 lib/, src/: Reduce scope of local variables
 2:  54a5b59c =  2:  54a5b59c lib/string/strcmp/: strprefix(): Add API
 3:  88a833a2 =  3:  88a833a2 lib/, src/: Use s=strprefix(s,p)?:s instead of its pattern
 4:  27a0da2d =  4:  27a0da2d lib/, src/: Use strprefix() instead of its pattern
 5:  cb394216 =  5:  cb394216 lib/env.c: sanitize_env(): Use !strprefix() instead of its pattern
 6:  367c0a08 =  6:  367c0a08 lib/: Use strprefix() instead of its pattern
 7:  83413af3 =  7:  83413af3 lib/: Use !strprefix() instead of its pattern
 8:  42abf0c1 <  -:  -------- src/check_subid_range.c: main(): Remove local variable
 9:  bcc306ef !  8:  40f955d1 lib/, src/: Use strprefix() instead of its pattern
    @@ src/check_subid_range.c
      static const char Prog[] = "check_subid_range";
     @@ src/check_subid_range.c: main(int argc, char **argv)
                exit(1);
    + 
    +   owner = argv[1];
    +-  check_uids = argv[2][0] == 'u';
    ++  check_uids = strprefix(argv[2], "u");
    +   if (get_uid(argv[3], &start) == -1)
    +           exit(1);
        if (str2ul(&count, argv[4]) == -1)
    -           exit(1);
    --  if (argv[2][0] == 'u') {
    -+  if (strprefix(argv[2], "u")) {
    -           if (have_sub_uids(owner, start, count))
    -                   exit(0);
    -           exit(1);
     
      ## src/grpck.c ##
     @@

}
char *val;

cp = strprefix(cp, ",") ?: cp;

Check notice

Code scanning / CodeQL

For loop variable changed in body Note

Loop counters should not be modified in the body of the
loop
.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This skips an optional prefix.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
@alejandro-colomar
Copy link
Collaborator Author

@ikerexxe , @hallyn , please have a look at this patch set when you can. It's a dependency of many others.

@hallyn
Copy link
Member

hallyn commented May 26, 2025

Apart from that, +1, thanks.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
@hallyn hallyn merged commit d1cbf68 into shadow-maint:master May 26, 2025
10 checks passed
@alejandro-colomar
Copy link
Collaborator Author

Hoo-ray! :)

@alejandro-colomar alejandro-colomar deleted the sp branch May 26, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Simpler A good issue for a new beginner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants