summaryrefslogtreecommitdiff
path: root/source3/lib/username.c
AgeCommit message (Collapse)AuthorFilesLines
2001-11-13Look for DOMAIN\group in group lists and ask winbind.Jeremy Allison1-68/+89
Jeremy. (This used to be commit 763fd1c78757ea640dd50ac72caf5ebbb465b3b9)
2001-10-29This commit is number 4 of 4.Andrew Bartlett1-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 used to be commit c95f5aeb9327347674589ae313b75bee3bf8e317)
2001-10-29This commit is number 3 of 4.Andrew Bartlett1-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 (This used to be commit e7634f81c5116ff4addfb7e495f54b6bb78e8f77)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-1/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-17move to SAFE_FREE()Simo Sorce1-2/+2
(This used to be commit 60e907b7e8e1c008463a88ed2b076344278986ef)
2001-09-10convert more code to use XFILEAndrew Tridgell1-4/+4
(This used to be commit fe6679dffba9a92bb35933ad52172c9be0e9ef90)
2001-07-24Convert other parameters (read list, write list, valid users...) to the ↵Simo Sorce1-21/+33
P_LIST format. changed functions to use list instead of strings addedd lp_list_substitute function (This used to be commit 7257d07563ba21bd88733d5d2b4ec4829fab2507)
2001-07-04strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell1-4/+4
can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-04-06If we can't open the username map file, at least print the strerror.Jeremy Allison1-1/+1
Jeremy. (This used to be commit abf436153a476b7c5a7bff31f1e657b8f53b9dee)
2001-01-24fixed typo in debug statementGerald Carter1-2/+2
jerry (This used to be commit a28d384e4d7aff1578f22947d34338b75ceab76d)
2001-01-17Cleanup of Get_Pwnam(). Adds debugging, cleans up the allow_changeDavid O'Neill1-48/+45
codepath. (This used to be commit 767f73aee62438d74248facf7122b2c49645d5c7)
2000-12-11new version of Get_Pwnam()Gerald Carter1-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 (This used to be commit 059f4fee5d8ad72cd699995c660263ed2cc4f25f)
2000-10-25Even when looking up a users groups via winbindd even if the lookup forJeremy Allison1-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. (This used to be commit 4ffda462b97e4f35c6d050c579dfe3e3b64e2c9f)
2000-10-25John Reilly @ HP (who is a wonderful human being and *definately* needsJeremy Allison1-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. (This used to be commit fd17374e6d888813f4ed7142480cf93b8a16bfef)
2000-10-13Added David O'Neills fix to HEAD (hmmm. how did this compile... :-).Jeremy Allison1-1/+1
Jeremy. (This used to be commit e222057140edb3f14d76e54bd6e744919f50b4df)
2000-10-13Fix to allow smbd to call winbindd if it is running for all group enumeration,Jeremy Allison1-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. (This used to be commit 5b0038a2afd8abbd6fd4a58f5477a40d1926d498)
2000-10-11Turns out we do need the pwnam check as on many systems the usersJeremy Allison1-0/+7
primary group is not listed in the groups file... Jeremy. (This used to be commit b1cb7bec51963ac2ddc62dd1abbf8f8fa4351f9b)
2000-10-11Fix to avoid calling getgrgid for no reason.Jeremy Allison1-21/+9
Jeremy. (This used to be commit b057a7349b2d6420f96a6ebc31822da66b39fe6c)
2000-05-29don't return a passwd struct for usernames that don'tAndrew Tridgell1-2/+12
belong to us (This used to be commit 2740a80e30cbf512d51ba76684905a904c2fddf7)
2000-05-12use "winbind separator" option for domain/user separator characterAndrew Tridgell1-14/+0
(This used to be commit 6cbb826b154e61085fd651116caf472d4d438c1d)
2000-05-10- changed smb_getpwnam() to use winbind style usernamesAndrew Tridgell1-7/+6
- finished ntdom -> winbind rename in head (This used to be commit ada483cb56453afc6df4ec4be18bfe5e943c7150)
2000-05-04a minimal change to get appliance mode to work with winbinddAndrew Tridgell1-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. (This used to be commit 8b7a10febead8be182e7d5b1d68259e31530b69c)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-423/+119
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-12changed function name of get_home_dir() to get_unixhome_dir(), to stopLuke Leighton1-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. (This used to be commit 054195df9b6187c663ede5cf4489499abbdc29fc)
1999-12-06the first independent msrpc daemon - lsarpcd.Luke Leighton1-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!!! (This used to be commit 2245b0c6d13c7c5886e81f9137b05df883598c26)
1999-07-06using jeremy's sys_getpwnam() call in the more critical area: Get_Pwnam().Luke Leighton1-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(). (This used to be commit 436a89145524d3539b3a247f98c1e71f0616dd70)
1999-07-06patch from michael stockman <pgmtekn-micke@algonet.se> to provide a staticLuke Leighton1-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(). (This used to be commit 41f071642dce994335e0ef180fa2d2503e216393)
1999-06-24#ifdef'd out hashed_getpwnam.Luke Leighton1-0/+4
(This used to be commit 1d2557cc27b146aa88f70d4b973fd2178f90718b)
1999-06-13Moved code that changes the pw_passwd entry (i.e shadow password andTim Potter1-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. (This used to be commit 36d7cb4ccc42268e8e6a7b783c945d1853624958)
1999-05-06clean-up of cache-getpw-hash code needed (make proto showed up loadsLuke Leighton1-12/+13
of functions that should be static). (This used to be commit 06fce76e535f151ff819210faf39dd77b9fcae08)
1999-05-06Jani Jaakkola's "getpwuid() / getpwnam()" hash-cache-hackLuke Leighton1-1/+271
(This used to be commit 899fc053c50448db65092d9f25fea99433cfb29f)
1998-12-14trying to track down issues in get_home_dir().Luke Leighton1-4/+8
(This used to be commit 2cce78aa00f31b79d51aaf46da72019b926e8226)
1998-11-17Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1-1/+1
Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac)
1998-08-31bounds check next_token() to prevent possible buffer overflowsAndrew Tridgell1-1/+1
(This used to be commit 3eade55dc7c842bdc50205c330802d211fae54d3)
1998-07-31added test for getpwanam().Andrew Tridgell1-1/+1
(This used to be commit 4eb28f7148f61a215ca644cbe704a4e8dbd83a77)
1998-07-29merge from the autoconf2 branch to the main branchAndrew Tridgell1-4/+3
(This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21)
1998-07-07Fixed (hopefully) last bug with username mapping.Jeremy Allison1-4/+5
map_username wasn't returning true on a map which was causing find_service not to find a home directory. Jeremy. (This used to be commit 97209a29467699173caf79e1c81729eb2afedda5)
1998-06-13Makefile: Added ubi_sLinkList.o as the groupname.o file needs it. Added ↵Jeremy Allison1-212/+127
groupname.o includes.h: Added ubi_sLinkList.h include. loadparm.c: Added groupname map parameter. password.c: Fix HPUX big_crypt. username.c: New user_in_list() code. Moved groupname map code to groupname.c lib/rpc/server/srv_util.c: Added lookup_wellknown_sid_from_name(). New groupname map stuff. Note that nothing currently uses this but at compiles ok. Jeremy. (This used to be commit beef636a4d772457816ef068c62ea965d07131f6)
1998-06-12ipc.c: map_username is now a BOOL function.Jeremy Allison1-16/+187
reply.c: map_username is now a BOOL function. server.c: Added capability to do map_username on service names when looking for a home directory. That's what the original code would do. lib/rpc/server/srv_util.c: Changed domain_ to builtin_ for BUILTIN aliases. username.c: Work in progress on groupname map parameter. Jeremy (This used to be commit fa95fae5eed95aff64f0a01825477610a101bbc7)
1998-06-10De-coupled the mapping of a Windows to UNIX username from the Get_PwnamJeremy Allison1-26/+27
username case conversion wrapper. It is now (very) explicit where we are mapping between an incoming Windows username, and when we are doing a UNIX password entry lookup, which may change the case of the given username. This makes things *much* clearer (IMHO:-) and will ease the adding of the 'groupname map' parameter, and the addition of the special 'jeremy' mode for Samba where unix users will not be needed. (We must think of a better name for it :-). Jeremy. (This used to be commit fb6ed81844e7cb6049749e43ac9b4adfaf4ca2de)
1998-04-13Changes to allow Samba to be compiled with -Wstrict-prototypesJeremy Allison1-4/+4
with gcc. (Not a big change although it looks like it :-). Jeremy. (This used to be commit cd2613c57261456485fe4eeecfda209ada70de8e)
1998-01-22This is *not* a big change (although it looks like one).Jeremy Allison1-1/+1
This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy. (This used to be commit b9c16977231efb274e08856f7f3f4408dad6d96c)
1997-12-03change the "username map" option to allow the user to stop theAndrew Tridgell1-0/+12
processing part way through the file if a match is found. If a line starts with ! and a match is made by that line then processing stops. This allows better wildcard handling. (patch from Anselm.Kruis@Physik.Uni-Muenchen.DE) (This used to be commit af57bc05fe0f248aaef329358c583abcffe1657c)
1997-09-26Adding Andrews buffer overflow fixes into the main branch.Jeremy Allison1-2/+2
Jeremy (jallison@whistle.com) (This used to be commit e7eb1f044d3101679dc7a118820ea5efe0cd837c)
1997-09-19Makefile: Changed proto: target to not include c files not used currently.Jeremy Allison1-0/+71
Caused proto.h to be from a sorted list of C files. arcfour.h: Added prototypes. client.c: Added username%password in environment patch from John Blair <jdblair@frodo.tucc.uab.edu> loadparm.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au] username.c: Added username manipulation code from Peter McCool [SMTP:peter@qimr.edu.au] mkproto.awk: Added arc4_key type. proto.h: Updated & sorted. Jeremy (jallison@whistle.com) (This used to be commit 97ed4fea67095dfb83227e7b5fffc236ff277e02)
1997-05-08'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com)Samba Release Account1-1/+1
Wed May 7 1997: Update for 1.9.17alpha1 release - 'browsefix release' designed to make browsing across subnets work. byteorder.h: Updated copyright to 1997. charcnv.c: Updated copyright to 1997. charset.c Updated copyright to 1997. charset.h Updated copyright to 1997. client.c Updated copyright to 1997. clientutil.c Updated copyright to 1997. dir.c Updated copyright to 1997. fault.c Updated copyright to 1997. includes.h Updated copyright to 1997. interface.c Updated copyright to 1997. ipc.c Updated copyright to 1997. kanji.c Updated copyright to 1997. kanji.h Updated copyright to 1997. loadparm.c Updated copyright to 1997. locking.c Updated copyright to 1997. mangle.c Updated copyright to 1997. message.c Updated copyright to 1997. nameannounce.c Made use of WINS subnet explicit. Added reset_announce_timer() so announcement can be made immediately when we become a master. Expanded code to do sync with dmb. namebrowse.c Removed redundent checks for AM_MASTER in sync code. Made use of WINS subnet explicit. namedbname.c Made use of WINS subnet explicit. namedbresp.c Made use of WINS subnet explicit. namedbserver.c Made use of WINS subnet explicit. namedbsubnet.c Explicitly add workgroup to WINS subnet when we become a dmb. Made use of WINS subnet explicit. namedbwork.c Made use of WINS subnet explicit. Removed redundent check_work_servertype() function. nameelect.c Explicitly add workgroup to WINS subnet when we become a master browser. Made use of WINS subnet explicit. namelogon.c Updated copyright to 1997. namepacket.c Updated copyright to 1997. namequery.c Updated copyright to 1997. nameresp.c Made use of WINS subnet explicit. Made nmbd fail if configured as master browser and one exists already. nameserv.c Made use of WINS subnet explicit. Remove redundent logon server and domain master code. nameserv.h Add emumerate subnet macros. nameservreply.c Made use of WINS subnet explicit. nameservresp.c Updated copyright to 1997. namework.c Made use of WINS subnet explicit. Updated code to add sync browser entries to add subnet parameter. nmbd.c Added sanity check for misconfigured nmbd. nmblib.c Updated copyright to 1997. nmblookup.c Updated copyright to 1997. nmbsync.c Removed redundent AM_ANY_MASTER check. params.c Updated copyright to 1997. password.c Updated copyright to 1997. pipes.c Updated copyright to 1997. predict.c Updated copyright to 1997. printing.c Updated copyright to 1997. proto.h Changed protos for new nmbd code. quotas.c Updated copyright to 1997. replace.c Updated copyright to 1997. reply.c Updated copyright to 1997. server.c Updated copyright to 1997. shmem.c Updated copyright to 1997. smb.h Updated copyright to 1997. smbencrypt.c Updated copyright to 1997. smbpasswd.c Updated copyright to 1997. smbrun.c Updated copyright to 1997. status.c Updated copyright to 1997. system.c Updated copyright to 1997. testparm.c Updated copyright to 1997. testprns.c Updated copyright to 1997. time.c Updated copyright to 1997. trans2.c Updated copyright to 1997. trans2.h Updated copyright to 1997. uid.c Updated copyright to 1997. username.c Updated copyright to 1997. util.c Updated copyright to 1997. version.h Changed to 1.9.17alpha1. (This used to be commit cf23a155a1315f50d488794a2caf88402bf3e3e6)
1997-01-29Fixed issue with null ypdomainname being used.Samba Release Account1-4/+12
Jermy. (This used to be commit 25175ce3113acad7fafb76e92f2f343d18ef4aea)
1996-06-10got rid of a lot of redundent header files as we now globally generateAndrew Tridgell1-1/+0
prototypes automatically using "make proto". This is much less prone to error than the old method of manually adding prototypes (This used to be commit b551dc98f7cc194a5fc2e67a4ebae7fd67a01bbc)
1996-05-04Initial version imported to CVS Samba Release Account1-0/+246
(This used to be commit 291551d80711daab7b7581720bcd9a08d6096517)