[jcifs] NetUserSetInfo and passwords

Michael B Allen mba2000 at ioplex.com
Tue Nov 2 18:13:33 GMT 2004

On Tue, 2 Nov 2004 09:19:14 +0100
<Thorsten.Leistenschneider at bertelsmann.de> wrote:

> Hi everyone,
> I have a very weird problem, occurring when I use the NetUserSetInfo
> method to set a user's password...
> First of all the method actually sets a password - i can see that in the
> Windows UserManager, because I set the option "user must change password
> at next logon" before the method call and the option was cleared after
> the method call.
> Unfortunately NetUserSetInfo doesn't set the password I specify by
> setting the "password" field of the UserInfo1 structure, because a logon
> with that password doesn't work.
> Now comes the weird thing: If I use a password containing only numbers,
> NetUserSetInfo works.
> Any ideas? Help would be greatly appreciated.

I don't know a whole lot about individual RAP functions. The RAP functions
in Windows are thuroughly deprecated. The prevailing method these days is
MSRPC. For this reason I have chosen to focus my efforts on that.

Using idlc you can generate stubs that work with jarapac. In particular add
samr.{OpenUser,SetUserInfo} to examples/TestSamr.java. To figure out what
the idl should be look at MSDN and the Samba pidl source [1]. Note idlc uses
MIDL format [2] whereas pidl uses it's own variant. Once you have added the
calls you'll need Ethereal to compare what you see from User Manager for
Domains with what you send on the wire.

I know it sounds like a lot of work but it's actually fairly straight
forward. These calls are not particularly complicated.



Greedo shoots first? Not in my Star Wars.

More information about the jcifs mailing list