summaryrefslogtreecommitdiffstats
path: root/source/lib/util_sid.c
Commit message (Collapse)AuthorAgeFilesLines
* r22611: Fix from Jens Nissen <jens.nissen@gmx.net>. Fix badJeremy Allison2007-04-301-3/+0
| | | | | | | | | | | memory leak I introduced into acl code, also remove redundent extra check for global_sid_System : global_sid_System == S-1-5-18 which is already included in the check for a domain of global_sid_NT_Authority == S-1-5 Jeremy.
* r22481: Move check for non-mappable SIDs to after sid_to_uid,Jeremy Allison2007-04-231-0/+3
| | | | | | sid_to_gid mapping, add LocalSystem to non-mappable list. Jeremy.
* r20090: Fix a class of bugs found by James Peach. EnsureJeremy Allison2006-12-091-16/+15
| | | | | | | | | | | | | we never mix malloc and talloc'ed contexts in the add_XX_to_array() and add_XX_to_array_unique() calls. Ensure that these calls always return False on out of memory, True otherwise and always check them. Ensure that the relevent parts of the conn struct and the nt_user_tokens are TALLOC_DESTROYED not SAFE_FREE'd. James - this should fix your crash bug in both branches. Jeremy.
* r19801: grabbing minor changes (some missing pieces from jmcd's SAMR work as ↵Gerald Carter2006-11-201-2/+2
| | | | well)
* r19795: * bring the 'enum lsa_SidType', 'struct GUID', & 'structGerald Carter2006-11-191-2/+2
| | | | policy_handle' over from SAMBA_3_0.
* r16418: Pull in more Klocwork fixes (up to r16415)Gerald Carter2006-06-201-0/+19
|
* r15837: starting sync up for 3.0.23rc1 (in sync with SAMBA_3_0 r15822)Gerald Carter2006-05-231-0/+20
|
* r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison2006-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy.
* r13316: Let the carnage begin....Gerald Carter2006-02-031-0/+5
| | | | Sync with trunk as off r13315
* r13024: Add is_null_sid.Günther Deschner2006-01-191-0/+6
| | | | GUenther
* r12387: Make string_to_sid a little more silent.Jeremy Allison2005-12-201-2/+2
| | | | Jeremy.
* r12169: Remove an unused functionVolker Lendecke2005-12-101-35/+0
|
* r12051: Merge across the lookup_name and lookup_sid work. Lets see how the ↵Volker Lendecke2005-12-031-42/+3
| | | | | | | | build farm reacts :-) Volker
* r11230: Remove the '//' i was using to test something...oopsJim McDonough2005-10-201-1/+1
|
* r11229: an even bigger speedup spotted by Volker. string_to_sid() is now ↵Jim McDonough2005-10-201-2/+2
| | | | | | | taking 1/5th the time it used to. Replace strcasecmp with invididual char checks for "S-" sid prefix.
* r11228: Speed up string_to_sid by removing next_token calls, thus eliminatingJim McDonough2005-10-201-34/+27
| | | | the need for allocating memory to duplicate the string.
* r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4Jeremy Allison2005-10-181-6/+5
| | | | | x86_64 box. Jeremy.
* r7415: * big change -- volker's new async winbindd from trunkGerald Carter2005-06-081-1/+7
|
* r6263: Get rid of generate_wellknown_sids, they are const static and ↵Volker Lendecke2005-04-091-88/+53
| | | | | | | | initializable statically. Volker
* r6080: Port some of the non-critical changes from HEAD to 3_0. The main one ↵Volker Lendecke2005-03-271-4/+23
| | | | | | | | is the change in pdb_enum_alias_memberships to match samr.idl a bit closer. Volker
* r4724: Add support for Windows privileges in Samba 3.0Gerald Carter2005-01-131-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (based on Simo's code in trunk). Rewritten with the following changes: * privilege set is based on a 32-bit mask instead of strings (plans are to extend this to a 64 or 128-bit mask before the next 3.0.11preX release). * Remove the privilege code from the passdb API (replication to come later) * Only support the minimum amount of privileges that make sense. * Rewrite the domain join checks to use the SeMachineAccountPrivilege instead of the 'is a member of "Domain Admins"?' check that started all this. Still todo: * Utilize the SePrintOperatorPrivilege in addition to the 'printer admin' parameter * Utilize the SeAddUserPrivilege for adding users and groups * Fix some of the hard coded _lsa_*() calls * Start work on enough of SAM replication to get privileges from one Samba DC to another. * Come up with some management tool for manipultaing privileges instead of user manager since it is buggy when run on a 2k client (haven't tried xp). Works ok on NT4.
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2004-12-071-3/+3
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
* r316: Fix split_domain_name. This defaulted to get_myname() instead ofVolker Lendecke2004-04-211-8/+14
| | | | | | | | | | | get_global_sam_name(). Error case: Adding a domain user to a XP local group did a lsalookupname on the user without domain prefix, and this then failed. Jerry: This is a must-fix before 3.0.3. Volker
* r196: merging struct uuid from trunkGerald Carter2004-04-131-17/+0
|
* r91: Fix lsalookupnames. Previously we'd fail if we didn't find the name, butJim McDonough2004-04-061-0/+7
| | | | we never checked if it was a domain user and didn't find a local one.
* r4: merge in the SAMBA_3_0 branch from cvsCVS Import User2004-04-041-0/+17
| | | | | | | | to checkout try this: svn co svn+ssh://svn.samba.org/home/svn/samba/branches/SAMBA_3_0 samba-3_0-work metze
* r2: import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunkCVS Import User2004-04-041-0/+636
metze