summaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2014-02-10 00:27:24 +0000
committerColin Watson <cjwatson@debian.org>2014-02-10 02:40:28 +0000
commita2b8818c5d21cfcba443625251f691a2ea3a29c7 (patch)
tree8fe1fe448cde57eecf71a7bcd57186661b90313f /loginrec.c
parentd399ecd8eb7d4aed3b7ba0d2727e619607fb901b (diff)
parentee8d8b97cc2c6081df3af453a228992b87309ec4 (diff)
Merge 6.5p1.
* New upstream release (http://www.openssh.com/txt/release-6.5, LP: #1275068): - ssh(1): Add support for client-side hostname canonicalisation using a set of DNS suffixes and rules in ssh_config(5). This allows unqualified names to be canonicalised to fully-qualified domain names to eliminate ambiguity when looking up keys in known_hosts or checking host certificate names (closes: #115286).
Diffstat (limited to 'loginrec.c')
-rw-r--r--loginrec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/loginrec.c b/loginrec.c
index 59e8a44ee..4219b9aef 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -310,9 +310,13 @@ login_get_lastlog(struct logininfo *li, const uid_t uid)
310 fatal("%s: Cannot find account for uid %ld", __func__, 310 fatal("%s: Cannot find account for uid %ld", __func__,
311 (long)uid); 311 (long)uid);
312 312
313 /* No MIN_SIZEOF here - we absolutely *must not* truncate the 313 if (strlcpy(li->username, pw->pw_name, sizeof(li->username)) >=
314 * username (XXX - so check for trunc!) */ 314 sizeof(li->username)) {
315 strlcpy(li->username, pw->pw_name, sizeof(li->username)); 315 error("%s: username too long (%lu > max %lu)", __func__,
316 (unsigned long)strlen(pw->pw_name),
317 (unsigned long)sizeof(li->username) - 1);
318 return NULL;
319 }
316 320
317 if (getlast_entry(li)) 321 if (getlast_entry(li))
318 return (li); 322 return (li);
@@ -320,7 +324,6 @@ login_get_lastlog(struct logininfo *li, const uid_t uid)
320 return (NULL); 324 return (NULL);
321} 325}
322 326
323
324/* 327/*
325 * login_alloc_entry(int, char*, char*, char*) - Allocate and initialise 328 * login_alloc_entry(int, char*, char*, char*) - Allocate and initialise
326 * a logininfo structure 329 * a logininfo structure