summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/auth.c b/auth.c
index 33680b91b..cd95da931 100644
--- a/auth.c
+++ b/auth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.c,v 1.91 2010/11/29 23:45:51 djm Exp $ */ 1/* $OpenBSD: auth.c,v 1.94 2011/05/23 03:33:38 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * 4 *
@@ -331,7 +331,7 @@ auth_root_allowed(char *method)
331 * 331 *
332 * This returns a buffer allocated by xmalloc. 332 * This returns a buffer allocated by xmalloc.
333 */ 333 */
334static char * 334char *
335expand_authorized_keys(const char *filename, struct passwd *pw) 335expand_authorized_keys(const char *filename, struct passwd *pw)
336{ 336{
337 char *file, ret[MAXPATHLEN]; 337 char *file, ret[MAXPATHLEN];
@@ -355,18 +355,6 @@ expand_authorized_keys(const char *filename, struct passwd *pw)
355} 355}
356 356
357char * 357char *
358authorized_keys_file(struct passwd *pw)
359{
360 return expand_authorized_keys(options.authorized_keys_file, pw);
361}
362
363char *
364authorized_keys_file2(struct passwd *pw)
365{
366 return expand_authorized_keys(options.authorized_keys_file2, pw);
367}
368
369char *
370authorized_principals_file(struct passwd *pw) 358authorized_principals_file(struct passwd *pw)
371{ 359{
372 if (options.authorized_principals_file == NULL) 360 if (options.authorized_principals_file == NULL)
@@ -468,7 +456,6 @@ secure_filename(FILE *f, const char *file, struct passwd *pw,
468 } 456 }
469 strlcpy(buf, cp, sizeof(buf)); 457 strlcpy(buf, cp, sizeof(buf));
470 458
471 debug3("secure_filename: checking '%s'", buf);
472 if (stat(buf, &st) < 0 || 459 if (stat(buf, &st) < 0 ||
473 (st.st_uid != 0 && st.st_uid != uid) || 460 (st.st_uid != 0 && st.st_uid != uid) ||
474 (st.st_mode & 022) != 0) { 461 (st.st_mode & 022) != 0) {
@@ -478,11 +465,9 @@ secure_filename(FILE *f, const char *file, struct passwd *pw,
478 } 465 }
479 466
480 /* If are past the homedir then we can stop */ 467 /* If are past the homedir then we can stop */
481 if (comparehome && strcmp(homedir, buf) == 0) { 468 if (comparehome && strcmp(homedir, buf) == 0)
482 debug3("secure_filename: terminating check at '%s'",
483 buf);
484 break; 469 break;
485 } 470
486 /* 471 /*
487 * dirname should always complete with a "/" path, 472 * dirname should always complete with a "/" path,
488 * but we can be paranoid and check for "." too 473 * but we can be paranoid and check for "." too