[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue Jun 11 13:53:02 MDT 2013
The branch, master has been updated
via 4cd0e38 lib: Remove an unused variable
via 61f59d8 winreg3: Fix a const warning
via 9c95110 libsmb: add ABI/smbclient-0.2.1.sigs
via 2252d78 Add smbc_getPort(), smbc_setPort(). Bump the .so minor number.
via 47471c8 Plumb the 'port' parameter into the connect code.
via ccb5c2d Add the port argument to SMBC_server().
via da6c84a Add port argument to SMBC_attr_server(). Does nothing as yet.
via 534cf51 Add the ability to parse out the port to SMBC_parse_path().
from c0cbf59 Remove remaining references to "password level" in the tree
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 4cd0e38fe0fa3432326fafd4baa845ec2483bb70
Author: Volker Lendecke <vl at samba.org>
Date: Tue Jun 11 19:41:30 2013 +0200
lib: Remove an unused variable
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Tue Jun 11 21:52:09 CEST 2013 on sn-devel-104
commit 61f59d84ae41fd2101cce91287ec54efd207cf28
Author: Volker Lendecke <vl at samba.org>
Date: Tue Jun 11 19:27:17 2013 +0200
winreg3: Fix a const warning
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 9c95110b67ee5f9b40340861b5bb91e770398c3e
Author: David Disseldorp <ddiss at samba.org>
Date: Tue Jun 11 14:20:53 2013 +0200
libsmb: add ABI/smbclient-0.2.1.sigs
Required following ABI vnum bump for smbc_get/setPort changes.
Signed-off-by: David Disseldorp <ddiss at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 2252d781234b963f24a7827a1228f85ba9f6d7da
Author: Jeremy Allison <jra at samba.org>
Date: Tue Apr 16 14:53:09 2013 -0700
Add smbc_getPort(), smbc_setPort(). Bump the .so minor number.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
commit 47471c82d0d5a024a0c64eab68adae1d482bd972
Author: Jeremy Allison <jra at samba.org>
Date: Tue Apr 16 14:13:57 2013 -0700
Plumb the 'port' parameter into the connect code.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
commit ccb5c2d6930eeb7672af33833adb195d0c525547
Author: Jeremy Allison <jra at samba.org>
Date: Tue Apr 16 14:11:08 2013 -0700
Add the port argument to SMBC_server().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
commit da6c84aff0b4b01ae1bf3d31cbc4e8e176168a9a
Author: Jeremy Allison <jra at samba.org>
Date: Tue Apr 16 12:22:11 2013 -0700
Add port argument to SMBC_attr_server(). Does nothing as yet.
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
commit 534cf516ed17d90bbd851fd8e190811a055aa5f0
Author: Jeremy Allison <jra at samba.org>
Date: Tue Apr 16 12:09:41 2013 -0700
Add the ability to parse out the port to SMBC_parse_path().
Signed-off-by: Jeremy Allison <jra at samba.org>
Reviewed-by: David Disseldorp <ddiss at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/include/libsmb_internal.h | 4 ++
source3/include/libsmbclient.h | 14 +++++++
source3/lib/popt_common.c | 1 -
source3/libsmb/ABI/smbclient-0.1.0.sigs | 2 +
.../{smbclient-0.2.0.sigs => smbclient-0.2.1.sigs} | 2 +
source3/libsmb/libsmb_context.c | 1 +
source3/libsmb/libsmb_dir.c | 38 ++++++++++++++------
source3/libsmb/libsmb_file.c | 14 +++++++-
source3/libsmb/libsmb_path.c | 27 +++++++++++++-
source3/libsmb/libsmb_printjob.c | 10 ++++-
source3/libsmb/libsmb_server.c | 23 +++++++-----
source3/libsmb/libsmb_setget.c | 19 ++++++++++
source3/libsmb/libsmb_stat.c | 6 +++-
source3/libsmb/libsmb_xattr.c | 18 ++++++---
source3/libsmb/wscript | 2 +-
source3/rpc_server/winreg/srv_winreg_nt.c | 4 ++-
16 files changed, 151 insertions(+), 34 deletions(-)
copy source3/libsmb/ABI/{smbclient-0.2.0.sigs => smbclient-0.2.1.sigs} (99%)
Changeset truncated at 500 lines:
diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h
index aba159a..7ce37d2 100644
--- a/source3/include/libsmb_internal.h
+++ b/source3/include/libsmb_internal.h
@@ -244,6 +244,7 @@ struct SMBC_internal_data {
} smb;
#endif
+ uint16_t port;
};
/* Functions in libsmb_cache.c */
@@ -415,6 +416,7 @@ SMBC_parse_path(TALLOC_CTX *ctx,
const char *fname,
char **pp_workgroup,
char **pp_server,
+ uint16_t *p_port,
char **pp_share,
char **pp_path,
char **pp_user,
@@ -473,6 +475,7 @@ SMBC_server(TALLOC_CTX *ctx,
SMBCCTX *context,
bool connect_if_not_found,
const char *server,
+ uint16_t port,
const char *share,
char **pp_workgroup,
char **pp_username,
@@ -482,6 +485,7 @@ SMBCSRV *
SMBC_attr_server(TALLOC_CTX *ctx,
SMBCCTX *context,
const char *server,
+ uint16_t port,
const char *share,
char **pp_workgroup,
char **pp_username,
diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h
index 61ff6a3..5846e9b 100644
--- a/source3/include/libsmbclient.h
+++ b/source3/include/libsmbclient.h
@@ -76,6 +76,7 @@ extern "C" {
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
+#include <stdint.h>
#include <fcntl.h>
#include <utime.h>
@@ -507,6 +508,19 @@ void
smbc_setTimeout(SMBCCTX *c, int timeout);
+/**
+ * Get the TCP port used to connect (0 means default).
+ */
+uint16_t
+smbc_getPort(SMBCCTX *c);
+
+/**
+ * Set the TCP port used to connect (0 means default).
+ */
+void
+smbc_setPort(SMBCCTX *c, uint16_t port);
+
+
/***********************************
* Getters and setters for OPTIONS *
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index eb3e2a4..e8eca57 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -489,7 +489,6 @@ static void popt_common_credentials_callback(poptContext con,
{
struct user_auth_info *auth_info = talloc_get_type_abort(
*((const char **)data), struct user_auth_info);
- char *p;
if (reason == POPT_CALLBACK_REASON_PRE) {
set_cmdline_auth_info_username(auth_info, "GUEST");
diff --git a/source3/libsmb/ABI/smbclient-0.1.0.sigs b/source3/libsmb/ABI/smbclient-0.1.0.sigs
index bbd7700..3dea59c 100644
--- a/source3/libsmb/ABI/smbclient-0.1.0.sigs
+++ b/source3/libsmb/ABI/smbclient-0.1.0.sigs
@@ -67,6 +67,7 @@ smbc_getOptionUseKerberos: smbc_bool (SMBCCTX *)
smbc_getOptionUserData: void *(SMBCCTX *)
smbc_getServerCacheData: struct smbc_server_cache *(SMBCCTX *)
smbc_getTimeout: int (SMBCCTX *)
+smbc_getPort: uint16_t (SMBCCTX *)
smbc_getUser: char *(SMBCCTX *)
smbc_getWorkgroup: char *(SMBCCTX *)
smbc_getdents: int (unsigned int, struct smbc_dirent *, int)
@@ -151,6 +152,7 @@ smbc_setOptionUseKerberos: void (SMBCCTX *, smbc_bool)
smbc_setOptionUserData: void (SMBCCTX *, void *)
smbc_setServerCacheData: void (SMBCCTX *, struct smbc_server_cache *)
smbc_setTimeout: void (SMBCCTX *, int)
+smbc_setPort: void (SMBCCTX *, uint16_t)
smbc_setUser: void (SMBCCTX *, char *)
smbc_setWorkgroup: void (SMBCCTX *, char *)
smbc_set_context: SMBCCTX *(SMBCCTX *)
diff --git a/source3/libsmb/ABI/smbclient-0.2.0.sigs b/source3/libsmb/ABI/smbclient-0.2.1.sigs
similarity index 99%
copy from source3/libsmb/ABI/smbclient-0.2.0.sigs
copy to source3/libsmb/ABI/smbclient-0.2.1.sigs
index aa85859..1b7f6ce 100644
--- a/source3/libsmb/ABI/smbclient-0.2.0.sigs
+++ b/source3/libsmb/ABI/smbclient-0.2.1.sigs
@@ -66,6 +66,7 @@ smbc_getOptionUseCCache: smbc_bool (SMBCCTX *)
smbc_getOptionUseKerberos: smbc_bool (SMBCCTX *)
smbc_getOptionUseNTHash: smbc_bool (SMBCCTX *)
smbc_getOptionUserData: void *(SMBCCTX *)
+smbc_getPort: uint16_t (SMBCCTX *)
smbc_getServerCacheData: struct smbc_server_cache *(SMBCCTX *)
smbc_getTimeout: int (SMBCCTX *)
smbc_getUser: char *(SMBCCTX *)
@@ -151,6 +152,7 @@ smbc_setOptionUseCCache: void (SMBCCTX *, smbc_bool)
smbc_setOptionUseKerberos: void (SMBCCTX *, smbc_bool)
smbc_setOptionUseNTHash: void (SMBCCTX *, smbc_bool)
smbc_setOptionUserData: void (SMBCCTX *, void *)
+smbc_setPort: void (SMBCCTX *, uint16_t)
smbc_setServerCacheData: void (SMBCCTX *, struct smbc_server_cache *)
smbc_setTimeout: void (SMBCCTX *, int)
smbc_setUser: void (SMBCCTX *, char *)
diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c
index b529cbe..6eb2996 100644
--- a/source3/libsmb/libsmb_context.c
+++ b/source3/libsmb/libsmb_context.c
@@ -169,6 +169,7 @@ smbc_new_context(void)
smbc_setDebug(context, 0);
smbc_setTimeout(context, 20000);
+ smbc_setPort(context, 0);
smbc_setOptionFullTimeNames(context, False);
smbc_setOptionOpenShareMode(context, SMBC_SHAREMODE_DENY_NONE);
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 700196c..87e10d8 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -378,6 +378,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
char *workgroup = NULL;
char *path = NULL;
uint16 mode;
+ uint16_t port = 0;
char *p = NULL;
SMBCSRV *srv = NULL;
SMBCFILE *dir = NULL;
@@ -404,6 +405,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
@@ -579,7 +581,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
* workgroups/domains that it knows about.
*/
- srv = SMBC_server(frame, context, True, server, "IPC$",
+ srv = SMBC_server(frame, context, True, server, port, "IPC$",
&workgroup, &user, &password);
if (!srv) {
continue;
@@ -634,7 +636,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
* exist.
*/
srv = SMBC_server(frame, context, False,
- server, "IPC$",
+ server, port, "IPC$",
&workgroup, &user, &password);
/*
@@ -683,7 +685,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
* we do not already have one
*/
srv = SMBC_server(frame, context, True,
- buserver, "IPC$",
+ buserver, port, "IPC$",
&workgroup,
&user, &password);
if (!srv) {
@@ -719,7 +721,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
*/
if (!srv) {
srv = SMBC_server(frame, context, True,
- server, "IPC$",
+ server, port, "IPC$",
&workgroup,
&user, &password);
}
@@ -781,7 +783,7 @@ SMBC_opendir_ctx(SMBCCTX *context,
/* We connect to the server and list the directory */
dir->dir_type = SMBC_FILE_SHARE;
- srv = SMBC_server(frame, context, True, server, share,
+ srv = SMBC_server(frame, context, True, server, port, share,
&workgroup, &user, &password);
if (!srv) {
@@ -1161,6 +1163,7 @@ SMBC_mkdir_ctx(SMBCCTX *context,
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
+ uint16_t port = 0;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -1184,6 +1187,7 @@ SMBC_mkdir_ctx(SMBCCTX *context,
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
@@ -1204,7 +1208,7 @@ SMBC_mkdir_ctx(SMBCCTX *context,
}
srv = SMBC_server(frame, context, True,
- server, share, &workgroup, &user, &password);
+ server, port, share, &workgroup, &user, &password);
if (!srv) {
@@ -1270,6 +1274,7 @@ SMBC_rmdir_ctx(SMBCCTX *context,
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
+ uint16_t port = 0;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -1293,6 +1298,7 @@ SMBC_rmdir_ctx(SMBCCTX *context,
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
@@ -1313,7 +1319,7 @@ SMBC_rmdir_ctx(SMBCCTX *context,
}
srv = SMBC_server(frame, context, True,
- server, share, &workgroup, &user, &password);
+ server, port, share, &workgroup, &user, &password);
if (!srv) {
@@ -1557,6 +1563,7 @@ SMBC_chmod_ctx(SMBCCTX *context,
struct cli_state *targetcli = NULL;
char *path = NULL;
uint16 mode;
+ uint16_t port = 0;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -1580,6 +1587,7 @@ SMBC_chmod_ctx(SMBCCTX *context,
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
@@ -1600,7 +1608,7 @@ SMBC_chmod_ctx(SMBCCTX *context,
}
srv = SMBC_server(frame, context, True,
- server, share, &workgroup, &user, &password);
+ server, port, share, &workgroup, &user, &password);
if (!srv) {
TALLOC_FREE(frame);
@@ -1648,6 +1656,7 @@ SMBC_utimes_ctx(SMBCCTX *context,
char *path = NULL;
time_t access_time;
time_t write_time;
+ uint16_t port = 0;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
@@ -1696,6 +1705,7 @@ SMBC_utimes_ctx(SMBCCTX *context,
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
@@ -1716,7 +1726,7 @@ SMBC_utimes_ctx(SMBCCTX *context,
}
srv = SMBC_server(frame, context, True,
- server, share, &workgroup, &user, &password);
+ server, port, share, &workgroup, &user, &password);
if (!srv) {
TALLOC_FREE(frame);
@@ -1748,6 +1758,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
+ uint16_t port = 0;
struct cli_state *targetcli = NULL;
SMBCSRV *srv = NULL;
TALLOC_CTX *frame = talloc_stackframe();
@@ -1773,6 +1784,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
@@ -1793,7 +1805,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
}
srv = SMBC_server(frame, context, True,
- server, share, &workgroup, &user, &password);
+ server, port, share, &workgroup, &user, &password);
if (!srv) {
TALLOC_FREE(frame);
@@ -1886,6 +1898,8 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
struct cli_state *targetcli1 = NULL;
struct cli_state *targetcli2 = NULL;
SMBCSRV *srv = NULL;
+ uint16_t port1 = 0;
+ uint16_t port2 = 0;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -1911,6 +1925,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
oname,
&workgroup,
&server1,
+ &port1,
&share1,
&path1,
&user1,
@@ -1935,6 +1950,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
nname,
NULL,
&server2,
+ &port2,
&share2,
&path2,
&user2,
@@ -1963,7 +1979,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
}
srv = SMBC_server(frame, ocontext, True,
- server1, share1, &workgroup, &user1, &password1);
+ server1, port1, share1, &workgroup, &user1, &password1);
if (!srv) {
TALLOC_FREE(frame);
return -1;
diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index 9521542..822491b 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -49,6 +49,7 @@ SMBC_open_ctx(SMBCCTX *context,
SMBCSRV *srv = NULL;
SMBCFILE *file = NULL;
uint16_t fd;
+ uint16_t port = 0;
NTSTATUS status = NT_STATUS_OBJECT_PATH_INVALID;
TALLOC_CTX *frame = talloc_stackframe();
@@ -69,6 +70,7 @@ SMBC_open_ctx(SMBCCTX *context,
fname,
&workgroup,
&server,
+ &port,
&share,
&path,
&user,
@@ -89,7 +91,7 @@ SMBC_open_ctx(SMBCCTX *context,
}
srv = SMBC_server(frame, context, True,
- server, share, &workgroup, &user, &password);
+ server, port, share, &workgroup, &user, &password);
if (!srv) {
if (errno == EPERM) errno = EACCES;
TALLOC_FREE(frame);
@@ -230,6 +232,7 @@ SMBC_read_ctx(SMBCCTX *context,
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
+ uint16_t port = 0;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -274,6 +277,7 @@ SMBC_read_ctx(SMBCCTX *context,
file->fname,
NULL,
&server,
+ &port,
&share,
&path,
&user,
@@ -327,6 +331,7 @@ SMBC_write_ctx(SMBCCTX *context,
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
+ uint16_t port = 0;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -360,6 +365,7 @@ SMBC_write_ctx(SMBCCTX *context,
file->fname,
NULL,
&server,
+ &port,
&share,
&path,
&user,
@@ -408,6 +414,7 @@ SMBC_close_ctx(SMBCCTX *context,
char *server = NULL, *share = NULL, *user = NULL, *password = NULL;
char *path = NULL;
char *targetpath = NULL;
+ uint16_t port = 0;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -436,6 +443,7 @@ SMBC_close_ctx(SMBCCTX *context,
file->fname,
NULL,
&server,
+ &port,
&share,
&path,
&user,
@@ -684,6 +692,7 @@ SMBC_lseek_ctx(SMBCCTX *context,
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
+ uint16_t port = 0;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -719,6 +728,7 @@ SMBC_lseek_ctx(SMBCCTX *context,
file->fname,
NULL,
&server,
+ &port,
&share,
&path,
&user,
@@ -782,6 +792,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
char *password = NULL;
char *path = NULL;
char *targetpath = NULL;
+ uint16_t port = 0;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
@@ -810,6 +821,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
file->fname,
NULL,
&server,
+ &port,
&share,
&path,
&user,
diff --git a/source3/libsmb/libsmb_path.c b/source3/libsmb/libsmb_path.c
index 1dcf2dd..64d5333 100644
--- a/source3/libsmb/libsmb_path.c
+++ b/source3/libsmb/libsmb_path.c
@@ -188,7 +188,8 @@ smbc_urlencode(char *dest,
*
*
* We accept:
- * smb://[[[domain;]user[:password]@]server[/share[/path[/file]]]][?options]
+ * smb://[[[domain;]user[:password]@]server[:port][/share[/path[/file]]]]
+ * [?options]
*
* Meaning of URLs:
*
@@ -224,6 +225,7 @@ SMBC_parse_path(TALLOC_CTX *ctx,
const char *fname,
char **pp_workgroup,
char **pp_server,
+ uint16_t *p_port,
char **pp_share,
char **pp_path,
char **pp_user,
@@ -238,6 +240,7 @@ SMBC_parse_path(TALLOC_CTX *ctx,
/* Ensure these returns are at least valid pointers. */
*pp_server = talloc_strdup(ctx, "");
+ *p_port = smbc_getPort(context);
*pp_share = talloc_strdup(ctx, "");
*pp_path = talloc_strdup(ctx, "");
*pp_user = talloc_strdup(ctx, "");
@@ -363,6 +366,28 @@ SMBC_parse_path(TALLOC_CTX *ctx,
return -1;
--
Samba Shared Repository
More information about the samba-cvs
mailing list