-/*
+/*
Unix SMB/Netbios implementation.
SMB client library implementation
Copyright (C) Andrew Tridgell 1998
Copyright (C) Richard Sharpe 2000, 2002
Copyright (C) John Terpstra 2000
- Copyright (C) Tom Jansen (Ninja ISD) 2002
+ Copyright (C) Tom Jansen (Ninja ISD) 2002
Copyright (C) Derrell Lipman 2003-2008
Copyright (C) Jeremy Allison 2007, 2008
#include "libsmb/libsmb.h"
#include "libsmbclient.h"
#include "libsmb_internal.h"
+#include "../libcli/smb/smbXcli_base.h"
-
-/*
+/*
* Generate an inode number from file name for those things that need it
*/
setup_stat(SMBCCTX *context,
struct stat *st,
const char *fname,
- SMB_OFF_T size,
+ off_t size,
int mode)
{
TALLOC_CTX *frame = talloc_stackframe();
struct timespec write_time_ts;
struct timespec access_time_ts;
struct timespec change_time_ts;
- SMB_OFF_T size = 0;
+ off_t size = 0;
uint16 mode = 0;
+ uint16_t port = 0;
SMB_INO_T ino = 0;
TALLOC_CTX *frame = talloc_stackframe();
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
}
srv = SMBC_server(frame, context, True,
- server, share, &workgroup, &user, &password);
+ server, port, share, &workgroup, &user, &password);
if (!srv) {
TALLOC_FREE(frame);
return -1; /* errno set by SMBC_server */
struct timespec change_time_ts;
struct timespec access_time_ts;
struct timespec write_time_ts;
- SMB_OFF_T size;
+ off_t size;
uint16 mode;
char *server = NULL;
char *share = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
SMB_INO_T ino = 0;
+ uint16_t port = 0;
TALLOC_CTX *frame = talloc_stackframe();
+ NTSTATUS status;
if (!context || !context->internal->initialized) {
errno = EINVAL;
file->fname,
NULL,
&server,
+ &port,
&share,
&path,
&user,
}
/*d_printf(">>>fstat: resolving %s\n", path);*/
- if (!cli_resolve_path(frame, "", context->internal->auth_info,
- file->srv->cli, path,
- &targetcli, &targetpath)) {
+ status = cli_resolve_path(frame, "", context->internal->auth_info,
+ file->srv->cli, path,
+ &targetcli, &targetpath);
+ if (!NT_STATUS_IS_OK(status)) {
d_printf("Could not resolve %s\n", path);
errno = ENOENT;
TALLOC_FREE(frame);
unsigned long flags = 0;
uint32 fs_attrs = 0;
struct cli_state *cli = file->srv->cli;
+ struct smbXcli_tcon *tcon;
+
+ if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
+ tcon = cli->smb2.tcon;
+ } else {
+ tcon = cli->smb1.tcon;
+ }
/* Initialize all fields (at least until we actually use them) */
memset(st, 0, sizeof(*st));
}
/* See if DFS is supported */
- if ((cli->capabilities & CAP_DFS) && cli->dfsroot) {
+ if (smbXcli_conn_dfs_supported(cli->conn) &&
+ smbXcli_tcon_is_dfs_share(tcon))
+ {
flags |= SMBC_VFS_FEATURE_DFS;
}