summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2001-05-01 04:15:33 +0000
committerAndrew G. Morgan <morgan@kernel.org>2001-05-01 04:15:33 +0000
commitd1a76fd910d68bbc660ea2be9120bad62b8c9af0 (patch)
tree2a7264f347a6d716debc50f0b95ee57823a2bdce /modules
parent7143eaf024a740627da96c69d960051816c5b593 (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_access/pam_access.c9
1 files changed, 5 insertions, 4 deletions
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 <saw@msu.ru>
*/
+
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))