summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-11-10 19:57:05 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-11-17 00:34:09 +0100
commit87bbe1be5f79107cb96227510588f222b7061c92 (patch)
tree411ebbf1cd1289dd64f8ae9ea53f9c9eb2fe24d0 /source3
parentcd23028ed05feaace335fb96247cfe344a776c71 (diff)
downloadsamba-87bbe1be5f79107cb96227510588f222b7061c92.tar.gz
samba-87bbe1be5f79107cb96227510588f222b7061c92.tar.bz2
samba-87bbe1be5f79107cb96227510588f222b7061c92.zip
s3-net Do not look for a local SID when we are a DC
If we are actually a DC, then the only SID we have is the domain SID, and looking for it under the local name fails if we are a Samba4 AD DC. Andrew Bartlett
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/net.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index d05f6143e1..ce9e7c57b2 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -346,14 +346,15 @@ static int net_getdomainsid(struct net_context *c, int argc, const char **argv)
/* Generate one, if it doesn't exist */
get_global_sam_sid();
- if (!secrets_fetch_domain_sid(lp_netbios_name(), &domain_sid)) {
- d_fprintf(stderr, _("Could not fetch local SID\n"));
- return 1;
+ if (!IS_DC) {
+ if (!secrets_fetch_domain_sid(lp_netbios_name(), &domain_sid)) {
+ d_fprintf(stderr, _("Could not fetch local SID\n"));
+ return 1;
+ }
+ sid_to_fstring(sid_str, &domain_sid);
+ d_printf(_("SID for local machine %s is: %s\n"),
+ lp_netbios_name(), sid_str);
}
- sid_to_fstring(sid_str, &domain_sid);
- d_printf(_("SID for local machine %s is: %s\n"),
- lp_netbios_name(), sid_str);
-
if (!secrets_fetch_domain_sid(c->opt_workgroup, &domain_sid)) {
d_fprintf(stderr, _("Could not fetch domain SID\n"));
return 1;