summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2020-01-06 10:12:32 +0100
committerJeremy Allison <jra@samba.org>2020-01-13 19:41:36 +0000
commitd2b5f85d221626ce505143c7c129c41603dcb24a (patch)
treeb0eec30d57e47a68c791f088ba43c7562fe2a3c3
parentc3d22018679c6aa83c4a5ae3e480532a3f5eccca (diff)
downloadsamba-d2b5f85d221626ce505143c7c129c41603dcb24a.tar.gz
smbd: remove enum server_allocated_state magic from get_valid_user_struct()
This has been obsoleted a long time ago by a129e271b5385853fb39a8e54b56b508b00a3e41. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/smbd/password.c45
1 files changed, 9 insertions, 36 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index eb648731a83..4b14e6f12f1 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -26,14 +26,14 @@
#include "auth.h"
#include "../libcli/security/security.h"
-enum server_allocated_state { SERVER_ALLOCATED_REQUIRED_YES,
- SERVER_ALLOCATED_REQUIRED_NO,
- SERVER_ALLOCATED_REQUIRED_ANY};
-
-static struct user_struct *get_valid_user_struct_internal(
- struct smbd_server_connection *sconn,
- uint64_t vuid,
- enum server_allocated_state server_allocated)
+/****************************************************************************
+ Check if a uid has been validated, and return an pointer to the user_struct
+ if it has. NULL if not. vuid is biased by an offset. This allows us to
+ tell random client vuid's (normally zero) from valid vuids.
+****************************************************************************/
+
+struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
+ uint64_t vuid)
{
struct user_struct *usp;
int count=0;
@@ -44,19 +44,6 @@ static struct user_struct *get_valid_user_struct_internal(
usp=sconn->users;
for (;usp;usp=usp->next,count++) {
if (vuid == usp->session->global->session_wire_id) {
- switch (server_allocated) {
- case SERVER_ALLOCATED_REQUIRED_YES:
- if (usp->session_info == NULL) {
- continue;
- }
- break;
- case SERVER_ALLOCATED_REQUIRED_NO:
- if (usp->session_info != NULL) {
- continue;
- }
- case SERVER_ALLOCATED_REQUIRED_ANY:
- break;
- }
if (count > 10) {
DLIST_PROMOTE(sconn->users, usp);
}
@@ -68,19 +55,6 @@ static struct user_struct *get_valid_user_struct_internal(
}
/****************************************************************************
- Check if a uid has been validated, and return an pointer to the user_struct
- if it has. NULL if not. vuid is biased by an offset. This allows us to
- tell random client vuid's (normally zero) from valid vuids.
-****************************************************************************/
-
-struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn,
- uint64_t vuid)
-{
- return get_valid_user_struct_internal(sconn, vuid,
- SERVER_ALLOCATED_REQUIRED_YES);
-}
-
-/****************************************************************************
Invalidate a uid.
****************************************************************************/
@@ -90,8 +64,7 @@ void invalidate_vuid(struct smbd_server_connection *sconn, uint64_t vuid)
struct smbXsrv_session *session = NULL;
NTSTATUS status;
- vuser = get_valid_user_struct_internal(sconn, vuid,
- SERVER_ALLOCATED_REQUIRED_ANY);
+ vuser = get_valid_user_struct(sconn, vuid);
if (vuser == NULL) {
return;
}