summaryrefslogtreecommitdiff
path: root/hostfile.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2020-06-26 15:30:06 +1000
committerDamien Miller <djm@mindrot.org>2020-06-26 15:30:06 +1000
commit32b2502a9dfdfded1ccdc1fd6dc2b3fe41bfc205 (patch)
tree8d46d19a64c554e86af54936a8f35bded680f622 /hostfile.c
parente073106f370cdd2679e41f6f55a37b491f0e82fe (diff)
missing ifdef SELINUX; spotted by dtucker
Diffstat (limited to 'hostfile.c')
-rw-r--r--hostfile.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hostfile.c b/hostfile.c
index 4b39def04..1cc4dba92 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -471,13 +471,17 @@ hostfile_create_user_ssh_dir(const char *filename, int notify)
471 else if (errno != ENOENT) 471 else if (errno != ENOENT)
472 error("Could not stat %s: %s", dotsshdir, strerror(errno)); 472 error("Could not stat %s: %s", dotsshdir, strerror(errno));
473 else { 473 else {
474#ifdef WITH_SELINUX
474 ssh_selinux_setfscreatecon(dotsshdir); 475 ssh_selinux_setfscreatecon(dotsshdir);
476#endif
475 if (mkdir(dotsshdir, 0700) == -1) 477 if (mkdir(dotsshdir, 0700) == -1)
476 error("Could not create directory '%.200s' (%s).", 478 error("Could not create directory '%.200s' (%s).",
477 dotsshdir, strerror(errno)); 479 dotsshdir, strerror(errno));
478 else if (notify) 480 else if (notify)
479 logit("Created directory '%s'.", dotsshdir); 481 logit("Created directory '%s'.", dotsshdir);
482#ifdef WITH_SELINUX
480 ssh_selinux_setfscreatecon(NULL); 483 ssh_selinux_setfscreatecon(NULL);
484#endif
481 } 485 }
482 free(dotsshdir); 486 free(dotsshdir);
483} 487}