1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

Add protocol version to smbstatus output

Signed-off-by: Mathias Dietz <mdietz@de.ibm.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 22 18:37:27 CEST 2014 on sn-devel-104
This commit is contained in:
Mathias Dietz 2014-03-05 16:26:20 +01:00 committed by Stefan Metzmacher
parent b328bb07ff
commit 8935242489
3 changed files with 33 additions and 4 deletions

View File

@ -38,5 +38,6 @@ struct sessionid {
struct server_id pid;
fstring ip_addr_str;
time_t connect_start;
fstring protocol_ver;
};

View File

@ -45,6 +45,34 @@ static int sessionid_traverse_read_fn(struct smbXsrv_session_global0 *global,
.pid = global->channels[0].server_id,
};
switch(global->connection_dialect){
case SMB2_DIALECT_REVISION_000:
fstrcpy(session.protocol_ver, "NT1");
break;
case SMB2_DIALECT_REVISION_202:
fstrcpy(session.protocol_ver, "SMB2_02");
break;
case SMB2_DIALECT_REVISION_210:
fstrcpy(session.protocol_ver, "SMB2_10");
break;
case SMB2_DIALECT_REVISION_222:
fstrcpy(session.protocol_ver, "SMB2_22");
break;
case SMB2_DIALECT_REVISION_224:
fstrcpy(session.protocol_ver, "SMB2_24");
break;
case SMB3_DIALECT_REVISION_300:
fstrcpy(session.protocol_ver, "SMB3_00");
break;
case SMB3_DIALECT_REVISION_302:
fstrcpy(session.protocol_ver, "SMB3_02");
break;
default:
fstr_sprintf(session.protocol_ver, "Unknown (0x%04x)",
global->connection_dialect);
break;
}
if (session_info != NULL) {
session.uid = session_info->unix_token->uid;
session.gid = session_info->unix_token->gid;

View File

@ -303,10 +303,10 @@ static int traverse_sessionid(const char *key, struct sessionid *session,
}
}
d_printf("%-7s %-12s %-12s %-12s (%s)\n",
d_printf("%-7s %-12s %-12s %-12s (%s) %-12s\n",
procid_str_static(&session->pid),
uid_str, gid_str,
session->remote_machine, session->hostname);
session->remote_machine, session->hostname, session->protocol_ver);
return 0;
}
@ -472,8 +472,8 @@ int main(int argc, const char *argv[])
if ( show_processes ) {
d_printf("\nSamba version %s\n",samba_version_string());
d_printf("PID Username Group Machine \n");
d_printf("-------------------------------------------------------------------\n");
d_printf("PID Username Group Machine Protocol Version \n");
d_printf("------------------------------------------------------------------------------\n");
sessionid_traverse_read(traverse_sessionid, NULL);