summaryrefslogtreecommitdiff
path: root/ssh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.c')
-rw-r--r--ssh.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ssh.c b/ssh.c
index 3ade744b6..70c71bc00 100644
--- a/ssh.c
+++ b/ssh.c
@@ -849,10 +849,19 @@ main(int ac, char **av)
849 */ 849 */
850 r = snprintf(buf, sizeof buf, "%s%s%s", pw->pw_dir, 850 r = snprintf(buf, sizeof buf, "%s%s%s", pw->pw_dir,
851 strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR); 851 strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR);
852 if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) 852 if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) {
853#ifdef WITH_SELINUX
854 char *scon;
855
856 matchpathcon(buf, 0700, &scon);
857 setfscreatecon(scon);
858#endif
853 if (mkdir(buf, 0700) < 0) 859 if (mkdir(buf, 0700) < 0)
854 error("Could not create directory '%.200s'.", buf); 860 error("Could not create directory '%.200s'.", buf);
855 861#ifdef WITH_SELINUX
862 setfscreatecon(NULL);
863#endif
864 }
856 /* load options.identity_files */ 865 /* load options.identity_files */
857 load_public_identity_files(); 866 load_public_identity_files();
858 867