Bug 2720 - "net usersidlist" returns empty lines
Summary: "net usersidlist" returns empty lines
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: net utility (show other bugs)
Version: 3.0.13
Hardware: All Linux
: P3 normal
Target Milestone: none
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
: 2719 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-16 18:46 UTC by Leon Vernikov
Modified: 2005-08-24 10:24 UTC (History)
1 user (show)

See Also:


Attachments
Patch (925 bytes, patch)
2005-05-17 05:06 UTC, Volker Lendecke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leon Vernikov 2005-05-16 18:46:31 UTC
1. Active Directory database has 10K user’s accounts
2. smb.conf has a global configuration setting
        winbind use default domain = Yes

3. Joined a domain successfully.
4. Verified the join operation with “net testjoin” option
5. “wbinfo –u” returns the list of user’s accounts
6. Utility
# net usersidlist
was executed. It returns empty pages
Comment 1 Leon Vernikov 2005-05-16 18:51:33 UTC
This is a proposed fix for this problem

samba-3.0.13/source/utils/net_rpc.c
===================================================================
+++ source/utils/net_rpc.c      Mon May 16 18:16:05 2005
@@ -3495,6 +3495,7 @@
        fstring name;
        int i;
        struct user_token *result;
+       char *my_domain = smb_xstrdup(opt_target_workgroup);
 
        /* Send request to winbind daemon */
 
@@ -3538,9 +3539,10 @@
 
                DEBUG(3, ("%s\n", name));
 
-               if (p == NULL)
-                       continue;
-
+               if (p == NULL) {
+                       strupper_m(my_domain);
+                       get_user_sids(my_domain, name, &(result[i].token));
+               } else {         
                *p++ = '\0';
 
                fstrcpy(domain, name);
@@ -3548,6 +3550,7 @@
                fstrcpy(user, p);
 
                get_user_sids(domain, user, &(result[i].token));
+               }
                i+=1;
        }
Comment 2 Leon Vernikov 2005-05-16 18:57:41 UTC
*** Bug 2719 has been marked as a duplicate of this bug. ***
Comment 3 Volker Lendecke 2005-05-17 05:06:46 UTC
Created attachment 1232 [details]
Patch

Could you try the attached (slightly different) patch?

Thanks,

Volker
Comment 4 Leon Vernikov 2005-05-17 12:29:16 UTC
New tested diff file

Index: bfc/linux/samba-3.0.x/source/utils/net_rpc.c
===================================================================
--- source/utils/.CC/cache/net_rpc.c@@/main/bd_merge_br/1       Fri May 13 
16:56:28 2005
+++ source/utils/net_rpc.c      Tue May 17 12:08:45 2005
@@ -3496,6 +3496,13 @@
        int i;
        struct user_token *result;
 
+       if (lp_winbind_use_default_domain() &&
+           (opt_target_workgroup == NULL)) {
+               d_printf("workgroup parameter is empty.\n"
+                        "Please, configure the workgroup parameter.\n");
+               return False;
+       }
+
        /* Send request to winbind daemon */
 
        ZERO_STRUCT(request);
@@ -3538,16 +3545,15 @@
 
                DEBUG(3, ("%s\n", name));
 
-               if (p == NULL)
-                       continue;
-
+               if (p == NULL) {
+                       get_user_sids(opt_target_workgroup, name, &(result
[i].token));
+               } else {
                *p++ = '\0';
-
                fstrcpy(domain, name);
                strupper_m(domain);
                fstrcpy(user, p);
-
                get_user_sids(domain, user, &(result[i].token));
+               }
                i+=1;
        }
Comment 5 Volker Lendecke 2005-05-18 04:59:28 UTC
Fixed with revision 6880. Thanks for finding it!

Volker
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:24:44 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.