[Samba] Disabling Machine Account password change

Gerald (Jerry) Carter jerry at samba.org
Thu Mar 11 16:00:17 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Florian Thiel wrote:

|> The MS kb artcile mentions the RefusrPasswordChange
|> reg value.  You could add this to the hardcoded registry
|> paths than Samba supports.
|
| Yes, that's the idea. The problem is that I'm not feeling able
| to do this on my own. Is there a samba developer around?
| I think it shouldn't be too hard if you know the structures.
| I'm not even sure what value Windows expect in return...

Try this patch (i only guarantee it to compile).
(stripped was the mailing list ).  Should apply to
any 3.0 version.



cheers, jerry
- ----------------------------------------------------------------------
Hewlett-Packard            ------------------------- http://www.hp.com
SAMBA Team                 ---------------------- http://www.samba.org
GnuPG Key                  ---- http://www.plainjoe.org/gpg_public.asc
"If we're adding to the noise, turn off this song" --Switchfoot (2003)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAUI0QIR7qMdg1EfYRAk6xAKCSLTt7xQw1bbFB9qP/DnJFaCEyoQCgnDTH
VDAlzSb5F4XrrfL1XVdRNVQ=
=H9L2
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: rpc_server/srv_reg_nt.c
===================================================================
RCS file: /data/cvs/samba/source/rpc_server/srv_reg_nt.c,v
retrieving revision 1.17.2.10
diff -u -r1.17.2.10 srv_reg_nt.c
--- rpc_server/srv_reg_nt.c	23 Jul 2003 12:33:58 -0000	1.17.2.10
+++ rpc_server/srv_reg_nt.c	11 Mar 2004 15:58:11 -0000
@@ -373,12 +373,14 @@
 	/* couple of hard coded registry values */
 	
 	if ( strequal(name, "RefusePasswordChange") ) {
-		if ( (val = (REGISTRY_VALUE*)malloc(sizeof(REGISTRY_VALUE))) == NULL ) {
-			DEBUG(0,("_reg_info: malloc() failed!\n"));
-			return NT_STATUS_NO_MEMORY;
-		}
-		ZERO_STRUCTP( val );
+		uint32 dwValue = 0x1;
+		
+		regval_ctr_addvalue(&regvals, "RefusePasswordChange", REG_DWORD, 
+			(const char*)&dwValue, sizeof(dwValue));
+		val = dup_registry_value( regval_ctr_specific_value( &regvals, 0 ) );
 	
+		status = NT_STATUS_OK;
+		
 		goto out;
 	}
 


More information about the samba mailing list