summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-10-03 12:55:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:31:07 -0500
commit4a952fb0c0bb9d8ebb733b32f3f16596293b320b (patch)
treed7b53177fc4e23664cdff267f4ae8100160a5ebf
parent3665d6d9d54f0f52fcf1ad68ca7e126d7343d4fd (diff)
downloadsamba-4a952fb0c0bb9d8ebb733b32f3f16596293b320b.tar.gz
samba-4a952fb0c0bb9d8ebb733b32f3f16596293b320b.tar.bz2
samba-4a952fb0c0bb9d8ebb733b32f3f16596293b320b.zip
r25481: Fix some typos, don't panic as non-root on net getdomainsid
Thanks to Karolin Seeger <ks@sernet.de> (This used to be commit 5ae4b2739853e2cd91e839909eb868dbb56be431)
-rw-r--r--source3/utils/net.c13
-rw-r--r--source3/utils/net_rpc.c4
2 files changed, 13 insertions, 4 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index 9c327f162d..88283ac145 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -625,7 +625,7 @@ static int net_getlocalsid(int argc, const char **argv)
if(!initialize_password_db(False, NULL)) {
DEBUG(0, ("WARNING: Could not open passdb - local sid may not reflect passdb\n"
- "backend knowlege (such as the sid stored in LDAP)\n"));
+ "backend knowledge (such as the sid stored in LDAP)\n"));
}
/* first check to see if we can even access secrets, so we don't
@@ -695,7 +695,16 @@ static int net_getdomainsid(int argc, const char **argv)
if(!initialize_password_db(False, NULL)) {
DEBUG(0, ("WARNING: Could not open passdb - domain sid may not reflect passdb\n"
- "backend knowlege (such as the sid stored in LDAP)\n"));
+ "backend knowledge (such as the sid stored in LDAP)\n"));
+ }
+
+ /* first check to see if we can even access secrets, so we don't
+ panic when we can't. */
+
+ if (!secrets_init()) {
+ d_fprintf(stderr, "Unable to open secrets.tdb. Can't fetch domain"
+ "SID for name: %s\n", get_global_sam_name());
+ return 1;
}
/* Generate one, if it doesn't exist */
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index b2e37ac559..ca81d367f2 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -6621,7 +6621,7 @@ int net_rpc_usage(int argc, const char **argv)
{
d_printf(" net rpc info \t\t\tshow basic info about a domain \n");
d_printf(" net rpc join \t\t\tto join a domain \n");
- d_printf(" net rpc oldjoin \t\t\tto join a domain created in server manager\n");
+ d_printf(" net rpc oldjoin \t\tto join a domain created in server manager\n");
d_printf(" net rpc testjoin \t\ttests that a join is valid\n");
d_printf(" net rpc user \t\t\tto add, delete and list users\n");
d_printf(" net rpc password <username> [<password>] -Uadmin_username%%admin_pass\n");
@@ -6632,7 +6632,7 @@ int net_rpc_usage(int argc, const char **argv)
d_printf(" net rpc changetrustpw \tto change the trust account password\n");
d_printf(" net rpc getsid \t\tfetch the domain sid into the local secrets.tdb\n");
d_printf(" net rpc vampire \t\tsyncronise an NT PDC's users and groups into the local passdb\n");
- d_printf(" net rpc samdump \t\tdiplay an NT PDC's users, groups and other data\n");
+ d_printf(" net rpc samdump \t\tdisplay an NT PDC's users, groups and other data\n");
d_printf(" net rpc trustdom \t\tto create trusting domain's account or establish trust\n");
d_printf(" net rpc abortshutdown \tto abort the shutdown of a remote server\n");
d_printf(" net rpc shutdown \t\tto shutdown a remote server\n");