summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/param/loadparm.c4
-rw-r--r--source3/smbd/chgpasswd.c10
3 files changed, 9 insertions, 6 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e57f7924ee..433e833c31 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -937,6 +937,7 @@ BOOL lp_time_server(void);
BOOL lp_bind_interfaces_only(void);
BOOL lp_net_wksta_user_logon(void);
BOOL lp_unix_password_sync(void);
+BOOL lp_passwd_chat_debug(void);
int lp_os_level(void);
int lp_max_ttl(void);
int lp_max_wins_ttl(void);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index da75b58d55..ce9b816e81 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -192,6 +192,7 @@ typedef struct
BOOL bBindInterfacesOnly;
BOOL bNetWkstaUserLogon;
BOOL bUnixPasswdSync;
+ BOOL bPasswdChatDebug;
} global;
static global Globals;
@@ -444,6 +445,7 @@ static struct parm_struct parm_table[] =
{"root", P_STRING, P_GLOBAL, &Globals.szRootdir, NULL, NULL, 0},
{"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, 0},
{"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, 0},
+ {"passwd chat debug",P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, 0},
{"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, 0},
{"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, 0},
{"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, 0},
@@ -751,6 +753,7 @@ static void init_globals(void)
Globals.bBindInterfacesOnly = False;
Globals.bNetWkstaUserLogon = True;
Globals.bUnixPasswdSync = False;
+ Globals.bPasswdChatDebug = False;
/* these parameters are set to defaults that are more appropriate
for the increasing samba install base:
@@ -981,6 +984,7 @@ FN_GLOBAL_BOOL(lp_time_server,&Globals.bTimeServer)
FN_GLOBAL_BOOL(lp_bind_interfaces_only,&Globals.bBindInterfacesOnly)
FN_GLOBAL_BOOL(lp_net_wksta_user_logon,&Globals.bNetWkstaUserLogon)
FN_GLOBAL_BOOL(lp_unix_password_sync,&Globals.bUnixPasswdSync)
+FN_GLOBAL_BOOL(lp_passwd_chat_debug,&Globals.bPasswdChatDebug)
FN_GLOBAL_INTEGER(lp_os_level,&Globals.os_level)
FN_GLOBAL_INTEGER(lp_max_ttl,&Globals.max_ttl)
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index 7494d0162d..92bdb1adf0 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -264,9 +264,8 @@ static int talktochild(int master, char *chatsequence)
if (!strequal(chatbuf,"."))
ok = expect(master,chatbuf,buf);
-#if DEBUG_PASSWORD
- DEBUG(100,("chatbuf=[%s] responsebuf=[%s]\n",chatbuf,buf));
-#endif
+ if(lp_passwd_chat_debug())
+ DEBUG(100,("talktochild: chatbuf=[%s] responsebuf=[%s]\n",chatbuf,buf));
if (!ok) {
DEBUG(3,("response %d incorrect\n",count));
@@ -278,9 +277,8 @@ static int talktochild(int master, char *chatsequence)
if (!strequal(chatbuf,"."))
writestring(master,chatbuf);
-#if DEBUG_PASSWORD
- DEBUG(100,("sendbuf=[%s]\n",chatbuf));
-#endif
+ if(lp_passwd_chat_debug())
+ DEBUG(100,("talktochild: sendbuf=[%s]\n",chatbuf));
}
if (count<1) return(False);