net rpc share allowedusers: Allow restricting shares
authorOlly Betts <olly@survex.com>
Tue, 1 May 2018 02:37:08 +0000 (14:37 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 30 Nov 2018 02:35:13 +0000 (03:35 +0100)
commit6af599223c51b27d5b8b6d72f52e9c273f82768d
tree0068de8482566703f52b87075bf2b311fb6afbb3
parent28aeb86a9fbc102007e3152bc6c574232204803a
net rpc share allowedusers: Allow restricting shares

The help already implies that you can specify "targets" for net rpc
share allowedusers, but actually the tail end of the command line
is just ignored.

This patch allows a list of shares to be specified, and only those
shares are checked, which can be much faster if you're only interested
in a few shares on a server which exports lots.

This subcommand already accepts an optional filename for the output
of net usersidlist, with a default of stdin.  Typically you'd just pipe
one command to the other so stdin is most likely what you want.  This
patch adds support for a filename of "-" to mean stdin so that you can
specify stdin explicitly when you provide a list of shares, since in
this case the filename can't be omitted.

Signed-off-by: Olly Betts <olly@survex.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/utils/net_rpc.c
source3/utils/net_share.c