diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-19 18:40:16 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2020-03-19 18:40:16 +0000 |
commit | 466e1de674b42b2afe13d2edd998acbf656a9c76 (patch) | |
tree | 1afc324c413069314650031e9167f082e199aa2a /modules/pam_access | |
parent | f6c60926adc9fa08feaeb696ffa5bfbac7c8c9e8 (diff) | |
download | pam-466e1de674b42b2afe13d2edd998acbf656a9c76.tar.gz pam-466e1de674b42b2afe13d2edd998acbf656a9c76.tar.bz2 pam-466e1de674b42b2afe13d2edd998acbf656a9c76.zip |
Fix remaining clang -Wcast-align compilation warnings
Introduce DIAG_PUSH_IGNORE_CAST_ALIGN and DIAG_POP_IGNORE_CAST_ALIGN
macros, use them to silence remaining clang -Wcast-align compilation
warnings.
* libpam/include/pam_cc_compat.h (DIAG_PUSH_IGNORE_CAST_ALIGN,
DIAG_POP_IGNORE_CAST_ALIGN): New macros.
* modules/pam_access/pam_access.c: Include "pam_cc_compat.h".
(from_match, network_netmask_match): Wrap inet_ntop invocations
in DIAG_PUSH_IGNORE_CAST_ALIGN and DIAG_POP_IGNORE_CAST_ALIGN.
Diffstat (limited to 'modules/pam_access')
-rw-r--r-- | modules/pam_access/pam_access.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 9a427ee2..9eab923a 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -66,6 +66,8 @@ #include <security/pam_modutil.h> #include <security/pam_ext.h> +#include "pam_cc_compat.h" + /* login_access.c from logdaemon-5.6 with several changes by A.Nogin: */ /* @@ -650,9 +652,11 @@ from_match (pam_handle_t *pamh UNUSED, char *tok, struct login_info *item) if (runp->ai_family == AF_INET) { + DIAG_PUSH_IGNORE_CAST_ALIGN; inet_ntop (runp->ai_family, &((struct sockaddr_in *) runp->ai_addr)->sin_addr, buf, sizeof (buf)); + DIAG_POP_IGNORE_CAST_ALIGN; strcat (buf, "."); @@ -781,11 +785,13 @@ network_netmask_match (pam_handle_t *pamh, { char buf[INET6_ADDRSTRLEN]; + DIAG_PUSH_IGNORE_CAST_ALIGN; inet_ntop (runp->ai_family, runp->ai_family == AF_INET ? (void *) &((struct sockaddr_in *) runp->ai_addr)->sin_addr : (void *) &((struct sockaddr_in6 *) runp->ai_addr)->sin6_addr, buf, sizeof (buf)); + DIAG_POP_IGNORE_CAST_ALIGN; if (are_addresses_equal(buf, tok, netmask_ptr)) { |