From 37e04236bb59491e13c378edda2ac2686c7dbca1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 18 Mar 2008 15:50:27 +0100 Subject: testparm: only check for %u und passwd program when passwd program is given. Michael (This used to be commit af12b24c4f5e3b77d482a011b62a5a3e13be7d67) --- source3/utils/testparm.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source3/utils/testparm.c') 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; + } } /* -- cgit