summaryrefslogtreecommitdiff
path: root/source3/groupdb
AgeCommit message (Collapse)AuthorFilesLines
2002-01-29Since we have dynamic initialisation in the group mapping code, makeTim Potter1-72/+94
init_group_mapping() a static function and don't call it from any client programs. Not sure whether I've made a bigger mess here or not... (This used to be commit 3c887d9021269aaa9fc0bc771af8589077e6208e)
2002-01-27Patch from Kevin Stefanik <kstef@mtppi.org> to do some more error checking forAndrew Bartlett1-6/+24
group mapping init failures. (This used to be commit cd6a2dad4e3092a19f784b6548fce49ecd8bb549)
2002-01-17A nice *big* change to the fundemental way we do things.Andrew Bartlett1-1/+2
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)
2002-01-13don't try to allocate zero bytesAndrew Tridgell1-10/+7
(This used to be commit d09616da6823b69a03a8a008987c4eb02ca0061b)
2002-01-09When re-writing tdb version numbers as little endian int32, we mustJeremy Allison1-6/+8
change the version number also. Jeremy. (This used to be commit 3dec9cf99a82bd15626eb99e7d937ff00183cc05)
2002-01-09Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endianJeremy Allison1-5/+18
in tdb's. All except winbindd_idmap.... Hmmmmmm. Jeremy. (This used to be commit ec71f1732b6b27bd2d65b250a6f3720a235dc38d)
2002-01-03Fixed nasty cast of tdb_delete in traversals.Jeremy Allison1-1/+1
Jeremy. (This used to be commit a0cdec3acc82d1ce0292fadd4b8dac23638450f3)
2002-01-02Actually enforce the passdb API.Andrew Bartlett1-1/+1
Thou shalt not reference SAM_ACCOUNT members directly - always use pdb_get/pdb_set. This is achived by making the whole of SAM_ACCOUNT have a .private member, where the real members live. This caught a pile of examples, and these have beeen fixed. The pdb_get..() functions are 'const' (have been for some time) and this required a few small changes to constify other functions. I've also added some debugs to the pdb get and set, they can be removed if requested. I've rewritten the copy_id2x_to_sam_pass() functions to use the new passdb interface, but I need the flags info to do it properly. The pdb_free_sam() funciton now blanks out the LM and NT hashes, and as such I have removed many extra 'samr_clear_sam_passwd(smbpass)' calls as a result. Finally, any and all testing is always appriciated - but the basics seem to work. Andrew Bartlett (This used to be commit d3dd28f6c443187b8d820d5a39c7c5b3be2fa95c)
2001-12-04added a boolean to the group mapping functions to specify if we need orJean-François Micouleau1-27/+69
not the privileges. Usually we don't need them, so the memory is free early. lib/util_sid.c: added some helper functions to check an SID. passdb/passdb.c: renamed local_lookup_rid() to local_lookup_sid() and pass an RID all the way. If the group doesn't exist on the domain SID, don't return a faked one as it can collide with a builtin one. Some rpc structures have been badly designed, they return only rids and force the client to do subsequent lsa_lookup_sid() on the domain sid and the builtin sid ! rpc_server/srv_util.c: wrote a new version of get_domain_user_groups(). Only the samr code uses it atm. It uses the group mapping code instead of a bloody hard coded crap. The netlogon code will use it too, but I have to do some test first. J.F. (This used to be commit 6c87e96149101995b7d049657d5c26eefef37d8c)
2001-12-03added a tdb to store the account policy informations.Jean-François Micouleau1-0/+3
You can change them with either usermanager->policies->account or from a command prompt on NT/W2K: net accounts /domain we can add a rpc accounts to the net command. As the net_rpc.c is still empty, I did not start. How should I add command to it ? Should I take the rpcclient/cmd_xxx functions and call them from there ? alse changed the SAM_UNK_INFO_3 parser, it's an NTTIME. This one is more for jeremy ;-) J.F. (This used to be commit bc28a8eebd9245ce3004ae4b1a359db51f77bf21)
2001-12-03init group db before useAndrew Tridgell1-0/+12
this fixes the smbpasswd segvs (This used to be commit d2bcdfd995b9562872d865e723b23ed84247a73f)
2001-12-01groups in the Builtin domain S-5-32 are alias and not well-known groupsJean-François Micouleau1-11/+15
J.F. (This used to be commit 192978e3fc96bc60fc3ceaad8f024bc91bf69da7)
2001-11-30Missing return in free_privilege()Tim Potter1-0/+2
(This used to be commit b35d90cd89849f0a01e8c79f0962ec9388673ad1)
2001-11-29Changed again how the privilege list is handled in the group mapping code.Jean-François Micouleau1-104/+307
This time it's a PRIVILEGE_SET struct instead of a simple uint32 array. It makes much more sense. Also added a uint32 systemaccount to the GROUP_MAP struct as some privilege showing in USRMGR.EXE are not real privs but a bitmask flag. I guess it's an heritage from NT 3.0 ! I could setup an NT 3.1 box to verify, but I'm too lazy (yes I still have my CDs). Added 3 more LSA calls: SetSystemAccount, AddPrivileges and RemovePrivileges, we can manage all this privilege from UserManager. Time to change the NT_USER_TOKEN struct and add checks in all the rpc functions. Fun, fun, fun. J.F. (This used to be commit 3f0a9ef2b8c626cfa2878394bb7b642342342bf3)
2001-11-24added "net join" commandAndrew Tridgell1-2/+2
this completes the first stage of the smbd ADS support (This used to be commit 058a5aee901e6609969ef7e1d482a720a84a4a12)
2001-11-24added lsaenumprivsaccount and lsalookupprivvalue to rpcclientJean-François Micouleau1-0/+10
and more to come ... J.F. (This used to be commit 1748d5a2af1f2dcf718d6f162ed483b001542494)
2001-11-23Changed how the privileges are stored in the group mapping code. It's nowJean-François Micouleau1-52/+163
an array of uint32. That's not perfect but that's better. Added more privileges too. Changed the local_lookup_rid/name functions in passdb.c to check if the group is mapped. Makes the LSA rpc calls return correct groups Corrected the return code in the LSA server code enum_sids. Only enumerate well known aliases if they are mapped to real unix groups. Won't confuse user seeing groups not available. Added a short/long view to smbgroupedit. now decoding rpc calls to add/remove privileges to sid. J.F. (This used to be commit f29774e58973f421bfa163c45bfae201a140f28c)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter5-7/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-17move to SAFE_FREE()Simo Sorce1-3/+3
(This used to be commit e61aec84edaf55b9ee087b076d2f1311033dc839)
2001-09-17fixed compilation of groupdbAndrew Tridgell1-3/+3
(This used to be commit 23e2561a1c303942cfceae8929e0806db91b4aa4)
2001-09-17move to SAFE_FREE()Simo Sorce5-22/+15
(This used to be commit 89833bbbd8508dcdca70dff2c94e1d8f22535f1f)
2001-09-06got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell1-1/+1
(This used to be commit c26e0d3f27a05ecc8bd2390f9aab7f9451524e47)
2001-08-19Realloc fix.Jeremy Allison1-6/+5
Jeremy. (This used to be commit 82153dde951ff7af3655f466cb2ea42c3195bdff)
2001-08-19Realloc fixes.Jeremy Allison1-13/+8
Jeremy. (This used to be commit 6b90263292d03b1ae2d5d18952e78fc26066f30d)
2001-08-19Realloc fixes.Jeremy Allison1-6/+5
Jeremy. (This used to be commit e4ef9e332fff99eb66101a3737a7efc3b7493cc5)
2001-08-19Realloc fixes.Jeremy Allison1-2/+3
Jeremy. (This used to be commit 560ae7615eb8eca2c872b1196ce0b9534bf8ad76)
2001-08-12this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce5-13/+42
many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also. (This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9)
2001-07-30Added "use mmap" for HPUX.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 840802f10677cb0009cb4df4c37c7d01aa5edacd)
2001-07-09when retrieving by sid fill also the map.sid fieldJean-François Micouleau1-5/+6
(This used to be commit f47797fa9595fb19d9e29ef43c5d0135268db455)
2001-06-04use LDSHFLAGS not -shared in several placesAndrew Tridgell1-1/+1
(This used to be commit 8ec9c87b5d1a7dae17d5b1a30f58effaf5e69e4b)
2001-05-17groupdb/mapping.c: Fix gcc compiler warning.Jeremy Allison1-1/+1
smbd/connection.c: Sync up with code in 2.2 Jeremy. (This used to be commit 87025c223dd33f2e02060c2a5cd45502946c87c6)
2001-05-08fixes to the group mapping code.Jean-François Micouleau1-0/+1
Not ready yet. J.F. (This used to be commit 62a7a567fdea230b77cc97a3f74d868542c34700)
2001-05-04Big cleanup of passdb and backends.Jean-François Micouleau1-11/+26
I did some basic tests but I have probably broken something. Notably the password changing. So don't cry ;-) J.F. (This used to be commit a4a4c02b12f030a3b9e6225b999c90689dfc4719)
2001-04-13Merge of Andrew's changes in 2.2.Jeremy Allison1-4/+4
Jeremy. (This used to be commit fc76681812b1469208ad6c8847afdfc68bc6db49)
2001-03-23groupdb/mapping.c:Jeremy Allison1-1/+1
include/proto.h: Fix missing (void) in proto. rpc_server/srv_samr_nt.c: Fix user private group problem by filtering out groups that clash with users. smbd/posix_acls.c: Ensure default ACE's are sensible. utils/pdbedit.c: Fix from Simo Sorce. Jeremy. (This used to be commit 29414fe0d6665642d9b5f88a35e712426376c47f)
2001-03-23first pass of the new group mapping codeJean-François Micouleau1-0/+754
J.F. (This used to be commit 7154deb026d53cb0cd503562174c3332a372be63)
2000-04-25moved trans2.h and nterr.h into includes.h with all our other includesAndrew Tridgell2-2/+0
(This used to be commit d7cd7c88fdabb01d9e40ae8a657737907a21ac37)
1999-12-132nd phase of head branch sync with SAMBA_2_0 - this delets all the files ↵Andrew Tridgell7-2762/+0
that were in the head branch but weren't in SAMBA_2_0 (This used to be commit d7b208786590b5a28618590172b8d523627dda09)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell4-351/+160
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-08-05reverted lookup change. from ignacio.Luke Leighton1-1/+1
(This used to be commit 5b8961a9d4ef6c8188062aaca7f42151ff9684ae)
1999-07-13renamed getfilepwent() and endfilepwent() to getfileent() and endfileent()Luke Leighton2-4/+4
as they are generic "file line-by-line" reading routines. lines with "#" at the front are ignored (as comments). this code started out as the password file reading code. (This used to be commit ef6df590fdf65a6d94b343998bac3a4d48ae07e0)
1999-07-08Ignacio Coupeau <icoupeau@unav.es> suggested modification to ldap search.Luke Leighton1-1/+1
(This used to be commit 7d6337641703884a5c6914ca6e292d67ea0c803b)
1999-03-09Greg Dickie spotted some wierd memory corruption problem with groupLuke Leighton3-21/+21
database enumeration. (This used to be commit b0381bb262f51fca916fb951fc0c7e54a58e2dd3)
1999-02-19last unix group not being listed. spotted by jacques sansdrap.Luke Leighton3-3/+3
(This used to be commit 2d5fc5c7cf2086c396c853c13a3409bfac77d05c)
1999-02-03cache unix groups so that two-level getgrent calls don't occur.Luke Leighton3-23/+146
(This used to be commit f7dfa55a2e191ae780d399026bce48f68cda4bf0)
1999-01-15Finally committing my LDAP changes.Matthew Chapman3-49/+385
* Added new APIs for modifying groups. * RIDs are allocated similarly to NT, starting from 1000 and incrementing by 1 for each new user/group. * RIDs are now consistently in hex * Fixed bugs reported by Allan Bjorklund <allan@umich.edu>: - ldap_close_connection is exported by OpenLDAP - changed to ldap_disconnect - Missing ldap_connect() in getusergroups functions - ldap_next_entry was being called too early while retrieving a sam_struct - LDAP globals should be extern in sampassldap.c * Fixed bugs reported by Martin Hofbauer <mh@bacher.at> - Newly added workstation trust accounts had attributes DU rather than W. - User dn's were forced to start with "uid=XX" rather than using the existing dn. (This used to be commit 91c77f5432169553572bb4d85ad5f09d17524f20)
1998-12-07added ldap files by Matthew Chapman.Luke Leighton3-0/+951
(This used to be commit 2bc031e8fafeafdc58c6a8056597b647d00657ae)
1998-12-07- lib/unix_sec_ctxt.cLuke Leighton8-31/+189
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-02added rid and sid_name_use to DOMAIN_GRP_MEMBER, for use in group memberLuke Leighton1-3/+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-01ok. unix-nt mapping code issuesLuke Leighton3-6/+6
need to check, when looking up group members, that a group member is a unix user [being mapped to an nt user] FIRST then if that fails check that a group member is a unix group [being mapped to an nt group]. why? because you can have group names in a unix /etc/group file with the same name as users. this _might_ be a problem... (This used to be commit 585d47644d3d709ccdfd5135c5f77166b609eb3b)