summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/auth.c b/auth.c
index 0b7a335fc..573cd03b0 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.c,v 1.128 2018/05/25 07:11:01 djm Exp $ */ 1/* $OpenBSD: auth.c,v 1.129 2018/06/01 03:33:53 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -422,11 +422,13 @@ auth_root_allowed(struct ssh *ssh, const char *method)
422char * 422char *
423expand_authorized_keys(const char *filename, struct passwd *pw) 423expand_authorized_keys(const char *filename, struct passwd *pw)
424{ 424{
425 char *file, ret[PATH_MAX]; 425 char *file, uidstr[32], ret[PATH_MAX];
426 int i; 426 int i;
427 427
428 snprintf(uidstr, sizeof(uidstr), "%llu",
429 (unsigned long long)pw->pw_uid);
428 file = percent_expand(filename, "h", pw->pw_dir, 430 file = percent_expand(filename, "h", pw->pw_dir,
429 "u", pw->pw_name, (char *)NULL); 431 "u", pw->pw_name, "U", uidstr, (char *)NULL);
430 432
431 /* 433 /*
432 * Ensure that filename starts anchored. If not, be backward 434 * Ensure that filename starts anchored. If not, be backward