summaryrefslogtreecommitdiff
path: root/source3/lib/util_pw.c
AgeCommit message (Collapse)AuthorFilesLines
2010-08-26s3-build: only include memcache.h where needed.Günther Deschner1-0/+1
Guenther
2008-11-14Make memcache_add_talloc NULL out the source pointerVolker Lendecke1-1/+1
This is an orthogonality measure to make clear this pointer now belongs to the cache. (cherry picked from commit e6080c6e87d6fe3995b121a772bf3f6343fa666f)
2008-11-14Rename some variables in getpwnam_alloc() for clarityVolker Lendecke1-11/+12
2008-11-14sys_pwnam doesn't return talloced memory, so don't mix up the returned struct.Volker Lendecke1-4/+1
(cherry picked from commit eb99923991960e53bd150ac8f1d818cb746101b4)
2008-11-06Make us clean under valgrind --leak-check=full by using ↵Jeremy Allison1-1/+1
talloc_autofree_context() instead of NULL. Remove the code in memcache that does a TALLOC_FREE on stored pointers. That's a disaster waiting to happen. If you're storing talloc'ed pointers, you can't know their lifecycle and they should be deleted when their parent context is deleted, so freeing them at some arbitrary point later will be a double-free. Jeremy.
2008-10-13Add data_blob_string_const_null() function that includes the terminatingJelmer Vernooij1-2/+2
null byte and use it in Samba 3. This matches the behaviour prior to my data_blob changes.
2007-12-21Convert the pwnam cache to memcacheVolker Lendecke1-53/+15
(This used to be commit 032c5589fe7f9f2fcb0f336e72517a81a720b6ce)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach1-1/+1
failed expression in SMB_ASSERT. (This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713)
2007-10-10r22026: Missed in my last commit, another case where we need to copy, not ↵Andrew Bartlett1-1/+1
reference. Andrew Bartlett (This used to be commit 635b83a21683068eb3908506d5ee1191e55381d1)
2007-10-10r22024: Don't leak, actually use the provided memory context...Andrew Bartlett1-1/+1
(This used to be commit 46ff4e599e79f47254e05c7e4db75db9a19934bc)
2007-10-10r22023: I don't like this cache, but I think Jeremy is right, the consequencesAndrew Bartlett1-2/+2
of the talloc heirarchy created are too subtle, particularly with callers picking out individual members. This might fix the faults on the build farm. Andrew Bartlett (This used to be commit 82667bc75e63292c61f73c1f7cde809cc3dd55b0)
2007-10-10r22020: Make it more clear that both the vuser struct and it's contents areAndrew Bartlett1-6/+6
talloc_free()'ed at the end of a session. Rework the passwd cache code to use talloc_unlink and talloc_reference, to more carefully manage the cache. Andrew Bartlett (This used to be commit e3e0ec25e67308de314aa61852905ee42aa2c8fe)
2007-10-10r17334: Some C++ warningsVolker Lendecke1-2/+2
(This used to be commit 8ae7ed1f3cecbb5285313d17b5f9511e2e622f0b)
2007-10-10r14764: Fix possible null pointer deref. Coverity #253.Jeremy Allison1-2/+4
Jeremy. (This used to be commit 7a18f38947385b8a5fb27a42610320003689e9e1)
2007-10-10r13601: * Remove unused code from pdb_ldap.cGerald Carter1-5/+4
* Add a 'struct passwd *' to the struct samu for later reference (I know this may be controversial but its easily reverted which is is why I'm checking this is as a seaparate patch before I get too deep). * Remove unix_homedir from struct samu {} and update the pdb wrapper functions associated with it. (This used to be commit 92c251fdf0f1f566cfeca3c75ba2284b644aef5d)
2007-10-10r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()Gerald Carter1-2/+2
macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2)
2007-10-10r13316: Let the carnage begin....Gerald Carter1-49/+30
Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
2007-10-10r5647: Caches are good for performance, but you get a consistency problem.Volker Lendecke1-0/+14
Fix bug # 2401. Volker (This used to be commit eb4ef94f244d28fe531d0b9f724a66ed3834b687)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-1/+1
allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
2007-10-10r3702: This is a getpwnam-cache. It is mainly to speed up Samba with slow nssVolker Lendecke1-0/+43
backends such as nss_ldap. Volker (This used to be commit a8bd0b75042f73b753fc1cb8a52e6e90372fd1fe)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-46/+2
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-03-18more verbose checking in talloc and util_pwSimo Sorce1-1/+1
fixed tdbsam memory corruption (and segfault) reducing calls to pdb_uid_to_user_rid and countrary to 0 to move to a non alghoritmic rid allocation with some passdb modules. (This used to be commit 9836af7cd623357feaec07bc49cfb78f0aa01fc3)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-17A nice *big* change to the fundemental way we do things.Andrew Bartlett1-0/+134
Samba (ab)uses the returns from getpwnam() a lot - in particular it keeps them around for a long time - often past the next call... This adds a getpwnam_alloc and a getpwuid_alloc to the collection. These function as expected, returning a malloced structure that can be free()ed with passwd_free(&passwd). This patch also cuts down on the number of calls to getpwnam - mostly by taking advantage of the fact that the passdb interface is already case-insensiteve. With this patch most of the recursive cases have been removed (that I know of) and the problems are reduced further by not using the sys_ interface in the new code. This means that pointers to the cache won't be affected. (This is a tempoary HACK, I intend to kill the password cache entirly). The only change I'm a little worried about is the change to rpc_server/srv_samr_nt.c for private groups. In this case we are getting groups from the new group mapping DB. Do we still need to check for private groups? I've toned down the check to a case sensitve match with the new code, but we might be able to kill it entirly. I've also added a make_modifyable_passwd() function, that copies a passwd struct into the form that the old sys_getpw* code provided. As far as I can tell this is only actually used in the pass_check.c crazies, where I moved the final 'special case' for shadow passwords (out of _Get_Pwnam()). The matching case for getpwent() is dealt with already, in lib/util_getent.c Also included in here is a small change to register the [homes] share at vuid creation rather than just in one varient of the session setup. (This picks up the SPNEGO cases). The home directory is now stored on the vuid, and I am hoping this might provide a saner way to do %H substitions. TODO: Kill off remaining Get_Pwnam_Modify calls (they are not needed), change the remaining sys_getpwnam() callers to use getpwnam_alloc() and move Get_Pwnam to return an allocated struct. Andrew Bartlett (This used to be commit 1d86c7f94230bc53daebd4d2cd829da6292e05da)