diff --git a/contrib/pam_zfs_key/pam_zfs_key.c b/contrib/pam_zfs_key/pam_zfs_key.c index d87384cee650..878e65a8e6ce 100644 --- a/contrib/pam_zfs_key/pam_zfs_key.c +++ b/contrib/pam_zfs_key/pam_zfs_key.c @@ -219,6 +219,8 @@ pw_clear(pam_handle_t *pamh) static void destroy_pw(pam_handle_t *pamh, void *data, int errcode) { + (void) pamh, (void) errcode; + if (data != NULL) { pw_free((pw_password_t *)data); } @@ -638,6 +640,8 @@ PAM_EXTERN int pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) flags, (void) argc, (void) argv; + if (pw_fetch_lazy(pamh) == NULL) { return (PAM_AUTH_ERR); } @@ -650,6 +654,7 @@ PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) pamh, (void) flags, (void) argc, (void) argv; return (PAM_SUCCESS); } @@ -737,6 +742,8 @@ PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) flags; + if (geteuid() != 0) { pam_syslog(pamh, LOG_ERR, "Cannot zfs_mount when not being root."); @@ -791,6 +798,8 @@ PAM_EXTERN int pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv) { + (void) flags; + if (geteuid() != 0) { pam_syslog(pamh, LOG_ERR, "Cannot zfs_mount when not being root.");