Password synchronization

Jeremy Allison jallison at
Fri May 15 00:09:56 GMT 1998

> If the password really is too short, I'd like to keep Samba from
> changing the entry in smbpassword.

That, I can do.

> I'd also like to have it tell the user that the new password is too short.
> If there are any other tests that Samba runs against the new password, I'd
> like them to be treated the same way.  Is is possible to configure Samba to 
> do this?Alan,

That, I can't. The only output we get from the UNIX
passwd command is the return code of the command. There
is no way to return any text to the user (There is only
a 16 bit status field in the return value to Win95).
Although Win95 has a 'password too short' error value,
it would be very difficult to extract this from all
the /bin/passwd varients that exist.

Try the following patch (this will be in 1.9.19alpha
series) - it will do the first part of what you want.


	Jeremy Allison.
	Samba Team.

-----------------------cut here-----------------------
Index: ipc.c
RCS file: /data/cvs/samba/source/ipc.c,v
retrieving revision
diff -w -b -u -r1.73.2.15 ipc.c
--- ipc.c       1998/05/12 22:52:09
+++ ipc.c       1998/05/15 00:09:19
@@ -1594,6 +1594,7 @@
   fstring new_passwd;
   struct smb_passwd *smbpw = NULL;
   char *p = param + 2;
+  int ret = True;
   *rparam_len = 2;
   *rparam = REALLOC(*rparam,*rparam_len);
@@ -1634,9 +1635,9 @@
    * available. JRA.
-    chgpasswd(user,"", new_passwd, True);
+    ret = chgpasswd(user,"", new_passwd, True);
-  if(change_oem_password( smbpw, new_passwd, False)) {
+  if(ret && change_oem_password( smbpw, new_passwd, False)) {
----------end patch-----------------------------

Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list