summaryrefslogtreecommitdiffstats
path: root/source3/utils/net.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-16 17:40:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:05 -0500
commit5e8221d9091320414bd168f8166e189c50f95a87 (patch)
treee659ae9b51f5b51d7ffb971711dd1a9283024776 /source3/utils/net.c
parent5255388e958573feb9121bd5ed934739a1f43306 (diff)
downloadsamba-5e8221d9091320414bd168f8166e189c50f95a87.tar.gz
samba-5e8221d9091320414bd168f8166e189c50f95a87.tar.xz
samba-5e8221d9091320414bd168f8166e189c50f95a87.zip
r15646: Implement an setdomainsid command as well
(This used to be commit 51df47c772f8bdd5a2c3a1e9814e625406e79b5f)
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r--source3/utils/net.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 4c7a6280f46..27b64aa96e5 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -596,6 +596,26 @@ static int net_setlocalsid(int argc, const char **argv)
return 0;
}
+static int net_setdomainsid(int argc, const char **argv)
+{
+ DOM_SID sid;
+
+ if ( (argc != 1)
+ || (strncmp(argv[0], "S-1-5-21-", strlen("S-1-5-21-")) != 0)
+ || (!string_to_sid(&sid, argv[0]))
+ || (sid.num_auths != 4)) {
+ d_printf("usage: net setdomainsid S-1-5-21-x-y-z\n");
+ return 1;
+ }
+
+ if (!secrets_store_domain_sid(lp_workgroup(), &sid)) {
+ DEBUG(0,("Can't store domain SID.\n"));
+ return 1;
+ }
+
+ return 0;
+}
+
static int net_getdomainsid(int argc, const char **argv)
{
DOM_SID domain_sid;
@@ -793,6 +813,7 @@ static struct functable net_func[] = {
{"CACHE", net_cache},
{"GETLOCALSID", net_getlocalsid},
{"SETLOCALSID", net_setlocalsid},
+ {"SETDOMAINSID", net_setdomainsid},
{"GETDOMAINSID", net_getdomainsid},
{"MAXRID", net_maxrid},
{"IDMAP", net_idmap},