summaryrefslogtreecommitdiffstats
path: root/source/smbd/uid.c
Commit message (Collapse)AuthorAgeFilesLines
* beginning to sync up for 2.2.5 release....Gerald Carter2002-06-171-1/+3
|
* Start of merge to 2_2_RELEASE branch for release.Jeremy Allison2002-04-301-3/+7
| | | | Jeremy.
* Move over to RELEASE branch.Jeremy Allison2002-02-011-35/+216
| | | | Jeremy.
* Sync-up with SAMBA_2_2 branch.Jeremy Allison2001-10-111-16/+17
| | | | Jeremy.
* Fixed potential bug in "become_guest" pointed out by elrond. Get_Pwnam()Jeremy Allison2001-04-151-6/+13
| | | | | | returns a pointer to changable storage so ensure we save the details and don't use the pointer directly. Jeremy.
* Fix for coredump when using username map file. lookup_name must haveJeremy Allison2001-03-201-2/+1
| | | | | | const fist args as it is called with quoted strings and can call functions that modify the name. Jeremy.
* But Doctor, I had to kill the patient in order to save him....Jeremy Allison2001-02-211-4/+0
| | | | | | | | | | | | | | | | | | | This will probably break 2.2 for a while. Do *NOT* checkout unless you like core dumps. This is the first merge of the TNG SAMR code into 2.2. It will eventually give us a wonderful PDC, but maybe painful in the short term. It had to be done however, and this touches almost every file (mostly just removing the OLD_NT_DOMAIN) stuff. I removed some SAMR functionality from rpcclient that would no longer compile. Also changed fstring to 256 bytes to better match an NT pathname. Jeremy.
* Allow names to be looked up in the domain when acting as a PDC for W2K clients.Jeremy Allison2001-02-161-3/+12
| | | | Jeremy.
* Sync up with appliance-head printer and other changes. Makes merges easier.Jeremy Allison2001-01-121-1/+1
| | | | Jeremy.
* Merged in Tim's changes: Removed static limit of MAX_LOOKUP_SIDS in rpc ↵Jeremy Allison2000-12-121-1/+6
| | | | | | | | | server and client lsa_lookup_names() and lsa_lookup_sids(). Removed the special casing of SIDs in se_access_check. This is now done (correctly) when the NT_USER_TOKEN is *created*. Jeremy.
* Merge of the printing fixes from HEAD to 2.2.Jeremy Allison2000-11-151-12/+36
| | | | Jeremy.
* Fix for admin user being ignored.Jeremy Allison2000-11-041-0/+1
| | | | Jeremy.
* Fix to allow smbd to call winbindd if it is running for all group enumeration,Jeremy Allison2000-10-131-0/+226
| | | | | | | | 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.
* Fixed memory leak with NT tokens.Jeremy Allison2000-08-091-2/+20
| | | | | | Added debug messages to se_access_check(). Added FULL_ACCESS acl to default acl on printers. Jeremy.
* Fixed up the user/group contexts when using authenticated pipes.Jeremy Allison2000-08-041-2/+1
| | | | | | | | Added a become_root()/unbecome_root() (push/pop security context) around the initgroups() call to ensure it would succeed. Hmmm - I wonder if this call being done as non-root might explain any "group access" bugs we've had in the past.... Jeremy.
* Added an NT_USER_TOKEN structure that is copied/passed around associatedJeremy Allison2000-08-031-3/+5
| | | | | | | with the current user. This will allow se_access_check() to quickly do a SD check without having to translate uid/gid's to SIDs. Still needs work on pipe calls. Jeremy.
* Started to canonicalize our handling of uid -> sid code in order toJeremy Allison2000-08-021-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | get ready and fix se_access_check(). Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid() functions that look via winbind first the fall back on local lookup. All Samba should use these rather than trying to call winbindd code directly. Added NT_USER_TOKEN struct in user_struct, contains list of NT sids associated with this user. se_access_check() should use this (cached) value rather than attempting to do the same thing itself when given a uid/gid pair. More work needs to be done to preserve these things accross security context changes (especially with the tricky pipe problem) but I'm beginning to see how this will be done..... probably by registering a new vuid for an authenticated RPC pipe and not treating the pipe calls specially. More thoughts needed - but we're almost there... Jeremy.
* Moved authenticated pipe user details into a current_user struct.Tim Potter2000-07-061-1/+1
|
* Some more sec_ctx changes. Modified some fields in the pipe_structTim Potter2000-07-031-1/+2
| | | | | structure so authenticated pipe users can have their unix groups set when become_authenticated_pipe_user() is called.
* Added return for become_authenticated_pipe_user() function.Tim Potter2000-06-231-0/+2
|
* Moved some static functions to sec_ctx.cTim Potter2000-06-231-222/+30
| | | | | Implemented become_root() and friends in terms of push/pop/set security contexts.
* more merging voodooAndrew Tridgell2000-05-101-0/+4
| | | | | | this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic - this isn't permanent, it should go after another few merge steps have been done
* split the username in the vuser structure into a separateAndrew Tridgell2000-05-021-1/+1
| | | | | | | | userdom_struct. As the name implies this also contains a domain (unused at the moment). This will be important shortly, as operation in appliance mode needs the domain to be always carried with the username.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-273/+161
|
* delineation between smb and msrpc more marked. smbd now constructsLuke Leighton1999-12-121-9/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pdus, and then feeds them over either a "local" function call or a "remote" function call to an msrpc service. the "remote" msrpc daemon, on the other side of a unix socket, then calls the same "local" function that smbd would, if the msrpc service were being run from inside smbd. this allows a transition from local msrpc services (inside the same smbd process) to remote (over a unix socket). removed reference to pipes_struct in msrpc services. all msrpc processing functions take rpcsrv_struct which is a structure containing state info for the msrpc functions to decode and create pdus. created become_vuser() which does everything not related to connection_struct that become_user() does. removed, as best i could, connection_struct dependencies from the nt spoolss printing code. todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific info on a per-connection basis, and if the connection dies then so does the info, and that's a fairly serious problem. had to put pretty much everything that is in user_struct into parse_creds.c to feed unix user info over to the msrpc daemons. why? because it's expensive to do unix password/group database lookups, and it's definitely expensive to do nt user profile lookups, not to mention pretty difficult and if you did either of these it would introduce a complication / unnecessary interdependency. so, send uid/gid/num_groups/gid_t* + SID+num_rids+domain_group_rids* + unix username + nt username + nt domain + user session key etc. this is the MINIMUM info identified so far that's actually implemented. missing bits include the called and calling netbios names etc. (basically, anything that can be loaded into standard_sub() and standard_sub_basic()...)
* Moved code that changes the pw_passwd entry (i.e shadow password andTim Potter1999-06-131-1/+1
| | | | | | | | 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.
* Ken McDonell from SGI was interested in adding some profilingAndrew Tridgell1999-04-011-0/+4
| | | | | | | | | | | | capabilities to Samba so that Samba could talk to the SGI PCP (Performance Co-Pilot) apps. This change adds a profiling shared memory area and uses it to count two fairly trivial things, the number of uid switches and the number of SMB packets processes. To add more just edit include/profile.h and then increment it at the right place. I've also added a -P switch to smbstatus to dump the profile area.
* Makefile.in: Added maintainer mode fixes.Jeremy Allison1998-11-251-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | aclocal.m4: Added AC_LIBTESTFUNC. configure.in: Fixed -lsecurity -lsec problems. client.c: dos_ fixes. groupdb/aliasunix.c: Dead code removal. include/includes.h: Added default PRINTCAP_NAME. lib/genrand.c: dos_ fixes. lib/replace.c: Added strtoul. lib/system.c: dos_ fixes. lib/util.c: dos_ fixes. lib/util_sid.c: Signed/unsigned fixes. lib/util_str.c: removed bad const. locking/locking_slow.c: dos_ fixes. printing/printing.c: dos_ fixes. rpc_server/srv_samr.c: Dead code removal. rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN ! smbd/dir.c: dos_ fixes. smbd/open.c: dos_ fixes. smbd/oplock.c: dos_ fixes. smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes. Jeremy.
* extracted the password change code from smbpasswd and used it in swatAndrew Tridgell1998-11-121-0/+2
| | | | instead of opening pipes and other horrible stuff.
* Got very strict about the differences and uses ofJeremy Allison1998-09-291-19/+19
| | | | | | | uid_t, gid_t and vuid. Added sys_getgroups() to get around the int * return problem. Set correct datatypes for all uid, gid and vuid variables. Jeremy.
* moved connection_struct handling code into smbd/conn.c and changed itAndrew Tridgell1998-08-171-1/+1
| | | | to a linked list with bitmap format.
* configure: Changes for extra headers.Jeremy Allison1998-08-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | configure.in: Source for header changes. client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile. include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers. include/includes.h: Headers for the above. include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int). lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/debug.c: Fixed signal functs. lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile. libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem_sysv.c: Fixed error messages in sysV stuff. nmbd/asyncdns.c: Fixed signal functs. nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/nttrans.c: Fixed fsp code path. smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem. smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/trans2.c: Fixed core dump bug. smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile. Jeremy.
* this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell1998-08-141-225/+78
| | | | | | | | Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep.
* nttrans.c: Fix change_notify. Queue processing code wasn't changing toJeremy Allison1998-08-041-1/+12
| | | | | | | | | the correct directory before doing the stat. Doh ! uid.c: Fix for performance in security=share mode. Invalid vuid meant that in security=share mode Samba was always doing the become_user/ undebome_user pairs for *every* smb. This code fixes it, but tridge should review for security implications. Jeremy.
* As per a Andrew's message, I went through and removed the timestring()Christopher R. Hertel1998-07-311-2/+1
| | | | | | | | | timestamps from several DEBUG messages. The timestamps are redundant now that DEBUG() provides them automatically. There are still a few more files to do, but I've got to get home for dinner. Chris -)-----
* get rid of the runtime test for broken getgroups() and add a compileAndrew Tridgell1998-07-291-2/+0
| | | | | time test instead. This also allows us to get rid of the igroups element of a couple of structures.
* merge from the autoconf2 branch to the main branchAndrew Tridgell1998-07-291-204/+75
|
* chgpasswd.c: Fixed up debug calls to stop crashes if ptsname failed.Jeremy Allison1998-07-271-2/+0
| | | | | | | | | | | | local.h: Kept FSTYPE_STRING as Samba for now. nmbd_browsesync.c: Added bugfix from Matt Chapman mattyc@cyberdude.com - lmb_browserlist is now a struct ubi_dlList not a struct browse_cache_record *. server.c: smb.h: uid.c: password.c: Removed attrs code - it is not used anywhere. Jeremy
* AIX patch from Michael Wojcik <mww@microfocus.com> adding detailJeremy Allison1998-07-101-4/+135
| | | | | to the AIX specific (and undocumented) setpriv and setuidx calls. Jeremy.
* changed to use slprintf() instead of sprintf() just aboutAndrew Tridgell1998-05-111-1/+1
| | | | | | | everywhere. I've implemented slprintf() as a bounds checked sprintf() using mprotect() and a non-writeable page. This should prevent any sprintf based security holes.
* This should (hopefully :-) be the final fix for the %U %G substitutionJeremy Allison1998-05-071-6/+0
| | | | | | | problem.... smbpass.c: Removed Luke's dire warning - as some of the functions in here *need* to be called externally :-). Jeremy.
* Fixes for the %U and %G problems people have reported.Jeremy Allison1998-05-061-1/+7
| | | | | | | | | | | | | | | | | | Essentially, multiple session_setup_and_X's may be done to an smbd. As there is only one global variable containing the requested connection name (sessionsetup_user), then any subsequent sessionsetups overwrite this name (causing %U and %G to get the wrong name). This is particularly common when an NT client does a null session setup to get a browse list after the user has connected, but before a share has been mounted. These changes store the requested_name in the vuid structure (so this only really works for user level and above security) and copies this name back into the global variable before the standard_sub call. Jeremy.
* Makefile: Added AIX 3.2.5.Jeremy Allison1998-02-111-2/+6
| | | | | | | | | | | | | | | | loadparm.c: Added "win95 bug compatibility" parameter. local.h: Replaced MAX_OPEN_FILES back to 100 from 10 (oops). reply.c: Fixed ulogoff check against uid - changed to vuid. server.c: Changed file struct save of uid - changed to vuid. smb.h: Changed id in struct current_user to vuid. Changed file struct uid to vuid. time.c: Added "win95 bug compatibility" atime -> mtime return. trans2.c: Added "win95 bug compatibility" fixes. uid.c: Changed id in struct current_user to vuid - added checks to set/reset it. util.c: Added code to expand environment variables. version.h : still at 1.9.18 (head branch doesn't matter too much at present). Jeremy.
* This is *not* a big change (although it looks like one).Jeremy Allison1998-01-221-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.
* Fixed security bug when 'force user' and 'user only' are set.Jeremy Allison1997-12-231-2/+5
| | | | | Reported by Brian McCauley <B.A.McCauley@bham.ac.uk>. Jeremy.
* ipc.c: Changing back arbitrary alignment change until I know *why*Jeremy Allison1997-11-061-1/+1
| | | | | | | | luke changed it. proto.h: The usual. uid.c: Fix crash bug when attaching with smbclient -mCORE. A vuid pointer was being used when it was null. Jeremy.
* Makefile :Luke Leighton1997-10-251-23/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding bits for new nt domain code byteorder.h : trying to get macros right, and not to crash on SUNOS5... client.c : added #ifdef NTDOMAIN, and created do_nt_login() function. don't want to have to recompile client.c unless absolutely necessary. credentials.c : moved deal_with_creds() [possibly inappropriately] into credentials.c ipc.c reply.c server.c uid.c : attempting to make (un)become_root() functions calleable from smbclient. this is a little tricky: smbclient might have to be another setuid root program, immediately setuid'ing to non-root, so that we can reset-uid to root to get at the smbpasswd file. or, have a secure pipe mechanism to smbd to grab smbpasswd entries. or the like. smbdes.c smbencrypt.c : created a function to generate lm and nt owf hashes. lsaparse.c ntclient.c smbparse.c : added nt client LSA_AUTH2 code. it works, too! pipenetlog.c pipentlsa.c pipesrvsvc.c : simplification. code-shuffling. getting that damn offset right for the opcode in RPC_HDR. smb.h : changed dcinfo xxx_creds to DOM_CRED structures instead of DOM_CHAL. we might need to store the server times as well. proto.h : the usual.
* fix the order of become_uid() and become_gid() in become_root(). ThisAndrew Tridgell1997-10-211-1/+1
| | | | | | was a harmless bug but left log entries code cleanup in reply_lanman2()
* ipc.c: Adding Andrews become_root code to the main branch.Jeremy Allison1997-10-151-0/+74
| | | | | | | | | | | locking.c: Adding Andrews become_root code to the main branch. pipes.c: Fixing the close_file issue. proto.h: The usual. reply.c: Move smb_pass into NTDOMAIN defined code. Fixing the close_file issue. server.c: Fixing the close_file issue. trans2.c: Fixing the close_file issue. uid.c: Adding Andrews become_root code to the main branch. Jeremy (jallison@whistle.com)
* Makefile:Luke Leighton1997-10-101-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | added credentials.c to smbd credentials.c: using credential structures instead of char* password.c uid.c server.c: added sid and attr to user_struct. smbdes.c: smbhash and str_to_key make public instead of private. pipes.c smb.h: lsa structures, sub-functions. proto.h: usual.