]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/gshadow_.h: Fix compatibility with libc's struct sgrp
authorAlejandro Colomar <alx@kernel.org>
Wed, 6 Nov 2024 13:51:06 +0000 (14:51 +0100)
committerAlejandro Colomar <alx@kernel.org>
Fri, 24 Jan 2025 11:10:15 +0000 (12:10 +0100)
The name of the first field was different.  Rename for compatiblity with
libc.

$ diff -wU10 \
<(grepc sgrp . | sed_rm_ccomments) \
<(grepc sgrp /usr/include/ | sed_rm_ccomments);
--- /dev/fd/63 2024-11-06 14:49:03.287204461 +0100
+++ /dev/fd/62 2024-11-06 14:49:03.287204461 +0100
@@ -1,6 +1,7 @@
-./lib/gshadow_.h:struct sgrp {
- char *sg_name;
+/usr/include/gshadow.h:struct sgrp
+  {
+    char *sg_namp;
char *sg_passwd;
char **sg_adm;
char **sg_mem;
 };

This originates from a typo in this project, which was later copied by
glibc, and so the typo was set in stone.  The typo was eventually fixed
in shadow, but glibc had already set the name in stone, so we should
just learn to live with it.

$ grep -rn -C3 sg_name ChangeLog
1607-
1608-2011-07-30  Nicolas François  <nicolas.francois@centraliens.net>
1609-
1610: * src/chgpasswd.c: Fix typo sp -> sg. sg_namp -> sg_name
1611- * src/chgpasswd.c: Always update the group file when SHADOWGRP is
1612- not enabled.
1613-

This is a scripted change:

$ find lib* src -type f \
| xargs sed -i 's/\<sg_name\>/sg_namp/g';

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
14 files changed:
lib/gshadow.c
lib/gshadow_.h
lib/sgroupio.c
src/chgpasswd.c
src/gpasswd.c
src/groupadd.c
src/groupmems.c
src/groupmod.c
src/grpck.c
src/grpconv.c
src/newusers.c
src/useradd.c
src/userdel.c
src/usermod.c

index 4c1ddf25854c4a0ff65df3dbada4bfe9cfbf60d4..d1ca70706b8289740aa6cd42b84248da0ffb1b12 100644 (file)
@@ -106,7 +106,7 @@ sgetsgent(const char *string)
        if (NULL != cp || i != FIELDS)
                return NULL;
 
-       sgroup.sg_name = fields[0];
+       sgroup.sg_namp = fields[0];
        sgroup.sg_passwd = fields[1];
 
        free(sgroup.sg_adm);
@@ -192,7 +192,7 @@ sgetsgent(const char *string)
        setsgent ();
 
        while ((sgrp = getsgent ()) != NULL) {
-               if (streq(name, sgrp->sg_name)) {
+               if (streq(name, sgrp->sg_namp)) {
                        break;
                }
        }
@@ -218,7 +218,7 @@ int putsgent (const struct sgrp *sgrp, FILE * fp)
        }
 
        /* calculate the required buffer size */
-       size = strlen (sgrp->sg_name) + strlen (sgrp->sg_passwd) + 10;
+       size = strlen (sgrp->sg_namp) + strlen (sgrp->sg_passwd) + 10;
        for (i = 0; (NULL != sgrp->sg_adm) && (NULL != sgrp->sg_adm[i]); i++) {
                size += strlen (sgrp->sg_adm[i]) + 1;
        }
@@ -235,7 +235,7 @@ int putsgent (const struct sgrp *sgrp, FILE * fp)
        /*
         * Copy the group name and passwd.
         */
-       cp = stpcpy(stpcpy(cp, sgrp->sg_name), ":");
+       cp = stpcpy(stpcpy(cp, sgrp->sg_namp), ":");
        cp = stpcpy(stpcpy(cp, sgrp->sg_passwd), ":");
 
        /*
index a523308281812bfa3a65fd9c4c8c6d260b3fcbf5..be1f0f1c236c406696e02beb741f07178bdb9db2 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 struct sgrp {
-       char *sg_name;          /* group name */
+       char *sg_namp;          /* group name */
        char *sg_passwd;        /* group password */
        char **sg_adm;          /* group administrator list */
        char **sg_mem;          /* group membership list */
index acb140d87e06bf4c978f39eb7cc03dde15812866..9805761248ed96baaf27d178f1cc2d8bf51a61c5 100644 (file)
@@ -36,9 +36,9 @@
        /* Do the same as the other _dup function, even if we know the
         * structure. */
        /*@-mustfreeonly@*/
-       sg->sg_name = strdup (sgent->sg_name);
+       sg->sg_namp = strdup (sgent->sg_namp);
        /*@=mustfreeonly@*/
-       if (NULL == sg->sg_name) {
+       if (NULL == sg->sg_namp) {
                free (sg);
                return NULL;
        }
@@ -46,7 +46,7 @@
        sg->sg_passwd = strdup (sgent->sg_passwd);
        /*@=mustfreeonly@*/
        if (NULL == sg->sg_passwd) {
-               free (sg->sg_name);
+               free (sg->sg_namp);
                free (sg);
                return NULL;
        }
@@ -57,7 +57,7 @@
        /*@=mustfreeonly@*/
        if (NULL == sg->sg_adm) {
                free (sg->sg_passwd);
-               free (sg->sg_name);
+               free (sg->sg_namp);
                free (sg);
                return NULL;
        }
@@ -69,7 +69,7 @@
                        }
                        free (sg->sg_adm);
                        free (sg->sg_passwd);
-                       free (sg->sg_name);
+                       free (sg->sg_namp);
                        free (sg);
                        return NULL;
                }
@@ -86,7 +86,7 @@
                }
                free (sg->sg_adm);
                free (sg->sg_passwd);
-               free (sg->sg_name);
+               free (sg->sg_namp);
                free (sg);
                return NULL;
        }
                        }
                        free (sg->sg_adm);
                        free (sg->sg_passwd);
-                       free (sg->sg_name);
+                       free (sg->sg_namp);
                        free (sg);
                        return NULL;
                }
@@ -131,7 +131,7 @@ void
 sgr_free(/*@only@*/struct sgrp *sgent)
 {
        size_t i;
-       free (sgent->sg_name);
+       free (sgent->sg_namp);
        if (NULL != sgent->sg_passwd)
                free(strzero(sgent->sg_passwd));
 
@@ -150,7 +150,7 @@ static const char *gshadow_getname (const void *ent)
 {
        const struct sgrp *gr = ent;
 
-       return gr->sg_name;
+       return gr->sg_namp;
 }
 
 static void *gshadow_parse (const char *line)
@@ -163,7 +163,7 @@ static int gshadow_put (const void *ent, FILE * file)
        const struct sgrp *sg = ent;
 
        if (   (NULL == sg)
-           || (valid_field (sg->sg_name, ":\n") == -1)
+           || (valid_field (sg->sg_namp, ":\n") == -1)
            || (valid_field (sg->sg_passwd, ":\n") == -1)) {
                return -1;
        }
index 1625e8540777c2d94109bc6756af1ba339cfaf85..c5f30284458c89bb5a215b8adcb3ad8cd5c8aba5 100644 (file)
@@ -557,7 +557,7 @@ int main (int argc, char **argv)
                                 * group, but there are no entries in
                                 * gshadow, create one.
                                 */
-                               newsg.sg_name   = name;
+                               newsg.sg_namp   = name;
                                /* newsg.sg_passwd = NULL; will be set later */
                                newsg.sg_adm    = &empty;
                                newsg.sg_mem    = dup_list (gr->gr_mem);
@@ -595,7 +595,7 @@ int main (int argc, char **argv)
                        if (sgr_update (&newsg) == 0) {
                                fprintf (stderr,
                                         _("%s: line %jd: failed to prepare the new %s entry '%s'\n"),
-                                        Prog, line, sgr_dbname (), newsg.sg_name);
+                                        Prog, line, sgr_dbname (), newsg.sg_namp);
                                errors = true;
                                continue;
                        }
index 650e479290e6fa2753774e827b7efe8a3edb5ff1..13abbdab7098c6ec56845c51bd4100859271edab 100644 (file)
@@ -708,7 +708,7 @@ static void update_group (struct group *gr)
        if (is_shadowgrp && (sgr_update (sg) == 0)) {
                fprintf (stderr,
                         _("%s: failed to prepare the new %s entry '%s'\n"),
-                        Prog, sgr_dbname (), sg->sg_name);
+                        Prog, sgr_dbname (), sg->sg_namp);
                exit (1);
        }
 #endif                         /* SHADOWGRP */
@@ -774,13 +774,13 @@ static void get_group (struct group *gr)
                tmpsg = sgr_locate (group);
                if (NULL != tmpsg) {
                        *sg = *tmpsg;
-                       sg->sg_name = xstrdup (tmpsg->sg_name);
+                       sg->sg_namp = xstrdup (tmpsg->sg_namp);
                        sg->sg_passwd = xstrdup (tmpsg->sg_passwd);
 
                        sg->sg_mem = dup_list (tmpsg->sg_mem);
                        sg->sg_adm = dup_list (tmpsg->sg_adm);
                } else {
-                       sg->sg_name = xstrdup (group);
+                       sg->sg_namp = xstrdup (group);
                        sg->sg_passwd = gr->gr_passwd;
                        gr->gr_passwd = SHADOW_PASSWD_STRING;   /* XXX warning: const */
 
index 9f0eb2e50f009085a91dcdfc28196dec1762fd79..ab30960e396461700f9568425e22449d3a7fbee9 100644 (file)
@@ -149,7 +149,7 @@ static void new_grent (struct group *grent)
 static void new_sgent (struct sgrp *sgent)
 {
        memzero (sgent, sizeof *sgent);
-       sgent->sg_name = group_name;
+       sgent->sg_namp = group_name;
        if (pflg) {
                sgent->sg_passwd = group_passwd;
        } else {
@@ -231,7 +231,7 @@ grp_update(void)
        if (is_shadow_grp && (sgr_update (&sgrp) == 0)) {
                fprintf (stderr,
                         _("%s: failed to prepare the new %s entry '%s'\n"),
-                        Prog, sgr_dbname (), sgrp.sg_name);
+                        Prog, sgr_dbname (), sgrp.sg_namp);
                exit (E_GRP_UPDATE);
        }
 #endif                         /* SHADOWGRP */
index 53729b767c52f21f8fc20235819861a4b551b30e..d37b237f2381242125f520ff4a4f9376cfff48bc 100644 (file)
@@ -128,7 +128,7 @@ static void add_user (const char *user,
                if (NULL == sg) {
                        /* Create a shadow group based on this group */
                        static struct sgrp sgrent;
-                       sgrent.sg_name = xstrdup (newgrp->gr_name);
+                       sgrent.sg_namp = xstrdup (newgrp->gr_name);
                        sgrent.sg_mem = dup_list (newgrp->gr_mem);
                        sgrent.sg_adm = XMALLOC(1, char *);
                        sgrent.sg_adm[0] = NULL;
@@ -154,7 +154,7 @@ static void add_user (const char *user,
                if (sgr_update (newsg) == 0) {
                        fprintf (stderr,
                                 _("%s: failed to prepare the new %s entry '%s'\n"),
-                                Prog, sgr_dbname (), newsg->sg_name);
+                                Prog, sgr_dbname (), newsg->sg_namp);
                        fail_exit (13);
                }
        }
@@ -203,7 +203,7 @@ static void remove_user (const char *user,
                if (NULL == sg) {
                        /* Create a shadow group based on this group */
                        static struct sgrp sgrent;
-                       sgrent.sg_name = xstrdup (newgrp->gr_name);
+                       sgrent.sg_namp = xstrdup (newgrp->gr_name);
                        sgrent.sg_mem = dup_list (newgrp->gr_mem);
                        sgrent.sg_adm = XMALLOC(1, char *);
                        sgrent.sg_adm[0] = NULL;
@@ -230,7 +230,7 @@ static void remove_user (const char *user,
                if (sgr_update (newsg) == 0) {
                        fprintf (stderr,
                                 _("%s: failed to prepare the new %s entry '%s'\n"),
-                                Prog, sgr_dbname (), newsg->sg_name);
+                                Prog, sgr_dbname (), newsg->sg_namp);
                        fail_exit (13);
                }
        }
@@ -269,7 +269,7 @@ static void purge_members (const struct group *grp)
                if (NULL == sg) {
                        /* Create a shadow group based on this group */
                        static struct sgrp sgrent;
-                       sgrent.sg_name = xstrdup (newgrp->gr_name);
+                       sgrent.sg_namp = xstrdup (newgrp->gr_name);
                        sgrent.sg_mem = XMALLOC(1, char *);
                        sgrent.sg_mem[0] = NULL;
                        sgrent.sg_adm = XMALLOC(1, char *);
@@ -299,7 +299,7 @@ static void purge_members (const struct group *grp)
                if (sgr_update (newsg) == 0) {
                        fprintf (stderr,
                                 _("%s: failed to prepare the new %s entry '%s'\n"),
-                                Prog, sgr_dbname (), newsg->sg_name);
+                                Prog, sgr_dbname (), newsg->sg_namp);
                        fail_exit (13);
                }
        }
index 7342707d06159191bc9ea31431911f9dc1ff613f..5164c4c3fdb204ac6522f9fee060197f950a3d91 100644 (file)
@@ -178,7 +178,7 @@ static void new_grent (struct group *grent)
 static void new_sgent (struct sgrp *sgent)
 {
        if (nflg) {
-               sgent->sg_name = xstrdup (group_newname);
+               sgent->sg_namp = xstrdup (group_newname);
        }
 
        /* Always update the shadowed password if there is a shadow entry
@@ -238,7 +238,7 @@ grp_update(void)
                         * gshadow entry when a new password is requested.
                         */
                        bzero(&sgrp, sizeof sgrp);
-                       sgrp.sg_name   = xstrdup (grp.gr_name);
+                       sgrp.sg_namp   = xstrdup (grp.gr_name);
                        sgrp.sg_passwd = xstrdup (grp.gr_passwd);
                        sgrp.sg_adm    = &empty;
                        sgrp.sg_mem    = dup_list (grp.gr_mem);
@@ -318,7 +318,7 @@ grp_update(void)
                if (sgr_update (&sgrp) == 0) {
                        fprintf (stderr,
                                 _("%s: failed to prepare the new %s entry '%s'\n"),
-                                Prog, sgr_dbname (), sgrp.sg_name);
+                                Prog, sgr_dbname (), sgrp.sg_namp);
                        exit (E_GRP_UPDATE);
                }
                if (nflg && (sgr_remove (group_name) == 0)) {
index e959f0adb3b9dc95bfed059ca0faaac903a4df16..d3f2baee6a453ff569e7b505c67c3cc7ed8b87c1 100644 (file)
@@ -613,7 +613,7 @@ static void check_grp_file (bool *errors, bool *changed)
                                        struct group gr;
                                        static char *empty = NULL;
 
-                                       sg.sg_name = grp->gr_name;
+                                       sg.sg_namp = grp->gr_name;
                                        sg.sg_passwd = grp->gr_passwd;
                                        sg.sg_adm = &empty;
                                        sg.sg_mem = grp->gr_mem;
@@ -625,7 +625,7 @@ static void check_grp_file (bool *errors, bool *changed)
                                        if (sgr_update (&sg) == 0) {
                                                fprintf (stderr,
                                                         _("%s: failed to prepare the new %s entry '%s'\n"),
-                                                        Prog, sgr_dbname (), sg.sg_name);
+                                                        Prog, sgr_dbname (), sg.sg_namp);
                                                fail_exit (E_CANT_UPDATE);
                                        }
                                        /* remove password from /etc/group */
@@ -740,7 +740,7 @@ static void check_sgr_file (bool *errors, bool *changed)
                                continue;
                        }
 
-                       if (!streq(sgr->sg_name, ent->sg_name)) {
+                       if (!streq(sgr->sg_namp, ent->sg_namp)) {
                                continue;
                        }
 
@@ -763,7 +763,7 @@ static void check_sgr_file (bool *errors, bool *changed)
                /*
                 * Make sure this entry exists in the /etc/group file.
                 */
-               grp = gr_locate (sgr->sg_name);
+               grp = gr_locate (sgr->sg_namp);
                if (grp == NULL) {
                        printf (_("no matching group file entry in %s\n"),
                                grp_file);
@@ -777,7 +777,7 @@ static void check_sgr_file (bool *errors, bool *changed)
                         * Verify that the all members defined in /etc/gshadow are also
                         * present in /etc/group.
                         */
-                       compare_members_lists (sgr->sg_name,
+                       compare_members_lists (sgr->sg_namp,
                                               sgr->sg_mem, grp->gr_mem,
                                               sgr_file, grp_file);
                }
@@ -785,7 +785,7 @@ static void check_sgr_file (bool *errors, bool *changed)
                /*
                 * Make sure each administrator exists
                 */
-               if (check_members (sgr->sg_name, sgr->sg_adm,
+               if (check_members (sgr->sg_namp, sgr->sg_adm,
                                   _("shadow group %s: no administrative user %s\n"),
                                   _("delete administrative member '%s'? "),
                                   "delete admin '%s' from shadow group '%s'",
@@ -798,7 +798,7 @@ static void check_sgr_file (bool *errors, bool *changed)
                /*
                 * Make sure each member exists
                 */
-               if (check_members (sgr->sg_name, sgr->sg_mem,
+               if (check_members (sgr->sg_namp, sgr->sg_mem,
                                   _("shadow group %s: no user %s\n"),
                                   _("delete member '%s'? "),
                                   "delete member '%s' from shadow group '%s'",
index 16cd52c9a281e69ffdcd651998918216cfeff840..1b31cb85abf745f8b463c79521b6567aa6d7b043 100644 (file)
@@ -172,17 +172,17 @@ int main (int argc, char **argv)
         */
        (void) sgr_rewind ();
        while ((sg = sgr_next ()) != NULL) {
-               if (gr_locate (sg->sg_name) != NULL) {
+               if (gr_locate (sg->sg_namp) != NULL) {
                        continue;
                }
 
-               if (sgr_remove (sg->sg_name) == 0) {
+               if (sgr_remove (sg->sg_namp) == 0) {
                        /*
                         * This shouldn't happen (the entry exists) but...
                         */
                        fprintf (stderr,
                                 _("%s: cannot remove entry '%s' from %s\n"),
-                                Prog, sg->sg_name, sgr_dbname ());
+                                Prog, sg->sg_namp, sgr_dbname ());
                        fail_exit (3);
                }
                (void) sgr_rewind ();
@@ -205,7 +205,7 @@ int main (int argc, char **argv)
 
                        /* add new shadow group entry */
                        bzero(&sgent, sizeof sgent);
-                       sgent.sg_name = gr->gr_name;
+                       sgent.sg_namp = gr->gr_name;
                        sgent.sg_passwd = gr->gr_passwd;
                        sgent.sg_adm = &empty;
                }
@@ -220,7 +220,7 @@ int main (int argc, char **argv)
                if (sgr_update (&sgent) == 0) {
                        fprintf (stderr,
                                 _("%s: failed to prepare the new %s entry '%s'\n"),
-                                Prog, sgr_dbname (), sgent.sg_name);
+                                Prog, sgr_dbname (), sgent.sg_namp);
                        fail_exit (3);
                }
                /* remove password from /etc/group */
index 5fde8bbe3017e6de472c3724e7d6ba365d9d4c43..e3685efe94826d12e7aa4043d541aaf191a28634 100644 (file)
@@ -323,7 +323,7 @@ static int add_group (const char *name, const char *gid, gid_t *ngid, uid_t uid)
        if (is_shadow_grp) {
                struct sgrp sgrent;
                char *admins[1];
-               sgrent.sg_name = grent.gr_name;
+               sgrent.sg_namp = grent.gr_name;
                sgrent.sg_passwd = "*"; /* XXX warning: const */
                grent.gr_passwd  = "x"; /* XXX warning: const */
                admins[0] = NULL;
index 498619e310f836f486e2a8fafad11e6b66bb1085..70a48cb8df24e72af43d620e045ee1bf2dce7a3c 100644 (file)
@@ -1098,11 +1098,11 @@ static void grp_update (void)
                 *        user_groups. All these groups should be checked
                 *        for existence with gr_locate already.
                 */
-               if (gr_locate (sgrp->sg_name) == NULL) {
+               if (gr_locate (sgrp->sg_namp) == NULL) {
                        continue;
                }
 
-               if (!is_on_list (user_groups, sgrp->sg_name)) {
+               if (!is_on_list (user_groups, sgrp->sg_namp)) {
                        continue;
                }
 
@@ -1133,7 +1133,7 @@ static void grp_update (void)
                if (sgr_update (nsgrp) == 0) {
                        fprintf (stderr,
                                 _("%s: failed to prepare the new %s entry '%s'\n"),
-                                Prog, sgr_dbname (), nsgrp->sg_name);
+                                Prog, sgr_dbname (), nsgrp->sg_namp);
                        SYSLOG ((LOG_ERR, "failed to prepare the new %s entry '%s'", sgr_dbname (), user_name));
 #ifdef WITH_AUDIT
                        audit_logger (AUDIT_ADD_USER, Prog,
@@ -1151,7 +1151,7 @@ static void grp_update (void)
 #endif
                SYSLOG ((LOG_INFO,
                         "add '%s' to shadow group '%s'",
-                        user_name, nsgrp->sg_name));
+                        user_name, nsgrp->sg_namp));
        }
 #endif                         /* SHADOWGRP */
 }
@@ -1913,7 +1913,7 @@ static void new_grent (struct group *grent)
 static void new_sgent (struct sgrp *sgent)
 {
        memzero (sgent, sizeof *sgent);
-       sgent->sg_name = (char *) user_name;
+       sgent->sg_namp = (char *) user_name;
        sgent->sg_passwd = "!"; /* XXX warning: const */
        sgent->sg_adm = &empty_list;
        sgent->sg_mem = &empty_list;
@@ -1965,7 +1965,7 @@ static void grp_add (void)
        if (is_shadow_grp && (sgr_update (&sgrp) == 0)) {
                fprintf (stderr,
                         _("%s: failed to prepare the new %s entry '%s'\n"),
-                        Prog, sgr_dbname (), sgrp.sg_name);
+                        Prog, sgr_dbname (), sgrp.sg_namp);
 #ifdef WITH_AUDIT
                audit_logger (AUDIT_ADD_GROUP, Prog,
                              "adding group",
index 1703f0e05e4873c5d6121832c78bc9f4876e743c..a267ae1d03985f6ed30e1670786b278e75f2a8a0 100644 (file)
@@ -264,7 +264,7 @@ static void update_groups (void)
                if (sgr_update (nsgrp) == 0) {
                        fprintf (stderr,
                                 _("%s: failed to prepare the new %s entry '%s'\n"),
-                                Prog, sgr_dbname (), nsgrp->sg_name);
+                                Prog, sgr_dbname (), nsgrp->sg_namp);
                        exit (E_GRP_UPDATE);
                }
 #ifdef WITH_AUDIT
@@ -273,7 +273,7 @@ static void update_groups (void)
                              user_name, user_id, SHADOW_AUDIT_SUCCESS);
 #endif                         /* WITH_AUDIT */
                SYSLOG ((LOG_INFO, "delete '%s' from shadow group '%s'\n",
-                        user_name, nsgrp->sg_name));
+                        user_name, nsgrp->sg_namp));
        }
 #endif                         /* SHADOWGRP */
 }
index 80ab4989edd68bba39cfa18410e60af5a0fea54e..7ea1a7244a3f6defad231539924c66e3ecfe4b6c 100644 (file)
@@ -850,7 +850,7 @@ update_gshadow(const struct sgrp *sgrp)
         * concurrent groups.
         */
        is_member = Gflg && (   (was_member && aflg)
-                            || is_on_list (user_groups, sgrp->sg_name));
+                            || is_on_list (user_groups, sgrp->sg_namp));
 
        if (!was_member && !was_admin && !is_member)
                return;
@@ -885,7 +885,7 @@ update_gshadow(const struct sgrp *sgrp)
 #endif
                SYSLOG ((LOG_INFO,
                         "change admin '%s' to '%s' in shadow group '%s'",
-                        user_name, user_newname, nsgrp->sg_name));
+                        user_name, user_newname, nsgrp->sg_namp));
        }
 
        if (was_member) {
@@ -908,7 +908,7 @@ update_gshadow(const struct sgrp *sgrp)
                                SYSLOG ((LOG_INFO,
                                         "change '%s' to '%s' in shadow group '%s'",
                                         user_name, user_newname,
-                                        nsgrp->sg_name));
+                                        nsgrp->sg_namp));
                        }
                } else {
                        /* User was a member but is no more a
@@ -923,7 +923,7 @@ update_gshadow(const struct sgrp *sgrp)
 #endif
                        SYSLOG ((LOG_INFO,
                                 "delete '%s' from shadow group '%s'",
-                                user_name, nsgrp->sg_name));
+                                user_name, nsgrp->sg_namp));
                }
        } else if (is_member) {
                /* User was not a member but is now a member this
@@ -937,7 +937,7 @@ update_gshadow(const struct sgrp *sgrp)
                              user_newname, AUDIT_NO_ID, 1);
 #endif
                SYSLOG ((LOG_INFO, "add '%s' to shadow group '%s'",
-                        user_newname, nsgrp->sg_name));
+                        user_newname, nsgrp->sg_namp));
        }
        if (!changed)
                goto free_nsgrp;
@@ -948,9 +948,9 @@ update_gshadow(const struct sgrp *sgrp)
        if (sgr_update (nsgrp) == 0) {
                fprintf (stderr,
                         _("%s: failed to prepare the new %s entry '%s'\n"),
-                        Prog, sgr_dbname (), nsgrp->sg_name);
+                        Prog, sgr_dbname (), nsgrp->sg_namp);
                SYSLOG ((LOG_WARN, "failed to prepare the new %s entry '%s'",
-                        sgr_dbname (), nsgrp->sg_name));
+                        sgr_dbname (), nsgrp->sg_namp));
                fail_exit (E_GRP_UPDATE);
        }