diff options
author | Damien Miller <djm@mindrot.org> | 2011-02-04 11:42:11 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2011-02-04 11:42:11 +1100 |
commit | 8ba5292c25655a1002ec790f5840a7b8420091bf (patch) | |
tree | 83bde87ca0908652b3a87ea86221dae1afaacf48 /openbsd-compat | |
parent | d4a5504cb19acf061bc6d68362b666416b21d9b3 (diff) |
cherry-pick
20110125
- (djm) [configure.ac Makefile.in ssh.c openbsd-compat/port-linux.c
openbsd-compat/port-linux.h] Move SELinux-specific code from ssh.c to
port-linux.c to avoid compilation errors. Add -lselinux to ssh when
building with SELinux support to avoid linking failure; report from
amk AT spamfence.net; ok dtucker
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/port-linux.c | 16 | ||||
-rw-r--r-- | openbsd-compat/port-linux.h | 2 |
2 files changed, 8 insertions, 10 deletions
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c index eb280e616..ee4290b98 100644 --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: port-linux.c,v 1.13 2011/01/27 23:30:20 djm Exp $ */ | 1 | /* $Id: port-linux.c,v 1.11.4.1 2011/02/04 00:42:21 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2005 Daniel Walsh <dwalsh@redhat.com> | 4 | * Copyright (c) 2005 Daniel Walsh <dwalsh@redhat.com> |
@@ -209,15 +209,13 @@ ssh_selinux_change_context(const char *newname) | |||
209 | void | 209 | void |
210 | ssh_selinux_setfscreatecon(const char *path) | 210 | ssh_selinux_setfscreatecon(const char *path) |
211 | { | 211 | { |
212 | security_context_t context; | 212 | security_context_t context; |
213 | 213 | ||
214 | if (!ssh_selinux_enabled()) | 214 | if (path == NULL) { |
215 | return; | 215 | setfscreatecon(NULL); |
216 | if (path == NULL) | 216 | return; |
217 | setfscreatecon(NULL); | 217 | } |
218 | return; | 218 | matchpathcon(path, 0700, &context); |
219 | } | ||
220 | if (matchpathcon(path, 0700, &context) == 0) | ||
221 | setfscreatecon(context); | 219 | setfscreatecon(context); |
222 | } | 220 | } |
223 | 221 | ||
diff --git a/openbsd-compat/port-linux.h b/openbsd-compat/port-linux.h index e3d1004aa..c2f618400 100644 --- a/openbsd-compat/port-linux.h +++ b/openbsd-compat/port-linux.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: port-linux.h,v 1.5 2011/01/25 01:16:18 djm Exp $ */ | 1 | /* $Id: port-linux.h,v 1.4.10.1 2011/02/04 00:42:21 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2006 Damien Miller <djm@openbsd.org> | 4 | * Copyright (c) 2006 Damien Miller <djm@openbsd.org> |