Lines Matching defs:group

52 static size_t grmemlen(const struct group *, const char *, int *);
53 static struct group *grcopy(const struct group *gr, char *mem, const char *, int ndx);
59 gr_init(const char *dir, const char *group)
72 if (group == NULL) {
75 } else if (snprintf(group_file, sizeof(group_file), "%s/group",
81 if (strlen(group) >= sizeof(group_file)) {
85 strcpy(group_file, group);
93 * Lock the group file
107 errx(1, "the group file is busy");
109 err(1, "could not lock the group file: ");
123 * Create and open a presmuably safe temp file for editing group data
161 * Copy the group file from one descriptor to another, replacing, deleting
165 gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
168 struct group *fgr;
169 const struct group *sgr;
178 /* deleting a group */
186 /* adding a group */
209 warnx("group line too long");
259 /* fgr is either a struct group for the current line,
327 * Regenerate the group file
341 * Make sure new group file is safe on disk. To improve performance we
378 * Compares two struct group's.
381 gr_equal(const struct group *gr1, const struct group *gr2)
429 * Make a group line out of a struct group.
432 gr_make(const struct group *gr)
441 /* Calculate the length of the group line. */
451 /* Create the group line and fill it. */
469 * Duplicate a struct group.
471 struct group *
472 gr_dup(const struct group *gr)
477 * Add a new member name to a struct group.
479 struct group *
480 gr_add(const struct group *gr, const char *newmember)
488 /* Create new group and copy old group into it. */
495 * guarantee the gr_mem + strings are contiguous in the given struct group
496 * but compactify the new group into the following form.
499 * for a group with two members only.
505 * (gr_mem * newgrp + sizeof(struct group) + sizeof(**)) points to gr_mem area
517 * Copy the contents of a group plus given name to a preallocated group struct
519 static struct group *
520 grcopy(const struct group *gr, char *dst, const char *name, int ndx)
523 struct group *newgr;
525 newgr = (struct group *)(void *)dst; /* avoid alignment warning */
544 /* Original group struct might have a NULL gr_mem */
564 * Calculate length of a struct group + given name
567 grmemlen(const struct group *gr, const char *name, int *num_mem)
574 /* Calculate size of the group. */
600 * Scan a line and place it into a group structure.
603 __gr_scan(char *line, struct group *gr)
646 * Create a struct group from a line.
648 struct group *
651 struct group gr;
653 struct group *new_gr;