summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:34:30 -0500
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:34:30 -0500
commite5a951325a6cac8567af3a66de6d2df577508ae4 (patch)
tree34da9fe59f3c2d7f8edb072144443a9704197831 /source3/client
parent57482469b32645250e92a7ffd003aeeb4a42235e (diff)
downloadsamba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.gz
samba-e5a951325a6cac8567af3a66de6d2df577508ae4.tar.bz2
samba-e5a951325a6cac8567af3a66de6d2df577508ae4.zip
[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/cifs_resolver.sh51
-rw-r--r--source3/client/client.c85
-rwxr-xr-xsource3/client/mount.cifs.c2
3 files changed, 19 insertions, 119 deletions
diff --git a/source3/client/cifs_resolver.sh b/source3/client/cifs_resolver.sh
deleted file mode 100644
index 2229d5a5f5..0000000000
--- a/source3/client/cifs_resolver.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-###############################################################################
-#
-# Written by Igor Mammedov (niallain@gmail.com)
-# Modified by Steve French <sfrench@samba.org>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version
-# 2 of the License, or (at your option) any later version.
-#
-###############################################################################
-#
-# linux-cifs-client dns name resolver helper
-# called by cifs kernel module upcall to key API to resolve server name
-# to IP when module connects to DFS link. We may eventually make this
-# C code, but this is a good starting point.
-# You should have appropriate kernel and keyutils installed.
-# CIFS DFS Support will require Linux kernel module
-# cifs.ko version 1.48 or later.
-#
-# Consult the CIFS client users guide for more details
-# http://www.samba.org/samba/ftp/cifs-cvs/linux-cifs-client-guide.pdf
-#
-# Put the following string in /etc/request-key.conf without comment sign :)
-# create cifs_resolver * * /sbin/cifs_resolver.sh %k %d %S
-#
-# Put this script into /sbin directory
-# Call: /sbin/cifs_resolver.sh <keyid> <desc> <session-keyring>
-#
-# <desc> - is server name to resolve
-#
-
-status=0
-{
- echo "cifs_resolver: resolving: $2"
-
- DATAA=`/usr/bin/host $2`
- status=$?
-
- if [ "x$status" != "x0" ]; then
- echo "cifs_resolver: failed to resolve: $2"
- exit $status
- else
- DATAA=`echo "$DATAA" | sed 's/.*has address //'`
- echo "cifs_resolver: resolved: $2 to $DATAA"
- keyctl instantiate $1 "$DATAA" $3 || exit 1
- fi
-# if you want to debug the upcall, replace /dev/null (below) with ttyS0 or file
-} >&/dev/null
-exit 0
diff --git a/source3/client/client.c b/source3/client/client.c
index 52ca5e309a..171d413b0a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -1823,54 +1823,6 @@ static int cmd_open(void)
/****************************************************************************
****************************************************************************/
-static int cmd_posix_encrypt(void)
-{
- NTSTATUS status;
-
- if (cli->use_kerberos) {
- status = cli_gss_smb_encryption_start(cli);
- } else {
- fstring buf;
- fstring domain;
- fstring user;
- fstring password;
-
- if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
- d_printf("posix_encrypt domain user password\n");
- return 1;
- }
- fstrcpy(domain,buf);
-
- if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
- d_printf("posix_encrypt domain user password\n");
- return 1;
- }
- fstrcpy(user,buf);
-
- if (!next_token_nr(NULL,buf,NULL,sizeof(buf))) {
- d_printf("posix_encrypt domain user password\n");
- return 1;
- }
- fstrcpy(password,buf);
-
- status = cli_raw_ntlm_smb_encryption_start(cli,
- user,
- password,
- domain);
- }
-
- if (!NT_STATUS_IS_OK(status)) {
- d_printf("posix_encrypt failed with error %s\n", nt_errstr(status));
- } else {
- d_printf("encryption on\n");
- }
-
- return 0;
-}
-
-/****************************************************************************
-****************************************************************************/
-
static int cmd_posix_open(void)
{
pstring mask;
@@ -3072,12 +3024,10 @@ static BOOL browse_host_rpc(BOOL sort)
NTSTATUS status;
struct rpc_pipe_client *pipe_hnd;
TALLOC_CTX *mem_ctx;
- uint32 enum_hnd = 0;
- struct srvsvc_NetShareCtr1 ctr1;
- union srvsvc_NetShareCtr ctr;
+ ENUM_HND enum_hnd;
+ WERROR werr;
+ SRV_SHARE_INFO_CTR ctr;
int i;
- uint32 level;
- uint32 numentries;
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
@@ -3085,6 +3035,8 @@ static BOOL browse_host_rpc(BOOL sort)
return False;
}
+ init_enum_hnd(&enum_hnd, 0);
+
pipe_hnd = cli_rpc_pipe_open_noauth(cli, PI_SRVSVC, &status);
if (pipe_hnd == NULL) {
@@ -3094,23 +3046,23 @@ static BOOL browse_host_rpc(BOOL sort)
return False;
}
- ZERO_STRUCT(ctr1);
- level = 1;
- ctr.ctr1 = &ctr1;
-
- status = rpccli_srvsvc_NetShareEnum(pipe_hnd, mem_ctx, "", &level,
- &ctr, 0xffffffff, &numentries,
- &enum_hnd);
+ werr = rpccli_srvsvc_net_share_enum(pipe_hnd, mem_ctx, 1, &ctr,
+ 0xffffffff, &enum_hnd);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!W_ERROR_IS_OK(werr)) {
TALLOC_FREE(mem_ctx);
cli_rpc_pipe_close(pipe_hnd);
return False;
}
- for (i=0; i<numentries; i++) {
- struct srvsvc_NetShareInfo1 *info = &ctr.ctr1->array[i];
- browse_fn(info->name, info->type, info->comment, NULL);
+ for (i=0; i<ctr.num_entries; i++) {
+ SRV_SHARE_INFO_1 *info = &ctr.share.info1[i];
+ char *name, *comment;
+ name = rpcstr_pull_unistr2_talloc(
+ mem_ctx, &info->info_1_str.uni_netname);
+ comment = rpcstr_pull_unistr2_talloc(
+ mem_ctx, &info->info_1_str.uni_remark);
+ browse_fn(name, info->info_1.type, comment, NULL);
}
TALLOC_FREE(mem_ctx);
@@ -3322,7 +3274,6 @@ static struct
{"newer",cmd_newer,"<file> only mget files newer than the specified local file",{COMPL_LOCAL,COMPL_NONE}},
{"open",cmd_open,"<mask> open a file",{COMPL_REMOTE,COMPL_NONE}},
{"posix", cmd_posix, "turn on all POSIX capabilities", {COMPL_REMOTE,COMPL_NONE}},
- {"posix_encrypt",cmd_posix_encrypt,"<domain> <user> <password> start up transport encryption",{COMPL_REMOTE,COMPL_NONE}},
{"posix_open",cmd_posix_open,"<name> 0<mode> open_flags mode open a file using POSIX interface",{COMPL_REMOTE,COMPL_NONE}},
{"posix_mkdir",cmd_posix_mkdir,"<name> 0<mode> creates a directory using POSIX interface",{COMPL_REMOTE,COMPL_NONE}},
{"posix_rmdir",cmd_posix_rmdir,"<name> removes a directory using POSIX interface",{COMPL_REMOTE,COMPL_NONE}},
@@ -3719,12 +3670,12 @@ static void readline_callback(void)
timeout.tv_usec = 0;
sys_select_intr(cli->fd+1,&fds,NULL,NULL,&timeout);
- /* We deliberately use cli_receive_smb_return_keepalive instead of
+ /* We deliberately use receive_smb instead of
client_receive_smb as we want to receive
session keepalives and then drop them here.
*/
if (FD_ISSET(cli->fd,&fds)) {
- if (!cli_receive_smb_return_keepalive(cli)) {
+ if (!receive_smb(cli->fd,cli->inbuf,0)) {
DEBUG(0, ("Read from server failed, maybe it closed the "
"connection\n"));
return;
diff --git a/source3/client/mount.cifs.c b/source3/client/mount.cifs.c
index 5ed0f27ab1..eb45ae5b4a 100755
--- a/source3/client/mount.cifs.c
+++ b/source3/client/mount.cifs.c
@@ -426,7 +426,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
} else if (strncmp(data, "ip", 2) == 0) {
if (!value || !*value) {
printf("target ip address argument missing");
- } else if (strnlen(value, INET6_ADDRSTRLEN) < INET6_ADDRSTRLEN) {
+ } else if (strnlen(value, 35) < 35) {
if(verboseflag)
printf("ip address %s override specified\n",value);
got_ip = 1;