diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/Symbols.list | 7 | ||||
-rw-r--r-- | lib/libc/gen/getnetgrent.c | 25 |
2 files changed, 16 insertions, 16 deletions
diff --git a/lib/libc/Symbols.list b/lib/libc/Symbols.list index 6d2fb18bfc5..d5d0c8ac40d 100644 --- a/lib/libc/Symbols.list +++ b/lib/libc/Symbols.list @@ -516,13 +516,6 @@ __signbitf __signbitl _ctype_ _longjmp -_ng_makekey -_ng_parse -_ng_print -_ng_sl_add -_ng_sl_find -_ng_sl_free -_ng_sl_init _setjmp _sys_errlist _sys_nerr diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index b2256516794..749ebc9dbe4 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getnetgrent.c,v 1.24 2015/08/31 02:53:57 guenther Exp $ */ +/* $OpenBSD: getnetgrent.c,v 1.25 2015/09/10 18:59:34 deraadt Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -33,7 +33,6 @@ #include <sys/types.h> #include <stdio.h> -#define _NETGROUP_PRIVATE #include <netgroup.h> #include <string.h> #include <fcntl.h> @@ -63,6 +62,14 @@ struct stringlist { size_t sl_cur; }; +static struct stringlist *_ng_sl_init(void); +static int _ng_sl_add(struct stringlist *, char *); +static void _ng_sl_free(struct stringlist *, int); +static char *_ng_sl_find(struct stringlist *, char *); +static char *_ng_makekey(const char *, const char *, size_t); +static int _ng_parse(char **, char **, struct netgroup **); +static void _ng_print(char *, size_t, const struct netgroup *); + static int getstring(char **, int, char **); static struct netgroup *getnetgroup(char **); static int lookup(const char *, char *, char **, int); @@ -79,7 +86,7 @@ static int in_lookup(const char *, const char *, /* * _ng_sl_init(): Initialize a string list */ -struct stringlist * +static struct stringlist * _ng_sl_init(void) { struct stringlist *sl = malloc(sizeof(struct stringlist)); @@ -100,7 +107,7 @@ _ng_sl_init(void) /* * _ng_sl_add(): Add an item to the string list */ -int +static int _ng_sl_add(struct stringlist *sl, char *name) { if (sl->sl_cur == sl->sl_max - 1) { @@ -123,7 +130,7 @@ _ng_sl_add(struct stringlist *sl, char *name) /* * _ng_sl_free(): Free a stringlist */ -void +static void _ng_sl_free(struct stringlist *sl, int all) { size_t i; @@ -139,7 +146,7 @@ _ng_sl_free(struct stringlist *sl, int all) /* * sl_find(): Find a name in the string list */ -char * +static char * _ng_sl_find(struct stringlist *sl, char *name) { size_t i; @@ -312,7 +319,7 @@ lookup(const char *ypdom, char *name, char **line, int bywhat) * * Public since used by netgroup_mkdb */ -int +static int _ng_parse(char **p, char **name, struct netgroup **ng) { while (**p) { @@ -503,7 +510,7 @@ in_find(char *ypdom, struct stringlist *sl, char *grp, const char *host, * _ng_makekey(): Make a key from the two names given. The key is of the form * <name1>.<name2> Names strings are replaced with * if they are empty; */ -char * +static char * _ng_makekey(const char *s1, const char *s2, size_t len) { char *buf = malloc(len); @@ -520,7 +527,7 @@ _ng_makekey(const char *s1, const char *s2, size_t len) return buf; } -void +static void _ng_print(char *buf, size_t len, const struct netgroup *ng) { (void) snprintf(buf, len, "(%s,%s,%s)", _NG_EMPTY(ng->ng_host), |