From d0cec300c804eb94f84bdb473becf34ff876eb5d Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Sep 08 2020 15:41:52 +0000 Subject: Do not use deprecated flask.h and av_permissions.h --- diff --git a/apps/apputil.c b/apps/apputil.c index 1937645..28d3137 100644 --- a/apps/apputil.c +++ b/apps/apputil.c @@ -26,8 +26,6 @@ #include #ifdef WITH_SELINUX #include -#include -#include #include #endif #include "../lib/error.h" @@ -57,7 +55,7 @@ check_access(const char *chuser, access_vector_t access) retval = security_compute_av(user_context, user_context, - SECCLASS_PASSWD, + string_to_security_class("passwd"), access, &avd); if (retval == 0 && (avd.allowed & access) == access) @@ -221,7 +219,8 @@ lu_authenticate_unprivileged(struct lu_context *ctx, const char *user, #ifdef WITH_SELINUX if (is_selinux_enabled() > 0) { /* FIXME: PASSWD_CHSH, PASSWD_PASSWD ? */ - if (getuid() == 0 && check_access(user, PASSWD__CHFN) != 0) { + if (getuid() == 0 && + check_access(user, string_to_av_perm(string_to_security_class("passwd"), "chfn")) != 0) { security_context_t user_context; if (getprevcon(&user_context) < 0)