summaryrefslogtreecommitdiffstats
path: root/source/lib/username.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixed incorrect debug.Tim Potter2002-04-151-1/+1
|
* Update some of the DEBUG()s in Get_Pwnam_internal()Andrew Bartlett2002-03-231-8/+11
| | | | Andrew Bartlett
* Make this function staticAndrew Bartlett2002-02-271-1/+1
|
* Thanks to David Edward Shapiro <David.Edward.Shapiro@btitele.com> for spottingAndrew Bartlett2002-02-201-1/+1
| | | | | | | | this! (groupname and domain name paramaters swapped, giving 'interesting' results...) Andrew Bartlett
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Some more 'winbind default domain' support patches from Alexander BokovoyAndrew Bartlett2002-01-271-0/+27
| | | | | | | | | | | <a.bokovoy@sam-solutions.net>. This patch is designed to remove the 'special cases' required for this support. In particular this now kills off winbind_initgroups, as it appears no longer to be required. Andrew Bartlett
* Bring this code into line with new winbind_lookup_name() interface. I thinkAndrew Bartlett2002-01-261-10/+23
| | | | | | | | | this might need a bit more work - or at least documentation. This is certainly a worthwile little hack, as it avoids the need to invert the group database. I don't think we should allow unqualified domains here - as that allows us to distinguish between (at least some) usernames and these 'special' groups.
* This is the 'winbind default domain' patch from Alexander BokovoyAndrew Bartlett2002-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <a.bokovoy@sam-solutions.net>. The idea is the domain\username is rather harsh for unix systems - people don't expect to have to FTP, SSH and (in particular) e-mail with a username like that. This 'corrects' that - but is not without its own problems. As you can see from the changes to files like username.c and wb_client.c (smbd's winbind client code) a lot of assumptions are made in a lot of places about lp_winbind_seperator determining a users's status as a domain or local user. The main change I will shortly be making is to investigate and kill off winbind_initgroups() - as far as I know it was a workaround for an old bug in winbind itself (and a bug in RH 5.2) and should no longer be relevent. I am also going to move to using the 'winbind uid' and 'winbind gid' paramaters to determine a user/groups's 'local' status, rather than the presence of the seperator. As such, this functionality is recommended for servers providing unix services, but is currently less than optimal for windows clients. (TODO: remove all references to lp_winbind_seperator() and lp_winbind_use_default_domain() from smbd) Andrew Bartlett
* A nice *big* change to the fundemental way we do things.Andrew Bartlett2002-01-171-28/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Separate out get_user_home_dir() from get_user_home_service_dir().Jeremy Allison2002-01-161-0/+19
| | | | Jeremy.
* Merged in %S fixes and XX_NOT_CHANGED fixes from 2.2.Jeremy Allison2002-01-161-6/+9
| | | | Jeremy.
* fixed warnings on irix and crash bug on big endian machinesAndrew Tridgell2001-12-201-4/+4
|
* A fix to override the location of a user's home directory if it isTim Potter2001-12-181-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the [homes] section of the smb.conf file. Jeremy, can you take a look at this? This is in response to someone on the samba mailing list worrying about it. Tim. From: Phil Thompson <philnanne@mediaone.net> To: samba@lists.samba.org Subject: Different [homes] behavior in 2.2.2 X-Original-Date: Mon, 17 Dec 2001 23:09:28 -0500 Is it possible to configure samba to disregard the home directory in the passwd file when using [homes]? Even though an alternate "path" is set in [homes], the service fails since the unix home directory is invalid (nonexistent) on the server. [...] This behavior of validating the user's home dir as set in the passwd files appears to be new in 2.2.2 and the latest CVS. Anyway to work around this?
* Added the group enum code from 2.2Jeremy Allison2001-12-141-13/+15
| | | | Jeremy.
* I see no reasons why we should limit username lenght while checkingSimo Sorce2001-12-141-4/+0
| | | | | | see bug 22130 jeremy, probably this should be fixed also in 2_2
* winbindd friendly user_in_list code. Tested on a 65k user domain.Jeremy Allison2001-12-041-7/+15
| | | | Jeremy.
* Moved name_is_local to the correct place. Ooops.Jeremy Allison2001-12-041-0/+10
| | | | Jeremy.
* Tidyup of lib/username. Add name_is_local fn to determine if name isJeremy Allison2001-12-041-171/+173
| | | | | winbindd. Getting ready for efficiency fix in group lookups. Jeremy.
* Look for DOMAIN\group in group lists and ask winbind.Jeremy Allison2001-11-131-68/+89
| | | | Jeremy.
* This commit is number 4 of 4.Andrew Bartlett2001-10-291-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular this commit focuses on: Actually adding the 'const' to the passdb interface, and the flow-on changes. Also kill off the 'disp_info' stuff, as its no longer used. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes introduces a large dose of 'const' to the Samba tree. There are a number of good reasons to do this: - I want to allow the SAM_ACCOUNT structure to move from wasteful pstrings and fstrings to allocated strings. We can't do that if people are modifying these outputs, as they may well make assumptions about getting pstrings and fstrings - I want --with-pam_smbpass to compile with a slightly sane volume of warnings, currently its pretty bad, even in 2.2 where is compiles at all. - Tridge assures me that he no longer opposes 'const religion' based on the ability to #define const the problem away. - Changed Get_Pwnam(x,y) into two variants (so that the const parameter can work correctly): - Get_Pwnam(const x) and Get_Pwnam_Modify(x). - Reworked smbd/chgpasswd.c to work with these mods, passing around a 'struct passwd' rather than the modified username --- This finishes this line of commits off, your tree should now compile again :-) Andrew Bartlett
* This commit is number 3 of 4.Andrew Bartlett2001-10-291-19/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular this commit focuses on: Changing the Get_Pwnam code so that it can work in a const-enforced environment. While these changes have been mildly tested, and are pretty small, any assistance in this is appreciated. ---- These changes allow for 'const' in the Samba tree. There are a number of good reasons to do this: - I want to allow the SAM_ACCOUNT structure to move from wasteful pstrings and fstrings to allocated strings. We can't do that if people are modifying these outputs, as they may well make assumptions about getting pstrings and fstrings - I want --with-pam_smbpass to compile with a slightly sane volume of warnings, currently its pretty bad, even in 2.2 where is compiles at all. - Tridge assures me that he no longer opposes 'const religion' based on the ability to #define const the problem away. - Changed Get_Pwnam(x,y) into two variants (so that the const parameter can work correctly): - Get_Pwnam(const x) and Get_Pwnam_Modify(x). - Reworked smbd/chgpasswd.c to work with these mods, passing around a 'struct passwd' rather than the modified username
* 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-2/+2
|
* convert more code to use XFILEAndrew Tridgell2001-09-101-4/+4
|
* Convert other parameters (read list, write list, valid users...) to the ↵Simo Sorce2001-07-241-21/+33
| | | | | | | P_LIST format. changed functions to use list instead of strings addedd lp_list_substitute function
* strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell2001-07-041-4/+4
| | | | can't redefine them. damn.
* If we can't open the username map file, at least print the strerror.Jeremy Allison2001-04-061-1/+1
| | | | Jeremy.
* fixed typo in debug statementGerald Carter2001-01-241-2/+2
| | | | jerry
* Cleanup of Get_Pwnam(). Adds debugging, cleans up the allow_changeDavid O'Neill2001-01-171-48/+45
| | | | codepath.
* new version of Get_Pwnam()Gerald Carter2000-12-111-52/+50
| | | | | | | | | o check the username in all lowercase o check the username as transmitted if this would be a different case o check the username in all upper case if this is a new version -- jerry
* Even when looking up a users groups via winbindd even if the lookup forJeremy Allison2000-10-251-2/+2
| | | | | | | | the list of groups a user is in succeeds via winbind, we must allow the lookup of the group name -> gid we are checking if the user is a member of to go via winbind or /etc/group - as it may be a group on the local box we are checking against. This is a subtle one..... Jeremy.
* John Reilly @ HP (who is a wonderful human being and *definately* needsJeremy Allison2000-10-251-2/+0
| | | | | | | | CVS commit access :-) has written a simple routine that peeks inside the MS PE printer driver file format and can tell if a driver is W2K or NT4.x. So we can now correctly return the driver version number. Hurrah ! JF - this is the code you always wanted ..... :-) :-). Jeremy.
* Added David O'Neills fix to HEAD (hmmm. how did this compile... :-).Jeremy Allison2000-10-131-1/+1
| | | | Jeremy.
* Fix to allow smbd to call winbindd if it is running for all group enumeration,Jeremy Allison2000-10-131-17/+113
| | | | | | | | falling back to the UNIX calls on error. This should fix all problems with smbd enumerating all users in all groups in all trusted domains via winbindd. Also changed GETDC to query 1C name rather than 1b name as only the PDC registers 1b. Jeremy.
* Turns out we do need the pwnam check as on many systems the usersJeremy Allison2000-10-111-0/+7
| | | | | primary group is not listed in the groups file... Jeremy.
* Fix to avoid calling getgrgid for no reason.Jeremy Allison2000-10-111-21/+9
| | | | Jeremy.
* don't return a passwd struct for usernames that don'tAndrew Tridgell2000-05-291-2/+12
| | | | belong to us
* use "winbind separator" option for domain/user separator characterAndrew Tridgell2000-05-121-14/+0
|
* - changed smb_getpwnam() to use winbind style usernamesAndrew Tridgell2000-05-101-7/+6
| | | | - finished ntdom -> winbind rename in head
* a minimal change to get appliance mode to work with winbinddAndrew Tridgell2000-05-041-0/+35
| | | | | | | | | we needed to accept usernames of the form DOMAIN/user, which means we needed to pass the domain to a getpwnam() like routine in certain critical spots. What I'd rather do is get rid of "char *user" everywhere and use the new userdom_struct, but that will have to wait a few days.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-423/+119
|
* changed function name of get_home_dir() to get_unixhome_dir(), to stopLuke Leighton1999-12-121-2/+2
| | | | | | | clash with gnu readline library. fixed issue with [homes] service not being there - call lp_add_home() just before starting the msrpc processing.
* the first independent msrpc daemon - lsarpcd.Luke Leighton1999-12-061-0/+29
| | | | | | | | | | | | | | | one horrible cut / paste job from smbd, plus a code split of shared components between the two. the job is not _yet_ complete, as i need to be able to do a become_user() call for security reasons. i picked lsarpcd first because you don't _need_ security on it (microsoft botched so badly on this one, it's not real. at least they fixed this in nt5 with restrictanonymous=0x2). fixing this involves sending the current smb and unix credentials down the unix pipe so that the daemon it eventually goes to can pick them up at the other end. i can't believe this all worked!!!
* using jeremy's sys_getpwnam() call in the more critical area: Get_Pwnam().Luke Leighton1999-07-061-111/+17
| | | | | | made sure that hashed_getpwnam() has the copy-passwd-struct-wrapper around it, too. TODO: replace all calls of getpwnam() with sys_getpwnam().
* patch from michael stockman <pgmtekn-micke@algonet.se> to provide a staticLuke Leighton1999-07-061-15/+25
| | | | | | struct passwd in _Get_Pwnam(). _Get_Pwnam() is responsible for malloc/ freeing the string pointers to this struct passwd, NOT the callers of _Get_Pwnam().
* #ifdef'd out hashed_getpwnam.Luke Leighton1999-06-241-0/+4
|
* Moved code that changes the pw_passwd entry (i.e shadow password andTim Potter1999-06-131-5/+87
| | | | | | | | weird unixware stuff) into _Get_Pwnam() to fix a memory allocation bug. Note that the Get_Pwnam() function now returns a const struct passwd * as a hint to other developers not to change entries in the struct passwd.
* clean-up of cache-getpw-hash code needed (make proto showed up loadsLuke Leighton1999-05-061-12/+13
| | | | of functions that should be static).
* Jani Jaakkola's "getpwuid() / getpwnam()" hash-cache-hackLuke Leighton1999-05-061-1/+271
|
* trying to track down issues in get_home_dir().Luke Leighton1998-12-141-4/+8
|