summaryrefslogtreecommitdiffstats
path: root/source/groupdb/mapping.c
Commit message (Collapse)AuthorAgeFilesLines
* Globally replace 'global_sam_sid' with get_global_sam_sid(), a selfAndrew Bartlett2002-06-071-6/+4
| | | | | | | | | 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
* DEBUG cleanup.Jean-François Micouleau2002-04-191-1/+1
| | | | J.F.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Since we have dynamic initialisation in the group mapping code, makeTim Potter2002-01-291-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...
* Patch from Kevin Stefanik <kstef@mtppi.org> to do some more error checking forAndrew Bartlett2002-01-271-6/+24
| | | | group mapping init failures.
* A nice *big* change to the fundemental way we do things.Andrew Bartlett2002-01-171-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
* don't try to allocate zero bytesAndrew Tridgell2002-01-131-10/+7
|
* When re-writing tdb version numbers as little endian int32, we mustJeremy Allison2002-01-091-6/+8
| | | | | change the version number also. Jeremy.
* Fixed all uses of tdb_fetch/store/_int to use explicit int32 little endianJeremy Allison2002-01-091-5/+18
| | | | | in tdb's. All except winbindd_idmap.... Hmmmmmm. Jeremy.
* Fixed nasty cast of tdb_delete in traversals.Jeremy Allison2002-01-031-1/+1
| | | | Jeremy.
* Actually enforce the passdb API.Andrew Bartlett2002-01-021-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
* added a boolean to the group mapping functions to specify if we need orJean-François Micouleau2001-12-041-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.
* added a tdb to store the account policy informations.Jean-François Micouleau2001-12-031-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.
* init group db before useAndrew Tridgell2001-12-031-0/+12
| | | | this fixes the smbpasswd segvs
* groups in the Builtin domain S-5-32 are alias and not well-known groupsJean-François Micouleau2001-12-011-11/+15
| | | | J.F.
* Missing return in free_privilege()Tim Potter2001-11-301-0/+2
|
* Changed again how the privilege list is handled in the group mapping code.Jean-François Micouleau2001-11-291-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.
* added "net join" commandAndrew Tridgell2001-11-241-2/+2
| | | | this completes the first stage of the smbd ADS support
* added lsaenumprivsaccount and lsalookupprivvalue to rpcclientJean-François Micouleau2001-11-241-0/+10
| | | | | | and more to come ... J.F.
* Changed how the privileges are stored in the group mapping code. It's nowJean-François Micouleau2001-11-231-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.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-1/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-3/+3
|
* fixed compilation of groupdbAndrew Tridgell2001-09-171-3/+3
|
* move to SAFE_FREE()Simo Sorce2001-09-171-10/+9
|
* got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell2001-09-061-1/+1
|
* this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce2001-08-121-5/+22
| | | | | | many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also.
* Added "use mmap" for HPUX.Jeremy Allison2001-07-301-1/+1
| | | | Jeremy.
* when retrieving by sid fill also the map.sid fieldJean-François Micouleau2001-07-091-5/+6
|
* use LDSHFLAGS not -shared in several placesAndrew Tridgell2001-06-041-1/+1
|
* groupdb/mapping.c: Fix gcc compiler warning.Jeremy Allison2001-05-171-1/+1
| | | | | smbd/connection.c: Sync up with code in 2.2 Jeremy.
* fixes to the group mapping code.Jean-François Micouleau2001-05-081-0/+1
| | | | | | Not ready yet. J.F.
* Big cleanup of passdb and backends.Jean-François Micouleau2001-05-041-11/+26
| | | | | | | I did some basic tests but I have probably broken something. Notably the password changing. So don't cry ;-) J.F.
* Merge of Andrew's changes in 2.2.Jeremy Allison2001-04-131-4/+4
| | | | Jeremy.
* groupdb/mapping.c:Jeremy Allison2001-03-231-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.
* first pass of the new group mapping codeJean-François Micouleau2001-03-231-0/+754
J.F.