diff options
author | Guillem Jover <guillem@debian.org> | 2015-02-11 06:50:35 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2015-03-30 20:06:11 +0200 |
commit | 19966da8950830948181ee707858384d3a11effb (patch) | |
tree | 10fd85f2511deaa01df6d4ce98362a908163c37b /src | |
parent | ad959d4c7bced43649b1aefc30beadc06f93111a (diff) | |
download | dpkg-19966da8950830948181ee707858384d3a11effb.tar.gz |
dpkg-statoverride: Set the SE Linux context on --update
When we update the file, we should apply the SE Linux context in the
same way we are doing while unpacking binary packages.
Closes: #690361
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 5 | ||||
-rw-r--r-- | src/statcmd.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 09a7330ce..2d776dd9a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -78,9 +78,14 @@ dpkg_query_SOURCES = \ dpkg_statoverride_SOURCES = \ filesdb.c \ infodb-format.c \ + selinux.c \ statdb.c \ statcmd.c +dpkg_statoverride_LDADD = \ + $(LDADD) \ + $(SELINUX_LIBS) + dpkg_trigger_SOURCES = \ trigcmd.c diff --git a/src/statcmd.c b/src/statcmd.c index 39006527c..ffccf410d 100644 --- a/src/statcmd.c +++ b/src/statcmd.c @@ -167,6 +167,10 @@ statdb_node_apply(const char *filename, struct file_stat *filestat) ohshite(_("error setting ownership of `%.255s'"), filename); if (chmod(filename, filestat->mode)) ohshite(_("error setting permissions of `%.255s'"), filename); + + dpkg_selabel_load(); + dpkg_selabel_set_context(filename, filename, filestat->mode); + dpkg_selabel_close(); } static void |