2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Prefix all libc replacements with sudo_ and #define the real name

to the sudo_ version.  That way we don't pollute the libc namespace.
This commit is contained in:
Todd C. Miller
2014-06-26 15:51:08 -06:00
parent 4d37a4a162
commit 87c2fe5a31
29 changed files with 173 additions and 127 deletions

View File

@@ -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 */