Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
const char *fname,
char **pp_workgroup,
char **pp_server,
const char *fname,
char **pp_workgroup,
char **pp_server,
char **pp_share,
char **pp_path,
char **pp_user,
char **pp_share,
char **pp_path,
char **pp_user,
char *workgroup = NULL;
char *path = NULL;
uint16 mode;
char *workgroup = NULL;
char *path = NULL;
uint16 mode;
char *p = NULL;
SMBCSRV *srv = NULL;
SMBCFILE *dir = NULL;
char *p = NULL;
SMBCSRV *srv = NULL;
SMBCFILE *dir = NULL;
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
struct cli_state *targetcli = NULL;
char *path = NULL;
uint16 mode;
struct cli_state *targetcli = NULL;
char *path = NULL;
uint16 mode;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *path = NULL;
time_t access_time;
time_t write_time;
char *path = NULL;
time_t access_time;
time_t write_time;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
char *workgroup = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
SMBCSRV *srv = NULL;
TALLOC_CTX *frame = talloc_stackframe();
struct cli_state *targetcli = NULL;
SMBCSRV *srv = NULL;
TALLOC_CTX *frame = talloc_stackframe();
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
struct cli_state *targetcli1 = NULL;
struct cli_state *targetcli2 = NULL;
SMBCSRV *srv = NULL;
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;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
oname,
&workgroup,
&server1,
oname,
&workgroup,
&server1,
SMBCSRV *srv = NULL;
SMBCFILE *file = NULL;
uint16_t fd;
SMBCSRV *srv = NULL;
SMBCFILE *file = NULL;
uint16_t fd;
NTSTATUS status = NT_STATUS_OBJECT_PATH_INVALID;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status = NT_STATUS_OBJECT_PATH_INVALID;
TALLOC_CTX *frame = talloc_stackframe();
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
file->fname,
NULL,
&server,
file->fname,
NULL,
&server,
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
file->fname,
NULL,
&server,
file->fname,
NULL,
&server,
char *server = NULL, *share = NULL, *user = NULL, *password = NULL;
char *path = NULL;
char *targetpath = NULL;
char *server = NULL, *share = NULL, *user = NULL, *password = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
file->fname,
NULL,
&server,
file->fname,
NULL,
&server,
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
file->fname,
NULL,
&server,
file->fname,
NULL,
&server,
char *password = NULL;
char *path = NULL;
char *targetpath = NULL;
char *password = NULL;
char *path = NULL;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
struct cli_state *targetcli = NULL;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
file->fname,
NULL,
&server,
file->fname,
NULL,
&server,
const char *fname,
char **pp_workgroup,
char **pp_server,
const char *fname,
char **pp_workgroup,
char **pp_server,
char **pp_share,
char **pp_path,
char **pp_user,
char **pp_share,
char **pp_path,
char **pp_user,
/* Ensure these returns are at least valid pointers. */
*pp_server = talloc_strdup(ctx, "");
/* Ensure these returns are at least valid pointers. */
*pp_server = talloc_strdup(ctx, "");
*pp_share = talloc_strdup(ctx, "");
*pp_path = talloc_strdup(ctx, "");
*pp_user = talloc_strdup(ctx, "");
*pp_share = talloc_strdup(ctx, "");
*pp_path = talloc_strdup(ctx, "");
*pp_user = talloc_strdup(ctx, "");
+ /*
+ * Does *pp_server contain a ':' ? If so
+ * this denotes the port.
+ */
+ q = strchr_m(*pp_server, ':');
+ if (q != NULL) {
+ long int port;
+ char *endptr = NULL;
+ *q = '\0';
+ q++;
+ if (*q == '\0') {
+ /* Bad port. */
+ return -1;
+ }
+ port = strtol(q, &endptr, 10);
+ if (*endptr != '\0') {
+ /* Bad port. */
+ return -1;
+ }
+ *p_port = (uint16_t)port;
+ }
+
if (*p == (char)0) {
goto decoding; /* That's it ... */
}
if (*p == (char)0) {
goto decoding; /* That's it ... */
}
char *user = NULL;
char *password = NULL;
char *path = NULL;
char *user = NULL;
char *password = NULL;
char *path = NULL;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
char *password = NULL;
char *workgroup = NULL;
char *path = NULL;
char *password = NULL;
char *workgroup = NULL;
char *path = NULL;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *workgroup = NULL;
char *path = NULL;
int err;
char *workgroup = NULL;
char *path = NULL;
int err;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
struct timespec change_time_ts;
off_t size = 0;
uint16 mode = 0;
struct timespec change_time_ts;
off_t size = 0;
uint16 mode = 0;
SMB_INO_T ino = 0;
TALLOC_CTX *frame = talloc_stackframe();
SMB_INO_T ino = 0;
TALLOC_CTX *frame = talloc_stackframe();
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
SMB_INO_T ino = 0;
char *targetpath = NULL;
struct cli_state *targetcli = NULL;
SMB_INO_T ino = 0;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
TALLOC_CTX *frame = talloc_stackframe();
NTSTATUS status;
file->fname,
NULL,
&server,
file->fname,
NULL,
&server,
const char * write_time_attr;
const char * change_time_attr;
} attr_strings;
const char * write_time_attr;
const char * change_time_attr;
} attr_strings;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
const char * write_time_attr;
const char * change_time_attr;
} attr_strings;
const char * write_time_attr;
const char * change_time_attr;
} attr_strings;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,
char *password = NULL;
char *workgroup = NULL;
char *path = NULL;
char *password = NULL;
char *workgroup = NULL;
char *path = NULL;
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
TALLOC_CTX *frame = talloc_stackframe();
if (!context || !context->internal->initialized) {
fname,
&workgroup,
&server,
fname,
&workgroup,
&server,