unknown_3 flag of USER_INFO

Simo Sorce simo.sorce at xsec.it
Tue Jan 13 16:16:34 GMT 2004


Thanks, very much, I tought it was something like that, but had no time
to check my idea.

I'll try to integrate your findings in the weekend if nobody does it
before.

Simo.

On Tue, 2004-01-13 at 17:08, Jianliang Lu wrote:
> I'd like to discuss about the implementation of SAMR_SET_USERINFO2,in which 
> the important ULONG flag "unknown_3" is not interpreted. The "unknown_3" flag 
> is "WhichFields" on MS RPC SAMR that is like  "can set" mask, means that I 
> can set a field of the user_info only its correspondent bit of mask is set. 
> So the code should be like as following: 
> 
> (WhichFields = unknown_3;)
> 
> if ( from->WhichFields & USER_INFO_WORKSTATIONS ) { then set WORKSTATIONS };  
> if ( from->WhichFields & USER_INFO_USERNAME ) ) { then set 
> USERNAMES };   .....
> 
> The mask bits are following:
> 
> #define USER_INFO_USERNAME           0x00000001
> #define USER_INFO_FULLNAME           0x00000002
> #define USER_INFO_USERID             0x00000004
> #define USER_INFO_PRIMARYGROUPID     0x00000008
> #define USER_INFO_ADMINCOMMENT       0x00000010
> #define USER_INFO_USERCOMMENT        0x00000020
> #define USER_INFO_HOMEDIRECTORY      0x00000040
> #define USER_INFO_HOMEDIRECTORYDRIVE 0x00000080
> #define USER_INFO_SCRIPTPATH         0x00000100
> #define USER_INFO_PROFILEPATH        0x00000200
> #define USER_INFO_WORKSTATIONS       0x00000400
> #define USER_INFO_LASTLOGON          0x00000800
> #define USER_INFO_LASTLOGOFF         0x00001000
> #define USER_INFO_LOGONHOURS         0x00002000
> #define USER_INFO_BADPASSWORDCOUNT   0x00004000
> #define USER_INFO_LOGONCOUNT         0x00008000
> #define USER_INFO_PASSWORDCANCHANGE  0x00010000
> #define USER_INFO_PASSWORDMUSTCHANGE 0x00020000
> #define USER_INFO_PASSWORDLASTSET    0x00040000
> #define USER_INFO_ACCOUNTEXPIRES     0x00080000
> #define USER_INFO_USERACCOUNTCONTROL 0x00100000
> #define USER_INFO_PARAMETERS         0x00200000 /* ntsubauth */
> #define USER_INFO_COUNTRYCODE        0x00400000
> #define USER_INFO_CODEPAGE           0x00800000
> #define USER_INFO_NTPASSWORDPRESENT  0x01000000  /* field AND boolean */
> #define USER_INFO_LMPASSWORDPRESENT  0x02000000  /* field AND boolean */
> #define USER_INFO_PRIVATEDATA        0x04000000  /* field AND boolean */
> #define USER_INFO_PASSWORDEXPIRED    0x08000000
> #define USER_INFO_SECURITYDESCRIPTOR 0x10000000
> #define USER_INFO_OWFPASSWORD        0x20000000  /* boolean */
> 
> #define USER_INFO_UNDEFINED_MASK     0xC0000000
> 
> Cheers,
> Jianliang Lu
> TieSse s.p.a.     Ivrea (To) - Italy
> j.lu at tiesse.com   luj at libero.it
> http://www.tiesse.com
-- 
Simo Sorce - simo.sorce at xsec.it
Xsec s.r.l. - http://www.xsec.it
via Garofalo, 39 - 20133 - Milano
mobile: +39 329 328 7702
tel. +39 02 2953 4143 - fax: +39 02 700 442 399


More information about the samba-technical mailing list