This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=4479118bca43859d5c6f85dd1f1b6bbc9d57c3f9 commit 4479118bca43859d5c6f85dd1f1b6bbc9d57c3f9 Author: Guillem Jover <[email protected]> AuthorDate: Fri Jun 25 14:27:49 2021 +0200 dpkg: Move SE Linux function declarations into its own header file This is generic functionality to be used by various tools, not just dpkg itself. Changelog: internal --- src/Makefile.am | 2 ++ src/main.h | 7 +------ src/{file-match.h => security-mac.h} | 23 +++++++++-------------- src/selinux.c | 1 + src/statcmd.c | 1 + 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 3a968639a..2d3efb9da 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -38,6 +38,7 @@ dpkg_SOURCES = \ perpkgstate.c \ remove.c \ script.c \ + security-mac.h \ select.c \ selinux.c \ trigproc.c \ @@ -58,6 +59,7 @@ dpkg_query_SOURCES = \ dpkg_statoverride_SOURCES = \ force.c force.h \ + security-mac.h \ selinux.c \ statcmd.c diff --git a/src/main.h b/src/main.h index 1a7a443d4..db98aaaec 100644 --- a/src/main.h +++ b/src/main.h @@ -26,6 +26,7 @@ #include <dpkg/pkg-list.h> #include "force.h" +#include "security-mac.h" /* These two are defined in <dpkg/fsys.h>. */ struct fsys_namenode_list; @@ -317,12 +318,6 @@ dir_has_conffiles(struct fsys_namenode *namenode, struct pkginfo *pkg); void log_action(const char *action, struct pkginfo *pkg, struct pkgbin *pkgbin); -/* From selinux.c */ - -void dpkg_selabel_load(void); -void dpkg_selabel_set_context(const char *matchpath, const char *path, mode_t mode); -void dpkg_selabel_close(void); - /* from trigproc.c */ enum trigproc_type { diff --git a/src/file-match.h b/src/security-mac.h similarity index 62% copy from src/file-match.h copy to src/security-mac.h index db7a40bab..637c6f727 100644 --- a/src/file-match.h +++ b/src/security-mac.h @@ -1,8 +1,8 @@ /* * dpkg - main program for package management - * file-match.h - file name/type match tracking functions + * security-mac.h - MAC-based security support * - * Copyright © 2011 Guillem Jover <[email protected]> + * Copyright © 2015 Guillem Jover <[email protected]> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,18 +18,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -#ifndef DPKG_FILE_MATCH_H -#define DPKG_FILE_MATCH_H +#ifndef DPKG_SECURITY_MAC_H +#define DPKG_SECURITY_MAC_H -struct match_node { - struct match_node *next; - char *filetype; - char *filename; -}; +#include <sys/stat.h> -struct match_node * -match_node_new(const char *name, const char *type, struct match_node *next); -void -match_node_free(struct match_node *node); +void dpkg_selabel_load(void); +void dpkg_selabel_set_context(const char *matchpath, const char *path, mode_t mode); +void dpkg_selabel_close(void); -#endif /* DPKG_FILE_MATCH_H */ +#endif /* DPKG_SECURITY_MAC_H */ diff --git a/src/selinux.c b/src/selinux.c index de361aa8d..29237e360 100644 --- a/src/selinux.c +++ b/src/selinux.c @@ -38,6 +38,7 @@ #endif #include "main.h" +#include "security-mac.h" #ifdef WITH_LIBSELINUX static struct selabel_handle *sehandle; diff --git a/src/statcmd.c b/src/statcmd.c index 303e14176..7bc5dd000 100644 --- a/src/statcmd.c +++ b/src/statcmd.c @@ -49,6 +49,7 @@ #include "force.h" #include "main.h" +#include "security-mac.h" static const char printforhelp[] = N_( "Use --help for help about overriding file stat information."); -- Dpkg.Org's dpkg

