summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2002-09-23 16:46:32 +0000
committerRichard Sharpe <sharpe@samba.org>2002-09-23 16:46:32 +0000
commit587c4c5aa67a4c589fb276fe2df355b443b1d086 (patch)
tree3c70927b0113578535b66f7381171b7ca26f9535 /source3
parent06ce201a29bb90a428a59a3d85752ccf2dca1bdd (diff)
downloadsamba-587c4c5aa67a4c589fb276fe2df355b443b1d086.tar.gz
samba-587c4c5aa67a4c589fb276fe2df355b443b1d086.tar.bz2
samba-587c4c5aa67a4c589fb276fe2df355b443b1d086.zip
Add net getlocalsid [name]
(This used to be commit 08c3e2b824cd2c93ca548fa18ea16a18f5b197e5)
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 9363d1a6a0..800aeded0a 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -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},