diff options
author | Jim McDonough <jmcd@samba.org> | 2002-05-31 17:03:48 +0000 |
---|---|---|
committer | Jim McDonough <jmcd@samba.org> | 2002-05-31 17:03:48 +0000 |
commit | 1b9c519dc964791273186cced8d17fd9c7793ce9 (patch) | |
tree | e26d8418b2a5d8d0b53ade15659486cdfae7de78 /source3/utils/net_rap.c | |
parent | e01175020613858f78f3fd604b758d9f6eae6f9e (diff) | |
download | samba-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_rap.c')
-rw-r--r-- | source3/utils/net_rap.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c index 248e601df9..b9eac1f077 100644 --- a/source3/utils/net_rap.c +++ b/source3/utils/net_rap.c @@ -35,7 +35,7 @@ #define ERRMSG_BOTH_SERVER_IPADDRESS "\nTarget server and IP address both "\ "specified. Do not set both at the same time. The target IP address was used\n" -static const char *share_type[] = { +const char *share_type[] = { "Disk", "Print", "Dev", @@ -50,15 +50,7 @@ static int errmsg_not_implemented(void) int net_rap_file_usage(int argc, const char **argv) { - d_printf("net rap file [misc. options] [targets]\n"\ - "\tlists all open files on file server\n\n"); - d_printf("net rap file USER <username> [misc. options] [targets]\n"\ - "\tlists all files opened by username on file server\n\n"); - d_printf("net rap file CLOSE <id> [misc. options] [targets]\n"\ - "\tcloses specified file on target server\n"); - - net_common_flags_usage(argc, argv); - return -1; + return net_help_file(argc, argv); } /*************************************************************************** @@ -67,7 +59,7 @@ int net_rap_file_usage(int argc, const char **argv) static void file_fn(const char * pPath, const char * pUser, uint16 perms, uint16 locks, uint32 id) { - d_printf("\t%-7.1d %-20.20s 0x%-4.2x %-6.1d %s\n", + d_printf("%-7.1d %-20.20s 0x%-4.2x %-6.1d %s\n", id, pUser, perms, locks, pPath); } @@ -143,8 +135,8 @@ int net_rap_file(int argc, const char **argv) /* list open files */ d_printf( "\nEnumerating open files on remote server:\n\n"\ - "\n\tFileId Opened by Perms Locks Path \n"\ - "\t------ --------- ----- ----- ---- \n"); + "\nFileId Opened by Perms Locks Path \n"\ + "------ --------- ----- ----- ---- \n"); ret = cli_NetFileEnum(cli, NULL, NULL, file_fn); cli_shutdown(cli); return ret; @@ -155,23 +147,7 @@ int net_rap_file(int argc, const char **argv) int net_rap_share_usage(int argc, const char **argv) { - d_printf( - "\nnet [rap] share [misc. options] [targets] \n"\ - "\tenumerates all exported resources (network shares) "\ - "on target server\n"); - d_printf( - "\nnet rap share ADD <name=serverpath> [misc. options] [targets]"\ - "\n\tAdds a share from a server (makes the export active)\n"); - d_printf( - "\nnet rap share DELETE <sharename> [misc. options] [targets]\n"\ - "\tor"\ - "\nnet rap share CLOSE <sharename> [misc. options] [targets]"\ - "\n\tDeletes a share from a server (makes the export inactive)\n"); - net_common_flags_usage(argc, argv); - d_printf( - "\t-C or --comment=<comment>\tdescriptive comment (for add only)\n"); - d_printf("\t-M or --maxusers=<num>\t\tmax users allowed for share\n"); - return -1; + return net_help_share(argc, argv); } static void long_share_fn(const char *share_name, uint32 type, @@ -672,8 +648,9 @@ static int rap_user_add(int argc, const char **argv) userinfo.priv = 1; userinfo.home_dir = NULL; userinfo.logon_script = NULL; - + ret = cli_NetUserAdd(cli, &userinfo); + cli_shutdown(cli); return ret; } |