summaryrefslogtreecommitdiffstats
path: root/source/lib/vuser.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/vuser.c')
-rw-r--r--source/lib/vuser.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/lib/vuser.c b/source/lib/vuser.c
index c86d8a3bad6..9a5a01a3d27 100644
--- a/source/lib/vuser.c
+++ b/source/lib/vuser.c
@@ -27,6 +27,23 @@ extern int DEBUGLEVEL;
static int num_validated_users = 0;
/****************************************************************************
+check if a uid has been validated.
+****************************************************************************/
+BOOL is_valid_user_struct(const vuser_key *key)
+{
+ if (key == NULL)
+ {
+ return False;
+ }
+
+ if (key->vuid == UID_FIELD_INVALID)
+ {
+ return False;
+ }
+ return tdb_lookup_vuid(key, NULL);
+}
+
+/****************************************************************************
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.