diff options
author | Colin Watson <cjwatson@debian.org> | 2011-09-06 09:45:52 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2011-09-06 09:45:52 +0100 |
commit | f38224d546cdde55f45c13d3d8225d273a3f920e (patch) | |
tree | a91a26b88ac90dc72d0ea3767feabb341eaa50a8 /auth.c | |
parent | 338146a3fc257e216fe5c10fe40e6896b40d7739 (diff) | |
parent | e90790abaf031e037f444a6658e136e48577ea49 (diff) |
merge 5.9p1
Diffstat (limited to 'auth.c')
-rw-r--r-- | auth.c | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -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 | */ |
334 | static char * | 334 | char * |
335 | expand_authorized_keys(const char *filename, struct passwd *pw) | 335 | expand_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 | ||
357 | char * | 357 | char * |
358 | authorized_keys_file(struct passwd *pw) | ||
359 | { | ||
360 | return expand_authorized_keys(options.authorized_keys_file, pw); | ||
361 | } | ||
362 | |||
363 | char * | ||
364 | authorized_keys_file2(struct passwd *pw) | ||
365 | { | ||
366 | return expand_authorized_keys(options.authorized_keys_file2, pw); | ||
367 | } | ||
368 | |||
369 | char * | ||
370 | authorized_principals_file(struct passwd *pw) | 358 | authorized_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 |