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:
parent
a9f84593f4
commit
596a10d107
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user