summaryrefslogtreecommitdiffstats
path: root/source/lib/username.c
Commit message (Collapse)AuthorAgeFilesLines
* THE Idmap patch :-)Simo Sorce2003-04-021-1/+1
| | | | | | | | | | | | | | | | | | | includes a --with-idmap=no switch to disable idmap usage if you find problems. cosmetic fixes and param aliases to separate winbind from idamp roles. A temporarily remote idmap winbind compatibility backend. As I have time I will further change code to not call directly winbind (partly done but not tested) and a specilized module will be built in place for the current glue hack. The patch has been tested locally in my limited time, the patch is simple and clear and should not reserve problems, if any just disable it. As usual, comments and fisex are welcome :-) Simo.
* This patch fixes one of my longest-standing pet hates with Samba :-).Andrew Bartlett2003-02-171-15/+42
| | | | | | | | | | | | | | | | | When we look see if a user is in a list, and we try to 'expand' an @group, we should lookup the user's own list of groups, rather than looking for all the members of a group. I'm sure this will fix some nasty performance issues, particularly on large domains etc. In particular, this avoids contacting winbind at all, if the group is not a winbind group. (This caused a deadlock on my winbind-on-PDC setup). The groups list always includes the user's primary group, as per the getgrouplist manpage, and my recent changes to our implementation. Andrew Bartlett
* Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison2002-11-121-2/+2
| | | | | | dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy.
* Kill of Get_Pwnam_Modify and smb_getpwnam(). The latter assumes some thingsAndrew Bartlett2002-09-251-57/+0
| | | | | | | | that just don't apply any more - now that we always keep username and domain seperate. Also, the policy it was trying to permit is now implemented by the auth code. Andrew Bartlett
* found nasty bug in intl/lang_tdb.c tdb structure was not tested to not be ↵Simo Sorce2002-07-281-1/+1
| | | | | | | | | | | | null before close this one fixes swat not working with browsers that set more then one language. along the way implemented language priority in web/neg_lang.c with bubble sort also changet str_list_make to be able to use a different separator string Simo.
* Unsused function since last commitAndrew Bartlett2002-06-151-34/+0
|
* moved lp_list_* functions away from param/loadparm.c, put int lib/util_str.cSimo Sorce2002-06-141-3/+3
| | | | | and renamed to str_list_* as it is a better name. Elrond should be satisfied now :)
* Clean up a few unused functions, add a bit of static etc.Andrew Bartlett2002-05-251-1/+1
| | | | | | | | | | | | | | Importantly: The removal of the silly 'delete user script' behaviour when secuity=domain. I have left the name the same - as it still does the (previously documented, but not in smb.conf(5)) sane behaviour of deleting users on request. When we decide what to do with the 'add user' functionality, we might rename it. Andrew Bartlett
* Make Get_Pwnam use getpwnam_alloc() in an attempt to make it segfault ratherAndrew Bartlett2002-05-171-9/+31
| | | | | | than allow silent reuse of stale static buffer. Next step is to make this fn return that allocated buffer.
* 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
|