summaryrefslogtreecommitdiff
path: root/source3/smbd/session.c
AgeCommit message (Collapse)AuthorFilesLines
2008-06-19Wrap the unix token info in a unix_user_token in auth_serversupplied_infoVolker Lendecke1-2/+2
No functional change, this is a preparation for more current_user ref removal (This used to be commit dcaedf345e62ab74ea87f0a3fa1e3199c75c5445)
2008-05-05Remove "userdom_struct user" from "struct user_struct"Volker Lendecke1-1/+1
(This used to be commit 420de035237bb08bc470c9eb820f3da2edaa6805)
2008-05-05Remove "guest" from "struct user_struct"Volker Lendecke1-1/+1
(This used to be commit 570a6b80feb5b0dc23213ba936c721e766cd4818)
2008-05-05Remove the unix token info from "struct user_struct"Volker Lendecke1-2/+2
(This used to be commit aa2299d42adf4d27e707ac755e07be70d0af1bb4)
2007-11-03Remove most of the remaining globals out of lib/util_sock.c.Jeremy Allison1-3/+4
I have a plan for dealing with the remaining..... Watch this space. Jeremy. (This used to be commit 963fc7685212689f02b3adcc05b4273ee5c382d4)
2007-11-03I can't get away without a 'length' arg. :-).Jeremy Allison1-2/+2
Jeremy. (This used to be commit 95d01279a5def709d0a5d5ae7224d6286006d120)
2007-11-03Stop get_peer_addr() and client_addr() from using globalJeremy Allison1-2/+3
statics. Part of my library cleanups. Jeremy. (This used to be commit e848506c858bd16706c1d7f6b4b032005512b8ac)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-3/+3
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-11Add const to the get_peer_addr() and get_socket_addr()Jeremy Allison1-1/+1
calls. Use the IPv6 varient for get_peer_addr(). Jeremy. (This used to be commit baf1f52e34ae2465a7a34be1065da29ed97e7bea)
2007-10-10[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.Gerald (Jerry) Carter1-4/+1
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
2007-10-10r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal withJeremy Allison1-16/+9
the ripple effects this causes. utmp has to change etc. Remove some global varables and store address/port in the unexpected db. Jeremy. (This used to be commit 18c6a2211d9e25233d01715b3f78977edcd6d869)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23236: Another bad merge: Correctly free and unlock the session record inVolker Lendecke1-1/+2
session_claim. Jerry, this fixes the hanging smbstatus. Sorry for that, Volker (This used to be commit 86ff82a5df998045185682cf09b2db3d37f01004)
2007-10-10r23220: Add traverse_read to dbwrapVolker Lendecke1-1/+1
(This used to be commit b38dc5ffdfe9fdc2879c57dc181815f06b4747fe)
2007-10-10r23173: Convert sessionid.tdb to ctdb. The 3.0.26 patch is a bit larger becauseVolker Lendecke1-53/+118
it brings across the tdb-based list_sessions (This used to be commit 0153386c1a3625b2f699863991893f399c40af48)
2007-10-10r23172: Change shutdown_other_smbds to use connections_traverse instead ofVolker Lendecke1-2/+3
session_traverse. (This used to be commit ccb5eb245e962b0264b337c2d0275c22e2a36830)
2007-10-10r22751: Next step for the cluster merge: sessionid.tdb should contain a 'structVolker Lendecke1-1/+1
server_id' instead of a 'uint32 pid' (This used to be commit be7bac55c37676a8137c59a22dfb2e4c4821ac21)
2007-10-10r22561: Fix a memleak in lanman.c: Nobody would free the session_list.Volker Lendecke1-2/+6
Volker (This used to be commit 5d428400f77399b7fc30fb2a0fb10f0c74b96458)
2007-10-10r22020: Make it more clear that both the vuser struct and it's contents areAndrew Bartlett1-2/+2
talloc_free()'ed at the end of a session. Rework the passwd cache code to use talloc_unlink and talloc_reference, to more carefully manage the cache. Andrew Bartlett (This used to be commit e3e0ec25e67308de314aa61852905ee42aa2c8fe)
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-1/+1
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21980: make use of tdb_*_bystring() and string_term_tdb_data() in smbd/Stefan Metzmacher1-16/+5
to avoid creating the TDB_DATA struct from strings "by hand" metze (This used to be commit 09b477ed85e46bc780ce3c1461472883a6b952f9)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-11/+34
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r13915: Fixed a very interesting class of realloc() bugs found by Coverity.Jeremy Allison1-0/+4
realloc can return NULL in one of two cases - (1) the realloc failed, (2) realloc succeeded but the new size requested was zero, in which case this is identical to a free() call. The error paths dealing with these two cases should be different, but mostly weren't. Secondly the standard idiom for dealing with realloc when you know the new size is non-zero is the following : tmp = realloc(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } However, there were *many* *many* places in Samba where we were using the old (broken) idiom of : p = realloc(p, size) if (!p) { return error; } which will leak the memory pointed to by p on realloc fail. This commit (hopefully) fixes all these cases by moving to a standard idiom of : p = SMB_REALLOC(p, size) if (!p) { return error; } Where if the realloc returns null due to the realloc failing or size == 0 we *guarentee* that the storage pointed to by p has been freed. This allows me to remove a lot of code that was dealing with the standard (more verbose) method that required a tmp pointer. This is almost always what you want. When a realloc fails you never usually want the old memory, you want to free it and get into your error processing asap. For the 11 remaining cases where we really do need to keep the old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR, which can be used as follows : tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size); if (!tmp) { SAFE_FREE(p); return error; } else { p = tmp; } SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the pointer p, even on size == 0 or realloc fail. All this is done by a hidden extra argument to Realloc(), BOOL free_old_on_error which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR macros (and their array counterparts). It remains to be seen what this will do to our Coverity bug count :-). Jeremy. (This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
2007-10-10r11909: Implement 'reset on zero vc'. This kills other connections when a ↵Volker Lendecke1-1/+2
session setup comes in with the vc (virtual connection) field set to zero. This is done by Windows, probably you can tweak that by some registry key. This boolean option controls whether an incoming session setup should kill other connections coming from the same IP. This matches the default Windows 2003 behaviour. Setting this parameter to yes becomes necessary when you have a flaky network and windows decides to reconnect while the old connection still has files with share modes open. These files become inaccessible over the new connection. The client sends a zero VC on the new connection, and Windows 2003 kills all other connections coming from the same IP. This way the locked files are accessible again. Please be aware that enabling this option will kill connections behind a masquerading router. Volker (This used to be commit 5629ca16235f0aa21fea3afd9e414309e4e1374e)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-3/+3
allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
2007-10-10r1011: fix bad merge (from a few months ago) and ensure that we always use ↵Gerald Carter1-2/+2
tdb_open_log() instead of tdb_open_ex() (This used to be commit e65564ab4aa1240e84b8d272510aa770cad0ed0e)
2004-02-19Fix the "too many fcntl locks" scalability problem raised by tridge.Jeremy Allison1-10/+19
I've now tested this in daemon mode and also on xinetd and I'm pretty sure it's working. Jeremy. (This used to be commit 14dee038019b11300466b148c53515fc76e5e870)
2004-02-12merge from old APP_HEADGerald Carter1-2/+2
* remove corrupt tdb and shutdown (only for printing tdbs, connections, sessionid & locking) * decrement smbd counter in connections.tdb in smb_panic() * various Makefile hack to get things to link 'max smbd processes' looks like it might be broken. The counter KEY is not being set. Will look into that tomorrow. (This used to be commit 6e22c5da929b6d9a4e32dc704c83112b2ad8fcfd)
2003-06-06* add in David Lee's utmp patch (defaults to on if available)Gerald Carter1-6/+0
* one more try at fixing builds when --with-ldap=no (This used to be commit b516ab7bdef6b6b2b7f0df8966dbd4c329f46a92)
2003-05-14spellingTim Potter1-1/+1
(This used to be commit 865c11275685c85124b506c9bbd2a8bde2e760b9)
2003-04-28inet_pton isn't portable, so use interpret_addr2.Andrew Bartlett1-3/+3
(This used to be commit 04d27381325561038bee1c27f10c748b9aaf447d)
2003-04-24When possible, store the IP address of the connecting client, not just theAndrew Bartlett1-1/+10
hostname. This makes 'last -i' show the IP. Thanks to Philip Anderson <pza@australia.op.org> for the idea. Andrew Bartlett (This used to be commit 107731c080da1e3e4e13e966f8b79bfd2692a952)
2002-08-17Sync 3.0 branch with headJelmer Vernooij1-26/+48
(This used to be commit 42615b945e2e48e53a21ea47f2e45407913a6a1e)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-7/+45
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-03-23Correctly store the hostname of the remote machine if so configured. If theAndrew Bartlett1-4/+6
reverse DNS fails, then store the IP. (This used to be commit d97771aa80b48fbdb9cae3e9712e35fcc895b148)
2002-02-09Do the reverse DNS lookup, but only if 'hostname lookups = yes'Andrew Bartlett1-5/+7
Andrew Bartlett (This used to be commit dfecd6a4534743a3e140eafc9836911286793951)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2001-11-19Don't resolve the hostname in smbd as we can pause for a long time whileTim Potter1-3/+6
waiting for DNS timeouts to occur. The correct place to do this is in the code that displays the session information. (This used to be commit 2e89165f22d9e9c1fa749ae54957d0ec84a1497d)
2001-11-08Change to guest logon code.Andrew Bartlett1-5/+3
This changes the way we process guest logons - we now treat them as normal logons, but set the 'guest' flag. In particular this is needed becouse Win2k will do an NTLMSSP login with username "", therefore missing our previous guest connection code - this is getting a pain to do as a special case all over the shop. Tridge: We don't seem to be setting a guest bit for NTLMSSP, in either the anonymous or authenticated case, can you take a look at this? Also some cleanups in the check_password() code that should make some of the debugs clearer. Various other minor cleanups: - change the session code to just take a vuser, rather than having to do a vuid lookup on vuser.vuid - Change some of the global_client_caps linking - Better debug in authorise_login(): show the vuid. Andrew Bartlett (This used to be commit 62f4e4bd0aef9ade653b3f8d575d2864c166ab4d)
2001-10-22server support for RAP session list functionJim McDonough1-0/+13
(This used to be commit d42c28fbadf577a23fb8c1da9e1c64a2f34fe133)
2001-09-17move to SAFE_FREE()Simo Sorce1-2/+1
(This used to be commit a95943fde0ad89ae3f2deca2f7ba9cb5ab612b74)
2001-09-06got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell1-1/+1
(This used to be commit c26e0d3f27a05ecc8bd2390f9aab7f9451524e47)
2001-08-23Fix up some unused variables and functions, fix up formattingAndrew Bartlett1-2/+0
(This used to be commit bfce4ba7b6db261d981a60a7e262f2f690355f5c)
2001-08-22A few changes:Andrew Bartlett1-29/+14
drop paramaters: status utmp hostname change session code to always record each vuid current on the server. The sessionid struct is no longer packed, as I couldn't get that to work ;-) change smbstatus to show this info and less of the connections.tdb info (its not actualy that accurate). I'll get swat doing some of this shortly. (This used to be commit b068ad300527c44673bbee0aede7849199c89de7)
2001-07-30Added "use mmap" for HPUX.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 840802f10677cb0009cb4df4c37c7d01aa5edacd)
2001-06-04use LDSHFLAGS not -shared in several placesAndrew Tridgell1-1/+1
(This used to be commit 8ec9c87b5d1a7dae17d5b1a30f58effaf5e69e4b)
2001-04-30Based on an original PAM patch by Andrew Bartlett, re-written by me toJeremy Allison1-12/+8
remove global static PAM variables, and to tidy up the PAM internals code. Now looks like the rest of Samba. Still needs testing. Jeremy. (This used to be commit 1648ac64a75de74d1a1575eb49cccc4f75488bfa)
2001-04-23Fixed memory leak in new session code.Jeremy Allison1-0/+3
Jeremy. (This used to be commit 43b69e5d6e78a30563d7c1d03c7e920d529487b5)
2001-04-23Added smb_ prefix to all Samba wrapper pam functions.Jeremy Allison1-3/+3
Fixed off by one bug using StrnCpy instead of strdup(). Jeremy. (This used to be commit d4b1c0be2e700c86a4338bb497777f97e3c960a7)