1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

Add net rap file user

(This used to be commit 2972c97e5e)
This commit is contained in:
Karolin Seeger 2007-10-18 13:00:46 +02:00 committed by Volker Lendecke
parent c595c8311b
commit 4d910553dc
2 changed files with 22 additions and 7 deletions

View File

@ -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;

View File

@ -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;