Created attachment 7612 [details] patch "net rpc allowedusers" to work with 2008r2 The RAP NetShareEnum command was removed in 2008r2, so this patch updates "net rpc share allowedusers" to use the RPC equivalent instead. I've been running this in production with various versions of samba since at least last July, and it seems to work well with both 2008r2 and older versions of Windows.
Created attachment 7620 [details] Modified patch for 3.6.x. Can you test this patch instead to see if it still does what you want ? Instead of using NetShareEnum() which opens a new pipe I used dcerpc_srvsvc_NetShareEnumAll() which should use the existing one. Please let me know if this fixes it for you ? Cheers, Jeremy.
Sure, I'll give that a try.
I've now tested the "Modified patch for 3.6.x" against a variety of servers, both 2008r2 and others, and it looks good.
Created attachment 7905 [details] Patch updated not to ignore hidden shares The current patch ignores hidden shares, which I've found unhelpful. I asked on #samba-technical if this was done for a good reason: ojwb: net rpc allowedusers carefully checks for hidden shares and excludes them, like so: if (netname[strlen(netname)-1] == '$') continue; ojwb: is there a good reason for doing that? vl: ojwb: I don't think so. ojwb is testing with the check removed - i'll send in a patch if that works Removing that check has the desired effect, so here's an amended patch with the check removed.
Created attachment 7906 [details] interdiff between Jeremy's patch and mine to show the difference clearly
Comment on attachment 7905 [details] Patch updated not to ignore hidden shares Patch applies cleanly to 3.6.next and 4.0.0rc2 and has already gone into master. Let's get it in a release ! :-). Jeremy.
Re-assigning to Karolin for inclusion in 3.6.next and 4.0.0rc3. Jeremy.
Pushed to autibuild-v4-0-test and v3-6-test. Closing out bug report. Thanks!