summaryrefslogtreecommitdiff
path: root/source4/rpc_server/samr/dcesrv_samr.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r3077: Add initial handling of Account Flags in SAMR user info level 21 and 25.Andrew Bartlett1-0/+9
Andrew Bartlett (This used to be commit 51774a9bcad97686e5259ac8d753b3df58072622)
2007-10-10r2675: added a convenience functionAndrew Tridgell1-47/+11
void *talloc_reference(const void *context, const void *ptr); this function makes a secondary reference to ptr, and hangs it off the given context. This greatly simplifies some of the current reference counting code in the samr server and I suspect it will be widely used in other places too. the way you use it is like this: domain_state->connect_state = talloc_reference(domain_state, connect_state); that makes the element connect_state of domain_state a secondary reference to connect_state. The connect_state structure will then only be freed when both domain_state and the original connect_state go away, allowing you to free them independently and in any order. you could do this alrady using a talloc destructor, and that is what the samr server did previously, but that meant this construct was being reinvented in several places. So this convenience function sets up the destructor for you, giving a much more convenient and less error prone API. (This used to be commit dc5315086156644fad093cbe6b02d999adba8540)
2007-10-10r2628: got rid of some warnings and converted a few more places to use ↵Andrew Tridgell1-2/+2
hierarchical memory allocation (This used to be commit 26da45a8019a2d6c9ff2ac2a6739c7d0b42b00de)
2007-10-10r2458: Rename policy handle parameters for the SAMR pipe. Parameters nowTim Potter1-37/+37
have the handle type implied by the parameter name. There are four types of handle: connect, domain, user and group handles. The various samr_Connect functions return a connect handle, and the samr_OpenFoo functions return a foo handle. There is one exception - the samr_{Get,Set}Security function can take any type of handle. Fix up all C callers. (This used to be commit 32f0f3154a8eb63de83145cbc8806b8906ccdc3e)
2007-10-10r2247: talloc_destroy -> talloc_freeTim Potter1-1/+1
(This used to be commit 6c1a72c5d667245b1eec94f58e68acd22dd720ce)
2007-10-10r2051: switched the samdb over to using the new destructor and referenceAndrew Tridgell1-127/+60
count features of talloc, instead of re-implementing both those features inside of samdb (which is what we did before). This makes samdb considerably simpler, and also fixes some bugs, as I found some error paths that didn't call samdb_close(). Those are now handled by the fact that a talloc_free() will auto-close and destroy the samdb context, using a destructor. (This used to be commit da60987a92266734c33b81ee217081abdc4330f3)
2007-10-10r1983: a completely new implementation of tallocAndrew Tridgell1-4/+4
This version does the following: 1) talloc_free(), talloc_realloc() and talloc_steal() lose their (redundent) first arguments 2) you can use _any_ talloc pointer as a talloc context to allocate more memory. This allows you to create complex data structures where the top level structure is the logical parent of the next level down, and those are the parents of the level below that. Then destroy either the lot with a single talloc_free() or destroy any sub-part with a talloc_free() of that part 3) you can name any pointer. Use talloc_named() which is just like talloc() but takes the printf style name argument as well as the parent context and the size. The whole thing ends up being a very simple piece of code, although some of the pointer walking gets hairy. So far, I'm just using the new talloc() like the old one. The next step is to actually take advantage of the new interface properly. Expect some new commits soon that simplify some common coding styles in samba4 by using the new talloc(). (This used to be commit e35bb094c52e550b3105dd1638d8d90de71d854f)
2007-10-10r1335: NT_STATUS_INTERNAL_DB_CORRUPTIONStefan Metzmacher1-13/+13
should cause DEBUG(0,(...)); metze (This used to be commit 80851e67783a9c3c8bdd7f2b52e0b46dd7b18d05)
2007-10-10r1235: as the pidl code init all output data.Stefan Metzmacher1-1/+1
we should do it manualy too. metze (This used to be commit d3b80fd40a07575c18593523070986b7aed6de92)
2007-10-10r1028: More consistancy fixes, which should also fix the build.Andrew Bartlett1-12/+12
Andrew Bartlett (This used to be commit 0d2ae66d3a82134d86084f63c05214e03dfcb48b)
2007-10-10r1025: Rename (across the samr and netlogon pipes, so far)Andrew Bartlett1-37/+37
pwd -> password passwd -> password username -> account_name Also work on consistant structure feild names between these two pipes, and fix up some callers to use samr_Password for the netlogon credential code. Andrew Bartlett (This used to be commit 4e35418c2776f7b79be5b358ffd077754685d1ac)
2007-10-10r1013: WE NEED ALWAYS TO INIT THE OUTPUT VARS!Stefan Metzmacher1-0/+2
in rpc server code! add missing ZERO_STRUCT(r->out.info); in samr_GetDomPwInfo metze (This used to be commit e21f8a343022424097ff53cd8d5e16ac46fff772)
2007-10-10r937: - added a simple QuerySecurity implementation in samr serverAndrew Tridgell1-1/+17
- moved some sec desc defines into misc.idl - fixed pw_len field in UserInfo26 - made some pipes available on TCP - added netr_DsrEnumerateDomainTrusts() to netlogon - added templates for remaining netlogon IDL calls (from ethereal) - added a unistr_noterm vs unistr error detector in ndr basic decoder - added torture test for netr_DsrEnumerateDomainTrusts() (This used to be commit ae5a5113fb83640dcb9ae4642c1b9eaf28487956)
2007-10-10r917: - added the start of a LSA server to samba4.Andrew Tridgell1-2/+58
- added start of QueryDomainInfo in samr server "net rpc info" from samba3 now works against a samba4 server. I suspect join will work fairly soon. (This used to be commit 0a2c6a1062d0e364356853001f5f39bdb542f453)
2007-10-10r901: w2k3 completely ignores the domain name argument to GetDomPwInfo,Andrew Tridgell1-5/+4
always returning the info for the primary domain. I noticed this because WinXP sends the wrong information in this field (it sends \\server_name) and gets away with it (This used to be commit e128bcca562960afe75bf14dd775113e1dd7b213)
2007-10-10r897: - user/group creation needs to create unique names across both theAndrew Tridgell1-2/+79
Builtin and local domain, as some calls (notably password change calls) don't specify a domain name, they just specifiy an account name. - added the remaining password set levels to SetUserInfo in the samr server. We now support all of the password set and change levels that we know about in SAMR. (This used to be commit 965748cbee7853238e9e5f4a4d75780f206d492e)
2007-10-10r884: convert samba4 to use [u]int32_t instead of [u]int32Stefan Metzmacher1-6/+6
metze (This used to be commit 0e5517d937a2eb7cf707991d1c7498c1ab456095)
2007-10-10r873: converted samba4 to use real 64 bit integers instead ofAndrew Tridgell1-2/+2
structures. This was suggested by metze recently. I checked on the build farm and all the machines we have support 64 bit ints, and support the LL suffix for 64 bit constants. I suspect some won't support strtoll() and related functions, so we will probably need replacements for those. (This used to be commit 9a9244a1c66654c12abe4379661cba83a73c4c21)
2007-10-10r839: password set/change in the samr server is complex enough that itAndrew Tridgell1-307/+7
deserves its own C module (This used to be commit 2ba7ff824c32b3db037263ddcff9c876293ea284)
2007-10-10r812: added a new samdb_replace() call that simplifies the code in the main ↵Andrew Tridgell1-30/+8
samr server a bit. (This used to be commit 255d6e77e705bb7a94e6738c9f48f9d8c625883c)
2007-10-10r796: fixed samr_OemChangePasswordUser2() to replace attributes, not addAndrew Tridgell1-1/+6
(This used to be commit 24bbf9f1bcfddb5131769439bd139faef2c022e2)
2007-10-10r793: - don't make templates members of any class that would make them showAndrew Tridgell1-32/+228
up in searches like "objectclass=user" - auto-add the computer objectclass for computer accounts on create - added two types of password change call in samr server - reset last_fault_code before each dcerpc call (This used to be commit c1a65f83f6a4c51e60efd204dab89c20cda65d2b)
2007-10-10r789: we return wrong number of entriesSimo Sorce1-1/+1
(This used to be commit c0c1596dbdb1769c3f10c8299f61807497b1d38a)
2007-10-10r754: Implement the SetPassword operation on the netlogon pipe.Andrew Bartlett1-1/+3
This involves allowing the password set code in samdb to take an already hashed password, and some fixes to our torture code. Andrew Bartlett (This used to be commit f9f581b5804a20785df06cde157b23c952edc2ce)
2007-10-10r743: Start on a NETLOGON server in Samba4.Andrew Bartlett1-22/+55
Currently this only authentiates the machine, not real users. As a consequence of running the Samba4 NETLOGON test against Samba4, I found a number of issues in the SAMR server, which I have addressed. There are more templates in the provison.ldif for this reason. I also added some debug to our credentials code, and fixed some bugs in the auth_sam module. The static buffer in generate_random_string() bit me badly, so I removed it in favor of a talloc based system. Andrew Bartlett (This used to be commit 94624e519b66def97758b8a48a01ffe9029176f0)
2007-10-10r626: make the code a bit more readableStefan Metzmacher1-151/+151
metze (This used to be commit 81b94718e4145a53947d401c4b4b88b71c71e4a4)
2007-10-10r625: - handle passwords longer than length 14 (thanks to abartlet for ↵Andrew Tridgell1-3/+6
pointing out the bug) - delete unicodePwd if not storing a plaintext password (This used to be commit 6c3f22a685c55f183f4e0e4303e3d9990f4b39b5)
2007-10-10r623: setUserInfo level 24 (password set) now works in the SAMR server. This ↵Andrew Tridgell1-11/+62
includes all of the password complexity, password history and other password restrictions. (This used to be commit cb070b9084d95cf5178edbef951b75eab62b7220)
2007-10-10r615: Implement samr_OpenGroup, samr_QueryGroupInfo, samr_SetGroupInfo,Volker Lendecke1-50/+238
samr_DeleteDomainGroup. I've added the hidden attribute numMembers that must be maintained by Add/DelGroupMember for the GroupInfoAll query. Volker (This used to be commit 945d7478605c1bd67e4162ebb0635ab7da11faaf)
2007-10-10r608: - a couple of very minor fixes to the CreateGroup codeAndrew Tridgell1-6/+20
- added samr_GetUserPwInfo() samr server call (This used to be commit 0250f5d6aaf4f9325ace707c69f5e24bcd7a0ed9)
2007-10-10r605: Implement CreateDomainGroup, essentially cut&paste from CreateUser2.Volker Lendecke1-12/+132
Volker (This used to be commit 59241c0c9aa2d64d66eb04e81aa5500681604061)
2007-10-10r601: added the server code for all the samr_SetUserInfo and ↵Andrew Tridgell1-14/+210
samr_QueryUserInfo levels except for the password set levels. This means that a large part of the RPC-SAMR torture test now runs correctly against Samba4 (This used to be commit ec0a51898f543578e755207d81ed5c1524861c64)
2007-10-10r595: nicer handling on max_size multiplierAndrew Tridgell1-2/+3
(This used to be commit 994baba7ebc267cb3051109aee022d71472aa6b6)
2007-10-10r587: added server code for samr_EnumDomainUsers, and started addingAndrew Tridgell1-9/+222
samr_SetUserInfo and samr_QueryUserInfo (This used to be commit e0db9659a85b59e52fbe033a94b411d6c64d9f9c)
2007-10-10r578: initial server side implementation of samr_CreateUser(),Andrew Tridgell1-56/+354
samr_CreateUser2(), samr_LookupNames(), samr_OpenUser(), and samr_DeleteUser() this uses a user template in the SAM db, of objectclass "userTemplate" and dn CN=TemplateUser,CN=Templates,$BASEDN. Using a template allows an admin to add any default user attributes that they might want to the user template and all new users will receive those attributes. (This used to be commit 10b6e0011b5952c98432dc2d4b2058ac89a9cc2d)
2007-10-10r514: added a context pointer to the samdb interface, as suggested byAndrew Tridgell1-9/+76
metze. Also added a reference count so that a client can close the connection handle and still used a derived domain handle. (This used to be commit b1cd98188d6f1f8236f5dbc7a3605a39ae27fb73)
2007-10-10r510: converted the samdb code to give ldb a talloc context rather than ↵Andrew Tridgell1-18/+55
letting ldb use malloc (This used to be commit a3edd4bca8769cd804a5908286c7a18ca5c8fa00)
2007-10-10r466: implemented samr_OpenDomain() and samr_GetDomPwInfo() server side callsAndrew Tridgell1-4/+95
if you take a look at samr_GetDomPwInfo() then you will get a fairly good idea of what I am planning for the database oriented SAMR server implementation. (This used to be commit bba0044a514cf86cbcf14bc82dd6c49808c22dab)
2007-10-10r465: we need common.h in two more rpc server pipesAndrew Tridgell1-0/+1
(This used to be commit d96b68169a5ab46cc0550732d4fe94af75e06fd6)
2007-10-10r464: a big improvement to the API for writing server-side RPCAndrew Tridgell1-103/+74
servers. Previously the server pipe code needed to return the RPC level status (nearly always "OK") and separately set the function call return using r->out.result. All the programmers writing servers (metze, jelmer and me) were often getting this wrong, by doing things like "return NT_STATUS_NO_MEMORY" which was really quite meaningless as there is no code like that at the dcerpc level. I have now modified pidl to generate the necessary boilerplate so that just returning the status you want from the function will work. So for a NTSTATUS function you return NT_STATUS_XXX and from a WERROR function you return WERR_XXX. If you really want to generate a DCERPC level fault rather than just a return value in your function then you should use the DCESRV_FAULT() macro which will correctly generate a fault for you. As a side effect, this also adds automatic type checking of all of our server side rpc functions, which was impossible with the old API. When I changed the API I found and fixed quite a few functions with the wrong type information, so this is definately useful. I have also changed the server side template generation to generate a DCERPC "operation range error" by default when you have not yet filled in a server side function. This allows us to correctly implement functions in any order in our rpc pipe servers and give the client the right information about the fault. (This used to be commit a4df5c7cf88891a78d82c8d6d7f058d8485e73f0)
2007-10-10r458: this is the (very primitive) beginnings of a SAMR server forAndrew Tridgell1-0/+933
Samba4. I'm committing this now so I can get comments on the approach. Note that you need to do something like this to initialise the SAM db: edit script/provision.pl script/provision.pl > provision.ldif.out bin/ldbadd /path/to/private/sam.ldb provision.ldif.out (This used to be commit e2002e40a5abe0cd33a2056b1da8ba5732f9021f)