Lines Matching refs:ent

107 internal_setgrent (ent_t *ent)  in internal_setgrent()  argument
111 ent->files = true; in internal_setgrent()
116 if (ent->blacklist.data != NULL) in internal_setgrent()
118 ent->blacklist.current = 1; in internal_setgrent()
119 ent->blacklist.data[0] = '|'; in internal_setgrent()
120 ent->blacklist.data[1] = '\0'; in internal_setgrent()
123 ent->blacklist.current = 0; in internal_setgrent()
125 ent->stream = __nss_files_fopen ("/etc/group"); in internal_setgrent()
127 if (ent->stream == NULL) in internal_setgrent()
135 internal_endgrent (ent_t *ent) in internal_endgrent() argument
137 if (ent->stream != NULL) in internal_endgrent()
139 fclose (ent->stream); in internal_endgrent()
140 ent->stream = NULL; in internal_endgrent()
143 if (ent->blacklist.data != NULL) in internal_endgrent()
145 ent->blacklist.current = 1; in internal_endgrent()
146 ent->blacklist.data[0] = '|'; in internal_endgrent()
147 ent->blacklist.data[1] = '\0'; in internal_endgrent()
150 ent->blacklist.current = 0; in internal_endgrent()
152 if (ent->need_endgrent && endgrent_impl != NULL) in internal_endgrent()
160 internal_endgrent_noerror (ent_t *ent) in internal_endgrent_noerror() argument
163 enum nss_status unused __attribute__ ((unused)) = internal_endgrent (ent); in internal_endgrent_noerror()
228 getgrent_next_nss (ent_t *ent, char *buffer, size_t buflen, const char *user, in getgrent_next_nss() argument
238 if (! ent->skip_initgroups_dyn) in getgrent_next_nss()
261 if (ent->blacklist.current <= 1) in getgrent_next_nss()
307 strlen (grpbuf.gr_name), ent) in getgrent_next_nss()
314 ent->need_endgrent = true; in getgrent_next_nss()
316 ent->skip_initgroups_dyn = true; in getgrent_next_nss()
348 while (in_blacklist (grpbuf.gr_name, strlen (grpbuf.gr_name), ent)); in getgrent_next_nss()
357 internal_getgrent_r (ent_t *ent, char *buffer, size_t buflen, const char *user, in internal_getgrent_r() argument
364 if (!ent->files) in internal_getgrent_r()
365 return getgrent_next_nss (ent, buffer, buflen, user, group, in internal_getgrent_r()
384 fgetpos (ent->stream, &pos); in internal_getgrent_r()
386 p = fgets_unlocked (buffer, buflen, ent->stream); in internal_getgrent_r()
387 if (p == NULL && feof_unlocked (ent->stream)) in internal_getgrent_r()
393 fsetpos (ent->stream, &pos); in internal_getgrent_r()
422 blacklist_store_name (&grpbuf.gr_name[1], ent); in internal_getgrent_r()
431 strlen (&grpbuf.gr_name[1]), ent)) in internal_getgrent_r()
435 blacklist_store_name (&grpbuf.gr_name[1], ent); in internal_getgrent_r()
459 ent->need_endgrent = true; in internal_getgrent_r()
461 ent->skip_initgroups_dyn = true; in internal_getgrent_r()
467 ent->files = false; in internal_getgrent_r()
469 return getgrent_next_nss (ent, buffer, buflen, user, group, in internal_getgrent_r()
520 blacklist_store_name (const char *name, ent_t *ent) in blacklist_store_name() argument
526 if (ent->blacklist.size == 0) in blacklist_store_name()
528 ent->blacklist.size = MAX (BLACKLIST_INITIAL_SIZE, 2 * namelen); in blacklist_store_name()
529 ent->blacklist.data = malloc (ent->blacklist.size); in blacklist_store_name()
530 if (ent->blacklist.data == NULL) in blacklist_store_name()
532 ent->blacklist.data[0] = '|'; in blacklist_store_name()
533 ent->blacklist.data[1] = '\0'; in blacklist_store_name()
534 ent->blacklist.current = 1; in blacklist_store_name()
538 if (in_blacklist (name, namelen, ent)) in blacklist_store_name()
541 if (ent->blacklist.current + namelen + 1 >= ent->blacklist.size) in blacklist_store_name()
543 ent->blacklist.size += MAX (BLACKLIST_INCREMENT, 2 * namelen); in blacklist_store_name()
544 tmp = realloc (ent->blacklist.data, ent->blacklist.size); in blacklist_store_name()
547 free (ent->blacklist.data); in blacklist_store_name()
548 ent->blacklist.size = 0; in blacklist_store_name()
551 ent->blacklist.data = tmp; in blacklist_store_name()
555 tmp = stpcpy (ent->blacklist.data + ent->blacklist.current, name); in blacklist_store_name()
558 ent->blacklist.current += namelen + 1; in blacklist_store_name()
565 in_blacklist (const char *name, int namelen, ent_t *ent) in in_blacklist() argument
570 if (ent->blacklist.data == NULL) in in_blacklist()
577 return strstr (ent->blacklist.data, buf) != NULL; in in_blacklist()