summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-09-12 15:20:15 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-09-12 15:20:15 +0000
commitd2542f192cb5097a45c36b7148efa3136dc5d76c (patch)
tree2c040f9e436c710188a50de01dfacf790e2e27e3 /lib
parent9c4c4a9b6433533d87e6e04c082fd31b2af0a469 (diff)
Wrap <bsd_auth.h> so that calls go direct and the symbols are all weak
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/auth_subr.c23
-rw-r--r--lib/libc/gen/authenticate.c11
-rw-r--r--lib/libc/hidden/bsd_auth.h54
3 files changed, 86 insertions, 2 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c
index 769fb35e4c5..f35b5741522 100644
--- a/lib/libc/gen/auth_subr.c
+++ b/lib/libc/gen/auth_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth_subr.c,v 1.43 2015/09/03 04:27:49 daniel Exp $ */
+/* $OpenBSD: auth_subr.c,v 1.44 2015/09/12 15:20:14 guenther Exp $ */
/*
* Copyright (c) 2000-2002,2004 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -151,6 +151,10 @@ void auth_setstate(auth_session_t *as, int s){ as->state = s; }
void auth_set_va_list(auth_session_t *as, va_list ap) { va_copy(as->ap, ap); }
int auth_getstate(auth_session_t *as) { return (as->state); }
struct passwd *auth_getpwd(auth_session_t *as) { return (as->pwd); }
+DEF_WEAK(auth_setstate);
+DEF_WEAK(auth_set_va_list);
+DEF_WEAK(auth_getstate);
+DEF_WEAK(auth_getpwd);
/*
* Open a new BSD Authentication session with the default service
@@ -168,6 +172,7 @@ auth_open(void)
return (as);
}
+DEF_WEAK(auth_open);
/*
* Clean the specified BSD Authentication session.
@@ -214,6 +219,7 @@ auth_clean(auth_session_t *as)
as->fd = -1;
}
}
+DEF_WEAK(auth_clean);
/*
* Close the specified BSD Authentication session.
@@ -290,6 +296,7 @@ auth_close(auth_session_t *as)
free(as);
return (s);
}
+DEF_WEAK(auth_close);
/*
* Request a challenge for the session.
@@ -323,6 +330,7 @@ auth_challenge(auth_session_t *as)
as->index = 0; /* toss our data */
return (as->challenge);
}
+DEF_WEAK(auth_challenge);
/*
* Set/unset the requested environment variables.
@@ -379,6 +387,7 @@ auth_setenv(auth_session_t *as)
;
}
}
+DEF_WEAK(auth_setenv);
/*
* Clear out any requested environment variables.
@@ -403,6 +412,7 @@ auth_clrenv(auth_session_t *as)
;
}
}
+DEF_WEAK(auth_clrenv);
char *
auth_getitem(auth_session_t *as, auth_item_t item)
@@ -427,6 +437,7 @@ auth_getitem(auth_session_t *as, auth_item_t item)
}
return (NULL);
}
+DEF_WEAK(auth_getitem);
int
auth_setitem(auth_session_t *as, auth_item_t item, char *value)
@@ -515,6 +526,7 @@ auth_setitem(auth_session_t *as, auth_item_t item, char *value)
return (-1);
}
}
+DEF_WEAK(auth_setitem);
int
auth_setoption(auth_session_t *as, char *n, char *v)
@@ -538,6 +550,7 @@ auth_setoption(auth_session_t *as, char *n, char *v)
as->optlist = opt;
return(0);
}
+DEF_WEAK(auth_setoption);
void
auth_clroptions(auth_session_t *as)
@@ -549,6 +562,7 @@ auth_clroptions(auth_session_t *as)
free(opt);
}
}
+DEF_WEAK(auth_clroptions);
void
auth_clroption(auth_session_t *as, char *option)
@@ -578,6 +592,7 @@ auth_clroption(auth_session_t *as, char *option)
opt = oopt;
}
}
+DEF_WEAK(auth_clroption);
int
auth_setdata(auth_session_t *as, void *ptr, size_t len)
@@ -604,6 +619,7 @@ auth_setdata(auth_session_t *as, void *ptr, size_t len)
}
return (0);
}
+DEF_WEAK(auth_setdata);
int
auth_setpwd(auth_session_t *as, struct passwd *pwd)
@@ -644,6 +660,7 @@ auth_setpwd(auth_session_t *as, struct passwd *pwd)
as->pwd = pwd;
return (0);
}
+DEF_WEAK(auth_setpwd);
char *
auth_getvalue(auth_session_t *as, char *what)
@@ -720,6 +737,7 @@ next:
}
return (NULL);
}
+DEF_WEAK(auth_getvalue);
quad_t
auth_check_expire(auth_session_t *as)
@@ -746,6 +764,7 @@ auth_check_expire(auth_session_t *as)
}
return (0);
}
+DEF_WEAK(auth_check_expire);
quad_t
auth_check_change(auth_session_t *as)
@@ -772,6 +791,7 @@ auth_check_change(auth_session_t *as)
}
return (0);
}
+DEF_WEAK(auth_check_change);
/*
* The down and dirty call to the login script
@@ -980,6 +1000,7 @@ fail:
}
return (okay);
}
+DEF_WEAK(auth_call);
static void
_recv_fd(auth_session_t *as, int fd)
diff --git a/lib/libc/gen/authenticate.c b/lib/libc/gen/authenticate.c
index 4ab4a600b64..3043836777a 100644
--- a/lib/libc/gen/authenticate.c
+++ b/lib/libc/gen/authenticate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authenticate.c,v 1.22 2015/08/31 02:53:57 guenther Exp $ */
+/* $OpenBSD: authenticate.c,v 1.23 2015/09/12 15:20:14 guenther Exp $ */
/*-
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@@ -100,6 +100,7 @@ auth_mkvalue(char *value)
*p = '\0';
return (big);
}
+DEF_WEAK(auth_mkvalue);
void
auth_checknologin(login_cap_t *lc)
@@ -107,6 +108,7 @@ auth_checknologin(login_cap_t *lc)
if (_auth_checknologin(lc, 1))
exit(1);
}
+DEF_WEAK(auth_checknologin);
static int
_auth_checknologin(login_cap_t *lc, int print)
@@ -169,6 +171,7 @@ auth_cat(char *file)
(void)close(fd);
return (1);
}
+DEF_WEAK(auth_cat);
int
auth_approval(auth_session_t *as, login_cap_t *lc, char *name, char *type)
@@ -300,6 +303,7 @@ out:
return (auth_close(as));
return (auth_getstate(as) & AUTH_ALLOW);
}
+DEF_WEAK(auth_approval);
auth_session_t *
auth_usercheck(char *name, char *style, char *type, char *password)
@@ -355,6 +359,7 @@ auth_usercheck(char *name, char *style, char *type, char *password)
login_close(lc);
return (as);
}
+DEF_WEAK(auth_usercheck);
int
auth_userokay(char *name, char *style, char *type, char *password)
@@ -365,6 +370,7 @@ auth_userokay(char *name, char *style, char *type, char *password)
return (as != NULL ? auth_close(as) : 0);
}
+DEF_WEAK(auth_userokay);
auth_session_t *
auth_userchallenge(char *name, char *style, char *type, char **challengep)
@@ -417,6 +423,7 @@ auth_userchallenge(char *name, char *style, char *type, char **challengep)
*challengep = auth_challenge(as);
return (as);
}
+DEF_WEAK(auth_userchallenge);
int
auth_userresponse(auth_session_t *as, char *response, int more)
@@ -468,6 +475,7 @@ auth_userresponse(auth_session_t *as, char *response, int more)
return (auth_close(as));
return (auth_getstate(as) & AUTH_ALLOW);
}
+DEF_WEAK(auth_userresponse);
/*
* Authenticate name with the specified style.
@@ -508,3 +516,4 @@ auth_verify(auth_session_t *as, char *style, char *name, ...)
va_end(ap);
return (as);
}
+DEF_WEAK(auth_verify);
diff --git a/lib/libc/hidden/bsd_auth.h b/lib/libc/hidden/bsd_auth.h
new file mode 100644
index 00000000000..1a6cd7d66f3
--- /dev/null
+++ b/lib/libc/hidden/bsd_auth.h
@@ -0,0 +1,54 @@
+/* $OpenBSD: bsd_auth.h,v 1.1 2015/09/12 15:20:14 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
+ *
+ * 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.
+ */
+
+#ifndef _LIBC_BSD_AUTH_H_
+#define _LIBC_BSD_AUTH_H_
+
+#include_next <bsd_auth.h>
+
+PROTO_NORMAL(auth_approval);
+PROTO_NORMAL(auth_call);
+PROTO_NORMAL(auth_cat);
+PROTO_NORMAL(auth_challenge);
+PROTO_NORMAL(auth_check_change);
+PROTO_NORMAL(auth_check_expire);
+PROTO_NORMAL(auth_checknologin);
+PROTO_NORMAL(auth_clean);
+PROTO_NORMAL(auth_close);
+PROTO_NORMAL(auth_clrenv);
+PROTO_NORMAL(auth_clroption);
+PROTO_NORMAL(auth_clroptions);
+PROTO_NORMAL(auth_getitem);
+PROTO_NORMAL(auth_getpwd);
+PROTO_NORMAL(auth_getstate);
+PROTO_NORMAL(auth_getvalue);
+PROTO_NORMAL(auth_mkvalue);
+PROTO_NORMAL(auth_open);
+PROTO_NORMAL(auth_set_va_list);
+PROTO_NORMAL(auth_setdata);
+PROTO_NORMAL(auth_setenv);
+PROTO_NORMAL(auth_setitem);
+PROTO_NORMAL(auth_setoption);
+PROTO_NORMAL(auth_setpwd);
+PROTO_NORMAL(auth_setstate);
+PROTO_NORMAL(auth_userchallenge);
+PROTO_NORMAL(auth_usercheck);
+PROTO_NORMAL(auth_userokay);
+PROTO_NORMAL(auth_userresponse);
+PROTO_NORMAL(auth_verify);
+
+#endif /* _LIBC_BSD_AUTH_H_ */