Linux System Programming 28 System Data File and Information-/etc/group User Information File and Function getgrgid()

一 /etc/group

getgrgid ()
getgrgrnam ()

vim /etc/group

mhr:x:1000:

Similarly, the storage form of group information is the same as passwd, and different systems have different methods.

NAME
getgrnam, getgrnam_r, getgrgid, getgrgid_r-get group file entry to
find new related information by group ID or name
SYNOPSIS
#include <sys/types.h>
#include <grp.h>

   struct group *getgrnam(const char *name);

   struct group *getgrgid(gid_t gid);

.

   The group structure is defined in <grp.h> as follows:

       struct group {
           char   *gr_name;        /* group name */
           char   *gr_passwd;      /* group password */
           gid_t   gr_gid;         /* group ID */
           char  **gr_mem;         /* NULL-terminated array of pointers
                                      to names of group members */
       };

二 /etc/shadow

Insert picture description here

Guess you like

Origin blog.csdn.net/LinuxArmbiggod/article/details/106034609