Bug 880 - testparm doesn't check missing %u in passwd program
Summary: testparm doesn't check missing %u in passwd program
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Config Files (show other bugs)
Version: 3.0.0
Hardware: Other other
: P4 minor
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-12 01:38 UTC by Clock
Modified: 2005-08-24 10:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clock 2003-12-12 01:38:22 UTC
I had passwd program = /bin/passwd and testparm didn't complain.
But smbd complained in logs when something tried to change a password.
Complained that passwd program must contain %u.
I think this should be added.
Comment 1 Waider 2004-09-23 06:06:00 UTC
See if this patch does what you want.

Index: source/utils/testparm.c
===================================================================
--- source/utils/testparm.c     (revision 2565)
+++ source/utils/testparm.c     (working copy)
@@ -132,6 +132,13 @@
 cannot be executed (error was %s).\n", truncated_prog, strerror(errno) );
                                        ret = 1;
                                }
+
+                               /* 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", truncated_prog );
+                                       ret = 1;
+                               }
                        }
 
 #ifdef WITH_PAM
Comment 2 Jelmer Vernooij 2004-10-05 15:26:47 UTC
Fixed in SVN (based on Ronans patch) 
Comment 3 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:19:16 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.