]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r2826: Complain if 'password chat' doesn't contain the %u variable. based on a patch...
authorJelmer Vernooij <jelmer@samba.org>
Tue, 5 Oct 2004 22:18:32 +0000 (22:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:54 +0000 (10:52 -0500)
source/utils/testparm.c

index 9db6d538d244af2f8be8b2f6d53cae1d7721fa00..d4dc22ec915651c3c8ea12aaf7cfd335edf6c49f 100644 (file)
@@ -132,7 +132,8 @@ parameter.\n" );
 cannot be executed (error was %s).\n", truncated_prog, strerror(errno) );
                                        ret = 1;
                                }
-                       }
+
+             }
 
 #ifdef WITH_PAM
                }
@@ -142,6 +143,11 @@ cannot be executed (error was %s).\n", truncated_prog, strerror(errno) );
                        fprintf(stderr, "ERROR: the 'unix password sync' parameter is set and there is no valid 'passwd chat' \
 parameter.\n");
                        ret = 1;
+               } else 
+               /* check if there's a %u parameter present */
+               if(strstr_m(lp_passwd_chat(), "%u") == NULL) {
+                       fprintf(stderr, "ERROR: the 'passwd program' (%s) requires a '%%u' parameter.\n", lp_passwd_program());
+                       ret = 1;
                }
 
                /*
@@ -365,3 +371,4 @@ via the %%o substitution. With encrypted passwords this is not possible.\n", lp_
        }
        return(ret);
 }
+