r22102: Remove obsoleted SHLIBS_PROGS from {Makefile,configure}.in.
[nivanova/samba-autobuild/.git] / source3 / utils / net_help.c
index 941baf3378de81ffe16db8533f94d22f6eaa0955..46531e0f6cdd48af5da13a1e8e1cd630db96f8c9 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "includes.h"
-#include "../utils/net.h"
+#include "utils/net.h"
 
 int net_common_methods_usage(int argc, const char**argv)
 {
@@ -42,12 +42,12 @@ int net_common_flags_usage(int argc, const char **argv)
        d_printf("Valid miscellaneous options are:\n"); /* misc options */
        d_printf("\t-p or --port=<port>\t\tconnection port on target\n");
        d_printf("\t-W or --myworkgroup=<wg>\tclient workgroup\n");
-       d_printf("\t-d or --debuglevel=<level>\t\tdebug level (0-10)\n");
+       d_printf("\t-d or --debuglevel=<level>\tdebug level (0-10)\n");
        d_printf("\t-n or --myname=<name>\t\tclient name\n");
        d_printf("\t-U or --user=<name>\t\tuser name\n");
-       d_printf("\t-s or --configfile=<path>\t\tpathname of smb.conf file\n");
+       d_printf("\t-s or --configfile=<path>\tpathname of smb.conf file\n");
        d_printf("\t-l or --long\t\t\tDisplay full information\n");
-       d_printf("\t-V or --version\t\tPrint samba version information\n");
+       d_printf("\t-V or --version\t\t\tPrint samba version information\n");
        d_printf("\t-P or --machine-pass\t\tAuthenticate as machine account\n");
        return -1;
 }
@@ -60,7 +60,8 @@ static int help_usage(int argc, const char **argv)
 "\n"\
 "Valid functions are:\n"\
 "  RPC RAP ADS FILE SHARE SESSION SERVER DOMAIN PRINTQ USER GROUP VALIDATE\n"\
-"  GROUPMEMBER ADMIN SERVICE PASSWORD TIME LOOKUP GETLOCALSID SETLOCALSID\n");
+"  GROUPMEMBER ADMIN SERVICE PASSWORD TIME LOOKUP GETLOCALSID SETLOCALSID\n"\
+"  SETDOMAINSID CHANGESCRETPW LOOKUP SAM\n");
        return -1;
 }
 
@@ -75,6 +76,9 @@ int net_help_user(int argc, const char **argv)
        d_printf("\nnet [<method>] user ADD <name> [password] [-c container] "\
                 "[-F user flags] [misc. options]"\
                 " [targets]\n\tAdd specified user\n");
+       d_printf("\nnet [<method>] user RENAME <oldusername> <newusername>"\
+                " [targets]\n\tRename specified user\n\n");
+
 
        net_common_methods_usage(argc, argv);
        net_common_flags_usage(argc, argv);
@@ -87,45 +91,21 @@ int net_help_group(int argc, const char **argv)
 {
        d_printf("net [<method>] group [misc. options] [targets]"\
                 "\n\tList user groups\n\n");
+       d_printf("net rpc group LIST [global|local|builtin]* [misc. options]"\
+                "\n\tList specific user groups\n\n");
        d_printf("net [<method>] group DELETE <name> "\
                 "[misc. options] [targets]"\
                 "\n\tDelete specified group\n");
        d_printf("\nnet [<method>] group ADD <name> [-C comment] [-c container]"\
                 " [misc. options] [targets]\n\tCreate specified group\n");
+       d_printf("\nnet rpc group MEMBERS <name>\n\tList Group Members\n\n");
+       d_printf("\nnet rpc group ADDMEM <group> <member>\n\tAdd Group Members\n\n");
+       d_printf("\nnet rpc group DELMEM <group> <member>\n\tDelete Group Members\n\n");
        net_common_methods_usage(argc, argv);
        net_common_flags_usage(argc, argv);
        d_printf("\t-C or --comment=<comment>\tdescriptive comment (for add only)\n");
        d_printf("\t-c or --container=<container>\tLDAP container, defaults to cn=Users (for add in ADS only)\n");
-       return -1;
-}
-
-int net_help_groupmap(int argc, const char **argv)
-{
-       if (getuid() != 0) {
-               d_printf("You must be root to edit group mappings.\nExiting...\n");
-               return -1;
-       }
-       
-       d_printf("net groupmap add"\
-               "\n  Create a new group mapping\n");
-       d_printf("net groupmap modify"\
-               "\n  Update a group mapping\n");
-       d_printf("net groupmap delete"\
-               "\n  Remove a group mapping\n");
-       d_printf("net groupmap list"\
-               "\n  List current group map\n");
-       
-       return -1;
-}
-
-int net_help_idmap(int argc, const char **argv)
-{
-       d_printf("net idmap dump filename"\
-                "\n  Dump current id mapping\n");
-
-       d_printf("net idmap restore"\
-                "\n  Restore entries from stdin to current local idmap\n");
-
+       d_printf("\t-L or --localgroup\t\tWhen adding groups, create a local group (alias)\n");
        return -1;
 }
 
@@ -147,14 +127,35 @@ int net_help_share(int argc, const char **argv)
         "\tenumerates all exported resources (network shares) "
         "on target server\n\n"
         "net [<method>] share ADD <name=serverpath> [misc. options] [targets]"
-        "\n\tAdds a share from a server (makes the export active)\n\n"
-        "net [<method>] share DELETE <sharename> [misc. options] [targets]\n"
-        "\n\tDeletes a share from a server (makes the export inactive)\n");
+       "\n\tadds a share from a server (makes the export active)\n\n"
+       "net [<method>] share DELETE <sharename> [misc. options] [targets]"
+       "\n\tdeletes a share from a server (makes the export inactive)\n\n"
+       "net [<method>] share ALLOWEDUSERS [<filename>] "
+       "[misc. options] [targets]"
+       "\n\tshows a list of all shares together with all users allowed to"
+       "\n\taccess them. This needs the output of 'net usersidlist' on"
+       "\n\tstdin or in <filename>.\n\n"
+        "net [<method>] share MIGRATE FILES <sharename> [misc. options] [targets]"
+        "\n\tMigrates files from remote to local server\n\n"
+        "net [<method>] share MIGRATE SHARES <sharename> [misc. options] [targets]"
+        "\n\tMigrates shares from remote to local server\n\n"
+        "net [<method>] share MIGRATE SECURITY <sharename> [misc. options] [targets]"
+        "\n\tMigrates share-ACLs from remote to local server\n\n" 
+        "net [<method>] share MIGRATE ALL <sharename> [misc. options] [targets]"
+        "\n\tMigrates shares (including directories, files) from remote\n"
+        "\tto local server\n\n"
+       );
        net_common_methods_usage(argc, argv);
        net_common_flags_usage(argc, argv);
        d_printf(
         "\t-C or --comment=<comment>\tdescriptive comment (for add only)\n"
-        "\t-M or --maxusers=<num>\t\tmax users allowed for share\n");
+        "\t-M or --maxusers=<num>\t\tmax users allowed for share\n"
+        "\t      --acls\t\t\tcopies ACLs as well\n"
+        "\t      --attrs\t\t\tcopies DOS Attributes as well\n"
+        "\t      --timestamps\t\tpreserve timestamps while copying files\n"
+        "\t      --destination\t\tmigration target server (default: localhost)\n"
+        "\t-e or --exclude\t\t\tlist of shares to be excluded from mirroring\n"
+        "\t-v or --verbose\t\t\tgive verbose output\n");
        return -1;
 }
 
@@ -175,17 +176,65 @@ int net_help_file(int argc, const char **argv)
        return -1;
 }
 
+int net_help_printer(int argc, const char **argv)
+{
+       d_printf("net rpc printer LIST [printer] [misc. options] [targets]\n"\
+                "\tlists all printers on print-server\n\n");
+       d_printf("net rpc printer DRIVER [printer] [misc. options] [targets]\n"\
+                "\tlists all printer-drivers on print-server\n\n");
+       d_printf("net rpc printer PUBLISH action [printer] [misc. options] [targets]\n"\
+                "\tpublishes printer settings in Active Directory\n"
+                "\taction can be one of PUBLISH, UPDATE, UNPUBLISH or LIST\n\n");
+       d_printf("net rpc printer MIGRATE PRINTERS [printer] [misc. options] [targets]"\
+                "\n\tmigrates printers from remote to local server\n\n");
+       d_printf("net rpc printer MIGRATE SETTINGS [printer] [misc. options] [targets]"\
+                "\n\tmigrates printer-settings from remote to local server\n\n");
+       d_printf("net rpc printer MIGRATE DRIVERS [printer] [misc. options] [targets]"\
+                "\n\tmigrates printer-drivers from remote to local server\n\n");
+       d_printf("net rpc printer MIGRATE FORMS [printer] [misc. options] [targets]"\
+                "\n\tmigrates printer-forms from remote to local server\n\n");
+       d_printf("net rpc printer MIGRATE SECURITY [printer] [misc. options] [targets]"\
+                "\n\tmigrates printer-ACLs from remote to local server\n\n");
+       d_printf("net rpc printer MIGRATE ALL [printer] [misc. options] [targets]"\
+                "\n\tmigrates drivers, forms, queues, settings and acls from\n"\
+                "\tremote to local print-server\n\n");
+       net_common_methods_usage(argc, argv);
+       net_common_flags_usage(argc, argv);
+       d_printf(
+        "\t-v or --verbose\t\t\tgive verbose output\n"
+        "\t      --destination\t\tmigration target server (default: localhost)\n");
+
+       return -1;
+}
+
+
+int net_help_status(int argc, const char **argv)
+{
+       d_printf("  net status sessions [parseable] "
+                "Show list of open sessions\n");
+       d_printf("  net status shares [parseable]   "
+                "Show list of open shares\n");
+       return -1;
+}
+
 static int net_usage(int argc, const char **argv)
 {
        d_printf("  net time\t\tto view or set time information\n"\
-                "  net lookup\t\tto lookup host name or ip address\n"\
                 "  net user\t\tto manage users\n"\
                 "  net group\t\tto manage groups\n"\
+                "  net sam\t\tto edit the local user database directly\n"\
+                "  net lookup\t\tto look up various things\n"\
                 "  net groupmap\t\tto manage group mappings\n"\
                 "  net join\t\tto join a domain\n"\
                 "  net cache\t\tto operate on cache tdb file\n"\
                 "  net getlocalsid [NAME]\tto get the SID for local name\n"\
                 "  net setlocalsid SID\tto set the local domain SID\n"\
+                "  net setdomainsid SID\tto set the domain SID on member servers\n"\
+                "  net changesecretpw\tto change the machine password in the local secrets database only\n"\
+                "                    \tthis requires the -f flag as a safety barrier\n"\
+                "  net status\t\tShow server status\n"\
+               "  net usersidlist\tto get a list of all users with their SIDs\n"
+               "  net usershare\t\tto add, delete and list locally user-modifiable shares\n"
                 "\n"\
                 "  net ads <command>\tto run ADS commands\n"\
                 "  net rap <command>\tto run RAP (pre-RPC) commands\n"\
@@ -223,6 +272,11 @@ int net_help(int argc, const char **argv)
                {"PASSWORD", net_rap_password_usage},
                {"TIME", net_time_usage},
                {"LOOKUP", net_lookup_usage},
+               {"USERSHARE", net_usershare_usage},
+               {"USERSIDLIST", net_usersidlist_usage},
+#ifdef WITH_FAKE_KASERVER
+               {"AFS", net_help_afs},
+#endif
 
                {"HELP", help_usage},
                {NULL, NULL}};