diff options
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.366 2011/09/23 07:45:05 markus Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.367 2011/10/18 05:15:28 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -886,17 +886,20 @@ main(int ac, char **av) | |||
886 | * Now that we are back to our own permissions, create ~/.ssh | 886 | * Now that we are back to our own permissions, create ~/.ssh |
887 | * directory if it doesn't already exist. | 887 | * directory if it doesn't already exist. |
888 | */ | 888 | */ |
889 | r = snprintf(buf, sizeof buf, "%s%s%s", pw->pw_dir, | 889 | if (config == NULL) { |
890 | strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR); | 890 | r = snprintf(buf, sizeof buf, "%s%s%s", pw->pw_dir, |
891 | if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) { | 891 | strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR); |
892 | if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) { | ||
892 | #ifdef WITH_SELINUX | 893 | #ifdef WITH_SELINUX |
893 | ssh_selinux_setfscreatecon(buf); | 894 | ssh_selinux_setfscreatecon(buf); |
894 | #endif | 895 | #endif |
895 | if (mkdir(buf, 0700) < 0) | 896 | if (mkdir(buf, 0700) < 0) |
896 | error("Could not create directory '%.200s'.", buf); | 897 | error("Could not create directory '%.200s'.", |
898 | buf); | ||
897 | #ifdef WITH_SELINUX | 899 | #ifdef WITH_SELINUX |
898 | ssh_selinux_setfscreatecon(NULL); | 900 | ssh_selinux_setfscreatecon(NULL); |
899 | #endif | 901 | #endif |
902 | } | ||
900 | } | 903 | } |
901 | /* load options.identity_files */ | 904 | /* load options.identity_files */ |
902 | load_public_identity_files(); | 905 | load_public_identity_files(); |