nsswitch: avoid some compiler warnings
authorStefan Metzmacher <metze@samba.org>
Thu, 27 Feb 2014 08:38:39 +0000 (09:38 +0100)
committerJeremy Allison <jra@samba.org>
Fri, 14 Nov 2014 22:27:05 +0000 (23:27 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
nsswitch/pam_winbind.c
nsswitch/wbinfo.c
nsswitch/winbind_nss_linux.c

index 564f773ee445dcf2fde38d45a35cb5f7ab09f040..f06f2b5ba8361759476701dd0258c39b418165fc 100644 (file)
@@ -663,7 +663,7 @@ static int converse(const pam_handle_t *pamh,
        retval = pam_get_item(pamh, PAM_CONV, (const void **) &conv);
        if (retval == PAM_SUCCESS) {
                retval = conv->conv(nargs,
-                                   (const struct pam_message **)message,
+                                   discard_const_p(const struct pam_message *, message),
                                    response, conv->appdata_ptr);
        }
 
@@ -1998,7 +1998,7 @@ static int winbind_chauthtok_request(struct pwb_context *ctx,
                }
 
                /* FIXME: avoid to send multiple PAM messages after another */
-               switch (reject_reason) {
+               switch ((int)reject_reason) {
                        case -1:
                                break;
                        case WBC_PWD_CHANGE_NO_ERROR:
index a31fbdf283fb0281d073ca2476ecb30c26771ee4..9e06fb222e1e3f5c56985ed28833eff301ec07a3 100644 (file)
@@ -1329,13 +1329,14 @@ static bool wbinfo_lookuprids(const char *domain, const char *arg)
        }
 
        wbc_status = wbcLookupRids(&dinfo->sid, num_rids, rids,
-                                  (const char **)&domain_name, &names, &types);
+                                  &p, &names, &types);
        if (!WBC_ERROR_IS_OK(wbc_status)) {
                d_printf("winbind_lookup_rids failed: %s\n",
                         wbcErrorString(wbc_status));
                goto done;
        }
 
+       domain_name = discard_const_p(char, p);
        d_printf("Domain: %s\n", domain_name);
 
        for (i=0; i<num_rids; i++) {
@@ -2104,7 +2105,7 @@ enum {
        OPT_KRB5CCNAME
 };
 
-int main(int argc, char **argv, char **envp)
+int main(int argc, const char **argv, char **envp)
 {
        int opt;
        TALLOC_CTX *frame = talloc_stackframe();
@@ -2219,7 +2220,7 @@ int main(int argc, char **argv, char **envp)
 
        /* Parse options */
 
-       pc = poptGetContext("wbinfo", argc, (const char **)argv,
+       pc = poptGetContext("wbinfo", argc, argv,
                            long_options, 0);
 
        /* Parse command line options */
index 70ede3edbd88992461fcdbbec09bc3d88cdb9d0e..9afa9d427251ba34ea9a7f36c3a38c5005910949 100644 (file)
@@ -287,7 +287,7 @@ static NSS_STATUS fill_pwent(struct passwd *result,
    Return NSS_STATUS_TRYAGAIN if we run out of memory. */
 
 static NSS_STATUS fill_grent(struct group *result, struct winbindd_gr *gr,
-                     char *gr_mem, char **buffer, size_t *buflen)
+                     const char *gr_mem, char **buffer, size_t *buflen)
 {
        char *name;
        int i;