From d1a76fd910d68bbc660ea2be9120bad62b8c9af0 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Tue, 1 May 2001 04:15:33 +0000 Subject: Relevant BUGIDs: 419631 Purpose of commit: bugfix Commit summary: --------------- Bring the module in to line with its documentation. The README refers to a trailing '.' on IP addresses. --- modules/pam_access/pam_access.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules/pam_access') diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 87ad708d..33bf767f 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -345,8 +345,9 @@ static int from_match(char *tok, struct login_info *item) by "string" starts from "tok". 1998/01/27 Andrey V. Savochkin */ + struct hostent *h; - char hn[3+1+3+1+3+1+3+1]; + char hn[3+1+3+1+3+1+3+1+1]; int r; h = gethostbyname(string); @@ -356,9 +357,9 @@ static int from_match(char *tok, struct login_info *item) return (NO); if (h->h_length != 4) return (NO); /* only IPv4 addresses (SAW) */ - r = snprintf(hn, sizeof(hn), "%u.%u.%u.%u", - (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], - (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); + r = snprintf(hn, sizeof(hn), "%u.%u.%u.%u.", + (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], + (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); if (r < 0 || r >= sizeof(hn)) return (NO); if (!strncmp(tok, hn, tok_len)) -- cgit v1.2.3