aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_mkhomedir
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-01-18 00:35:14 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-01-20 12:28:59 +0000
commitdf86351adfbe6a5dc7a68dce1074403f97fd1046 (patch)
tree557fde50cae3659fe836600c10f34953e2c78c0e /modules/pam_mkhomedir
parent98244ec036096c7571d3bc3782baccab4c7565db (diff)
downloadpam-df86351adfbe6a5dc7a68dce1074403f97fd1046.tar.gz
pam-df86351adfbe6a5dc7a68dce1074403f97fd1046.tar.bz2
pam-df86351adfbe6a5dc7a68dce1074403f97fd1046.zip
Fix remaining -Wcast-qual compilation warnings
Introduce a new internal header file with definitions of DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL macros, use them to temporary silence -Wcast-qual compilation warnings in various modules. * libpam/include/pam_cc_compat.h: New file. * libpam/Makefile.am (noinst_HEADERS): Add include/pam_cc_compat.h. * modules/pam_mkhomedir/pam_mkhomedir.c: Include "pam_cc_compat.h". (create_homedir): Wrap execve invocation in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL. * modules/pam_namespace/pam_namespace.c: Include "pam_cc_compat.h". (pam_sm_close_session): Wrap the cast that discards ‘const’ qualifier in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL. * modules/pam_tty_audit/pam_tty_audit.c: Include "pam_cc_compat.h". (nl_send): Wrap the cast that discards ‘const’ qualifier in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL. * modules/pam_unix/pam_unix_acct.c: Include "pam_cc_compat.h". (_unix_run_verify_binary): Wrap execve invocation in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL. * modules/pam_unix/pam_unix_passwd.c: Include "pam_cc_compat.h". (_unix_run_update_binary): Wrap execve invocation in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL. * modules/pam_unix/passverify.c: Include "pam_cc_compat.h". (unix_update_shadow): Wrap the cast that discards ‘const’ qualifier in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL. * modules/pam_unix/support.c: Include "pam_cc_compat.h". (_unix_run_helper_binary): Wrap execve invocation in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL. * modules/pam_xauth/pam_xauth.c: Include "pam_cc_compat.h". (run_coprocess): Wrap execv invocation in DIAG_PUSH_IGNORE_CAST_QUAL and DIAG_POP_IGNORE_CAST_QUAL.
Diffstat (limited to 'modules/pam_mkhomedir')
-rw-r--r--modules/pam_mkhomedir/pam_mkhomedir.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/pam_mkhomedir/pam_mkhomedir.c b/modules/pam_mkhomedir/pam_mkhomedir.c
index aec1e7e5..1a4dab47 100644
--- a/modules/pam_mkhomedir/pam_mkhomedir.c
+++ b/modules/pam_mkhomedir/pam_mkhomedir.c
@@ -58,6 +58,8 @@
#include <security/pam_modutil.h>
#include <security/pam_ext.h>
+#include "pam_cc_compat.h"
+
/* argument parsing */
#define MKHOMEDIR_DEBUG 020 /* be verbose about things */
#define MKHOMEDIR_QUIET 040 /* keep quiet about things */
@@ -143,7 +145,9 @@ create_homedir (pam_handle_t *pamh, options_t *opt,
args[2] = opt->umask;
args[3] = opt->skeldir;
+ DIAG_PUSH_IGNORE_CAST_QUAL;
execve(MKHOMEDIR_HELPER, (char **)args, envp);
+ DIAG_POP_IGNORE_CAST_QUAL;
/* should not get here: exit with error */
D(("helper binary is not available"));