summaryrefslogtreecommitdiffstats
path: root/lib/libutil
diff options
context:
space:
mode:
authorghelmer <ghelmer@FreeBSD.org>2000-12-31 16:15:06 +0000
committerghelmer <ghelmer@FreeBSD.org>2000-12-31 16:15:06 +0000
commit1a641391629820dfdce27d28a225245a73dcab7a (patch)
treecba248881ff3e8197899c8596aa46dadca2e9425 /lib/libutil
parent27ec6a6ff157f1f82390e9e9b38e7eff340aa203 (diff)
downloadFreeBSD-src-1a641391629820dfdce27d28a225245a73dcab7a.zip
FreeBSD-src-1a641391629820dfdce27d28a225245a73dcab7a.tar.gz
In call to realloc, pass the number of bytes needed, not simply the
number of login time structures. Forward the name of the deny capability rather than hard-coding it in login_hostok.
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/login_ok.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libutil/login_ok.c b/lib/libutil/login_ok.c
index 365528b..4c4724e 100644
--- a/lib/libutil/login_ok.c
+++ b/lib/libutil/login_ok.c
@@ -101,7 +101,7 @@ login_timelist(login_cap_t *lc, char const *cap, int *ltno,
;
if (*ltno >= j)
lt = *ltptr;
- else if ((lt = realloc(*ltptr, j)) != NULL) {
+ else if ((lt = realloc(*ltptr, j * sizeof(struct login_time))) != NULL) {
*ltno = j;
*ltptr = lt;
}
@@ -188,7 +188,7 @@ login_hostok(login_cap_t *lc, const char *host, const char *ip,
rc = 0; /* host or IP not in allow list */
else {
- hl = login_getcaplist(lc, "host.deny", NULL);
+ hl = login_getcaplist(lc, denycap, NULL);
if (hl != NULL && login_str2inlist(hl, host, ip, FNM_CASEFOLD))
rc = 0; /* host or IP in deny list */
}
OpenPOWER on IntegriCloud