summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr.c
AgeCommit message (Collapse)AuthorFilesLines
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-1946/+490
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-12delineation between smb and msrpc more marked. smbd now constructsLuke Leighton1-44/+42
pdus, and then feeds them over either a "local" function call or a "remote" function call to an msrpc service. the "remote" msrpc daemon, on the other side of a unix socket, then calls the same "local" function that smbd would, if the msrpc service were being run from inside smbd. this allows a transition from local msrpc services (inside the same smbd process) to remote (over a unix socket). removed reference to pipes_struct in msrpc services. all msrpc processing functions take rpcsrv_struct which is a structure containing state info for the msrpc functions to decode and create pdus. created become_vuser() which does everything not related to connection_struct that become_user() does. removed, as best i could, connection_struct dependencies from the nt spoolss printing code. todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific info on a per-connection basis, and if the connection dies then so does the info, and that's a fairly serious problem. had to put pretty much everything that is in user_struct into parse_creds.c to feed unix user info over to the msrpc daemons. why? because it's expensive to do unix password/group database lookups, and it's definitely expensive to do nt user profile lookups, not to mention pretty difficult and if you did either of these it would introduce a complication / unnecessary interdependency. so, send uid/gid/num_groups/gid_t* + SID+num_rids+domain_group_rids* + unix username + nt username + nt domain + user session key etc. this is the MINIMUM info identified so far that's actually implemented. missing bits include the called and calling netbios names etc. (basically, anything that can be loaded into standard_sub() and standard_sub_basic()...) (This used to be commit aa3c659a8dba0437c17c60055a6ed30fdfecdb6d)
1999-11-24rewrote policy handle code to be generic (it's needed for client-side too)Luke Leighton1-70/+70
attempted to fix regsetsec command (This used to be commit eaac0923e0e5e3f4c3d944272a71f3235ac2a741)
1999-11-20dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT()Luke Leighton1-0/+2
some of the server-side stuff. Realloc() was being used, so it Realloc()d some random area of memory. oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT() some of the server-side stuff. Realloc() was being used, so it Realloc()d some random area of memory. oops.dynamic memory allocation i added a month ago: forgot to ZERO_STRUCT() some of the server-side stuff. Realloc() was being used, so it Realloc()d some random area of memory. oops. (This used to be commit a51f62f4cf610c23e45251cedb543144747a3e54)
1999-11-19The First Necessary UNICODE String Support.Luke Leighton1-12/+12
the random workstation trust account password is TOTAL garbage. i mean, complete garbage. it's nowhere CLOSE to being a UNICODE string. therefore we can't just take every second character. created nt_owf_genW() which creates NT#(password) instead of NT#(Unicode(pw)). followed through to the password setting in srv_samr.c (This used to be commit 172601b84ae94044b27ded917d4e0e21e47a5a66)
1999-11-18responses to UDP samquery go back to SERVER<00> not DOMAIN<1c>, theLuke Leighton1-3/+5
request name. modified createuser rpcclient command to examine name being added. if it ends in a $, assume that a workstation trust account is being added. (This used to be commit 4aea261cb0e5f34255ff83271eb5cadb0eb78bc9)
1999-11-18added samuserset2 rpcclient command to test ACB_XXX bit-setting onLuke Leighton1-0/+107
samr opcode 0x25. _yet_ another failed attempt to get nt5rc2 to join a samba domain. what _is_ it with this stuff, dammit? (This used to be commit c3913f8ae272c496fc4519141accf01ee9f1e49e)
1999-11-16attempting to get nt5 wksta to join domain.Luke Leighton1-2/+19
1) had to fix samr "create user" and "set user info" (level 23). 2) had to fix netlogon enum trust domains 3) registry key needed \\ in it not \. (This used to be commit 70b2c1ecbb4fbbb86fea676c80754485aae5ab13)
1999-11-15added server-side samr enum domains. fixed some parsing issues, server-side.Luke Leighton1-1/+71
(This used to be commit 60b0840106a6f5c283a8339428f3cfeb62398355)
1999-11-02free up memory allocated by enum dom groups / aliasesLuke Leighton1-0/+20
(This used to be commit edb49e754b66ecb59685234338a96d48a53f0161)
1999-10-29more reshuffling of enum groups code. more higher order functions.Luke Leighton1-4/+4
(This used to be commit 497d4231723576390b10f5ea8704bd0af88d76ab)
1999-10-25one of those wonderful moments when running against a different MSRPCLuke Leighton1-5/+9
implementation (NT5) when you discover that your code is trash. samr_enum_dom_users(), samr_enum_dom_aliases() and samr_enum_dom_groups() all take a HANDLE for multiple-call enumeration purposes. (This used to be commit 19490d8b4fb8a103f3df4e6104f6f22937b0c518)
1999-10-21the dynamic memory alloc blood-fest goes on...Luke Leighton1-0/+3
(This used to be commit 134b20e2a7b5ddfa4cc9bf100de5025c7b98f594)
1999-10-21various. debug levels changed. nmbd doesn't need libsmb/clienttrust.c.Luke Leighton1-0/+1
samr_lookup_rids() moved to a dynamic memory structure not a static one limited to 32 RIDs. cli_pipe.c reading wasn't checking ERRmoredata when DOS error codes negotiated (this terminates MSRPC code with prejudice). (This used to be commit 8976eca2db43576c32069dcda017e8777048e007)
1999-08-31matthew chapman identified 4 previously unknown samr functions.Luke Leighton1-3/+3
(This used to be commit 001b53866c819045bc52330cad5746e1a2f7a4b1)
1999-08-30debugged enumgroups -g optionLuke Leighton1-2/+5
(This used to be commit 1cde47ba6a6409e0ae178ca9f44be2123bef0f9d)
1999-05-03last part of RPC api change.Jean-François Micouleau1-37/+37
and of rpcclient eventlog funtion Jean Francois (This used to be commit 7fc8659e83bf0269df297016beac6793ff0bdf32)
1999-04-23Added new define NT_STATUS_MORE_ENTRIES = 0x105.Matthew Chapman1-1/+1
(This used to be commit 52b4fd5b55c22deb691124b743ae9d3beb33b39e)
1999-03-29added SamrQueryDomainInfo call info level 0x3 for kix32.exe supportLuke Leighton1-5/+10
(This used to be commit ac070dfd39bfa9b60680855585155ce528ab7691)
1999-03-25"User Manager" - create user + change password now work.Luke Leighton1-7/+25
next problem: user group adding not supported so an "access denied" message is reported instead of "ok" when a new user is created. (This used to be commit f5f61bd477b4910cb90675c926381342c30a5b16)
1999-03-25fixed issues with "Welcome to SAMBA Domain" for when admin user/pass isLuke Leighton1-9/+23
used to add workstation to domain. unix account db not modified: only SAM password db is used. (This used to be commit 129a9a4d4b74897ed753a697a3aed9b194c25568)
1999-03-25added SAMR_USER_INFO_24 info level to samr_set_userinfo. this is usedLuke Leighton1-0/+30
by "Welcome to SAMBA Domain". (This used to be commit 4aed18b5e1e2309c0f6931fbfdd604b01cb9498a)
1999-03-25SAM database "set user info".Luke Leighton1-50/+194
---------------------------- - removed DOM_RID4 - removed SAMR_UNKNOWN_32 - added SAMR_SET_USERINFO (opcode 0x32) - added level 0x1 to SAMR_QUERY_DOM_INFO (needed for create user) - fixed pwdb_gethexpwd() it was failing on XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - added mod_sam21pwd_entry() - preparing to call mod_sam21pwd_entry() - added "user session key" to user_struct.dc. this is md4(nt#) and is needed to decode user's clear-text passwords in SAMR_SET_USERINFO. - split code out in chgpasswd.c to decode 516 byte password buffers. (This used to be commit 2e58ed742435befe419aa366c4052019fede8c23)
1999-03-24removed 2 unnecessary args from make_uni_hdr.Luke Leighton1-2/+1
(This used to be commit f84dede27e16a5f02ee6d02fe2d16f2661c65470)
1999-03-23dynamic memory allocation in samr enum dom users. works with 849 entries now.Luke Leighton1-0/+10
(This used to be commit 103557e26b071bf1e65e025ef5a52ccdbf483d02)
1999-02-24Win9x user level security.Matthew Chapman1-41/+182
* Added SAMR_LOOKUP_DOMAIN (-> SamrLookupDomainInSamServer) * Added real SAMR_ENUM_DOM_GROUPS (corresponding to SamrEnumerateGroupsInDomain). The existing one is just an alias for SamrQueryDisplayInformation (see below). * Added three extra info levels to SAMR_QUERY_DISPINFO. Info level 3 is what was previously SAMR_ENUM_DOM_GROUPS; info levels 4 and 5 are simple user/group list requests used by Win9x and I suspect (haven't checked) the "low speed connection" User Manager. * Added another two aliases for SAMR_QUERY_DISPINFO, opcodes 0x30 and 0x33. Usually the first is with info level 3 and the second 4 but there is some overlap so indeed these should be implemented as just aliases. * Return ERRDOS/ERRmoredata on extra data instead of STATUS_BUFFER_OVERFLOW for Win95's benefit. On a named pipe this results in an SMBreadX as usual. Still need to fix SAMR_QUERY_DOMAIN_INFO which has a hard-coded number of users and groups - which Win95 proceeds to truncate at. (This used to be commit 7d03e6e21908f3a759a4e65c5edd850622335e3e)
1999-02-15Always null-terminate strings.Matthew Chapman1-6/+6
Also some string length and sizeof(pointer) corrections. (This used to be commit ce24191939b82985d09eabe945199f38b0fea486)
1999-02-12UNICODE cleanup (see lib/util_unistr.c).Matthew Chapman1-6/+6
No more ugly static library buffers and all functions take a destination string length (especially unistrcpy was rather dangerous; we were only saved by the fact that datagrams are limited in size). (This used to be commit a1d39af1ce1d451b811dbd7c2ba391214851b87e)
1999-02-09groups and aliases being "manually" added which do not necessarily haveLuke Leighton1-45/+7
representation in the underlying database: removed this code. for example, with the nt->unix mapping system (don't know about the ldap one) if you want "Domain Admins" to appear you _must_ put it in the domaingroup.map file. the previous code was adding builtin aliases and well-known groups even if they weren't in the domain maps. bad idea. (This used to be commit 56469578a1af0fbcf6edddf94c498c7bbfb385c6)
1999-02-09removal of the use of unistrn2 function: replace it with unistr2_to_strLuke Leighton1-4/+3
which is more appropriate. (This used to be commit ac72fe1ab3d10f64a5945ccbd4ed3817e30f9f7b)
1999-01-29fix for enumerate domain users (bug spotted by sean matthews).Luke Leighton1-3/+7
also needed to use start index properly and generate next index. both client and server code need to recognise error code 0x105 when there's not enough room to store all the users in one call. sort this out another time. (This used to be commit ad58cdfac6b85d9431216e32e532ad4d60f9c6dd)
1999-01-28error code cleanupLuke Leighton1-27/+27
(This used to be commit 61c40982d6fde34729dc6850cf3372482392f4c9)
1999-01-15Fixed typo in srv_samr.c where samr_add_groupmem and samr_del_groupmem wereMatthew Chapman1-4/+4
the wrong way around. (This used to be commit 2b6f4818858d422399321064245a36be1dba9738)
1998-12-08adding srvsvc pipe.Luke Leighton1-2/+16
(This used to be commit d06d6369942828ec89e90f99bd0d0d3f91d61d13)
1998-12-07- lib/unix_sec_ctxt.cLuke Leighton1-131/+635
attempt at taking lib/uid.c and getting a unix security context change module that is independent of "cnums" and "snums". a security context is needed for pipes, not just IPC$ or other services. - group database API added add_group/alias_member, del_group/alias_member, del_group/alias_entry functions. del_builtin_entry() is deliberately set to NULL to cause an exception, you cannot delete builtin aliases. - parse_lsa.c srv_lsa.c fixed lookup_names code, it was a load of trash and didn't do anything. - cmd_samr.c rpcclient.c srv_samr.c added "deletegroup", "deletealias", "delaliasmem", "delgroupmem", "addgroupmem", "addaliasmem", "createalias", "creategroup", to both client and server code. server code calls into unix stubs right now, which don't actually do anything. the only instance where they are expected to do anything is in appliance mode NOT even in the ldap code or anything. client code modified to call samr_lookup_names() for group code (because we can) and lsa_lookup_names() for alias code (because we have to). - srv_lookup.c oops, lookup on unsplit name, we got lookup on DOMAIN, DOMAIN\name instead of DOMAIN, name. (This used to be commit b8175702ef61b8b37b078f38e81452c00a5e2986)
1998-12-04- oops, i got "add alias member" and "delete alias member" swapped.Luke Leighton1-3/+2
- samr_enum_dom_users, the first 4 bytes is some sort of garbage, nt5-beta2 clears them out to zeros whereas nt4 does not. fixed bug where we were assuming that the first 4 bytes of a response _had_ to be non-zero. - cli_lsarpc.c: forgot to append the rid on the lsa_lookup_names() client call. - added in "addaliasmem" and "addgroupmem" commands. the addaliasmem command actually turned out to be a "delaliasmem" :-) :-) - parse_lsa.c: moved assert array check to after the size of useable array space is set... (This used to be commit 165b15a8cacc4bc7cf8cc0b9aaabb6b92cef7fdb)
1998-12-04- renamed do_samr_xxx to samr_xxxLuke Leighton1-20/+20
- renamed do_lsa_xxx to lsa_xxx - added "enumgroups [-m]" command, enumerates groups, shows members. - added cmd_sam_add_groupmem(), need to call these in rpcclient.c - added cmd_sam_add_aliasmem(), need to call these in rpcclient.c - modified "enumaliases [-m]" command - improved "enumgroups" and "enumaliases" to display names not just RIDS/SIDs. - renamed "samr_unknown_12" to "samr_lookup_rids". - added the following client-side functions: get_samr_query_groupmem() get_samr_query_aliasmem() get_samr_query_groupinfo() samr_enum_dom_groups() samr_enum_dom_aliases() samr_add_aliasmem() samr_add_groupmem() - improved display output (display.c) (This used to be commit eacc5e581af2b4de24186b9be3238b352c54effe)
1998-12-03added createalias command to rpcclientLuke Leighton1-1/+1
(This used to be commit 4771d5451b49375cc2fd4246d7d746b0d03cd5ba)
1998-12-03create domain group command (creategroup) added to rpcclient.Luke Leighton1-2/+2
renamed do_samr_xxxx to samr_xxxx. (This used to be commit 1e5d81c154740349a2cda4c1892b33a21c0683a8)
1998-12-02added rid and sid_name_use to DOMAIN_GRP_MEMBER, for use in group memberLuke Leighton1-8/+10
query. domain groups now work, hurrah! only thing is that the description is one character long, don't know why (which is wierd in itself). (This used to be commit 78a86c64960a7823b0db8b7bebfffabb4a5ba864)
1998-12-02adding group member code, made a start. found that the group members'Luke Leighton1-0/+235
rid is needed not the name (see DOMAIN_GRP_MEMBER) decided to go home. (This used to be commit 9337049dfc98becfa74522d418dae64a97c7a304)
1998-12-01query_aliasmem code. it works (hurrah).Luke Leighton1-5/+9
(This used to be commit f7f2516df46dde1671235f788f7689c93d9395ae)
1998-12-01rpc_samr.h parse_samr.c srv_samr.c :Luke Leighton1-4/+114
samr_query_aliasmembers (cool!) util_pwdb.c sids.c nmbd.c server.c smbpasswd.c swat.c : pwdb_initialise(BOOL is_server) now creates / reads DOMAIN_NAME.SID if is_server is True, and does LsaQueryInfoPolicy(levels 3 and 5) to obtain member and pdc sids. (This used to be commit 3e1eb4f26b67e484b05e1dde94fd4e4dae982631)
1998-12-01adding some samr parsing calls (group / alias adding / deleting)Luke Leighton1-7/+12
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists. (This used to be commit 51c1c31768a92d9c57ee6c09b78419bcbc544f03)
1998-11-30- adding builtin[alias]db.Luke Leighton1-8/+15
- lib/sids.c: generate_sam_sid() modified to take a domain name: it now generates "DOMAIN_NAME.SID". reasons: 1) if you run multiple samba servers on the same machine under different netbios names as members of a domain, they won't all use the same SID, which is a _big_ mistake but it would happen _by default_. 2) we have (had) a problem with sid_to_string() and string_to_sid() which cause SIDs to be incorrectly read. one of the major reasons for *NOT* making this change was so as not to disrupt existing users. but as they will be anyway by this bug, we might as well go ahead. - passdb/smbpass.c: wanted to change the meaning of the name in the smbpasswd file to an "nt" name not a "unix" name. this is probably not a good idea: reverted this. - output formatting / bug-fixing in rpcclient query_useraliases code. (This used to be commit e4930f5f48f8246ceec8add8bf769954a963190c)
1998-11-29weekend work. user / group database API.Luke Leighton1-85/+50
- split sam_passwd and smb_passwd into separate higher-order function tables - renamed struct smb_passwd's "smb_user" to "unix_user". added "nt_user" plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd password databases to fill in the blank entries that are not obtained from whatever password database API instance is being used. NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c for the only example outside of the password database APIs i could find. - added query_useraliases code to rpcclient. - dealt with some nasty interdependencies involving non-smbd programs and the password database API. this is still not satisfactorily resolved completelely, but it's the best i can do for now. - #ifdef'd out some password database options so that people don't mistakenly set them unless they recompile to _use_ those options. lots of debugging done, it's still not finished. the unix/NT uid/gid and user-rid/group-rid issues are better, but not perfect. the "BUILTIN" domain is still missing: users cannot be added to "BUILTIN" groups yet, as we only have an "alias" db API and a "group" db API but not "builtin-alias" db API... (This used to be commit 5d5d7e4de7d1514ab87b07ede629de8aa00519a1)
1998-11-25yeehaah got users to be included in S-1-5-xxx-yyy-zzz's local groups.Luke Leighton1-19/+19
now need search capability on S-1-5-20, which will need argh, a "group database API" on S-1-5-20, and the ability to add BUILTIN\Admins etc to "local group map" argh. (This used to be commit a24f6eb00ba7486479cbcf7fadf5456521c56179)
1998-11-25Makefile.in: Added maintainer mode fixes.Jeremy Allison1-4/+2
aclocal.m4: Added AC_LIBTESTFUNC. configure.in: Fixed -lsecurity -lsec problems. client.c: dos_ fixes. groupdb/aliasunix.c: Dead code removal. include/includes.h: Added default PRINTCAP_NAME. lib/genrand.c: dos_ fixes. lib/replace.c: Added strtoul. lib/system.c: dos_ fixes. lib/util.c: dos_ fixes. lib/util_sid.c: Signed/unsigned fixes. lib/util_str.c: removed bad const. locking/locking_slow.c: dos_ fixes. printing/printing.c: dos_ fixes. rpc_server/srv_samr.c: Dead code removal. rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN ! smbd/dir.c: dos_ fixes. smbd/open.c: dos_ fixes. smbd/oplock.c: dos_ fixes. smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes. Jeremy. (This used to be commit 6acb4b68f68d516e2ac3c47e500f5600d653435e)
1998-11-23uninitialised counterLuke Leighton1-1/+1
(This used to be commit 403f53d696d17f34dd1afc035a72eda792dd20ea)
1998-11-23unix instance of group database APILuke Leighton1-10/+34
(This used to be commit e76f593b3572ac881f1aa1fb3326d8b7169b0078)