fi
])dnl
-dnl
-dnl check for fullly working void
-dnl
-AC_DEFUN(SUDO_FULL_VOID, [AC_MSG_CHECKING(for full void implementation)
-AC_TRY_COMPILE(, [void *foo;
-foo = (void *)0; (void *)"test";], AC_DEFINE(VOID, void, [Define to "void" if your compiler supports void pointers, else use "char"].)
-AC_MSG_RESULT(yes), AC_DEFINE(VOID, char)
-AC_MSG_RESULT(no))])
-
dnl
dnl SUDO_CHECK_TYPE(TYPE, DEFAULT)
dnl XXX - should require the check for unistd.h...
/*
* Local protoypes
*/
-static int alias_compare __P((const VOID *, const VOID *));
-static void alias_free __P((VOID *));
+static int alias_compare __P((const void *, const void *));
+static void alias_free __P((void *));
/*
* Comparison function for the red-black tree.
*/
static int
alias_compare(v1, v2)
- const VOID *v1, *v2;
+ const void *v1, *v2;
{
const struct alias *a1 = (const struct alias *)v1;
const struct alias *a2 = (const struct alias *)v2;
*/
void
alias_apply(func, cookie)
- int (*func) __P((VOID *, VOID *));
- VOID *cookie;
+ int (*func) __P((void *, void *));
+ void *cookie;
{
rbapply(aliases, func, cookie, inorder);
}
*/
static void
alias_free(v)
- VOID *v;
+ void *v;
{
struct alias *a = (struct alias *)v;
struct member *m;
- VOID *next;
+ void *next;
for (m = a->members.first; m != NULL; m = next) {
next = m->next;
* emalloc() calls the system malloc(3) and exits with an error if
* malloc(3) fails.
*/
-VOID *
+void *
emalloc(size)
size_t size;
{
- VOID *ptr;
+ void *ptr;
if (size == 0)
errorx(1, "internal error, tried to emalloc(0)");
- if ((ptr = (VOID *) malloc(size)) == NULL)
+ if ((ptr = (void *) malloc(size)) == NULL)
errorx(1, "unable to allocate memory");
return(ptr);
}
* emalloc2() allocates nmemb * size bytes and exits with an error
* if overflow would occur or if the system malloc(3) fails.
*/
-VOID *
+void *
emalloc2(nmemb, size)
size_t nmemb;
size_t size;
{
- VOID *ptr;
+ void *ptr;
if (nmemb == 0 || size == 0)
errorx(1, "internal error, tried to emalloc2(0)");
errorx(1, "internal error, emalloc2() overflow");
size *= nmemb;
- if ((ptr = (VOID *) malloc(size)) == NULL)
+ if ((ptr = (void *) malloc(size)) == NULL)
errorx(1, "unable to allocate memory");
return(ptr);
}
* realloc(3) fails. You can call erealloc() with a NULL pointer even
* if the system realloc(3) does not support this.
*/
-VOID *
+void *
erealloc(ptr, size)
- VOID *ptr;
+ void *ptr;
size_t size;
{
if (size == 0)
errorx(1, "internal error, tried to erealloc(0)");
- ptr = ptr ? (VOID *) realloc(ptr, size) : (VOID *) malloc(size);
+ ptr = ptr ? (void *) realloc(ptr, size) : (void *) malloc(size);
if (ptr == NULL)
errorx(1, "unable to allocate memory");
return(ptr);
* You can call erealloc() with a NULL pointer even if the system realloc(3)
* does not support this.
*/
-VOID *
+void *
erealloc3(ptr, nmemb, size)
- VOID *ptr;
+ void *ptr;
size_t nmemb;
size_t size;
{
errorx(1, "internal error, erealloc3() overflow");
size *= nmemb;
- ptr = ptr ? (VOID *) realloc(ptr, size) : (VOID *) malloc(size);
+ ptr = ptr ? (void *) realloc(ptr, size) : (void *) malloc(size);
if (ptr == NULL)
errorx(1, "unable to allocate memory");
return(ptr);
*/
void
efree(ptr)
- VOID *ptr;
+ void *ptr;
{
if (ptr != NULL)
free(ptr);
short flags; /* various flags, see below */
short status; /* status from verify routine */
char *name; /* name of the method in string form */
- VOID *data; /* method-specific data pointer */
+ void *data; /* method-specific data pointer */
int (*init) __P((struct passwd *pw, char **prompt, sudo_auth *auth));
int (*setup) __P((struct passwd *pw, char **prompt, sudo_auth *auth));
#include "sudo.h"
#include "sudo_auth.h"
-#undef VOID
#include <afs/stds.h>
#include <afs/kautils.h>
return(AUTH_FATAL);
}
- auth->data = (VOID *) as;
+ auth->data = (void *) as;
return(AUTH_SUCCESS);
}
return(AUTH_FAILURE);
/* Stash a pointer to the realm (used in kerb4_verify) */
- auth->data = (VOID *) realm;
+ auth->data = (void *) realm;
return(AUTH_SUCCESS);
}
char cache_name[64];
char *pname;
- auth->data = (VOID *) &sudo_krb5_data; /* Stash all our data here */
+ auth->data = (void *) &sudo_krb5_data; /* Stash all our data here */
#ifdef HAVE_KRB5_INIT_SECURE_CONTEXT
error = krb5_init_secure_context(&(sudo_krb5_data.sudo_context));
#endif /* lint */
static int sudo_conv __P((int, PAM_CONST struct pam_message **,
- struct pam_response **, VOID *));
+ struct pam_response **, void *));
static char *def_prompt;
#ifndef PAM_DATA_SILENT
/* Initial PAM setup */
if (auth != NULL)
- auth->data = (VOID *) &pam_status;
+ auth->data = (void *) &pam_status;
pam_conv.conv = sudo_conv;
pam_status = pam_start("sudo", pw->pw_name, &pam_conv, &pamh);
if (pam_status != PAM_SUCCESS) {
int num_msg;
PAM_CONST struct pam_message **msg;
struct pam_response **response;
- VOID *appdata_ptr;
+ void *appdata_ptr;
{
struct pam_response *pr;
PAM_CONST struct pam_message *pm;
{
static struct SD_CLIENT sd_dat; /* SecurID data block */
- auth->data = (VOID *) &sd_dat; /* For method-specific data */
+ auth->data = (void *) &sd_dat; /* For method-specific data */
if (creadcfg() == 0)
return(AUTH_SUCCESS);
{
static SDI_HANDLE sd_dat; /* SecurID handle */
- auth->data = (VOID *) &sd_dat; /* For method-specific data */
+ auth->data = (void *) &sd_dat; /* For method-specific data */
/* Start communications */
if (AceInitialize() != SD_FALSE)
return(AUTH_FATAL);
}
- auth->data = (VOID *) siah;
+ auth->data = (void *) siah;
return(AUTH_SUCCESS);
}
short flags; /* various flags, see below */
short status; /* status from verify routine */
char *name; /* name of the method as a string */
- VOID *data; /* method-specific data pointer */
+ void *data; /* method-specific data pointer */
int (*init) __P((struct passwd *pw, char **prompt, struct sudo_auth *auth));
int (*setup) __P((struct passwd *pw, char **prompt, struct sudo_auth *auth));
int (*verify) __P((struct passwd *pw, char *p, struct sudo_auth *auth));
/* Define to 1 if you want a different ticket file for each tty. */
#undef USE_TTY_TICKETS
-/* Define to "void" if your compiler supports void pointers, else use "char".
- */
-#undef VOID
-
/* Define to avoid using the passwd/shadow file for authentication. */
#undef WITHOUT_PASSWD
SUDO_TYPE_SSIZE_T
SUDO_TYPE_DEV_T
SUDO_TYPE_INO_T
-SUDO_FULL_VOID
SUDO_UID_T_LEN
SUDO_TYPE_LONG_LONG
SUDO_SOCK_SA_LEN
#define KEPT_MAX 0xff00
#undef VNULL
-#define VNULL (VOID *)NULL
+#define VNULL (void *)NULL
struct environment {
char **envp; /* pointer to the new environment */
int bind_timelimit;
int use_sasl;
int rootuse_sasl;
+ int use_ssl;
+ int start_tls;
char *host;
char *uri;
char *binddn;
char *bindpw;
char *rootbinddn;
char *base;
- char *ssl;
char *tls_cacertfile;
char *tls_cacertdir;
char *tls_random_file;
char *sasl_auth_id;
char *rootsasl_auth_id;
char *sasl_secprops;
+ char *sslpath;
char *krb5_ccname;
} ldap_conf;
sudo_ldap_read_config()
{
FILE *f;
- char buf[LINE_MAX], *c, *keyword, *value;
+ char buf[LINE_MAX], *c, *keyword, *value, *ssl = NULL;
/* defaults */
- ldap_conf.version = 3;
- ldap_conf.port = 389;
+ ldap_conf.version = LDAP_VERSION_MAX; /* XXX - use LDAP_VERSION? */
+ ldap_conf.port = -1;
ldap_conf.tls_checkpeer = -1;
ldap_conf.timelimit = -1;
ldap_conf.bind_timelimit = -1;
else
MATCH_I("port", ldap_conf.port)
else
- MATCH_S("ssl", ldap_conf.ssl)
+ MATCH_S("ssl", ssl)
+ else
+ MATCH_S("sslpath", ldap_conf.sslpath)
else
MATCH_B("tls_checkpeer", ldap_conf.tls_checkpeer)
else
}
fclose(f);
+ /*
+ * The ssl option may be a boolean or the string "start_tls".
+ */
+ if (ssl != NULL) {
+ if (strcasecmp(ssl, "start_tls") == 0)
+ ldap_conf.start_tls = 1;
+ else
+ ldap_conf.use_ssl = _atobool(ssl);
+ }
+
+ if (ldap_conf.port == -1) {
+#ifdef HAVE_LDAPSSL_INIT
+ if (ldap_conf.use_ssl)
+ ldap_conf.port = LDAPS_PORT;
+ else
+#endif
+ ldap_conf.port = LDAP_PORT;
+ }
+
if (!ldap_conf.host)
ldap_conf.host = estrdup("localhost");
ldap_conf.bindpw : "(anonymous)");
fprintf(stderr, "bind_timelimit %d\n", ldap_conf.bind_timelimit);
fprintf(stderr, "timelimit %d\n", ldap_conf.timelimit);
+#ifdef HAVE_LDAPSSL_INIT
+ fprintf(stderr, "use_ssl %d\n", ldap_conf.use_ssl);
+#endif
#ifdef HAVE_LDAP_START_TLS_S
- fprintf(stderr, "ssl %s\n", ldap_conf.ssl ?
- ldap_conf.ssl : "(no)");
+ fprintf(stderr, "start_tls %d\n", ldap_conf.start_tls);
#endif
#ifdef HAVE_LDAP_SASL_INTERACTIVE_BIND_S
fprintf(stderr, "use_sasl %d\n", ldap_conf.use_sasl);
*/
void
sudo_ldap_display_privs(ldv, pw)
- VOID *ldv;
+ void *ldv;
struct passwd *pw;
{
LDAP *ld = (LDAP *) ldv;
int
sudo_ldap_display_cmnd(ldv, pw)
- VOID *ldv;
+ void *ldv;
struct passwd *pw;
{
LDAP *ld = (LDAP *) ldv;
/*
* Open a connection to the LDAP server.
*/
-VOID *
+void *
sudo_ldap_open()
{
LDAP *ld = NULL;
if (!sudo_ldap_read_config())
return(NULL);
- /* attempt to setup ssl options */
+ /* attempt to setup TLS options */
#ifdef LDAP_OPT_X_TLS_CACERTFILE
SET_OPTS(X_TLS_CACERTFILE, tls_cacertfile);
#endif /* LDAP_OPT_X_TLS_CACERTFILE */
}
#endif
- /* attempt connect */
+#ifdef HAVE_LDAPSSL_INIT
+ /* setup SSL before connecting */
+ if (ldap_conf.use_ssl && ldap_conf.sslpath != NULL) {
+ rc = ldapssl_client_init(ldap_conf.sslpath, NULL);
+ if (rc != LDAP_SUCCESS) {
+ fprintf(stderr, "ldapssl_client_init()=%d : %s\n",
+ rc, ldap_err2string(rc));
+ return(NULL);
+ }
+ }
+#endif
+
+ /* attempt connection */
#ifdef HAVE_LDAP_INITIALIZE
if (ldap_conf.uri) {
DPRINTF(("ldap_initialize(ld,%s)", ldap_conf.uri), 2);
rc = ldap_initialize(&ld, ldap_conf.uri);
- if (rc) {
+ if (rc != LDAP_SUCCESS) {
fprintf(stderr, "ldap_initialize()=%d : %s\n",
rc, ldap_err2string(rc));
return(NULL);
} else
#endif /* HAVE_LDAP_INITIALIZE */
if (ldap_conf.host) {
+#ifdef HAVE_LDAPSSL_INIT
+ DPRINTF(("ldapssl_init(%s,%d,%d)", ldap_conf.host, ldap_conf.port,
+ ldap_conf.use_ssl), 2);
+ ld = ldapssl_init(ldap_conf.host, ldap_conf.port, ldap_conf.use_ssl);
+ if (ld == NULL) {
+ warning("ldapssl_init()");
+ return(NULL);
+ }
+#else
DPRINTF(("ldap_init(%s,%d)", ldap_conf.host, ldap_conf.port), 2);
if ((ld = ldap_init(ldap_conf.host, ldap_conf.port)) == NULL) {
warning("ldap_init()");
return(NULL);
}
+#endif
}
#ifdef LDAP_OPT_PROTOCOL_VERSION
#ifdef HAVE_LDAP_START_TLS_S
/* Turn on TLS */
- if (ldap_conf.ssl && !strcasecmp(ldap_conf.ssl, "start_tls")) {
+ if (ldap_conf.start_tls) {
rc = ldap_start_tls_s(ld, NULL, NULL);
if (rc != LDAP_SUCCESS) {
fprintf(stderr, "ldap_start_tls_s(): %d: %s\n", rc,
DPRINTF(("ldap_bind() ok"), 1);
}
- return((VOID *) ld);
+ return((void *) ld);
}
void
sudo_ldap_update_defaults(v)
- VOID *v;
+ void *v;
{
LDAP *ld = (LDAP *) v;
LDAPMessage *entry = NULL, *result = NULL; /* used for searches */
*/
int
sudo_ldap_check(v, pwflag)
- VOID *v;
+ void *v;
int pwflag;
{
LDAP *ld = (LDAP *) v;
*/
void
sudo_ldap_close(v)
- VOID *v;
+ void *v;
{
if (v != NULL)
ldap_unbind_s((LDAP *) v);
* Pop the last element off the end of vh.
* Returns the popped element.
*/
-VOID *
+void *
lh_pop(vh)
- VOID *vh;
+ void *vh;
{
struct list_head_proto *h = (struct list_head_proto *)vh;
- VOID *last = NULL;
+ void *last = NULL;
if (!lh_empty(h)) {
- last = (VOID *)h->last;
+ last = (void *)h->last;
if (h->first == h->last) {
h->first = NULL;
h->last = NULL;
*/
void
list2head(vh, vl)
- VOID *vh;
- VOID *vl;
+ void *vh;
+ void *vl;
{
struct list_head_proto *h = (struct list_head_proto *)vh;
struct list_proto *l = (struct list_proto *)vl;
*/
void
list_append(vl1, vl2)
- VOID *vl1;
- VOID *vl2;
+ void *vl1;
+ void *vl2;
{
struct list_proto *l1 = (struct list_proto *)vl1;
struct list_proto *l2 = (struct list_proto *)vl2;
- VOID *tail = l2->prev;
+ void *tail = l2->prev;
l1->prev->next = l2;
l2->prev = l1->prev;
*/
void
lh_append(vh, vl)
- VOID *vh;
- VOID *vl;
+ void *vh;
+ void *vl;
{
struct list_head_proto *h = (struct list_head_proto *)vh;
struct list_proto *l = (struct list_proto *)vl;
- VOID *tail = l->prev;
+ void *tail = l->prev;
if (h->first == NULL)
h->first = l;
/*
* Prototypes for list.c
*/
-VOID *lh_pop __P((VOID *));
-void lh_append __P((VOID *, VOID *));
-void list_append __P((VOID *, VOID *));
-void list2head __P((VOID *, VOID *));
+void *lh_pop __P((void *));
+void lh_append __P((void *, void *));
+void list_append __P((void *, void *));
+void list2head __P((void *, void *));
#endif /* _SUDO_LIST_H */
* Reverse memchr()
* Find the last occurence of 'c' in the buffer 's' of size 'n'.
*/
-VOID *
+void *
memrchr(s, c, n)
- const VOID *s;
+ const void *s;
int c;
size_t n;
{
cp = (unsigned char *)s + n;
do {
if (*(--cp) == (unsigned char)c)
- return((VOID *)cp);
+ return((void *)cp);
} while (--n != 0);
}
- return((VOID *)0);
+ return((void *)0);
}
*/
void
display_privs(v, pw)
- VOID *v;
+ void *v;
struct passwd *pw;
{
struct lbuf lbuf;
*/
int
display_cmnd(v, pw)
- VOID *v;
+ void *v;
struct passwd *pw;
{
struct cmndspec *cs;
int usergr_matches __P((char *, char *, struct passwd *));
int userpw_matches __P((char *, char *, struct passwd *));
struct alias *find_alias __P((char *, int));
-void alias_apply __P((int (*)(VOID *, VOID *), VOID *));
+void alias_apply __P((int (*)(void *, void *), void *));
void init_aliases __P((void));
void init_parser __P((char *, int));
static struct rbtree *pwcache_byuid, *pwcache_byname;
static struct rbtree *grcache_bygid, *grcache_byname;
-static int cmp_pwuid __P((const VOID *, const VOID *));
-static int cmp_pwnam __P((const VOID *, const VOID *));
-static int cmp_grgid __P((const VOID *, const VOID *));
-static int cmp_grnam __P((const VOID *, const VOID *));
+static int cmp_pwuid __P((const void *, const void *));
+static int cmp_pwnam __P((const void *, const void *));
+static int cmp_grgid __P((const void *, const void *));
+static int cmp_grnam __P((const void *, const void *));
/*
* Compare by uid.
*/
static int
cmp_pwuid(v1, v2)
- const VOID *v1;
- const VOID *v2;
+ const void *v1;
+ const void *v2;
{
const struct passwd *pw1 = (const struct passwd *) v1;
const struct passwd *pw2 = (const struct passwd *) v2;
*/
static int
cmp_pwnam(v1, v2)
- const VOID *v1;
- const VOID *v2;
+ const void *v1;
+ const void *v2;
{
const struct passwd *pw1 = (const struct passwd *) v1;
const struct passwd *pw2 = (const struct passwd *) v2;
zero_bytes(pw->pw_passwd, strlen(pw->pw_passwd));
pw->pw_passwd = cp;
- if (rbinsert(pwcache_byname, (VOID *) pw) != NULL)
+ if (rbinsert(pwcache_byname, (void *) pw) != NULL)
errorx(1, "unable to cache user name, already exists");
- if (rbinsert(pwcache_byuid, (VOID *) pw) != NULL)
+ if (rbinsert(pwcache_byuid, (void *) pw) != NULL)
errorx(1, "unable to cache uid, already exists");
return(pw);
} else {
pw = emalloc(sizeof(*pw));
memset(pw, 0, sizeof(*pw));
pw->pw_uid = uid;
- if (rbinsert(pwcache_byuid, (VOID *) pw) != NULL)
+ if (rbinsert(pwcache_byuid, (void *) pw) != NULL)
errorx(1, "unable to cache uid, already exists");
return(NULL);
}
zero_bytes(pw->pw_passwd, strlen(pw->pw_passwd));
pw->pw_passwd = cp;
- if (rbinsert(pwcache_byname, (VOID *) pw) != NULL)
+ if (rbinsert(pwcache_byname, (void *) pw) != NULL)
errorx(1, "unable to cache user name, already exists");
- if (rbinsert(pwcache_byuid, (VOID *) pw) != NULL)
+ if (rbinsert(pwcache_byuid, (void *) pw) != NULL)
errorx(1, "unable to cache uid, already exists");
return(pw);
} else {
memcpy(cp, name, len);
pw->pw_name = cp;
pw->pw_uid = (uid_t) -1;
- if (rbinsert(pwcache_byname, (VOID *) pw) != NULL)
+ if (rbinsert(pwcache_byname, (void *) pw) != NULL)
errorx(1, "unable to cache user name, already exists");
return(NULL);
}
/* Store by uid and by name, overwriting cached version. */
if ((node = rbinsert(pwcache_byuid, pw)) != NULL) {
efree(node->data);
- node->data = (VOID *) pw;
+ node->data = (void *) pw;
}
if ((node = rbinsert(pwcache_byname, pw)) != NULL) {
efree(node->data);
- node->data = (VOID *) pw;
+ node->data = (void *) pw;
}
return(pw);
}
/* Store by uid and by name, overwriting cached version. */
if ((node = rbinsert(pwcache_byuid, pw)) != NULL) {
efree(node->data);
- node->data = (VOID *) pw;
+ node->data = (void *) pw;
}
if ((node = rbinsert(pwcache_byname, pw)) != NULL) {
efree(node->data);
- node->data = (VOID *) pw;
+ node->data = (void *) pw;
}
return(pw);
}
}
#ifdef notyet
-static void pw_free __P((VOID *));
+static void pw_free __P((void *));
void
sudo_freepwcache()
static void
pw_free(v)
- VOID *v;
+ void *v;
{
struct passwd *pw = (struct passwd *) v;
*/
static int
cmp_grgid(v1, v2)
- const VOID *v1;
- const VOID *v2;
+ const void *v1;
+ const void *v2;
{
const struct group *grp1 = (const struct group *) v1;
const struct group *grp2 = (const struct group *) v2;
*/
static int
cmp_grnam(v1, v2)
- const VOID *v1;
- const VOID *v2;
+ const void *v1;
+ const void *v2;
{
const struct group *grp1 = (const struct group *) v1;
const struct group *grp2 = (const struct group *) v2;
*/
if ((gr = getgrgid(gid)) != NULL) {
gr = sudo_grdup(gr);
- if (rbinsert(grcache_byname, (VOID *) gr) != NULL)
+ if (rbinsert(grcache_byname, (void *) gr) != NULL)
errorx(1, "unable to cache group name, already exists");
- if (rbinsert(grcache_bygid, (VOID *) gr) != NULL)
+ if (rbinsert(grcache_bygid, (void *) gr) != NULL)
errorx(1, "unable to cache gid, already exists");
return(gr);
} else {
gr = emalloc(sizeof(*gr));
memset(gr, 0, sizeof(*gr));
gr->gr_gid = gid;
- if (rbinsert(grcache_bygid, (VOID *) gr) != NULL)
+ if (rbinsert(grcache_bygid, (void *) gr) != NULL)
errorx(1, "unable to cache gid, already exists");
return(NULL);
}
*/
if ((gr = getgrnam(name)) != NULL) {
gr = sudo_grdup(gr);
- if (rbinsert(grcache_byname, (VOID *) gr) != NULL)
+ if (rbinsert(grcache_byname, (void *) gr) != NULL)
errorx(1, "unable to cache group name, already exists");
- if (rbinsert(grcache_bygid, (VOID *) gr) != NULL)
+ if (rbinsert(grcache_bygid, (void *) gr) != NULL)
errorx(1, "unable to cache gid, already exists");
return(gr);
} else {
memcpy(cp, name, len);
gr->gr_name = cp;
gr->gr_gid = (gid_t) -1;
- if (rbinsert(grcache_byname, (VOID *) gr) != NULL)
+ if (rbinsert(grcache_byname, (void *) gr) != NULL)
errorx(1, "unable to cache group name, already exists");
return(NULL);
}
static void rotate_left __P((struct rbtree *, struct rbnode *));
static void rotate_right __P((struct rbtree *, struct rbnode *));
static void _rbdestroy __P((struct rbtree *, struct rbnode *,
- void (*)(VOID *)));
+ void (*)(void *)));
/*
* Red-Black tree, see http://en.wikipedia.org/wiki/Red-black_tree
*/
struct rbtree *
rbcreate(compar)
- int (*compar)__P((const VOID *, const VOID*));
+ int (*compar)__P((const void *, const void*));
{
struct rbtree *tree;
struct rbnode *
rbinsert(tree, data)
struct rbtree *tree;
- VOID *data;
+ void *data;
{
struct rbnode *node = rbfirst(tree);
struct rbnode *parent = rbroot(tree);
struct rbnode *
rbfind(tree, key)
struct rbtree *tree;
- VOID *key;
+ void *key;
{
struct rbnode *node = rbfirst(tree);
int res;
rbapply_node(tree, node, func, cookie, order)
struct rbtree *tree;
struct rbnode *node;
- int (*func)__P((VOID *, VOID *));
- VOID *cookie;
+ int (*func)__P((void *, void *));
+ void *cookie;
enum rbtraversal order;
{
int error;
_rbdestroy(tree, node, destroy)
struct rbtree *tree;
struct rbnode *node;
- void (*destroy)__P((VOID *));
+ void (*destroy)__P((void *));
{
if (node != rbnil(tree)) {
_rbdestroy(tree, node->left, destroy);
void
rbdestroy(tree, destroy)
struct rbtree *tree;
- void (*destroy)__P((VOID *));
+ void (*destroy)__P((void *));
{
_rbdestroy(tree, rbfirst(tree), destroy);
efree(tree);
/*
* Delete victim from tree and return its data pointer.
*/
-VOID *
+void *
rbdelete(tree, victim)
struct rbtree *tree;
struct rbnode *victim;
{
struct rbnode *pred, *succ;
- VOID *data;
+ void *data;
if (victim->left != rbnil(tree) && victim->right != rbnil(tree)) {
succ = rbsuccessor(tree, victim);
struct rbnode {
struct rbnode *left, *right, *parent;
- VOID *data;
+ void *data;
enum rbcolor color;
};
struct rbtree {
- int (*compar) __P((const VOID *, const VOID *));
+ int (*compar) __P((const void *, const void *));
struct rbnode root;
struct rbnode nil;
};
#define rbroot(t) (&(t)->root)
#define rbnil(t) (&(t)->nil)
-VOID *rbdelete __P((struct rbtree *, struct rbnode *));
+void *rbdelete __P((struct rbtree *, struct rbnode *));
int rbapply_node __P((struct rbtree *, struct rbnode *,
- int (*)(VOID *, VOID *), VOID *,
+ int (*)(void *, void *), void *,
enum rbtraversal));
-struct rbnode *rbfind __P((struct rbtree *, VOID *));
-struct rbnode *rbinsert __P((struct rbtree *, VOID *));
-struct rbtree *rbcreate __P((int (*)(const VOID *, const VOID *)));
-void rbdestroy __P((struct rbtree *, void (*)(VOID *)));
+struct rbnode *rbfind __P((struct rbtree *, void *));
+struct rbnode *rbinsert __P((struct rbtree *, void *));
+struct rbtree *rbcreate __P((int (*)(const void *, const void *)));
+void rbdestroy __P((struct rbtree *, void (*)(void *)));
#endif /* _SUDO_REDBLACK_H */
#define BUF 68
#ifndef HAVE_MEMCHR
-VOID *
+void *
memchr(s, c, n)
- const VOID *s;
+ const void *s;
unsigned char c;
size_t n;
{
do {
if (*p++ == c)
- return ((VOID *)(p - 1));
+ return ((void *)(p - 1));
} while (--n != 0);
}
return (NULL);
* defined manner.''
* -- ANSI X3J11
*/
- ulval = (unsigned long)va_arg(ap, VOID *);
+ ulval = (unsigned long)va_arg(ap, void *);
base = 16;
xdigs = "0123456789abcdef";
flags = (flags & ~QUADINT) | HEXPREFIX;
int sudo_mode;
int pwflag;
sigaction_t sa;
- VOID *ld = NULL;
+ void *ld = NULL;
#if defined(SUDO_DEVEL) && defined(__OpenBSD__)
extern char *malloc_options;
malloc_options = "AFGJPR";
size_t strlcpy __P((char *, const char *, size_t));
#endif
#ifndef HAVE_MEMRCHR
-VOID *memrchr __P((const VOID *, int, size_t));
+void *memrchr __P((const void *, int, size_t));
#endif
#ifndef HAVE_MKSTEMP
int mkstemp __P((char *));
int sudoers_lookup __P((int));
int parse_sudoers __P((const char *));
#ifdef HAVE_LDAP
-int sudo_ldap_check __P((VOID *, int));
-void sudo_ldap_display_privs __P((VOID *, struct passwd *));
-int sudo_ldap_display_cmnd __P((VOID *, struct passwd *));
-void sudo_ldap_update_defaults __P((VOID *));
-VOID *sudo_ldap_open __P((void));
-void sudo_ldap_close __P((VOID *));
+int sudo_ldap_check __P((void *, int));
+void sudo_ldap_display_privs __P((void *, struct passwd *));
+int sudo_ldap_display_cmnd __P((void *, struct passwd *));
+void sudo_ldap_update_defaults __P((void *));
+void *sudo_ldap_open __P((void));
+void sudo_ldap_close __P((void *));
#endif
void set_perms __P((int));
void remove_timestamp __P((int));
void pam_attempt_auth __P((void));
int yyparse __P((void));
void pass_warn __P((FILE *));
-VOID *emalloc __P((size_t));
-VOID *emalloc2 __P((size_t, size_t));
-VOID *erealloc __P((VOID *, size_t));
-VOID *erealloc3 __P((VOID *, size_t, size_t));
+void *emalloc __P((size_t));
+void *emalloc2 __P((size_t, size_t));
+void *erealloc __P((void *, size_t));
+void *erealloc3 __P((void *, size_t, size_t));
char *estrdup __P((const char *));
int easprintf __P((char **, const char *, ...))
__printflike(2, 3);
int evasprintf __P((char **, const char *, va_list))
__printflike(2, 0);
-void efree __P((VOID *));
+void efree __P((void *));
void dump_defaults __P((void));
void dump_auth_methods __P((void));
void init_envtables __P((void));
int set_runaspw __P((char *));
char *sudo_getepw __P((const struct passwd *));
int pam_prep_user __P((struct passwd *));
-void zero_bytes __P((volatile VOID *, size_t));
+void zero_bytes __P((volatile void *, size_t));
int gettime __P((struct timespec *));
FILE *open_sudoers __P((const char *, int *));
-void display_privs __P((VOID *, struct passwd *));
-int display_cmnd __P((VOID *, struct passwd *));
+void display_privs __P((void *, struct passwd *));
+int display_cmnd __P((void *, struct passwd *));
int get_ttycols __P((void));
void sudo_setenv __P((const char *, const char *, int));
void sudo_unsetenv __P((const char *));
extern char *optarg;
extern int optind;
-int print_alias __P((VOID *, VOID *));
+int print_alias __P((void *, void *));
void dump_sudoers __P((void));
void print_defaults __P((void));
void print_privilege __P((struct privilege *));
int
print_alias(v1, v2)
- VOID *v1, *v2;
+ void *v1, *v2;
{
struct alias *a = (struct alias *)v1;
struct member *m;
static int check_syntax __P((char *, int));
static int edit_sudoers __P((struct sudoersfile *, char *, char *, int));
static int install_sudoers __P((struct sudoersfile *));
-static int print_unused __P((VOID *, VOID *));
+static int print_unused __P((void *, void *));
static int reparse_sudoers __P((char *, char *, int, int));
static int run_command __P((char *, char **));
static void setup_signals __P((void));
static int
print_unused(v1, v2)
- VOID *v1;
- VOID *v2;
+ void *v1;
+ void *v2;
{
struct alias *a = (struct alias *)v1;
char *prefix = (char *)v2;
*/
void
zero_bytes(v, n)
- volatile VOID *v;
+ volatile void *v;
size_t n;
{
volatile char *p, *ep;