1 /* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3 Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
25 #include <bits/libc-lock.h>
27 #include <rpcsvc/yp.h>
28 #include <rpcsvc/ypclnt.h>
29 #include <rpcsvc/nis.h>
32 #include "nss-nisplus.h"
33 #include "nisplus-parser.h"
35 static service_user
*ni
= NULL
;
36 static bool_t use_nisplus
= FALSE
; /* default: group_compat: nis */
37 static nis_name grptable
= NULL
; /* Name of the group table */
38 static size_t grptablelen
= 0;
40 /* Get the declaration of the parser function. */
42 #define STRUCTURE group
44 #include <nss/nss_files/files-parse.c>
46 /* Structure for remembering -group members ... */
47 #define BLACKLIST_INITIAL_SIZE 512
48 #define BLACKLIST_INCREMENT 256
64 struct blacklist_t blacklist
;
66 typedef struct ent_t ent_t
;
68 static ent_t ext_ent
= {0, 0, NULL
, 0, NULL
, NULL
, {NULL
, 0, 0}};
70 /* Protect global state against multiple changers. */
71 __libc_lock_define_initialized (static, lock
)
73 /* Prototypes for local functions. */
74 static void blacklist_store_name (const char *, ent_t
*);
75 static int in_blacklist (const char *, int, ent_t
*);
77 static enum nss_status
78 _nss_first_init (void)
82 __nss_database_lookup ("group_compat", NULL
, "nis", &ni
);
83 use_nisplus
= (strcmp (ni
->name
, "nisplus") == 0);
88 static const char key
[] = "group.org_dir.";
89 const char *local_dir
= nis_local_directory ();
90 size_t len_local_dir
= strlen (local_dir
);
92 grptable
= malloc (sizeof (key
) + len_local_dir
);
94 return NSS_STATUS_TRYAGAIN
;
96 grptablelen
= ((char *) mempcpy (mempcpy (grptable
,
97 key
, sizeof (key
) - 1),
98 local_dir
, len_local_dir
+ 1)
102 return NSS_STATUS_SUCCESS
;
105 static enum nss_status
106 internal_setgrent (ent_t
*ent
)
108 enum nss_status status
= NSS_STATUS_SUCCESS
;
110 ent
->nis
= ent
->nis_first
= 0;
112 if (_nss_first_init () != NSS_STATUS_SUCCESS
)
113 return NSS_STATUS_UNAVAIL
;
115 if (ent
->oldkey
!= NULL
)
122 if (ent
->result
!= NULL
)
124 nis_freeresult (ent
->result
);
128 if (ent
->blacklist
.data
!= NULL
)
130 ent
->blacklist
.current
= 1;
131 ent
->blacklist
.data
[0] = '|';
132 ent
->blacklist
.data
[1] = '\0';
135 ent
->blacklist
.current
= 0;
137 if (ent
->stream
== NULL
)
139 ent
->stream
= fopen ("/etc/group", "r");
141 if (ent
->stream
== NULL
)
142 status
= errno
== EAGAIN
? NSS_STATUS_TRYAGAIN
: NSS_STATUS_UNAVAIL
;
145 /* We have to make sure the file is `closed on exec'. */
148 result
= flags
= fcntl (fileno (ent
->stream
), F_GETFD
, 0);
152 result
= fcntl (fileno (ent
->stream
), F_SETFD
, flags
);
156 /* Something went wrong. Close the stream and return a
158 fclose (ent
->stream
);
160 status
= NSS_STATUS_UNAVAIL
;
165 rewind (ent
->stream
);
172 _nss_compat_setgrent (void)
174 enum nss_status result
;
176 __libc_lock_lock (lock
);
178 result
= internal_setgrent (&ext_ent
);
180 __libc_lock_unlock (lock
);
186 static enum nss_status
187 internal_endgrent (ent_t
*ent
)
189 if (ent
->stream
!= NULL
)
191 fclose (ent
->stream
);
195 ent
->nis
= ent
->nis_first
= 0;
197 if (ent
->oldkey
!= NULL
)
204 if (ent
->result
!= NULL
)
206 nis_freeresult (ent
->result
);
210 if (ent
->blacklist
.data
!= NULL
)
212 ent
->blacklist
.current
= 1;
213 ent
->blacklist
.data
[0] = '|';
214 ent
->blacklist
.data
[1] = '\0';
217 ent
->blacklist
.current
= 0;
219 return NSS_STATUS_SUCCESS
;
223 _nss_compat_endgrent (void)
225 enum nss_status result
;
227 __libc_lock_lock (lock
);
229 result
= internal_endgrent (&ext_ent
);
231 __libc_lock_unlock (lock
);
236 static enum nss_status
237 getgrent_next_nis (struct group
*result
, ent_t
*ent
, char *buffer
,
238 size_t buflen
, int *errnop
)
240 struct parser_data
*data
= (void *) buffer
;
242 char *outkey
, *outval
;
243 int outkeylen
, outvallen
, parse_res
;
246 if (yp_get_default_domain (&domain
) != YPERR_SUCCESS
)
250 return NSS_STATUS_NOTFOUND
;
257 bool_t save_nis_first
;
261 if (yp_first (domain
, "group.byname", &outkey
, &outkeylen
,
262 &outval
, &outvallen
) != YPERR_SUCCESS
)
265 return NSS_STATUS_UNAVAIL
;
268 if ( buflen
< ((size_t) outvallen
+ 1))
272 return NSS_STATUS_TRYAGAIN
;
275 save_oldkey
= ent
->oldkey
;
276 save_oldlen
= ent
->oldkeylen
;
277 save_nis_first
= TRUE
;
278 ent
->oldkey
= outkey
;
279 ent
->oldkeylen
= outkeylen
;
280 ent
->nis_first
= FALSE
;
284 if (yp_next (domain
, "group.byname", ent
->oldkey
, ent
->oldkeylen
,
285 &outkey
, &outkeylen
, &outval
, &outvallen
)
290 return NSS_STATUS_NOTFOUND
;
293 if ( buflen
< ((size_t) outvallen
+ 1))
297 return NSS_STATUS_TRYAGAIN
;
300 save_oldkey
= ent
->oldkey
;
301 save_oldlen
= ent
->oldkeylen
;
302 save_nis_first
= FALSE
;
303 ent
->oldkey
= outkey
;
304 ent
->oldkeylen
= outkeylen
;
307 /* Copy the found data to our buffer... */
308 p
= strncpy (buffer
, outval
, buflen
);
310 /* ...and free the data. */
316 parse_res
= _nss_files_parse_grent (p
, result
, data
, buflen
, errnop
);
320 ent
->oldkey
= save_oldkey
;
321 ent
->oldkeylen
= save_oldlen
;
322 ent
->nis_first
= save_nis_first
;
324 return NSS_STATUS_TRYAGAIN
;
333 in_blacklist (result
->gr_name
, strlen (result
->gr_name
), ent
))
334 parse_res
= 0; /* if result->gr_name in blacklist,search next entry */
338 return NSS_STATUS_SUCCESS
;
341 static enum nss_status
342 getgrent_next_nisplus (struct group
*result
, ent_t
*ent
, char *buffer
,
343 size_t buflen
, int *errnop
)
349 nis_result
*save_oldres
;
350 bool_t save_nis_first
;
354 save_oldres
= ent
->result
;
355 save_nis_first
= TRUE
;
356 ent
->result
= nis_first_entry(grptable
);
357 if (niserr2nss (ent
->result
->status
) != NSS_STATUS_SUCCESS
)
360 return niserr2nss (ent
->result
->status
);
362 ent
->nis_first
= FALSE
;
368 save_oldres
= ent
->result
;
369 save_nis_first
= FALSE
;
370 res
= nis_next_entry(grptable
, &ent
->result
->cookie
);
372 if (niserr2nss (ent
->result
->status
) != NSS_STATUS_SUCCESS
)
375 return niserr2nss (ent
->result
->status
);
378 parse_res
= _nss_nisplus_parse_grent (ent
->result
, 0, result
,
379 buffer
, buflen
, errnop
);
382 nis_freeresult (ent
->result
);
383 ent
->result
= save_oldres
;
384 ent
->nis_first
= save_nis_first
;
386 return NSS_STATUS_TRYAGAIN
;
391 nis_freeresult (save_oldres
);
395 in_blacklist (result
->gr_name
, strlen (result
->gr_name
), ent
))
396 parse_res
= 0; /* if result->gr_name in blacklist,search next entry */
400 return NSS_STATUS_SUCCESS
;
403 /* This function handle the +group entrys in /etc/group */
404 static enum nss_status
405 getgrnam_plusgroup (const char *name
, struct group
*result
, char *buffer
,
406 size_t buflen
, int *errnop
)
408 struct parser_data
*data
= (void *) buffer
;
411 if (use_nisplus
) /* Do the NIS+ query here */
414 char buf
[strlen (name
) + 24 + grptablelen
];
416 sprintf(buf
, "[name=%s],%s", name
, grptable
);
417 res
= nis_list(buf
, FOLLOW_PATH
| FOLLOW_LINKS
, NULL
, NULL
);
418 if (niserr2nss (res
->status
) != NSS_STATUS_SUCCESS
)
420 enum nss_status status
= niserr2nss (res
->status
);
422 nis_freeresult (res
);
425 parse_res
= _nss_nisplus_parse_grent (res
, 0, result
, buffer
, buflen
,
429 nis_freeresult (res
);
431 return NSS_STATUS_TRYAGAIN
;
433 nis_freeresult (res
);
437 char *domain
, *outval
, *p
;
440 if (yp_get_default_domain (&domain
) != YPERR_SUCCESS
)
441 return NSS_STATUS_NOTFOUND
;
443 if (yp_match (domain
, "group.byname", name
, strlen (name
),
444 &outval
, &outvallen
) != YPERR_SUCCESS
)
447 return NSS_STATUS_NOTFOUND
;
450 if (buflen
< ((size_t) outvallen
+ 1))
454 return NSS_STATUS_TRYAGAIN
;
457 /* Copy the found data to our buffer... */
458 p
= strncpy (buffer
, outval
, buflen
);
460 /* ... and free the data. */
464 parse_res
= _nss_files_parse_grent (p
, result
, data
, buflen
, errnop
);
466 return NSS_STATUS_TRYAGAIN
;
470 /* We found the entry. */
471 return NSS_STATUS_SUCCESS
;
473 return NSS_STATUS_RETURN
;
476 static enum nss_status
477 getgrent_next_file (struct group
*result
, ent_t
*ent
,
478 char *buffer
, size_t buflen
, int *errnop
)
480 struct parser_data
*data
= (void *) buffer
;
489 fgetpos (ent
->stream
, &pos
);
490 buffer
[buflen
- 1] = '\xff';
491 p
= fgets (buffer
, buflen
, ent
->stream
);
492 if (p
== NULL
&& feof (ent
->stream
))
495 return NSS_STATUS_NOTFOUND
;
497 if (p
== NULL
|| buffer
[buflen
- 1] != '\xff')
499 fsetpos (ent
->stream
, &pos
);
501 return NSS_STATUS_TRYAGAIN
;
504 /* Terminate the line for any case. */
505 buffer
[buflen
- 1] = '\0';
507 /* Skip leading blanks. */
511 while (*p
== '\0' || *p
== '#' || /* Ignore empty and comment lines. */
512 /* Parse the line. If it is invalid, loop to
513 get the next line of the file to parse. */
514 !(parse_res
= _nss_files_parse_grent (p
, result
, data
, buflen
,
519 /* The parser ran out of space. */
520 fsetpos (ent
->stream
, &pos
);
522 return NSS_STATUS_TRYAGAIN
;
525 if (result
->gr_name
[0] != '+' && result
->gr_name
[0] != '-')
526 /* This is a real entry. */
530 if (result
->gr_name
[0] == '-' && result
->gr_name
[1] != '\0'
531 && result
->gr_name
[1] != '@')
533 blacklist_store_name (&result
->gr_name
[1], ent
);
538 if (result
->gr_name
[0] == '+' && result
->gr_name
[1] != '\0'
539 && result
->gr_name
[1] != '@')
541 enum nss_status status
;
543 /* Store the group in the blacklist for the "+" at the end of
545 blacklist_store_name (&result
->gr_name
[1], ent
);
546 status
= getgrnam_plusgroup (&result
->gr_name
[1], result
, buffer
,
548 if (status
== NSS_STATUS_SUCCESS
) /* We found the entry. */
551 if (status
== NSS_STATUS_RETURN
/* We couldn't parse the entry */
552 || status
== NSS_STATUS_NOTFOUND
) /* No group in NIS */
556 if (status
== NSS_STATUS_TRYAGAIN
)
558 /* The parser ran out of space. */
559 fsetpos (ent
->stream
, &pos
);
567 if (result
->gr_name
[0] == '+' && result
->gr_name
[1] == '\0')
570 ent
->nis_first
= TRUE
;
573 return getgrent_next_nisplus (result
, ent
, buffer
, buflen
, errnop
);
575 return getgrent_next_nis (result
, ent
, buffer
, buflen
, errnop
);
579 return NSS_STATUS_SUCCESS
;
583 static enum nss_status
584 internal_getgrent_r (struct group
*gr
, ent_t
*ent
, char *buffer
,
585 size_t buflen
, int *errnop
)
590 return getgrent_next_nisplus (gr
, ent
, buffer
, buflen
, errnop
);
592 return getgrent_next_nis (gr
, ent
, buffer
, buflen
, errnop
);
595 return getgrent_next_file (gr
, ent
, buffer
, buflen
, errnop
);
599 _nss_compat_getgrent_r (struct group
*grp
, char *buffer
, size_t buflen
,
602 enum nss_status status
= NSS_STATUS_SUCCESS
;
604 __libc_lock_lock (lock
);
606 /* Be prepared that the setgrent function was not called before. */
607 if (ext_ent
.stream
== NULL
)
608 status
= internal_setgrent (&ext_ent
);
610 if (status
== NSS_STATUS_SUCCESS
)
611 status
= internal_getgrent_r (grp
, &ext_ent
, buffer
, buflen
, errnop
);
613 __libc_lock_unlock (lock
);
618 /* Searches in /etc/group and the NIS/NIS+ map for a special group */
619 static enum nss_status
620 internal_getgrnam_r (const char *name
, struct group
*result
, ent_t
*ent
,
621 char *buffer
, size_t buflen
, int *errnop
)
623 struct parser_data
*data
= (void *) buffer
;
632 fgetpos (ent
->stream
, &pos
);
633 buffer
[buflen
- 1] = '\xff';
634 p
= fgets (buffer
, buflen
, ent
->stream
);
635 if (p
== NULL
&& feof (ent
->stream
))
638 return NSS_STATUS_NOTFOUND
;
640 if (p
== NULL
|| buffer
[buflen
- 1] != '\xff')
642 fsetpos (ent
->stream
, &pos
);
644 return NSS_STATUS_TRYAGAIN
;
647 /* Terminate the line for any case. */
648 buffer
[buflen
- 1] = '\0';
650 /* Skip leading blanks. */
654 while (*p
== '\0' || *p
== '#' || /* Ignore empty and comment lines. */
655 /* Parse the line. If it is invalid, loop to
656 get the next line of the file to parse. */
657 !(parse_res
= _nss_files_parse_grent (p
, result
, data
, buflen
,
662 /* The parser ran out of space. */
663 fsetpos (ent
->stream
, &pos
);
665 return NSS_STATUS_TRYAGAIN
;
668 /* This is a real entry. */
669 if (result
->gr_name
[0] != '+' && result
->gr_name
[0] != '-')
671 if (strcmp (result
->gr_name
, name
) == 0)
672 return NSS_STATUS_SUCCESS
;
678 if (result
->gr_name
[0] == '-' && result
->gr_name
[1] != '\0')
680 if (strcmp (&result
->gr_name
[1], name
) == 0)
683 return NSS_STATUS_NOTFOUND
;
690 if (result
->gr_name
[0] == '+' && result
->gr_name
[1] != '\0')
692 if (strcmp (name
, &result
->gr_name
[1]) == 0)
694 enum nss_status status
;
696 status
= getgrnam_plusgroup (name
, result
, buffer
, buflen
,
698 if (status
== NSS_STATUS_RETURN
)
699 /* We couldn't parse the entry */
706 if (result
->gr_name
[0] == '+' && result
->gr_name
[1] == '\0')
708 enum nss_status status
;
710 status
= getgrnam_plusgroup (name
, result
, buffer
, buflen
, errnop
);
711 if (status
== NSS_STATUS_RETURN
)
712 /* We couldn't parse the entry */
719 return NSS_STATUS_SUCCESS
;
723 _nss_compat_getgrnam_r (const char *name
, struct group
*grp
,
724 char *buffer
, size_t buflen
, int *errnop
)
726 ent_t ent
= {0, 0, NULL
, 0, NULL
, NULL
, {NULL
, 0, 0}};
727 enum nss_status status
;
729 if (name
[0] == '-' || name
[0] == '+')
730 return NSS_STATUS_NOTFOUND
;
732 __libc_lock_lock (lock
);
734 status
= internal_setgrent (&ent
);
736 __libc_lock_unlock (lock
);
738 if (status
!= NSS_STATUS_SUCCESS
)
741 status
= internal_getgrnam_r (name
, grp
, &ent
, buffer
, buflen
, errnop
);
743 internal_endgrent (&ent
);
748 /* This function handle the + entry in /etc/group */
749 static enum nss_status
750 getgrgid_plusgroup (gid_t gid
, struct group
*result
, char *buffer
,
751 size_t buflen
, int *errnop
)
753 struct parser_data
*data
= (void *) buffer
;
756 if (use_nisplus
) /* Do the NIS+ query here */
759 char buf
[24 + grptablelen
];
761 sprintf(buf
, "[gid=%d],%s", gid
, grptable
);
762 res
= nis_list(buf
, FOLLOW_PATH
| FOLLOW_LINKS
, NULL
, NULL
);
763 if (niserr2nss (res
->status
) != NSS_STATUS_SUCCESS
)
765 enum nss_status status
= niserr2nss (res
->status
);
767 nis_freeresult (res
);
770 if ((parse_res
= _nss_nisplus_parse_grent (res
, 0, result
, buffer
,
771 buflen
, errnop
)) == -1)
773 nis_freeresult (res
);
775 return NSS_STATUS_TRYAGAIN
;
777 nis_freeresult (res
);
782 char *domain
, *outval
, *p
;
785 if (yp_get_default_domain (&domain
) != YPERR_SUCCESS
)
788 return NSS_STATUS_TRYAGAIN
;
791 snprintf (buf
, sizeof (buf
), "%d", gid
);
793 if (yp_match (domain
, "group.bygid", buf
, strlen (buf
),
794 &outval
, &outvallen
) != YPERR_SUCCESS
)
797 return NSS_STATUS_TRYAGAIN
;
800 if (buflen
< ((size_t) outvallen
+ 1))
804 return NSS_STATUS_TRYAGAIN
;
807 /* Copy the found data to our buffer... */
808 p
= strncpy (buffer
, outval
, buflen
);
810 /* ... and free the data. */
815 parse_res
= _nss_files_parse_grent (p
, result
, data
, buflen
, errnop
);
817 return NSS_STATUS_TRYAGAIN
;
821 /* We found the entry. */
822 return NSS_STATUS_SUCCESS
;
824 return NSS_STATUS_RETURN
;
827 /* Searches in /etc/group and the NIS/NIS+ map for a special group id */
828 static enum nss_status
829 internal_getgrgid_r (gid_t gid
, struct group
*result
, ent_t
*ent
,
830 char *buffer
, size_t buflen
, int *errnop
)
832 struct parser_data
*data
= (void *) buffer
;
841 fgetpos (ent
->stream
, &pos
);
842 buffer
[buflen
- 1] = '\xff';
843 p
= fgets (buffer
, buflen
, ent
->stream
);
844 if (p
== NULL
&& feof (ent
->stream
))
847 return NSS_STATUS_NOTFOUND
;
849 if (p
== NULL
|| buffer
[buflen
- 1] != '\xff')
851 fsetpos (ent
->stream
, &pos
);
853 return NSS_STATUS_TRYAGAIN
;
856 /* Terminate the line for any case. */
857 buffer
[buflen
- 1] = '\0';
859 /* Skip leading blanks. */
863 while (*p
== '\0' || *p
== '#' || /* Ignore empty and comment lines. */
864 /* Parse the line. If it is invalid, loop to
865 get the next line of the file to parse. */
866 !(parse_res
= _nss_files_parse_grent (p
, result
, data
, buflen
,
871 /* The parser ran out of space. */
872 fsetpos (ent
->stream
, &pos
);
874 return NSS_STATUS_TRYAGAIN
;
877 /* This is a real entry. */
878 if (result
->gr_name
[0] != '+' && result
->gr_name
[0] != '-')
880 if (result
->gr_gid
== gid
)
881 return NSS_STATUS_SUCCESS
;
887 if (result
->gr_name
[0] == '-' && result
->gr_name
[1] != '\0')
889 blacklist_store_name (&result
->gr_name
[1], ent
);
894 if (result
->gr_name
[0] == '+' && result
->gr_name
[1] != '\0')
896 enum nss_status status
;
898 /* Store the group in the blacklist for the "+" at the end of
900 blacklist_store_name (&result
->gr_name
[1], ent
);
901 status
= getgrnam_plusgroup (&result
->gr_name
[1], result
, buffer
,
903 if (status
== NSS_STATUS_SUCCESS
&& result
->gr_gid
== gid
)
909 if (result
->gr_name
[0] == '+' && result
->gr_name
[1] == '\0')
911 enum nss_status status
;
913 status
= getgrgid_plusgroup (gid
, result
, buffer
, buflen
, errnop
);
914 if (status
== NSS_STATUS_RETURN
) /* We couldn't parse the entry */
915 return NSS_STATUS_NOTFOUND
;
921 return NSS_STATUS_SUCCESS
;
925 _nss_compat_getgrgid_r (gid_t gid
, struct group
*grp
,
926 char *buffer
, size_t buflen
, int *errnop
)
928 ent_t ent
= {0, 0, NULL
, 0, NULL
, NULL
, {NULL
, 0, 0}};
929 enum nss_status status
;
931 __libc_lock_lock (lock
);
933 status
= internal_setgrent (&ent
);
935 __libc_lock_unlock (lock
);
937 if (status
!= NSS_STATUS_SUCCESS
)
940 status
= internal_getgrgid_r (gid
, grp
, &ent
, buffer
, buflen
, errnop
);
942 internal_endgrent (&ent
);
948 /* Support routines for remembering -@netgroup and -user entries.
949 The names are stored in a single string with `|' as separator. */
951 blacklist_store_name (const char *name
, ent_t
*ent
)
953 int namelen
= strlen (name
);
956 /* first call, setup cache */
957 if (ent
->blacklist
.size
== 0)
959 ent
->blacklist
.size
= MAX (BLACKLIST_INITIAL_SIZE
, 2 * namelen
);
960 ent
->blacklist
.data
= malloc (ent
->blacklist
.size
);
961 if (ent
->blacklist
.data
== NULL
)
963 ent
->blacklist
.data
[0] = '|';
964 ent
->blacklist
.data
[1] = '\0';
965 ent
->blacklist
.current
= 1;
969 if (in_blacklist (name
, namelen
, ent
))
970 return; /* no duplicates */
972 if (ent
->blacklist
.current
+ namelen
+ 1 >= ent
->blacklist
.size
)
974 ent
->blacklist
.size
+= MAX (BLACKLIST_INCREMENT
, 2 * namelen
);
975 tmp
= realloc (ent
->blacklist
.data
, ent
->blacklist
.size
);
978 free (ent
->blacklist
.data
);
979 ent
->blacklist
.size
= 0;
982 ent
->blacklist
.data
= tmp
;
986 tmp
= stpcpy (ent
->blacklist
.data
+ ent
->blacklist
.current
, name
);
989 ent
->blacklist
.current
+= namelen
+ 1;
994 /* returns TRUE if ent->blacklist contains name, else FALSE */
996 in_blacklist (const char *name
, int namelen
, ent_t
*ent
)
998 char buf
[namelen
+ 3];
1001 if (ent
->blacklist
.data
== NULL
)
1005 cp
= stpcpy (&buf
[1], name
);
1008 return strstr (ent
->blacklist
.data
, buf
) != NULL
;