summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-05-18 11:57:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:56 -0500
commit3b0df6770db55a7690473547bef29a5a7bede0b9 (patch)
tree38496ce07ed101e65678780ccc7dda0049569275
parenta54f0ea83e3cab4c27e730981bbfec2a958d4829 (diff)
downloadsamba-3b0df6770db55a7690473547bef29a5a7bede0b9.tar.gz
samba-3b0df6770db55a7690473547bef29a5a7bede0b9.tar.bz2
samba-3b0df6770db55a7690473547bef29a5a7bede0b9.zip
r6880: Fix bug 2070 after positive feedback from Leon Vernikov. Thanks!
Volker (This used to be commit f25da82ffd8cdaf9ba773352b6f35d5390ee4aad)
-rw-r--r--source3/utils/net_rpc.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 46eae155d5..3602e90956 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3491,6 +3491,13 @@ static BOOL get_user_tokens(int *num_tokens, struct user_token **user_tokens)
int i;
struct user_token *result;
+ if (lp_winbind_use_default_domain() &&
+ (opt_target_workgroup == NULL)) {
+ d_printf("winbind use default domain = yes set, please "
+ "specify a workgroup\n");
+ return False;
+ }
+
/* Send request to winbind daemon */
ZERO_STRUCT(request);
@@ -3533,14 +3540,15 @@ static BOOL get_user_tokens(int *num_tokens, struct user_token **user_tokens)
DEBUG(3, ("%s\n", name));
- if (p == NULL)
- continue;
-
- *p++ = '\0';
-
- fstrcpy(domain, name);
- strupper_m(domain);
- fstrcpy(user, p);
+ if (p == NULL) {
+ fstrcpy(domain, opt_target_workgroup);
+ fstrcpy(user, name);
+ } else {
+ *p++ = '\0';
+ fstrcpy(domain, name);
+ strupper_m(domain);
+ fstrcpy(user, p);
+ }
get_user_sids(domain, user, &(result[i].token));
i+=1;