2 Samba Unix/Linux SMB client library
4 Copyright (C) 2002 Andrew Tridgell (tridge@samba.org)
5 Copyright (C) 2008 Kai Blin (kai@samba.org)
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "utils/net.h"
24 int net_share_usage(struct net_context
*c
, int argc
, const char **argv
)
27 "\nnet [<method>] share [misc. options] [targets] \n"
28 "\tenumerates all exported resources (network shares) "
29 "on target server\n\n"
30 "net [<method>] share ADD <name=serverpath> [misc. options] [targets]"
31 "\n\tadds a share from a server (makes the export active)\n\n"
32 "net [<method>] share DELETE <sharename> [misc. options] [targets]"
33 "\n\tdeletes a share from a server (makes the export inactive)\n\n"
34 "net [<method>] share ALLOWEDUSERS [misc. options] [<filename>|- "
36 "\n\tshows a list of shares (either from [targets] or by default all"
37 "\n\tshares) together with all users allowed to access them. This"
38 "\n\tneeds the output of 'net usersidlist' on stdin or in <filename>."
40 "net [<method>] share MIGRATE FILES <sharename> [misc. options] [targets]"
41 "\n\tMigrates files from remote to local server\n\n"
42 "net [<method>] share MIGRATE SHARES <sharename> [misc. options] [targets]"
43 "\n\tMigrates shares from remote to local server\n\n"
44 "net [<method>] share MIGRATE SECURITY <sharename> [misc. options] [targets]"
45 "\n\tMigrates share-ACLs from remote to local server\n\n"
46 "net [<method>] share MIGRATE ALL <sharename> [misc. options] [targets]"
47 "\n\tMigrates shares (including directories, files) from remote\n"
48 "\tto local server\n\n"
50 net_common_methods_usage(c
, argc
, argv
);
51 net_common_flags_usage(c
, argc
, argv
);
53 "\t-C or --comment=<comment>\tdescriptive comment (for add only)\n"
54 "\t-M or --maxusers=<num>\t\tmax users allowed for share\n"
55 "\t --acls\t\t\tcopies ACLs as well\n"
56 "\t --attrs\t\t\tcopies DOS Attributes as well\n"
57 "\t --timestamps\t\tpreserve timestamps while copying files\n"
58 "\t --destination\t\tmigration target server (default: localhost)\n"
59 "\t-e or --exclude\t\t\tlist of shares to be excluded from mirroring\n"
60 "\t-v or --verbose\t\t\tgive verbose output\n"));
64 int net_share(struct net_context
*c
, int argc
, const char **argv
)
66 if (argc
> 0 && strcasecmp_m(argv
[0], "HELP") == 0) {
67 net_share_usage(c
, argc
, argv
);
71 if (net_rpc_check(c
, 0))
72 return net_rpc_share(c
, argc
, argv
);
73 return net_rap_share(c
, argc
, argv
);