Fix suggested by Nicholas.S.Jenkins@cdc.com - connect to the
authorJeremy Allison <jra@samba.org>
Fri, 30 Oct 1998 23:53:04 +0000 (23:53 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 30 Oct 1998 23:53:04 +0000 (23:53 +0000)
password change server as anonymous - you don't need to have
logged on as the user to do the password change. Doh ! (Why
didn't *I* think of that one.... :-).
Jeremy.

source/utils/smbpasswd.c

index bce5d7512fd0a304f30eb31f29960ae59e722a5c..883acd0941083390f2bd983ff0d46513fd80bb87 100644 (file)
@@ -495,8 +495,13 @@ int main(int argc, char **argv)
       exit(1);
     }
   
-    if (!cli_session_setup(&cli, user_name, old_passwd, strlen(old_passwd),
-                           "", 0, "")) {
+    /*
+     * We should connect as the anonymous user here, in case
+     * the server has "must change password" checked...
+     * Thanks to <Nicholas.S.Jenkins@cdc.com> for this fix.
+     */
+
+    if (!cli_session_setup(&cli, "", "", 0, "", 0, "")) {
       fprintf(stderr, "%s: machine %s rejected the session setup. Error was : %s.\n",        
               prog_name, remote_machine, cli_errstr(&cli) );
       cli_shutdown(&cli);