mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-23 18:05:42 +08:00
3aaa42deaa
Ubuntu 20.10 is using a newer version of libselinux that complains that matchpathcon is obsolete. Rewrite the code that it uses the recommended selabel_lookup instead. * m4/jm-macros.m4 (coreutils_MACROS): Do not check for matchpathcon_init_prefix, as it is no longer used. * src/copy.c (set_file_security_ctx): Omit process_local arg, as it is equivalent to !x->set_security_context. All callers changed. * src/copy.h (struct cp_options): set_security_context is now of type struct selabel_handle *, not bool. All uses changed. * src/cp.c, src/install.c, src/mkdir.c, src/mkfifo.c, src/mknod.c: * src/mv.c: Include selinux/label.h. (main): Use selabel_open for set_security context. * src/install.c (matchpathcon_init_prefix): Remove; now unused. (get_labeling_handle): New static function. (setdefaultfilecon, main): Use it. (setdefaultfilecon): Do something regardless of ENABLE_MATCHPATHCON, which seems to be a revenant macro. (setdefaultfilecon): Use selabel_lookup instead of the obsolescent matchpathcon. Report an error unless it fails due to ENOENT. * src/local.mk (src_ginstall_CPPFLAGS): Remove. * src/selinux.c: Include selinux/label.h Do not include die.h, error.h, canonicalize.h. (defaultcon, restorecon_private, restorecon): New arg HANDLE. All callers changed. Use selabel_lookup rather than matchpathcon. (restorecon_private, restorecon): Don’t lose track of errno. * src/selinux.c, src/selinux.h: (restorecon): Don’t call ‘error’; that’s the caller’s job. Use HAVE_SELINUX_LABEL_H, not HAVE_SELINUX_SELINUX_H, in case there is some weird system with the former but not the latter. * src/selinux.h (struct selinux_handle): Add forward decl. |
||
---|---|---|
.. | ||
boottime.m4 | ||
check-decl.m4 | ||
include-exclude-prog.m4 | ||
jm-macros.m4 | ||
prereq.m4 | ||
stat-prog.m4 | ||
xattr.m4 |