1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-08 05:57:51 +03:00

Add net getlocalsid [name]

(This used to be commit 08c3e2b824cd2c93ca548fa18ea16a18f5b197e5)
This commit is contained in:
Richard Sharpe 2002-09-23 16:46:32 +00:00
parent 06ce201a29
commit 587c4c5aa6

View File

@ -329,6 +329,31 @@ static int net_file(int argc, const char **argv)
return net_rap_file(argc, argv);
}
/*
Retrieve our local SID or the SID for the specified name
*/
static int net_getlocalsid(int argc, const char **argv)
{
DOM_SID sid;
const char *name;
fstring sid_str;
if (argc >= 1) {
name = argv[0];
}
else {
name = global_myname;
}
if (!secrets_fetch_domain_sid(name, &sid)) {
DEBUG(0, ("Can't fetch domain SID for name: %s\n", name));
return 1;
}
sid_to_string(sid_str, &sid);
d_printf("SID for domain %s is: %s\n", name, sid_str);
return 0;
}
static int net_setlocalsid(int argc, const char **argv)
{
DOM_SID sid;
@ -396,6 +421,7 @@ static struct functable net_func[] = {
{"LOOKUP", net_lookup},
{"JOIN", net_join},
{"CACHE", net_cache},
{"GETLOCALSID", net_getlocalsid},
{"SETLOCALSID", net_setlocalsid},
{"GETDOMAINSID", net_getdomainsid},