summaryrefslogtreecommitdiff
path: root/source3/utils/net.c
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2002-05-31 17:03:48 +0000
committerJim McDonough <jmcd@samba.org>2002-05-31 17:03:48 +0000
commit1b9c519dc964791273186cced8d17fd9c7793ce9 (patch)
treee26d8418b2a5d8d0b53ade15659486cdfae7de78 /source3/utils/net.c
parente01175020613858f78f3fd604b758d9f6eae6f9e (diff)
downloadsamba-1b9c519dc964791273186cced8d17fd9c7793ce9.tar.gz
samba-1b9c519dc964791273186cced8d17fd9c7793ce9.tar.bz2
samba-1b9c519dc964791273186cced8d17fd9c7793ce9.zip
Enable net rpc share and net rpc file commands (list subcommands only), and
autoselect for this subcommand when appropriate. (This used to be commit 77418256d3162b41a672a25f7e512999f1193926)
Diffstat (limited to 'source3/utils/net.c')
-rw-r--r--source3/utils/net.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/source3/utils/net.c b/source3/utils/net.c
index b6998efdf7..e132b8d6e3 100644
--- a/source3/utils/net.c
+++ b/source3/utils/net.c
@@ -297,10 +297,8 @@ static int net_group(int argc, const char **argv)
if (net_ads_check() == 0)
return net_ads_group(argc, argv);
-
- /* if server is not specified, default to PDC? */
- /* not implemented yet if (net_rpc_check(NET_FLAGS_PDC))
- return net_rpc_group(argc, argv); */
+ if (argc == 0 && net_rpc_check(NET_FLAGS_PDC))
+ return net_rpc_group(argc, argv);
return net_rap_group(argc, argv);
}
@@ -316,6 +314,22 @@ static int net_join(int argc, const char **argv)
return net_rpc_join(argc, argv);
}
+static int net_share(int argc, const char **argv)
+{
+ /* only share list is implemented in RPC */
+ if (argc == 0 && net_rpc_check(0))
+ return net_rpc_share(argc, argv);
+ return net_rap_share(argc, argv);
+}
+
+static int net_file(int argc, const char **argv)
+{
+ /* only file list is implemented in RPC */
+ if (argc == 0 && net_rpc_check(0))
+ return net_rpc_file(argc, argv);
+ return net_rap_file(argc, argv);
+}
+
/* main function table */
static struct functable net_func[] = {
{"RPC", net_rpc},
@@ -323,8 +337,8 @@ static struct functable net_func[] = {
{"ADS", net_ads},
/* eventually these should auto-choose the transport ... */
- {"FILE", net_rap_file},
- {"SHARE", net_rap_share},
+ {"FILE", net_file},
+ {"SHARE", net_share},
{"SESSION", net_rap_session},
{"SERVER", net_rap_server},
{"DOMAIN", net_rap_domain},