summaryrefslogtreecommitdiffstats
path: root/ssh.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-09-10 04:28:24 +0200
committerDarren Tucker <dtucker@zip.com.au>2010-09-10 04:28:24 +0200
commit8ccb7392e7ea45d2997afdfa981a450c7db85211 (patch)
tree5dd0769c5ec6a54fffb0e77a670bdc4e84046a6c /ssh.c
parent - (djm) [authfd.c authfile.c bufec.c buffer.h configure.ac kex.h kexecdh.c] (diff)
downloadopenssh-8ccb7392e7ea45d2997afdfa981a450c7db85211.tar.xz
openssh-8ccb7392e7ea45d2997afdfa981a450c7db85211.zip
- (dtucker) [kex.h key.c packet.h ssh-agent.c ssh.c] A few more ECC ifdefs
for missing headers and compiler warnings.
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)
*/
r = snprintf(buf, sizeof buf, "%s%s%s", pw->pw_dir,
strcmp(pw->pw_dir, "/") ? "/" : "", _PATH_SSH_USER_DIR);
- if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0)
+ if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) {
+#ifdef WITH_SELINUX
+ char *scon;
+
+ matchpathcon(buf, 0700, &scon);
+ setfscreatecon(scon);
+#endif
if (mkdir(buf, 0700) < 0)
error("Could not create directory '%.200s'.", buf);
-
+#ifdef WITH_SELINUX
+ setfscreatecon(NULL);
+#endif
+ }
/* load options.identity_files */
load_public_identity_files();