Make local includes consistent; use double quotes for local includes
except for generated ones where we use angle brackets. Also g/c unused compat.h.
This commit is contained in:
@@ -45,9 +45,9 @@
|
|||||||
# include <inttypes.h>
|
# include <inttypes.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include <alloc.h>
|
#include "alloc.h"
|
||||||
#include <error.h>
|
#include "error.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is no SIZE_MAX or SIZE_T_MAX we have to assume that size_t
|
* If there is no SIZE_MAX or SIZE_T_MAX we have to assume that size_t
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif /* HAVE_STRINGS_H */
|
#endif /* HAVE_STRINGS_H */
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
atobool(const char *str)
|
atobool(const char *str)
|
||||||
|
@@ -44,11 +44,11 @@
|
|||||||
# include <time.h>
|
# include <time.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef HAVE_TIMESPEC
|
#ifndef HAVE_TIMESPEC
|
||||||
# include <emul/timespec.h>
|
# include "compat/timespec.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include <fileops.h>
|
#include "fileops.h"
|
||||||
|
|
||||||
#ifndef LINE_MAX
|
#ifndef LINE_MAX
|
||||||
# define LINE_MAX 2048
|
# define LINE_MAX 2048
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif /* HAVE_STRINGS_H */
|
#endif /* HAVE_STRINGS_H */
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate storage for a name=value string and return it.
|
* Allocate storage for a name=value string and return it.
|
||||||
|
@@ -42,10 +42,10 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include <alloc.h>
|
#include "alloc.h"
|
||||||
#include <error.h>
|
#include "error.h"
|
||||||
#include <lbuf.h>
|
#include "lbuf.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
lbuf_init(struct lbuf *lbuf, int (*output)(const char *),
|
lbuf_init(struct lbuf *lbuf, int (*output)(const char *),
|
||||||
|
@@ -29,10 +29,10 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* STDC_HEADERS */
|
#endif /* STDC_HEADERS */
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include <list.h>
|
#include "list.h"
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
# include <error.h>
|
# include "error.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct list_proto {
|
struct list_proto {
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
#endif /* HAVE_STRINGS_H */
|
#endif /* HAVE_STRINGS_H */
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#ifndef TCSASOFT
|
#ifndef TCSASOFT
|
||||||
# define TCSASOFT 0
|
# define TCSASOFT 0
|
||||||
|
@@ -15,10 +15,11 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <config.h>
|
#include "missing.h"
|
||||||
#include <missing.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Like bzero(3) but with a volatile pointer. The hope is that
|
* Like bzero(3) but with a volatile pointer. The hope is that
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#ifndef HAVE_FCNTL_CLOSEM
|
#ifndef HAVE_FCNTL_CLOSEM
|
||||||
# ifndef HAVE_DIRFD
|
# ifndef HAVE_DIRFD
|
||||||
|
@@ -49,9 +49,9 @@
|
|||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif /* HAVE_STRINGS_H */
|
#endif /* HAVE_STRINGS_H */
|
||||||
|
|
||||||
#include <missing.h>
|
|
||||||
#include "fnmatch.h"
|
|
||||||
#include "charclass.h"
|
#include "charclass.h"
|
||||||
|
#include "fnmatch.h"
|
||||||
|
#include "missing.h"
|
||||||
|
|
||||||
#undef EOS
|
#undef EOS
|
||||||
#define EOS '\0'
|
#define EOS '\0'
|
||||||
|
@@ -71,7 +71,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#define ISDOT(dp) \
|
#define ISDOT(dp) \
|
||||||
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
|
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#endif /* HAVE_STRINGS_H */
|
#endif /* HAVE_STRINGS_H */
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BSD-compatible getgrouplist(3) using getgrent(3)
|
* BSD-compatible getgrouplist(3) using getgrent(3)
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
#endif /* HAVE_STRINGS_H */
|
#endif /* HAVE_STRINGS_H */
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#ifndef LINE_MAX
|
#ifndef LINE_MAX
|
||||||
# define LINE_MAX 2048
|
# define LINE_MAX 2048
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
static const char *progname = "sudo";
|
static const char *progname = "sudo";
|
||||||
|
|
||||||
|
@@ -95,7 +95,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include "glob.h"
|
#include "glob.h"
|
||||||
#include "charclass.h"
|
#include "charclass.h"
|
||||||
|
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#undef isblank
|
#undef isblank
|
||||||
int
|
int
|
||||||
|
@@ -14,9 +14,11 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <missing.h>
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "missing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reverse memchr()
|
* Reverse memchr()
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#endif /* STDC_HEADERS */
|
#endif /* STDC_HEADERS */
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
|
@@ -36,7 +36,7 @@
|
|||||||
# include <time.h>
|
# include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
static unsigned int get_random(void);
|
static unsigned int get_random(void);
|
||||||
static void seed_random(void);
|
static void seed_random(void);
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
nanosleep(const struct timespec *ts, struct timespec *rts)
|
nanosleep(const struct timespec *ts, struct timespec *rts)
|
||||||
|
@@ -38,7 +38,7 @@
|
|||||||
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
|
#endif /* HAVE_MALLOC_H && !STDC_HEADERS */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
setenv(const char *var, const char *val, int overwrite)
|
setenv(const char *var, const char *val, int overwrite)
|
||||||
|
@@ -71,7 +71,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
static int xxxprintf(char **, size_t, int, const char *, va_list);
|
static int xxxprintf(char **, size_t, int, const char *, va_list);
|
||||||
|
|
||||||
|
@@ -17,11 +17,12 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <config.h>
|
#include "missing.h"
|
||||||
#include <missing.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Appends src to string dst of size siz (unlike strncat, siz is the
|
* Appends src to string dst of size siz (unlike strncat, siz is the
|
||||||
|
@@ -17,10 +17,11 @@
|
|||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <config.h>
|
#include "missing.h"
|
||||||
#include <missing.h>
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copy src to string dst of size siz. At most siz-1 characters
|
* Copy src to string dst of size siz. At most siz-1 characters
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#if defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST == 1
|
#if defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST == 1
|
||||||
# define my_sys_siglist sys_siglist
|
# define my_sys_siglist sys_siglist
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
#endif /* HAVE_STRINGS_H */
|
#endif /* HAVE_STRINGS_H */
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
extern char **environ; /* global environment */
|
extern char **environ; /* global environment */
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
# include "utime.h"
|
# include "utime.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#ifndef HAVE_UTIMES
|
#ifndef HAVE_UTIMES
|
||||||
/*
|
/*
|
||||||
|
324
include/compat.h
324
include/compat.h
@@ -1,324 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1996, 1998-2005, 2008, 2009-2010
|
|
||||||
* Todd C. Miller <Todd.Miller@courtesan.com>
|
|
||||||
*
|
|
||||||
* Permission to use, copy, modify, and distribute this software for any
|
|
||||||
* purpose with or without fee is hereby granted, provided that the above
|
|
||||||
* copyright notice and this permission notice appear in all copies.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*
|
|
||||||
* Sponsored in part by the Defense Advanced Research Projects
|
|
||||||
* Agency (DARPA) and Air Force Research Laboratory, Air Force
|
|
||||||
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _SUDO_MISSING_H
|
|
||||||
#define _SUDO_MISSING_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Macros and functions that may be missing on some operating systems.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Define away __attribute__ for non-gcc or old gcc */
|
|
||||||
#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5
|
|
||||||
# define __attribute__(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For silencing gcc warnings about rcsids */
|
|
||||||
#ifndef __unused
|
|
||||||
# if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ > 7)
|
|
||||||
# define __unused __attribute__((__unused__))
|
|
||||||
# else
|
|
||||||
# define __unused
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For catching format string mismatches */
|
|
||||||
#ifndef __printflike
|
|
||||||
# if defined(__GNUC__) && (__GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
|
||||||
# define __printflike(f, v) __attribute__((__format__ (__printf__, f, v)))
|
|
||||||
# else
|
|
||||||
# define __printflike(f, v)
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Some systems lack full limit definitions.
|
|
||||||
*/
|
|
||||||
#ifndef OPEN_MAX
|
|
||||||
# define OPEN_MAX 256
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef INT_MAX
|
|
||||||
# define INT_MAX 0x7fffffff
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PATH_MAX
|
|
||||||
# ifdef MAXPATHLEN
|
|
||||||
# define PATH_MAX MAXPATHLEN
|
|
||||||
# else
|
|
||||||
# ifdef _POSIX_PATH_MAX
|
|
||||||
# define PATH_MAX _POSIX_PATH_MAX
|
|
||||||
# else
|
|
||||||
# define PATH_MAX 1024
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef MAXHOSTNAMELEN
|
|
||||||
# define MAXHOSTNAMELEN 64
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Posix versions for those without...
|
|
||||||
*/
|
|
||||||
#ifndef _S_IFMT
|
|
||||||
# define _S_IFMT S_IFMT
|
|
||||||
#endif /* _S_IFMT */
|
|
||||||
#ifndef _S_IFREG
|
|
||||||
# define _S_IFREG S_IFREG
|
|
||||||
#endif /* _S_IFREG */
|
|
||||||
#ifndef _S_IFDIR
|
|
||||||
# define _S_IFDIR S_IFDIR
|
|
||||||
#endif /* _S_IFDIR */
|
|
||||||
#ifndef _S_IFLNK
|
|
||||||
# define _S_IFLNK S_IFLNK
|
|
||||||
#endif /* _S_IFLNK */
|
|
||||||
#ifndef S_ISREG
|
|
||||||
# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
|
|
||||||
#endif /* S_ISREG */
|
|
||||||
#ifndef S_ISDIR
|
|
||||||
# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
|
|
||||||
#endif /* S_ISDIR */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Some OS's may not have this.
|
|
||||||
*/
|
|
||||||
#ifndef S_IRWXU
|
|
||||||
# define S_IRWXU 0000700 /* rwx for owner */
|
|
||||||
#endif /* S_IRWXU */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* These should be defined in <unistd.h> but not everyone has them.
|
|
||||||
*/
|
|
||||||
#ifndef STDIN_FILENO
|
|
||||||
# define STDIN_FILENO 0
|
|
||||||
#endif
|
|
||||||
#ifndef STDOUT_FILENO
|
|
||||||
# define STDOUT_FILENO 1
|
|
||||||
#endif
|
|
||||||
#ifndef STDERR_FILENO
|
|
||||||
# define STDERR_FILENO 2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* BSD defines these in <sys/param.h> but others may not.
|
|
||||||
*/
|
|
||||||
#ifndef MIN
|
|
||||||
# define MIN(a,b) (((a)<(b))?(a):(b))
|
|
||||||
#endif
|
|
||||||
#ifndef MAX
|
|
||||||
# define MAX(a,b) (((a)>(b))?(a):(b))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Simple isblank() macro and function for systems without it.
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_ISBLANK
|
|
||||||
int isblank(int);
|
|
||||||
# define isblank(_x) ((_x) == ' ' || (_x) == '\t')
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NCR's SVr4 has _innetgr(3) instead of innetgr(3) for some reason.
|
|
||||||
*/
|
|
||||||
#ifdef HAVE__INNETGR
|
|
||||||
# define innetgr(n, h, u, d) (_innetgr(n, h, u, d))
|
|
||||||
# define HAVE_INNETGR 1
|
|
||||||
#endif /* HAVE__INNETGR */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* On POSIX systems, O_NOCTTY is the default so some OS's may lack this define.
|
|
||||||
*/
|
|
||||||
#ifndef O_NOCTTY
|
|
||||||
# define O_NOCTTY 0
|
|
||||||
#endif /* O_NOCTTY */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Add IRIX-like sigaction_t for those without it.
|
|
||||||
* SA_RESTART is not required by POSIX; SunOS has SA_INTERRUPT instead.
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_SIGACTION_T
|
|
||||||
typedef struct sigaction sigaction_t;
|
|
||||||
#endif
|
|
||||||
#ifndef SA_INTERRUPT
|
|
||||||
# define SA_INTERRUPT 0
|
|
||||||
#endif
|
|
||||||
#ifndef SA_RESTART
|
|
||||||
# define SA_RESTART 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If dirfd() does not exists, hopefully dd_fd does.
|
|
||||||
*/
|
|
||||||
#if !defined(HAVE_DIRFD) && defined(HAVE_DD_FD)
|
|
||||||
# define dirfd(_d) ((_d)->dd_fd)
|
|
||||||
# define HAVE_DIRFD
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Define futimes() in terms of futimesat() if needed.
|
|
||||||
*/
|
|
||||||
#if !defined(HAVE_FUTIMES) && defined(HAVE_FUTIMESAT)
|
|
||||||
# define futimes(_f, _tv) futimesat(_f, NULL, _tv)
|
|
||||||
# define HAVE_FUTIMES
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(HAVE_KILLPG) && !defined(killpg)
|
|
||||||
# define killpg(s) kill(-(s))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If we lack getprogname(), emulate with __progname if possible.
|
|
||||||
* Otherwise, add a prototype for use with our own getprogname.c.
|
|
||||||
*/
|
|
||||||
#ifndef HAVE_GETPROGNAME
|
|
||||||
# ifdef HAVE___PROGNAME
|
|
||||||
extern const char *__progname;
|
|
||||||
# define getprogname() (__progname)
|
|
||||||
# else
|
|
||||||
const char *getprogname(void);
|
|
||||||
void setprogname(const char *);
|
|
||||||
#endif /* HAVE___PROGNAME */
|
|
||||||
#endif /* !HAVE_GETPROGNAME */
|
|
||||||
|
|
||||||
#ifndef timevalclear
|
|
||||||
# define timevalclear(tv) ((tv)->tv_sec = (tv)->tv_usec = 0)
|
|
||||||
#endif
|
|
||||||
#ifndef timevalisset
|
|
||||||
# define timevalisset(tv) ((tv)->tv_sec || (tv)->tv_usec)
|
|
||||||
#endif
|
|
||||||
#ifndef timevalcmp
|
|
||||||
# define timevalcmp(tv1, tv2, op) \
|
|
||||||
(((tv1)->tv_sec == (tv2)->tv_sec) ? \
|
|
||||||
((tv1)->tv_usec op (tv2)->tv_usec) : \
|
|
||||||
((tv1)->tv_sec op (tv2)->tv_sec))
|
|
||||||
#endif
|
|
||||||
#ifndef timevaladd
|
|
||||||
# define timevaladd(tv1, tv2) \
|
|
||||||
do { \
|
|
||||||
(tv1)->tv_sec += (tv2)->tv_sec; \
|
|
||||||
(tv1)->tv_usec += (tv2)->tv_usec; \
|
|
||||||
if ((tv1)->tv_usec >= 1000000) { \
|
|
||||||
(tv1)->tv_sec++; \
|
|
||||||
(tv1)->tv_usec -= 1000000; \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
#endif
|
|
||||||
#ifndef timevalsub
|
|
||||||
# define timevalsub(tv1, tv2) \
|
|
||||||
do { \
|
|
||||||
(tv1)->tv_sec -= (tv2)->tv_sec; \
|
|
||||||
(tv1)->tv_usec -= (tv2)->tv_usec; \
|
|
||||||
if ((tv1)->tv_usec < 0) { \
|
|
||||||
(tv1)->tv_sec--; \
|
|
||||||
(tv1)->tv_usec += 1000000; \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Not all systems define NSIG in signal.h */
|
|
||||||
#if !defined(NSIG)
|
|
||||||
# if defined(_NSIG)
|
|
||||||
# define NSIG _NSIG
|
|
||||||
# elif defined(__NSIG)
|
|
||||||
# define NSIG __NSIG
|
|
||||||
# else
|
|
||||||
# define NSIG 64
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef WCOREDUMP
|
|
||||||
# define WCOREDUMP(x) ((x) & 0x80)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_SETEUID
|
|
||||||
# if defined(HAVE_SETRESUID)
|
|
||||||
# define seteuid(u) setresuid(-1, (u), -1)
|
|
||||||
# define setegid(g) setresgid(-1, (g), -1)
|
|
||||||
# define HAVE_SETEUID 1
|
|
||||||
# elif defined(HAVE_SETREUID)
|
|
||||||
# define seteuid(u) setreuid(-1, (u))
|
|
||||||
# define setegid(g) setregid(-1, (g))
|
|
||||||
# define HAVE_SETEUID 1
|
|
||||||
# endif
|
|
||||||
#endif /* HAVE_SETEUID */
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdarg.h>
|
|
||||||
|
|
||||||
/* Functions "missing" from libc. */
|
|
||||||
|
|
||||||
struct timeval;
|
|
||||||
struct timespec;
|
|
||||||
|
|
||||||
#ifndef HAVE_CLOSEFROM
|
|
||||||
void closefrom(int);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_GETCWD
|
|
||||||
char *getcwd(char *, size_t size);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_GETLINE
|
|
||||||
ssize_t getline(char **, size_t *, FILE *);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_UTIMES
|
|
||||||
int utimes(const char *, const struct timeval *);
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_FUTIME
|
|
||||||
int futimes(int, const struct timeval *);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_SNPRINTF
|
|
||||||
int snprintf(char *, size_t, const char *, ...) __printflike(3, 4);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_VSNPRINTF
|
|
||||||
int vsnprintf(char *, size_t, const char *, va_list) __printflike(3, 0);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_ASPRINTF
|
|
||||||
int asprintf(char **, const char *, ...) __printflike(2, 3);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_VASPRINTF
|
|
||||||
int vasprintf(char **, const char *, va_list) __printflike(2, 0);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_STRLCAT
|
|
||||||
size_t strlcat(char *, const char *, size_t);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_STRLCPY
|
|
||||||
size_t strlcpy(char *, const char *, size_t);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_MEMRCHR
|
|
||||||
void *memrchr(const void *, int, size_t);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_MKSTEMPS
|
|
||||||
int mkstemps(char *, int);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_NANOSLEEP
|
|
||||||
int nanosleep(const struct timespec *, struct timespec *);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_SETENV
|
|
||||||
int setenv(const char *, const char *, int);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_UNSETENV
|
|
||||||
int unsetenv(const char *);
|
|
||||||
#endif
|
|
||||||
#ifndef HAVE_STRSIGNAL
|
|
||||||
char *strsignal(int);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* _SUDO_MISSING_H */
|
|
@@ -49,9 +49,9 @@
|
|||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <sudo_plugin.h>
|
|
||||||
#include <missing.h>
|
|
||||||
#include <pathnames.h>
|
#include <pathnames.h>
|
||||||
|
#include "sudo_plugin.h"
|
||||||
|
#include "missing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sample plugin module that allows any user who knows the password
|
* Sample plugin module that allows any user who knows the password
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#ifndef LINE_MAX
|
#ifndef LINE_MAX
|
||||||
# define LINE_MAX 2048
|
# define LINE_MAX 2048
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include <sudo_plugin.h>
|
#include "sudo_plugin.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Simple driver to test sudoer group plugins.
|
* Simple driver to test sudoer group plugins.
|
||||||
|
@@ -48,8 +48,8 @@
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include <sudo_plugin.h>
|
#include "sudo_plugin.h"
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Sample sudoers group plugin that uses an extra group file with the
|
* Sample sudoers group plugin that uses an extra group file with the
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#endif /* STDC_HEADERS */
|
#endif /* STDC_HEADERS */
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
|
|
||||||
#ifdef HAVE_BSM_AUDIT
|
#ifdef HAVE_BSM_AUDIT
|
||||||
|
@@ -43,12 +43,12 @@
|
|||||||
#endif /* HAVE_UNISTD_H */
|
#endif /* HAVE_UNISTD_H */
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
#include "sudoers.h"
|
|
||||||
#include "sudo_auth.h"
|
|
||||||
|
|
||||||
#include <afs/stds.h>
|
#include <afs/stds.h>
|
||||||
#include <afs/kautils.h>
|
#include <afs/kautils.h>
|
||||||
|
|
||||||
|
#include "sudoers.h"
|
||||||
|
#include "sudo_auth.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
afs_verify(struct passwd *pw, char *pass, sudo_auth *auth)
|
afs_verify(struct passwd *pw, char *pass, sudo_auth *auth)
|
||||||
{
|
{
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
# include <sys/sysctl.h>
|
# include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill in a struct timeval with the time the system booted.
|
* Fill in a struct timeval with the time the system booted.
|
||||||
|
@@ -50,7 +50,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
|
|
||||||
#define EPOCH 1970
|
#define EPOCH 1970
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
|
|
||||||
#define EPOCH 1970
|
#define EPOCH 1970
|
||||||
|
@@ -31,10 +31,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <libaudit.h>
|
#include <libaudit.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include <error.h>
|
#include "error.h"
|
||||||
#include <alloc.h>
|
#include "alloc.h"
|
||||||
#include <linux_audit.h>
|
#include "linux_audit.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open audit connection if possible.
|
* Open audit connection if possible.
|
||||||
|
@@ -83,10 +83,10 @@
|
|||||||
#include <gram.h>
|
#include <gram.h>
|
||||||
|
|
||||||
#ifndef HAVE_FNMATCH
|
#ifndef HAVE_FNMATCH
|
||||||
# include <compat/fnmatch.h>
|
# include "compat/fnmatch.h"
|
||||||
#endif /* HAVE_FNMATCH */
|
#endif /* HAVE_FNMATCH */
|
||||||
#ifndef HAVE_EXTENDED_GLOB
|
#ifndef HAVE_EXTENDED_GLOB
|
||||||
# include <compat/glob.h>
|
# include "compat/glob.h"
|
||||||
#endif /* HAVE_EXTENDED_GLOB */
|
#endif /* HAVE_EXTENDED_GLOB */
|
||||||
|
|
||||||
static struct member_list empty;
|
static struct member_list empty;
|
||||||
|
@@ -24,10 +24,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include <alloc.h>
|
#include "alloc.h"
|
||||||
#include <error.h>
|
#include "error.h"
|
||||||
#include <sudo_plugin.h>
|
#include "sudo_plugin.h"
|
||||||
|
|
||||||
static void _warning(int, const char *, va_list);
|
static void _warning(int, const char *, va_list);
|
||||||
void cleanup(int);
|
void cleanup(int);
|
||||||
|
@@ -85,9 +85,9 @@
|
|||||||
|
|
||||||
#include <pathnames.h>
|
#include <pathnames.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "alloc.h"
|
||||||
#include <alloc.h>
|
#include "error.h"
|
||||||
#include <error.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#ifndef LINE_MAX
|
#ifndef LINE_MAX
|
||||||
# define LINE_MAX 2048
|
# define LINE_MAX 2048
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
#endif /* STDC_HEADERS */
|
#endif /* STDC_HEADERS */
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
char *get_timestr(time_t, int);
|
char *get_timestr(time_t, int);
|
||||||
|
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
static void _warning(int, const char *, va_list);
|
static void _warning(int, const char *, va_list);
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
|
12
src/sudo.h
12
src/sudo.h
@@ -24,14 +24,14 @@
|
|||||||
#ifndef _SUDO_SUDO_H
|
#ifndef _SUDO_SUDO_H
|
||||||
#define _SUDO_SUDO_H
|
#define _SUDO_SUDO_H
|
||||||
|
|
||||||
#include <pathnames.h>
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include <pathnames.h>
|
||||||
#include <alloc.h>
|
#include "missing.h"
|
||||||
#include <error.h>
|
#include "alloc.h"
|
||||||
#include <fileops.h>
|
#include "error.h"
|
||||||
#include <list.h>
|
#include "fileops.h"
|
||||||
|
#include "list.h"
|
||||||
|
|
||||||
#ifdef __TANDEM
|
#ifdef __TANDEM
|
||||||
# define ROOT_UID 65535
|
# define ROOT_UID 65535
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Dummy versions of the execve() family of syscalls. We don't need
|
* Dummy versions of the execve() family of syscalls. We don't need
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#endif /* HAVE_UNISTD_H */
|
#endif /* HAVE_UNISTD_H */
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
#include <missing.h>
|
#include "missing.h"
|
||||||
|
|
||||||
#if !defined(TIOCGSIZE) && defined(TIOCGWINSZ)
|
#if !defined(TIOCGSIZE) && defined(TIOCGWINSZ)
|
||||||
# define TIOCGSIZE TIOCGWINSZ
|
# define TIOCGSIZE TIOCGWINSZ
|
||||||
|
Reference in New Issue
Block a user