r6149: Fixes bugs #2498 and 2484.
[samba.git] / source / utils / net_ads.c
index 83fdb08a9a8423faca6bf372b82276ce3604e468..34a357cd46d2f3c86b76866ef3174adf6cdd522b 100644 (file)
@@ -81,7 +81,7 @@ static int net_ads_lookup(int argc, const char **argv)
                d_printf("Didn't find the cldap server!\n");
                return -1;
        } if (!ads->config.realm) {
-                ads->config.realm = (char *) opt_target_workgroup;
+                ads->config.realm = CONST_DISCARD(char *, opt_target_workgroup);
                ads->ldap_port = 389;
        }
 
@@ -1168,7 +1168,7 @@ static int net_ads_password(int argc, const char **argv)
        }
 
        if (argv[1]) {
-               new_password = (char *)argv[1];
+               new_password = CONST_DISCARD(char *, argv[1]);
        } else {
                asprintf(&prompt, "Enter new password for %s:", user);
                new_password = getpass(prompt);