diff --git a/config.h.in b/config.h.in index 61b48b8c1..d75a99545 100644 --- a/config.h.in +++ b/config.h.in @@ -506,9 +506,6 @@ /* Define to 1 if you have the `setauthdb' function. */ #undef HAVE_SETAUTHDB -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV - /* Define to 1 if you have the `seteuid' function. */ #undef HAVE_SETEUID diff --git a/configure b/configure index c42d0daff..e97a0e32c 100755 --- a/configure +++ b/configure @@ -17154,7 +17154,7 @@ $as_echo "#define HAVE_GETGROUPS 1" >>confdefs.h fi LIBS=$ac_save_LIBS -for ac_func in glob nl_langinfo regcomp setenv strftime strrchr strtoll \ +for ac_func in glob nl_langinfo regcomp strftime strrchr strtoll \ sysconf tzset do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -18903,6 +18903,7 @@ fi ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" if test "x$ac_cv_func_inet_pton" = xyes; then : + $as_echo "#define HAVE_INET_PTON 1" >>confdefs.h else diff --git a/configure.ac b/configure.ac index 003d6770e..8b6380ada 100644 --- a/configure.ac +++ b/configure.ac @@ -2311,7 +2311,7 @@ dnl dnl Function checks dnl AC_FUNC_GETGROUPS -AC_CHECK_FUNCS(glob nl_langinfo regcomp setenv strftime strrchr strtoll \ +AC_CHECK_FUNCS(glob nl_langinfo regcomp strftime strrchr strtoll \ sysconf tzset) AC_CHECK_FUNCS(getgrouplist, [], [ case "$host_os" in @@ -2578,7 +2578,7 @@ dnl If inet_pton(3) not in libc, check -lnsl and -linet dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols dnl Some systems may have inet_pton() in libresolv. dnl -AC_CHECK_FUNC(inet_pton, [], [ +AC_CHECK_FUNC(inet_pton, [AC_DEFINE(HAVE_INET_PTON)], [ for libs in "-lsocket" "-linet" "-lsocket -lnsl" "-lresolv"; do _libs= for lib in $libs; do diff --git a/include/compat/fnmatch.h b/include/compat/fnmatch.h index 8cdaeed97..a6fb6024c 100644 --- a/include/compat/fnmatch.h +++ b/include/compat/fnmatch.h @@ -25,8 +25,8 @@ #define FNM_LEADING_DIR (1 << 3) /* Only match the leading directory */ #define FNM_CASEFOLD (1 << 4) /* Case insensitive matching */ -int rpl_fnmatch(const char *pattern, const char *string, int flags); +int sudo_fnmatch(const char *pattern, const char *string, int flags); -#define fnmatch(_a, _b, _c) rpl_fnmatch((_a), (_b), (_c)) +#define fnmatch(_a, _b, _c) sudo_fnmatch((_a), (_b), (_c)) #endif /* _FNMATCH_H */ diff --git a/include/compat/getaddrinfo.h b/include/compat/getaddrinfo.h index a8a4b6934..52031480d 100644 --- a/include/compat/getaddrinfo.h +++ b/include/compat/getaddrinfo.h @@ -66,10 +66,18 @@ struct addrinfo { #define EAI_OVERFLOW 10 /* An argument buffer overflowed */ /* Function prototypes. */ -int getaddrinfo(const char *nodename, const char *servname, +int sudo_getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); -void freeaddrinfo(struct addrinfo *ai); -const char *gai_strerror(int ecode); +void sudo_freeaddrinfo(struct addrinfo *ai); +const char *sudo_gai_strerror(int ecode); + +/* Map sudo_* to RFC 3493 names. */ +#undef getaddrinfo +#define getaddrinfo(_a, _b, _c, _d) sudo_getaddrinfo((_a), (_b), (_c), (_d)) +#undef freeaddrinfo +#define freeaddrinfo(_a) sudo_freeaddrinfo((_a)) +#undef gai_strerror +#define gai_strerror(_a) sudo_gai_strerror((_a)) #endif /* !HAVE_GETADDRINFO */ #endif /* _COMPAT_GETADDRINFO_H */ diff --git a/include/compat/getopt.h b/include/compat/getopt.h index 5d6ca8331..20972b9ee 100644 --- a/include/compat/getopt.h +++ b/include/compat/getopt.h @@ -55,12 +55,21 @@ struct option { int val; }; -int getopt_long(int, char * const *, const char *, - const struct option *, int *); -int getopt_long_only(int, char * const *, const char *, - const struct option *, int *); +int sudo_getopt_long(int, char * const *, const char *, + const struct option *, int *); +#undef getopt_long +#define getopt_long(_a, _b, _c, _d, _e) \ + sudo_getopt_long((_a), (_b), (_c), (_d), (_e)) + +int sudo_getopt_long_only(int, char * const *, const char *, + const struct option *, int *); +#undef getopt_long_only +#define getopt_long_only(_a, _b, _c, _d, _e) \ + sudo_getopt_long_only((_a), (_b), (_c), (_d), (_e)) #if 0 -int getopt(int, char * const [], const char *); +int sudo_getopt(int, char * const [], const char *); +#undef getopt +#define getopt(_a, _b, _c) sudo_getopt((_a), (_b), (_c)) #endif extern char *optarg; /* getopt(3) external variables */ diff --git a/include/compat/glob.h b/include/compat/glob.h index 7e7153b30..97e48c053 100644 --- a/include/compat/glob.h +++ b/include/compat/glob.h @@ -69,10 +69,10 @@ typedef struct { #define GLOB_NOSYS (-4) /* Function not supported. */ #define GLOB_ABEND GLOB_ABORTED -int rpl_glob(const char *, int, int (*)(const char *, int), glob_t *); -void rpl_globfree(glob_t *); +int sudo_glob(const char *, int, int (*)(const char *, int), glob_t *); +void sudo_globfree(glob_t *); -#define glob(_a, _b, _c, _d) rpl_glob((_a), (_b), (_c), (_d)) -#define globfree(_a) rpl_globfree((_a)) +#define glob(_a, _b, _c, _d) sudo_glob((_a), (_b), (_c), (_d)) +#define globfree(_a) sudo_globfree((_a)) #endif /* !_GLOB_H_ */ diff --git a/include/missing.h b/include/missing.h index 53f2fa28a..99db7f9ba 100644 --- a/include/missing.h +++ b/include/missing.h @@ -363,96 +363,127 @@ int innetgr(const char *, const char *, const char *, const char *); int getdomainname(char *, size_t); #endif -/* Functions "missing" from libc. */ +/* + * Functions "missing" from libc. + * All libc replacements are prefixed with "sudo_" to avoid namespace issues. + */ struct timeval; struct timespec; #ifndef HAVE_CLOSEFROM -void closefrom(int); -#endif +void sudo_closefrom(int); +# undef closefrom +# define closefrom(_a) sudo_closefrom((_a)) +#endif /* HAVE_CLOSEFROM */ #ifndef HAVE_GETCWD -char *getcwd(char *, size_t size); -#endif +char *sudo_getcwd(char *, size_t size); +# undef getcwd +# define getcwd(_a, _b) sudo_getcwd((_a), (_b)) +#endif /* HAVE_GETCWD */ #ifndef HAVE_GETGROUPLIST -int getgrouplist(const char *, gid_t, gid_t *, int *); -#endif +int sudo_getgrouplist(const char *, gid_t, gid_t *, int *); +# undef getgrouplist +# define getgrouplist(_a, _b, _c, _d) sudo_getgrouplist((_a), (_b), (_c), (_d)) +#endif /* GETGROUPLIST */ #ifndef HAVE_GETLINE -ssize_t getline(char **, size_t *, FILE *); -#endif +ssize_t sudo_getline(char **, size_t *, FILE *); +# undef getline +# define getline(_a, _b, _c) sudo_getline((_a), (_b), (_c)) +#endif /* HAVE_GETLINE */ #ifndef HAVE_UTIMES -int utimes(const char *, const struct timeval *); -#endif +int sudo_utimes(const char *, const struct timeval *); +# undef utimes +# define utimes(_a, _b) sudo_utimes(((_a), (_b)) +#endif /* HAVE_UTIMES */ #ifdef HAVE_FUTIME -int futimes(int, const struct timeval *); -#endif +int sudo_futimes(int, const struct timeval *); +# undef futimes +# define futimes(_a, _b) sudo_futimes(((_a), (_b)) +#endif /* HAVE_FUTIME */ #if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) -int rpl_snprintf(char *, size_t, const char *, ...) __printflike(3, 4); +int sudo_snprintf(char *, size_t, const char *, ...) __printflike(3, 4); # undef snprintf -# define snprintf rpl_snprintf -#endif +# define snprintf sudo_snprintf +#endif /* HAVE_SNPRINTF */ #if !defined(HAVE_VSNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) -int rpl_vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0); +int sudo_vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0); # undef vsnprintf -# define vsnprintf rpl_vsnprintf -#endif +# define vsnprintf sudo_vsnprintf +#endif /* HAVE_VSNPRINTF */ #if !defined(HAVE_ASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) -int rpl_asprintf(char **, const char *, ...) __printflike(2, 3); +int sudo_asprintf(char **, const char *, ...) __printflike(2, 3); # undef asprintf -# define asprintf rpl_asprintf -#endif +# define asprintf sudo_asprintf +#endif /* HAVE_ASPRINTF */ #if !defined(HAVE_VASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) -int rpl_vasprintf(char **, const char *, va_list) __printflike(2, 0); +int sudo_vasprintf(char **, const char *, va_list) __printflike(2, 0); # undef vasprintf -# define vasprintf rpl_vasprintf -#endif +# define vasprintf sudo_vasprintf +#endif /* HAVE_VASPRINTF */ #ifndef HAVE_STRLCAT -size_t strlcat(char *, const char *, size_t); -#endif +size_t sudo_strlcat(char *, const char *, size_t); +# undef strlcat +# define strlcat(_a, _b, _c) sudo_strlcat((_a), (_b), (_c)) +#endif /* HAVE_STRLCAT */ #ifndef HAVE_STRLCPY -size_t strlcpy(char *, const char *, size_t); -#endif +size_t sudo_strlcpy(char *, const char *, size_t); +# undef strlcpy +# define strlcpy(_a, _b, _c) sudo_strlcpy((_a), (_b), (_c)) +#endif /* HAVE_STRLCPY */ #ifndef HAVE_MEMRCHR -void *memrchr(const void *, int, size_t); -#endif +void *sudo_memrchr(const void *, int, size_t); +# undef memrchr +# define memrchr(_a, _b, _c) sudo_memrchr((_a), (_b), (_c)) +#endif /* HAVE_MEMRCHR */ #ifndef HAVE_MEMSET_S -errno_t memset_s(void *, rsize_t, int, rsize_t); -#endif +errno_t sudo_memset_s(void *, rsize_t, int, rsize_t); +# undef memset_s +# define memset_s(_a, _b, _c, _d) sudo_memset_s((_a), (_b), (_c), (_d)) +#endif /* HAVE_MEMSET_S */ #ifndef HAVE_MKDTEMP -char *mkdtemp(char *); -#endif +char *sudo_mkdtemp(char *); +# undef mkdtemp +# define mkdtemp(_a) sudo_mkdtemp((_a)) +#endif /* HAVE_MKDTEMP */ #ifndef HAVE_MKSTEMPS int mkstemps(char *, int); -#endif +# undef mkstemps +# define mkstemps(_a, _b) sudo_mkstemps((_a), (_b)) +#endif /* HAVE_MKSTEMPS */ #ifndef HAVE_PW_DUP -struct passwd *pw_dup(const struct passwd *); -#endif -#ifndef HAVE_SETENV -int setenv(const char *, const char *, int); -#endif -#ifndef HAVE_UNSETENV -int unsetenv(const char *); -#endif +struct passwd *sudo_pw_dup(const struct passwd *); +# undef pw_dup +# define pw_dup(_a) sudo_pw_dup((_a)) +#endif /* HAVE_PW_DUP */ #ifndef HAVE_STRSIGNAL -char *strsignal(int); -#endif +char *sudo_strsignal(int); +# undef strsignal +# define strsignal(_a) sudo_strsignal((_a)) +#endif /* HAVE_STRSIGNAL */ #ifndef HAVE_SIG2STR -int sig2str(int, char *); -#endif +int sudo_sig2str(int, char *); +# undef sig2str +# define sig2str(_a, _b) sudo_sig2str((_a), (_b)) +#endif /* HAVE_SIG2STR */ #ifndef HAVE_STRTONUM -long long rpl_strtonum(const char *, long long, long long, const char **); +long long sudo_strtonum(const char *, long long, long long, const char **); # undef strtonum -# define strtonum rpl_strtonum -#endif +# define strtonum(_a, _b, _c, _d) sudo_strtonum((_a), (_b), (_c), (_d)) +#endif /* HAVE_STRTONUM */ #ifndef HAVE_CLOCK_GETTIME # define CLOCK_REALTIME 0 # ifdef __MACH__ # define CLOCK_MONOTONIC 1 # endif -int clock_gettime(clockid_t clock_id, struct timespec *tp); -#endif +int sudo_clock_gettime(clockid_t clock_id, struct timespec *tp); +# undef clock_gettime +# define clock_gettime(_a, _b) sudo_clock_gettime((_a), (_b)) +#endif /* HAVE_CLOCK_GETTIME */ #ifndef HAVE_INET_PTON -int inet_pton(int af, const char *src, void *dst); -#endif +int sudo_inet_pton(int af, const char *src, void *dst); +# undef inet_pton +# define inet_pton(_a, _b, _c) sudo_inet_pton((_a), (_b), (_c)) +#endif /* HAVE_INET_PTON */ #endif /* _SUDO_MISSING_H */ diff --git a/lib/util/clock_gettime.c b/lib/util/clock_gettime.c index f0463a6b6..603b5aebe 100644 --- a/lib/util/clock_gettime.c +++ b/lib/util/clock_gettime.c @@ -43,7 +43,7 @@ * (and CLOCK_MONOTONIC on Mach). */ int -clock_gettime(clockid_t clock_id, struct timespec *ts) +sudo_clock_gettime(clockid_t clock_id, struct timespec *ts) { switch (clock_id) { diff --git a/lib/util/closefrom.c b/lib/util/closefrom.c index e53ae4f36..ee6685e78 100644 --- a/lib/util/closefrom.c +++ b/lib/util/closefrom.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005, 2007, 2010, 2012-2013 + * Copyright (c) 2004-2005, 2007, 2010, 2012-2014 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -57,7 +57,7 @@ #include "missing.h" #if defined(HAVE_FCNTL_CLOSEM) && !defined(HAVE_DIRFD) -# define closefrom closefrom_fallback +# define sudo_closefrom closefrom_fallback #endif /* @@ -98,14 +98,14 @@ closefrom_fallback(int lowfd) */ #if defined(HAVE_FCNTL_CLOSEM) void -closefrom(int lowfd) +sudo_closefrom(int lowfd) { if (fcntl(lowfd, F_CLOSEM, 0) == -1) closefrom_fallback(lowfd); } #elif defined(HAVE_PSTAT_GETPROC) void -closefrom(int lowfd) +sudo_closefrom(int lowfd) { struct pst_status pstat; int fd; @@ -119,7 +119,7 @@ closefrom(int lowfd) } #elif defined(HAVE_DIRFD) void -closefrom(int lowfd) +sudo_closefrom(int lowfd) { const char *path; DIR *dirp; diff --git a/lib/util/fnmatch.c b/lib/util/fnmatch.c index 7ea5dc5de..40e84c246 100644 --- a/lib/util/fnmatch.c +++ b/lib/util/fnmatch.c @@ -267,7 +267,7 @@ fnmatch_ch_success: return result; } -int rpl_fnmatch(const char *pattern, const char *string, int flags) +int sudo_fnmatch(const char *pattern, const char *string, int flags) { static const char dummystring[2] = {' ', 0}; const int escape = !(flags & FNM_NOESCAPE); diff --git a/lib/util/getaddrinfo.c b/lib/util/getaddrinfo.c index 10d2b1113..92db4cd99 100644 --- a/lib/util/getaddrinfo.c +++ b/lib/util/getaddrinfo.c @@ -159,7 +159,7 @@ static const char * const gai_errors[] = { * indicating an unknown error. */ const char * -gai_strerror(int ecode) +sudo_gai_strerror(int ecode) { if (ecode < 1 || (size_t) ecode > ARRAY_SIZE(gai_errors)) return "Unknown error"; @@ -172,7 +172,7 @@ gai_strerror(int ecode) * Free a linked list of addrinfo structs. */ void -freeaddrinfo(struct addrinfo *ai) +sudo_freeaddrinfo(struct addrinfo *ai) { struct addrinfo *next; @@ -360,7 +360,7 @@ gai_lookup(const char *nodename, int flags, int socktype, unsigned short port, * The actual getaddrinfo implementation. */ int -getaddrinfo(const char *nodename, const char *servname, +sudo_getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res) { struct addrinfo *ai; diff --git a/lib/util/getcwd.c b/lib/util/getcwd.c index c5765be21..3fd008fbd 100644 --- a/lib/util/getcwd.c +++ b/lib/util/getcwd.c @@ -80,7 +80,7 @@ (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) char * -getcwd(char *pt, size_t size) +sudo_getcwd(char *pt, size_t size) { struct dirent *dp; DIR *dir = NULL; diff --git a/lib/util/getgrouplist.c b/lib/util/getgrouplist.c index a8085c100..8685feffd 100644 --- a/lib/util/getgrouplist.c +++ b/lib/util/getgrouplist.c @@ -54,7 +54,7 @@ * BSD-compatible getgrouplist(3) using AIX getgrset(3) */ int -getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp) +sudo_getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp) { char *cp, *grset = NULL; int ngroups = 1; @@ -276,7 +276,7 @@ done: * BSD-compatible getgrouplist(3) using nss_search(3) */ int -getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp) +sudo_getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp) { struct nss_groupsbymem gbm; static DEFINE_NSS_DB_ROOT(db_root); @@ -315,7 +315,7 @@ getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp) * BSD-compatible getgrouplist(3) using getgrent(3) */ int -getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp) +sudo_getgrouplist(const char *name, gid_t basegid, gid_t *groups, int *ngroupsp) { int i, ngroups = 1; int grpsize = *ngroupsp; diff --git a/lib/util/getline.c b/lib/util/getline.c index 5d869d9f8..0a93f5631 100644 --- a/lib/util/getline.c +++ b/lib/util/getline.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010, 2012-2013 Todd C. Miller + * Copyright (c) 2009-2010, 2012-2014 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -45,7 +45,7 @@ #ifdef HAVE_FGETLN ssize_t -getline(char **bufp, size_t *bufsizep, FILE *fp) +sudo_getline(char **bufp, size_t *bufsizep, FILE *fp) { char *buf, *cp; size_t bufsize; @@ -69,7 +69,7 @@ getline(char **bufp, size_t *bufsizep, FILE *fp) } #else ssize_t -getline(char **bufp, size_t *bufsizep, FILE *fp) +sudo_getline(char **bufp, size_t *bufsizep, FILE *fp) { char *buf, *cp; size_t bufsize; diff --git a/lib/util/getopt_long.c b/lib/util/getopt_long.c index 8357a66fb..bdc8f9d58 100644 --- a/lib/util/getopt_long.c +++ b/lib/util/getopt_long.c @@ -588,7 +588,7 @@ start: * Parse argc/argv argument vector. */ int -getopt(int nargc, char * const *nargv, const char *options) +sudo_getopt(int nargc, char * const *nargv, const char *options) { /* @@ -608,7 +608,7 @@ getopt(int nargc, char * const *nargv, const char *options) * Parse argc/argv argument vector. */ int -getopt_long(int nargc, char * const *nargv, const char *options, +sudo_getopt_long(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx) { @@ -621,7 +621,7 @@ getopt_long(int nargc, char * const *nargv, const char *options, * Parse argc/argv argument vector. */ int -getopt_long_only(int nargc, char * const *nargv, const char *options, +sudo_getopt_long_only(int nargc, char * const *nargv, const char *options, const struct option *long_options, int *idx) { diff --git a/lib/util/glob.c b/lib/util/glob.c index c24f77a97..cc5fee14d 100644 --- a/lib/util/glob.c +++ b/lib/util/glob.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2010 Todd C. Miller + * Copyright (c) 2008-2014 Todd C. Miller * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * @@ -176,7 +176,7 @@ static void qprintf(const char *, Char *); #endif int -rpl_glob(const char *pattern, int flags, int (*errfunc)(const char *, int), +sudo_glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) { const unsigned char *patnext; @@ -812,7 +812,7 @@ match(Char *name, Char *pat, Char *patend) /* Free allocated data belonging to a glob_t structure. */ void -rpl_globfree(glob_t *pglob) +sudo_globfree(glob_t *pglob) { int i; char **pp; diff --git a/lib/util/inet_pton.c b/lib/util/inet_pton.c index a4e0fafd9..1c89b5fd1 100644 --- a/lib/util/inet_pton.c +++ b/lib/util/inet_pton.c @@ -239,7 +239,7 @@ inet_pton6(const char *src, u_char *dst) * Paul Vixie, 1996. */ int -inet_pton(int af, const char *src, void *dst) +sudo_inet_pton(int af, const char *src, void *dst) { switch (af) { case AF_INET: diff --git a/lib/util/memrchr.c b/lib/util/memrchr.c index 34d82712c..6c357e3fc 100644 --- a/lib/util/memrchr.c +++ b/lib/util/memrchr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2010-2011, 2013 + * Copyright (c) 2007, 2010-2014 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -28,7 +28,7 @@ * Find the last occurrence of 'c' in the buffer 's' of size 'n'. */ void * -memrchr(const void *s, int c, size_t n) +sudo_memrchr(const void *s, int c, size_t n) { const unsigned char *cp; diff --git a/lib/util/memset_s.c b/lib/util/memset_s.c index 59070d585..aeff77bca 100644 --- a/lib/util/memset_s.c +++ b/lib/util/memset_s.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Todd C. Miller + * Copyright (c) 2013-2014 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -48,7 +48,7 @@ * that it be non-zero. We use EINVAL for all errors. */ errno_t -memset_s(void *v, rsize_t smax, int c, rsize_t n) +sudo_memset_s(void *v, rsize_t smax, int c, rsize_t n) { errno_t ret = 0; volatile unsigned char *s = v; diff --git a/lib/util/mktemp.c b/lib/util/mktemp.c index 8e31c10fd..f1fad0b7d 100644 --- a/lib/util/mktemp.c +++ b/lib/util/mktemp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2003, 2004, 2008-2011, 2013 + * Copyright (c) 2001, 2003, 2004, 2008-2011, 2013, 2014 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -144,7 +144,7 @@ mktemp_internal(char *path, int slen, int mode) #ifndef HAVE_MKSTEMPS int -mkstemps(char *path, int slen) +sudo_mkstemps(char *path, int slen) { return mktemp_internal(path, slen, MKTEMP_FILE); } @@ -152,7 +152,7 @@ mkstemps(char *path, int slen) #ifndef HAVE_MKDTEMP char * -mkdtemp(char *path) +sudo_mkdtemp(char *path) { if (mktemp_internal(path, 0, MKTEMP_DIR) == -1) return NULL; diff --git a/lib/util/pw_dup.c b/lib/util/pw_dup.c index 357121ab8..56a5aa041 100644 --- a/lib/util/pw_dup.c +++ b/lib/util/pw_dup.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2002, 2012-2013 + * Copyright (c) 2000, 2002, 2012-2014 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -63,7 +63,7 @@ do { \ } while (0) struct passwd * -pw_dup(const struct passwd *pw) +sudo_pw_dup(const struct passwd *pw) { size_t nsize = 0, psize = 0, gsize = 0, dsize = 0, ssize = 0, total; #ifdef HAVE_LOGIN_CAP_H diff --git a/lib/util/sig2str.c b/lib/util/sig2str.c index d698df1e1..26a461a95 100644 --- a/lib/util/sig2str.c +++ b/lib/util/sig2str.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2013 Todd C. Miller + * Copyright (c) 2012-2014 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -61,7 +61,7 @@ extern const char *const sudo_sys_signame[NSIG]; * Translate signal number to name. */ int -sig2str(int signo, char *signame) +sudo_sig2str(int signo, char *signame) { #if defined(SIGRTMIN) && defined(SIGRTMAX) /* Realtime signal support as per Solaris. */ diff --git a/lib/util/snprintf.c b/lib/util/snprintf.c index 84ec33c1e..f6fbf99dd 100644 --- a/lib/util/snprintf.c +++ b/lib/util/snprintf.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2005, 2008, 2010-2013 + * Copyright (c) 1999-2005, 2008, 2010-2014 * Todd C. Miller * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -616,7 +616,7 @@ done: #if !defined(HAVE_VSNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) int -rpl_vsnprintf(char *str, size_t n, const char *fmt, va_list ap) +sudo_vsnprintf(char *str, size_t n, const char *fmt, va_list ap) { return xxxprintf(&str, n, 0, fmt, ap); @@ -625,7 +625,7 @@ rpl_vsnprintf(char *str, size_t n, const char *fmt, va_list ap) #if !defined(HAVE_SNPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) int -rpl_snprintf(char *str, size_t n, char const *fmt, ...) +sudo_snprintf(char *str, size_t n, char const *fmt, ...) { int ret; va_list ap; @@ -639,7 +639,7 @@ rpl_snprintf(char *str, size_t n, char const *fmt, ...) #if !defined(HAVE_VASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) int -rpl_vasprintf(char **str, const char *fmt, va_list ap) +sudo_vasprintf(char **str, const char *fmt, va_list ap) { return xxxprintf(str, 0, 1, fmt, ap); @@ -648,7 +648,7 @@ rpl_vasprintf(char **str, const char *fmt, va_list ap) #if !defined(HAVE_ASPRINTF) || defined(PREFER_PORTABLE_SNPRINTF) int -rpl_asprintf(char **str, char const *fmt, ...) +sudo_asprintf(char **str, char const *fmt, ...) { int ret; va_list ap; diff --git a/lib/util/strlcat.c b/lib/util/strlcat.c index 535d9f2c8..d234fe798 100644 --- a/lib/util/strlcat.c +++ b/lib/util/strlcat.c @@ -1,7 +1,7 @@ /* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */ /* - * Copyright (c) 1998, 2003-2005, 2010-2011, 2013 + * Copyright (c) 1998, 2003-2005, 2010-2011, 2013, 2014 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -34,7 +34,7 @@ * If retval >= siz, truncation occurred. */ size_t -strlcat(char *dst, const char *src, size_t siz) +sudo_strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; diff --git a/lib/util/strlcpy.c b/lib/util/strlcpy.c index 765bde84e..687f45442 100644 --- a/lib/util/strlcpy.c +++ b/lib/util/strlcpy.c @@ -1,7 +1,7 @@ /* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */ /* - * Copyright (c) 1998, 2003-2005, 2010-2011, 2013 + * Copyright (c) 1998, 2003-2005, 2010-2011, 2013, 2014 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -31,7 +31,7 @@ * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t -strlcpy(char *dst, const char *src, size_t siz) +sudo_strlcpy(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; diff --git a/lib/util/strsignal.c b/lib/util/strsignal.c index b82ba0c89..8e2ad4b86 100644 --- a/lib/util/strsignal.c +++ b/lib/util/strsignal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2013 Todd C. Miller + * Copyright (c) 2009-2014 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -42,7 +42,7 @@ extern const char *const sudo_sys_siglist[NSIG]; * Get signal description string */ char * -strsignal(int signo) +sudo_strsignal(int signo) { if (signo > 0 && signo < NSIG && sudo_sys_siglist[signo] != NULL) return (char *)sudo_sys_siglist[signo]; diff --git a/lib/util/strtonum.c b/lib/util/strtonum.c index d665d6486..af4bd030e 100644 --- a/lib/util/strtonum.c +++ b/lib/util/strtonum.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Todd C. Miller + * Copyright (c) 2013-2014 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -52,7 +52,7 @@ * too small -> value too small */ long long -rpl_strtonum(const char *str, long long minval, long long maxval, +sudo_strtonum(const char *str, long long minval, long long maxval, const char **errstrp) { long long retval; @@ -86,7 +86,7 @@ enum strtonum_err { * Convert a string to a number in the range [minval, maxval] */ long long -rpl_strtonum(const char *str, long long minval, long long maxval, +sudo_strtonum(const char *str, long long minval, long long maxval, const char **errstrp) { const unsigned char *ustr = (const unsigned char *)str; diff --git a/lib/util/utimes.c b/lib/util/utimes.c index 65c192621..3bc4f9437 100644 --- a/lib/util/utimes.c +++ b/lib/util/utimes.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004-2005, 2007, 2010-2011, 2013 + * Copyright (c) 2004-2005, 2007, 2010-2011, 2013, 2014 * Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any @@ -39,7 +39,7 @@ * Emulate utimes() via utime() */ int -utimes(const char *file, const struct timeval *times) +sudo_utimes(const char *file, const struct timeval *times) { if (times != NULL) { struct utimbuf utb; @@ -57,7 +57,7 @@ utimes(const char *file, const struct timeval *times) * Emulate futimes() via futime() */ int -futimes(int fd, const struct timeval *times) +sudo_futimes(int fd, const struct timeval *times) { if (times != NULL) { struct utimbuf utb;