summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-18 15:50:27 +0100
committerMichael Adam <obnox@samba.org>2008-03-18 15:52:45 +0100
commit37e04236bb59491e13c378edda2ac2686c7dbca1 (patch)
tree335f58731e07035efb618812951b6d823112abdc /source3
parent7ec398b188df4655ae10884ec949e740a05b375f (diff)
downloadsamba-37e04236bb59491e13c378edda2ac2686c7dbca1.tar.gz
samba-37e04236bb59491e13c378edda2ac2686c7dbca1.tar.bz2
samba-37e04236bb59491e13c378edda2ac2686c7dbca1.zip
testparm: only check for %u und passwd program when passwd program is given.
Michael (This used to be commit af12b24c4f5e3b77d482a011b62a5a3e13be7d67)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/testparm.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c
index d409ff992d..aded4a83c1 100644
--- a/source3/utils/testparm.c
+++ b/source3/utils/testparm.c
@@ -140,11 +140,16 @@ 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_program(), "%u") == NULL) {
- fprintf(stderr, "ERROR: the 'passwd program' (%s) requires a '%%u' parameter.\n", lp_passwd_program());
- ret = 1;
+ }
+
+ if ((lp_passwd_program() != NULL) &&
+ (strlen(lp_passwd_program()) > 0))
+ {
+ /* check if there's a %u parameter present */
+ if(strstr_m(lp_passwd_program(), "%u") == NULL) {
+ fprintf(stderr, "ERROR: the 'passwd program' (%s) requires a '%%u' parameter.\n", lp_passwd_program());
+ ret = 1;
+ }
}
/*