1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3:lib: let sessionid_traverse_read() report if the session was authenticated

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15412

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
This commit is contained in:
Stefan Metzmacher 2023-07-03 15:08:31 +02:00
parent a9f84593f4
commit 596a10d107
2 changed files with 9 additions and 0 deletions

View File

@ -39,6 +39,7 @@ struct sessionid {
fstring ip_addr_str;
time_t connect_start;
uint16_t connection_dialect;
bool authenticated;
uint8_t encryption_flags;
uint16_t cipher;
uint16_t signing;

View File

@ -25,6 +25,7 @@
#include "util_tdb.h"
#include "smbd/globals.h"
#include "source3/smbd/smbXsrv_session.h"
#include "../libcli/security/session.h"
struct sessionid_traverse_read_state {
int (*fn)(const char *key, struct sessionid *session,
@ -49,11 +50,18 @@ static int sessionid_traverse_read_fn(struct smbXsrv_session_global0 *global,
};
if (session_info != NULL) {
enum security_user_level ul;
session.uid = session_info->unix_token->uid;
session.gid = session_info->unix_token->gid;
strncpy(session.username,
session_info->unix_info->unix_name,
sizeof(fstring)-1);
ul = security_session_user_level(session_info, NULL);
if (ul >= SECURITY_USER) {
session.authenticated = true;
}
}
strncpy(session.remote_machine,