Commit 1043f614 authored by Danny Kukawka's avatar Danny Kukawka Committed by David Zeuthen

Patch from Danny Kukawka <danny.kukawka@web.de> with some cleanup.s

	* pam-polkit-console/pam-polkit-console.c: (pam_sm_open_session),
	(pam_sm_close_session): fixed usage of pam_get_item() to respect
	strict-aliasing rules

        * polkitd/polkit-manager.c: (polkit_manager_get_caller_info):
	added ifdef around currently unused calling_selinux_context

        * tools/polkit-grant-privilege.c: (grant_complete_cb): replaced
	libpolkit_free_context() with correct libpolkit_grant_free_context()
parent accea27e
......@@ -169,7 +169,7 @@ pam_sm_open_session (pam_handle_t *pamh,
_pam_log (pamh, LOG_ERR, TRUE, "pam_polkit_console open_session");
_parse_module_args (pamh, argc, argv);
if(pam_get_item (pamh, PAM_USER_PROMPT, (const void **) &user_prompt) != PAM_SUCCESS) {
if(pam_get_item (pamh, PAM_USER_PROMPT, (const void **)(char*) &user_prompt) != PAM_SUCCESS) {
user_prompt = "user name: ";
}
username = NULL;
......@@ -178,7 +178,7 @@ pam_sm_open_session (pam_handle_t *pamh,
return PAM_SESSION_ERR;
}
pam_get_item(pamh, PAM_TTY, (const void**) &tty);
pam_get_item(pamh, PAM_TTY, (const void**)(char*) &tty);
if (tty == NULL || strlen (tty) == 0) {
_pam_log(pamh, LOG_ERR, TRUE, "TTY not defined");
return PAM_SESSION_ERR;
......@@ -216,7 +216,7 @@ pam_sm_close_session (pam_handle_t *pamh,
_pam_log (pamh, LOG_ERR, TRUE, "pam_polkit_console close_session");
_parse_module_args (pamh, argc, argv);
if (pam_get_item (pamh, PAM_USER_PROMPT, (const void **) &user_prompt) != PAM_SUCCESS) {
if (pam_get_item (pamh, PAM_USER_PROMPT, (const void **)(char*) &user_prompt) != PAM_SUCCESS) {
user_prompt = "user name: ";
}
username = NULL;
......@@ -225,7 +225,7 @@ pam_sm_close_session (pam_handle_t *pamh,
return PAM_SESSION_ERR;
}
pam_get_item (pamh, PAM_TTY, (const void**) &tty);
pam_get_item (pamh, PAM_TTY, (const void**)(char*) &tty);
if (tty == NULL || strlen (tty) == 0) {
_pam_log(pamh, LOG_ERR, TRUE, "TTY not defined");
return PAM_SESSION_ERR;
......
......@@ -315,8 +315,9 @@ polkit_manager_get_caller_info (PolicyKitManager *manager,
gboolean res;
CallerInfo *caller_info;
GError *error = NULL;
#if 0
GArray *calling_selinux_context;
#endif
res = FALSE;
if (sender == NULL)
......
......@@ -144,7 +144,7 @@ grant_complete_cb (LibPolKitGrantContext *ctx,
libpolkit_grant_close (ctx, FALSE);
}
libpolkit_free_context (ctx);
libpolkit_grant_free_context (ctx);
exit (0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment