[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-pam-commits
Subject:    [linux-pam] pam_unix: Silence warnings and fix a minor bug.
From:       Tomáš Mráz <tmraz () fedoraproject ! org>
Date:       2016-03-04 13:18:31
Message-ID: 20160304131831.A89E761B69 () fedorahosted ! org
[Download RAW message or body]

commit 144f8c64cbb906c1f4a7f6bf5fbed16e35ae7bc2
Author: Tomas Mraz <tmraz@fedoraproject.org>
Date:   Fri Mar 4 14:15:31 2016 +0100

    pam_unix: Silence warnings and fix a minor bug.
    
    Fixes a minor bug in behavior when is_selinux_enabled()
    returned negative value.
    
    * modules/pam_unix/passverify.c: Add parentheses to SELINUX_ENABLED macro.
    (unix_update_shadow): Safe cast forwho to non-const char *.
    * modules/pam_unix/support.c: Remove unused SELINUX_ENABLED macro.

 modules/pam_unix/passverify.c |    4 ++--
 modules/pam_unix/support.c    |    6 ------
 2 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/modules/pam_unix/passverify.c b/modules/pam_unix/passverify.c
index 078adc6..5d6a148 100644
--- a/modules/pam_unix/passverify.c
+++ b/modules/pam_unix/passverify.c
@@ -31,7 +31,7 @@
 
 #ifdef WITH_SELINUX
 #include <selinux/selinux.h>
-#define SELINUX_ENABLED is_selinux_enabled()>0
+#define SELINUX_ENABLED (is_selinux_enabled()>0)
 #else
 #define SELINUX_ENABLED 0
 #endif
@@ -958,7 +958,7 @@ PAMH_ARG_DECL(int unix_update_shadow,
     fclose(opwfile);
 
     if (!wroteentry && !err) {
-	spwdent.sp_namp = forwho;
+	spwdent.sp_namp = (char *)forwho;
 	spwdent.sp_pwdp = towhat;
 	spwdent.sp_lstchg = time(NULL) / (60 * 60 * 24);
 	if (spwdent.sp_lstchg == 0)
diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
index abccd82..0fd1dba 100644
--- a/modules/pam_unix/support.c
+++ b/modules/pam_unix/support.c
@@ -30,12 +30,6 @@
 
 #include "support.h"
 #include "passverify.h"
-#ifdef WITH_SELINUX
-#include <selinux/selinux.h>
-#define SELINUX_ENABLED is_selinux_enabled()>0
-#else
-#define SELINUX_ENABLED 0
-#endif
 
 static char *
 search_key (const char *key, const char *filename)
_______________________________________________
linux-pam-commits mailing list
linux-pam-commits@lists.fedorahosted.org
https://lists.fedorahosted.org/admin/lists/linux-pam-commits@lists.fedorahosted.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic