summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_samr_nt.c
AgeCommit message (Collapse)AuthorFilesLines
2003-03-21Give volker a hand, and let domain joins with existing user accounts workAndrew Bartlett1-12/+38
a bit better. This just sets the minimum possible attributes - if we are 'upgrading' an LDAP based user account, the attributes will be there anyway. This matches NT pretty well to. This also fixes some use of unitialised values in the desired_access checking. (found by valgrind). Andrew Bartlett (This used to be commit 929213ff2a5829ba8435ba1be0de317bca1e0da0)
2003-02-17This patch fixes one of my longest-standing pet hates with Samba :-).Andrew Bartlett1-10/+10
When we look see if a user is in a list, and we try to 'expand' an @group, we should lookup the user's own list of groups, rather than looking for all the members of a group. I'm sure this will fix some nasty performance issues, particularly on large domains etc. In particular, this avoids contacting winbind at all, if the group is not a winbind group. (This caused a deadlock on my winbind-on-PDC setup). The groups list always includes the user's primary group, as per the getgrouplist manpage, and my recent changes to our implementation. Andrew Bartlett (This used to be commit 9be21976f7662ebe6eb92fff7cecbdb352eca334)
2003-01-17reverted this patch till I sort out the craziness with UNIHDRAndrew Tridgell1-4/+4
(This used to be commit e3d00fa47d38cd214f5e350e1d6b30d90ed8a52c)
2003-01-17This removes the 3rd argument from init_unistr2(). There were 240Andrew Tridgell1-4/+4
calls to init_unistr2() in the code and every one of them got the 3rd argument incorrect, so I thought it best just to remove the argument. The incorrect usage was caused by callers using strlen() to determine the length of the string. The 3rd argument to init_unistr2() was supposed to be the character length, not the byte length of the string, so for non-english this could come out wrong. I also removed the bogus 'always allocate at least 256 bytes' hack. There may be some code that relies on this, but if there is then the code is broken and needs fixing. (This used to be commit b9eff31b1433c81fbff733e194914a40f25e3bda)
2003-01-15small merges from SAMBA_3_0; mostly typos, renames, etc...Gerald Carter1-1/+1
(This used to be commit 9ac196dad4893b0ceef13281a140be5d85391e6c)
2003-01-01Move our password change code along a little - use NTSTATUS, and implmenetAndrew Bartlett1-3/+2
minimum password age and min password length for all password changes. Andrew Bartlett (This used to be commit 028f808c032becfa4618924cb301a4af2708fa96)
2002-12-20Forward port the change to talloc_init() to make all talloc contextsJeremy Allison1-1/+1
named. Ensure we can query them. Jeremy. (This used to be commit 842e08e52a665ae678eea239759bb2de1a0d7b33)
2002-11-20Spelling fix.Tim Potter1-1/+1
(This used to be commit 43cd6e5a702bb1004b36a5845e0765851395ebf2)
2002-11-12Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison1-9/+7
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
2002-11-08Make it easier to track things down here - add some debugs on failure.Andrew Bartlett1-0/+2
(This used to be commit 62ee7b7dc08e7be261211de8f85b8e9be4df7b54)
2002-10-23Reverted a fix from Volker (sorry). We need to move this fix to the correctJeremy Allison1-0/+3
place. Jeremy. (This used to be commit e46e38beabe8ae5b1ba1941dcffecbc89165ce2a)
2002-10-23Debug level 12 is a typo.Jeremy Allison1-2/+2
Jeremy. (This used to be commit 4d9b205362997f897be4739efd52ee2cfde4c6cb)
2002-10-23First cut of new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.Jeremy Allison1-1/+1
This is not 100% the same as what SuSE shipped in their Samba, there is a crash bug fix, a race condition fix, and a few logic changes I'd like to discuss with Andreas. Added Andreas to (C) notices for posix_acls.c Jeremy. (This used to be commit a81d700ae9c82d4b7ea631ab7862162a2ed3d512)
2002-10-21Same segfault as in add_groupmem.Volker Lendecke1-5/+10
Volker (This used to be commit 1f702dcd2ced6f64a619e3ddbb570f41f7f0986b)
2002-10-21This moves the group mapping API into the passdb backend.Volker Lendecke1-9/+9
Currently this calls back to mapping.c, but we have the framework to get the information into LDAP and the passdb.tdb (should we? I think so..). This has received moderate testing with net rpc vampire and usrmgr. I found the add_groupmem segfault in add_aliasmem as well, but that will be another checkin. Volker (This used to be commit f30095852fea19421ac8e25dfe9c5cd4b2206f84)
2002-10-19This fixes some bugs for NT4 usrmgr.exeVolker Lendecke1-7/+21
Volker (This used to be commit 32d6bcf3acefc77873a7241cc0c7e26241a65301)
2002-10-12Nice *big* patch from metze.Andrew Bartlett1-8/+9
The actual design change is relitivly small however: It all goes back to jerry's 'BOOL store', added to many of the elements in a SAM_ACCOUNT. This ensured that smb.conf defaults did not get 'fixed' into ldap. This was a great win for admins, and this patch follows in the same way. This patch extends the concept - we don't store values back into LDAP unless they have been changed. So if we read a value, but don't update it, or we read a value, find it's not there and use a default, we will not update ldap with that value. This reduced clutter in our LDAP DB, and makes it easier to change defaults later on. Metze's particular problem was that when we 'write back' an unchanged value, we would clear any muliple values in that feild. Now he can still have his mulitivalued 'uid' feild, without Samba changing it for *every* other operation. This also applies to many other attributes, and helps to eliminate a nasty race condition. (Time between get and set) This patch is big, and needs more testing, but metze has tested usrmgr, and I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly flawed ;-). The same system will be introduced into the SAM code shortly, but this fixes bugs that people were coming across in production uses of Samba 3.0/HEAD, hence it's inclusion here. Andrew Bartlett (This used to be commit 7f237bde212eb188df84a5d8adb598a93fba8155)
2002-10-08Third part of my fix for usrmgr. Assuming automagic mappingVolker Lendecke1-1/+1
only in parts of srv_samr_nt is not good. This is soo broken. :-) Volker (This used to be commit 74e4a3479f380b320daa0d46c0ba4daa9f98c18f)
2002-10-06try to put every security descriptors related definitions in the same file.Simo Sorce1-44/+44
also try to uniform names to a clean scheme. first part. (This used to be commit a123e05877caf90c28980be2d84b1d0b46e4fd21)
2002-09-30Second part of my fix -- incorrect merge.Volker Lendecke1-1/+1
(This used to be commit 2613d3a48a8d60c3db38406a1abd943dbe0b7d09)
2002-09-29We have to hand out info on Builtin here as well. They are stored inVolker Lendecke1-1/+1
group mapping not as local, but as WKN_GRP. Volker (This used to be commit cb05dcab2de117ea4db54af313a05905cd5a0d0a)
2002-09-26Patch from "Kai Krueger" <kai@kruegernetz.de> to get some more of our accessAndrew Bartlett1-4/+15
control bits right on the SAMR pipe. Andrew Bartlett (This used to be commit e87948c777b59592b130da081ef5d25600455d29)
2002-09-26Patch from "Stefan (metze) Metzmacher" <metze@metzemix.de> to do a *much*Andrew Bartlett1-2/+2
better job of working with usrmgr. Previously we were blanking out entires, and all sort of mischif. The new patch (which I've now had a chance to test/modify) also takes care not to expand % values (ie we go \\%L\%U -> \\server\user, we don't want to store \\server\user back) and to correctly notice 'not set' compared to 'null string' etc. Andrew Bartlett (This used to be commit ab878b6cc4132594fc33f78aeebf0d8b7266c150)
2002-09-23Ok, getting a bit more ambitious. Stop me, if this is wrong. ;-)Volker Lendecke1-4/+8
When creating a group you have to take care of the fact that the underlying unix might not like the group name. This change gets around that problem by giving the add group script the chance to invent a group name. It then must only return the newly created numerical gid. Volker (This used to be commit b959419ed38e66a12b63cad3e5fbfa849f952acc)
2002-09-19trivial comment fixVolker Lendecke1-2/+2
(This used to be commit 9d6331524089d76c5832b9ba001fb0e8a05f39d7)
2002-09-04Only cache the user list on the SAMR handle for a particularAndrew Bartlett1-6/+24
acb_mask/all_machines flag combination. The avoids a bug where we were listing users in the 'trusting domains' dialog in usrmgr. We might also need to invalidate the cache for some other SAMR actions. Andrew Bartlett (This used to be commit 65047aee7fefefaecded9772184a54c046ab1784)
2002-08-30Add a fix for 'query_disp_info level 2', which should return all machines inAndrew Bartlett1-19/+21
the DC's SAM. We were only returning workstations, not PDCs or BDCs. Win2k's 'Computer Manager' tool uses this to list all computers in the domain (as opposed to using NetBIOS). Andrew Bartlett (This used to be commit 004090edffef6cc04c286b9924b8c47ea3260ef2)
2002-08-30Removed some misleading comment.Volker Lendecke1-2/+0
Volker (This used to be commit 70cf2f1e2f0187c546a0193824ab85a416c5236c)
2002-08-29Move samr_make_sam_obj_sd to lib/util_seaccess.c. samtest now compiles andJelmer Vernooij1-40/+0
links successfully! (This used to be commit 0ea4bcb6b772a0d95d20f7c1a2a0c08a0ba9e466)
2002-08-28add proto for forward referenceHerb Lewis1-0/+1
(This used to be commit 7573fd1746dfe5034deb51a6d205e15af6ff81de)
2002-08-28Put in intermediate version of new SAM system. It's not stable yet, codeJelmer Vernooij1-3/+1
might be ugly, etc - please don't blame me for anything but instead try to fix the code :-). Compiling of the new sam system can be enabled with the configure option --with-sam Removing passdb/passgrp.c as it's unused fix typo in utils/testparm.c (This used to be commit 4b7de5ee236c043e6169f137992baf09a95c6f2c)
2002-08-16Return access granted in create_user2.Tim Potter1-3/+1
(This used to be commit 8ebc295f4a487993474390e0686d2aa9313be8d1)
2002-08-16Return the error if get_group_domain_entries() fails.Andrew Bartlett1-1/+3
(This used to be commit bc9e9e3e2e0d861f34de26a9ef8b627a86c9954d)
2002-08-15Rename unknown_0 field in create_user2 reply in the actual struct.Tim Potter1-1/+4
(This used to be commit 482d873c26bf02e27ffcd92042b476eda765a5ff)
2002-08-06Add SAMR 0x3e, which is samr_connect4. Seems to be the same as ourJim McDonough1-4/+56
existing connect (which I've been told is really connect2), with one extra dword. We've only seen 0x00000002 there... (This used to be commit 266344634944dff30f56453f9d86c490e7ac7a55)
2002-07-26Mimir has been busy with patches again, and sent in the followingAndrew Bartlett1-3/+1
patches: Andrew Bartlett From his e-mail: Below I attach the following patches as a result of my work on trusted domains support: 1) srv_samr_nt.c.diff This fixes a bug which caused to return null string as the first entry of enumerated accounts list (no matter what entry, it was always null string and rid) and possibly spoiled further names, depeding on their length. I found that while testing my 'net rpc trustdom list' against nt servers and samba server. 2) libsmb.diff Now, fallback to anonymous connection works correctly. 3) smbpasswd.c.diff Just a little fix which actually allows one to create a trusting domain account using smbpasswd 4) typos.diff As the name suggests, it's just a few typos fix :) (This used to be commit 888d595fab4f6b28318b743f47378cb7ca35d479)
2002-07-21More use of intermediate variables to avoid issues with pointer size and casts.Andrew Bartlett1-9/+27
Andrew Bartlett (This used to be commit 88b68f79721b5fea7ddcad5a83b9555528c75c20)
2002-07-20More fixes towards warnings on the IRIX compilerAndrew Bartlett1-9/+26
(and yes, some of these are real bugs) In particular, the samr code was doing an &foo of various types, to a function that assumed uint32. If time_t isn't 32 bits long, that broke. They are assignment compatible however, so use that and an intermediate variable. Andrew Bartlett (This used to be commit 30d0998c8c1a1d4de38ef0fbc83c2b763e05a3e6)
2002-07-05Remove C++ comments.Tim Potter1-2/+2
(This used to be commit 180374c4440765f3d08e5690967beb387ae3b54d)
2002-07-04More code from "Kai Krueger" <kai@kruegernetz.de>, this time starting to makeAndrew Bartlett1-0/+11
the 'user cannot change password' button work. Needs help from a future SAM backend, but at least this parses the data, and returns an error. Andrew Bartlett (This used to be commit 0c4afe075aa018ec2be10f36fd3f0a5af2a032f1)
2002-07-04Patch to add security descriptors to the SAMR pipe.Andrew Bartlett1-121/+602
This is not the final solution, I think this will probably changed with the move to the new SAM subsystem, but it allows some research and gives us somthing to start with. It should also help with getting proper NT_TOKEN passing set-up. Original patch by "Kai Krueger" <kai@kruegernetz.de>, which I have modified to pass back NTSTATUS returns in more places and to use a little more common code. Andrew Bartlett (This used to be commit 43b72493708e74e089989db42a003a3862c793e6)
2002-07-03Break up the passdb objects (to allow RPC clients to link without brining inAndrew Bartlett1-148/+111
*.o) and implment new enum_dom_users code in the SAMR RPC subsystem. Incresingly, we are using the pdb_get_{user,group}_sid() functions, in the eventual hope that we might one day support muliple domains off a single passdb. To extract the RID, we use sid_peek_check_rid(), and supply an 'expected' domain SID. The id21 -> SAM_ACCOUNT and id23 -> SAM_ACCOUNT code has been moved to srv_samr_util.c, to ease linking in passdb users. Compatiblity code that uses 'get_global_sam_sid()' for the 'expected' sid is in pdb_compat.c Andrew Bartlett (This used to be commit 5a2a6f1ba316489d118a8bdd9551b155226de94f)
2002-06-25I'm going to try and check this against Win2k shortly, but I'm certain thatAndrew Bartlett1-1/+1
'NT_STATUS_OK' is not the right answer here. Try NO_MORE_ENTRIES for now. Andrew Bartlett (This used to be commit c98b9a965905f1876b4884f932ff2e0237d85b03)
2002-06-18more debug classess activatedSimo Sorce1-0/+3
(This used to be commit 897e64d2e0c1d04ab93441ccaffe369bf43be46e)
2002-06-14Add const, kill of useless casts and therefore eliminate warnings.Andrew Bartlett1-1/+1
Andrew Bartlett (This used to be commit 29490f214750acd44cee6c4ab1354722d82d853a)
2002-06-13Latest patch from metze <metze@metzemix.de> to move most of samba acrossAndrew Bartlett1-12/+3
to using SIDs instead of RIDs. The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument. The idea here is to prevent mistakes where the SID is implict, but isn't the same one that we have in the struct. Andrew Bartlett (This used to be commit 04f9a8ff4c7982f6597c0f6748f85d66d4784901)
2002-06-09This (hopefully) fixes a bug reported by Kai Krueger <kai@kruegernetz.de>Andrew Bartlett1-14/+6
involving the use of lp_winbind_gid() without checking if they have been set. Also revert the 'clashing user' check back to a Get_Pwnam() - I probably should never have changed it. Andrew Bartlett (This used to be commit 1d6ba405589cee4e1582bc91cf659b89564899d4)
2002-06-07Globally replace 'global_sam_sid' with get_global_sam_sid(), a selfAndrew Bartlett1-20/+19
initialising function. This patch thanks to the work of "Stefan (metze) Metzmacher" <metze@metzemix.de> This is partly to enable the transition to SIDs in the the passdb. Andrew Bartlett (This used to be commit 96afea638e15d4cbadc57023a511094a770c6adc)
2002-06-04Update the SAMR pipe for more use of NTSTATUS and to talloc the stored list ofAndrew Bartlett1-96/+141
users/groups for better memory accounting. Andrew Bartlett (This used to be commit fe7c5efe91ab77784af9dbb56716170f4c6fd057)
2002-06-03Restrict anonymous checks for the SAMR pipe. This is done byTim Potter1-0/+27
returning access denied for a SAMR_CONNECT by an anonymous user which seems to be the way 2K does it rather than blocking individual RPC calls like NT. Also checked is the SAMR_GET_DOM_PWINFO rpc which for some reason doesn't require a policy handle to return information. No idea what it's actually used. (This used to be commit 40c68fa85c31c1baf7ba2c8ed62cd06c34711913)