summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorKarolin Seeger <ks@sernet.de>2007-10-18 13:00:46 +0200
committerVolker Lendecke <vl@sernet.de>2007-10-18 13:12:58 +0200
commit4d910553dcf8e19f4b1d6fb65ee9d5473a55cbbd (patch)
treee56c771e3e480cba3a0522a2a0617ec00570b11c /source3
parentc595c8311bb77fe9c6e8a5794612735f3bbab517 (diff)
downloadsamba-4d910553dcf8e19f4b1d6fb65ee9d5473a55cbbd.tar.gz
samba-4d910553dcf8e19f4b1d6fb65ee9d5473a55cbbd.tar.bz2
samba-4d910553dcf8e19f4b1d6fb65ee9d5473a55cbbd.zip
Add net rap file user
(This used to be commit 2972c97e5e676964585de930601f083c19080735)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/clirap2.c5
-rw-r--r--source3/utils/net_rap.c24
2 files changed, 22 insertions, 7 deletions
diff --git a/source3/libsmb/clirap2.c b/source3/libsmb/clirap2.c
index 23113003f0..b8fe31a562 100644
--- a/source3/libsmb/clirap2.c
+++ b/source3/libsmb/clirap2.c
@@ -1021,7 +1021,10 @@ int cli_NetFileGetInfo(struct cli_state *cli, uint32 file_id, void (*fn)(const c
* False - failure
*
****************************************************************************/
-int cli_NetFileEnum(struct cli_state *cli, char * user, char * base_path, void (*fn)(const char *, const char *, uint16, uint16, uint32))
+int cli_NetFileEnum(struct cli_state *cli, const char * user,
+ const char * base_path,
+ void (*fn)(const char *, const char *, uint16, uint16,
+ uint32))
{
char *rparam = NULL;
char *rdata = NULL;
diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c
index 74eda61331..b4de374885 100644
--- a/source3/utils/net_rap.c
+++ b/source3/utils/net_rap.c
@@ -108,11 +108,23 @@ static int rap_file_info(int argc, const char **argv)
static int rap_file_user(int argc, const char **argv)
{
+ struct cli_state *cli;
+ int ret;
+
if (argc == 0)
return net_rap_file_usage(argc, argv);
- d_fprintf(stderr, "net rap file user not implemented yet\n");
- return -1;
+ if (!NT_STATUS_IS_OK(net_make_ipc_connection(0, &cli)))
+ return -1;
+
+ /* list open files */
+
+ d_printf("\nEnumerating open files on remote server:\n\n"
+ "\nFileId Opened by Perms Locks Path \n"
+ "------ --------- ----- ----- ---- \n");
+ ret = cli_NetFileEnum(cli, argv[0], NULL, file_fn);
+ cli_shutdown(cli);
+ return ret;
}
int net_rap_file(int argc, const char **argv)
@@ -132,10 +144,10 @@ int net_rap_file(int argc, const char **argv)
return -1;
/* list open files */
- d_printf(
- "\nEnumerating open files on remote server:\n\n"\
- "\nFileId Opened by Perms Locks Path \n"\
- "------ --------- ----- ----- ---- \n");
+
+ d_printf("\nEnumerating open files on remote server:\n\n"
+ "\nFileId Opened by Perms Locks Path \n"
+ "------ --------- ----- ----- ---- \n");
ret = cli_NetFileEnum(cli, NULL, NULL, file_fn);
cli_shutdown(cli);
return ret;