summaryrefslogtreecommitdiff
path: root/src/chsh.c
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2019-12-05 13:29:31 +0100
committerAndreas Henriksson <andreas@fatal.se>2019-12-05 13:29:31 +0100
commit69d932140c70455a282b6e7115d9caf0cc56d6ff (patch)
treeeda18bc82cc58e5d193e608f00543b2b5b537d49 /src/chsh.c
parentb28d45d2bd2462414b9dbbe38e6c7f3d5f7b462b (diff)
downloadshadow-69d932140c70455a282b6e7115d9caf0cc56d6ff.tar.gz
New upstream version 4.8upstream/4.8
Diffstat (limited to 'src/chsh.c')
-rw-r--r--src/chsh.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/chsh.c b/src/chsh.c
index 910e3dd4..06edf407 100644
--- a/src/chsh.c
+++ b/src/chsh.c
@@ -39,10 +39,6 @@
#include <pwd.h>
#include <stdio.h>
#include <sys/types.h>
-#ifdef WITH_SELINUX
-#include <selinux/selinux.h>
-#include <selinux/av_permissions.h>
-#endif
#include "defines.h"
#include "getdef.h"
#include "nscd.h"
@@ -286,8 +282,7 @@ static void check_perms (const struct passwd *pw)
* check if the change is allowed by SELinux policy.
*/
if ((pw->pw_uid != getuid ())
- && (is_selinux_enabled () > 0)
- && (selinux_check_passwd_access (PASSWD__CHSH) != 0)) {
+ && (check_selinux_permit("chsh") != 0)) {
SYSLOG ((LOG_WARN, "can't change shell for '%s'", pw->pw_name));
fprintf (stderr,
_("You may not change the shell for '%s'.\n"),