Line data Source code
1 : /* 2 : Samba Unix/Linux SMB client library 3 : net share commands 4 : Copyright (C) 2002 Andrew Tridgell (tridge@samba.org) 5 : Copyright (C) 2008 Kai Blin (kai@samba.org) 6 : 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. 11 : 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. 16 : 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/>. 19 : */ 20 : 21 : #include "includes.h" 22 : #include "utils/net.h" 23 : 24 0 : int net_share_usage(struct net_context *c, int argc, const char **argv) 25 : { 26 0 : d_printf(_( 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>|- " 35 : " [targets]]" 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>." 39 : "\n\n" 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" 49 : )); 50 0 : net_common_methods_usage(c, argc, argv); 51 0 : net_common_flags_usage(c, argc, argv); 52 0 : d_printf(_( 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")); 61 0 : return -1; 62 : } 63 : 64 4 : int net_share(struct net_context *c, int argc, const char **argv) 65 : { 66 4 : if (argc > 0 && strcasecmp_m(argv[0], "HELP") == 0) { 67 0 : net_share_usage(c, argc, argv); 68 0 : return 0; 69 : } 70 : 71 4 : if (net_rpc_check(c, 0)) 72 4 : return net_rpc_share(c, argc, argv); 73 0 : return net_rap_share(c, argc, argv); 74 : } 75 :