On Wed, Mar 25, 2015 at 03:03:15PM +0100, Lukas Slebodnik wrote:
ehlo,
clang complains about remoing cant qualifier in casting
src/sss_client/pam_sss.c:1461:73:
error: cast from 'int **' to 'const void **' must have all
intermediate pointers const qualified to be safe [-Werror,-Wcast-qual]
pam_get_data(pamh, "pam_sss:password_expired_flag", (const void **)
&exp_data);
'int **' should not be casted to 'const void **'
The const must not be removed
There aren't warnings with following castings.
'const int **' - 'const void **'
'int **' - 'void **'
BTW you can see the same kind warning with icc
patch is attached.
LS
Changing the variables for last argument of pam_get_data() to const
makes sense, but ...
@@ -1536,7 +1536,7 @@ static int pam_sss(enum sss_cli_command task,
pam_handle_t *pamh,
int pam_status;
struct pam_items pi;
uint32_t flags = 0;
- int *exp_data;
+ const int *exp_data;
bool retry = false;
bool quiet_mode = false;
int retries = 0;
@@ -1618,17 +1618,18 @@ static int pam_sss(enum sss_cli_command task, pam_handle_t
*pamh,
/* We allow sssd to send the return code PAM_NEW_AUTHTOK_REQD during
* authentication, see sss_cli.h for details */
if (pam_status == PAM_NEW_AUTHTOK_REQD) {
+ int *pw_exp_data;
can you declare pw_exp_data at the beginning of pam_sss()?
bye,
Sumit
D(("Authtoken expired, trying to change
it"));
- exp_data = malloc(sizeof(int));
- if (exp_data == NULL) {
+ pw_exp_data = malloc(sizeof(int));
+ if (pw_exp_data == NULL) {
D(("malloc failed."));
pam_status = PAM_BUF_ERR;
break;
}
- *exp_data = 1;
+ *pw_exp_data = 1;
- pam_status = pam_set_data(pamh, PWEXP_FLAG, exp_data,
+ pam_status = pam_set_data(pamh, PWEXP_FLAG, pw_exp_data,
free_exp_data);
if (pam_status != PAM_SUCCESS) {
D(("pam_set_data failed."));