diff options
author | Guillem Jover <guillem@debian.org> | 2012-11-20 18:05:02 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-08-09 22:04:12 +0200 |
commit | 5362b6e879ee26323d8257e474d4c94a2b242592 (patch) | |
tree | ebf86c1e554d592c2468fb60943cbd517051560a /src | |
parent | f1cdf4ad022189d3e840543bc2e854c67903b40b (diff) | |
download | dpkg-5362b6e879ee26323d8257e474d4c94a2b242592.tar.gz |
dpkg: Use SELinux setexecfilecon() if available instead of ad-hoc code
There's no point in duplicating all this code in dpkg, when this is
provided now by libselinux.
Diffstat (limited to 'src')
-rw-r--r-- | src/script.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/script.c b/src/script.c index ea96fe17a..e776611bd 100644 --- a/src/script.c +++ b/src/script.c @@ -146,6 +146,9 @@ maintscript_set_exec_context(struct command *cmd, const char *fallback) { int rc = 0; #ifdef WITH_SELINUX +#if HAVE_SETEXECFILECON + rc = setexecfilecon(cmd->filename, fallback); +#else security_context_t curcon = NULL, newcon = NULL, filecon = NULL; context_t tmpcon = NULL; @@ -189,6 +192,7 @@ out: freecon(curcon); freecon(filecon); #endif +#endif return rc < 0 ? rc : 0; } |