summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-03-26 22:10:32 +1100
committerAndrew Tridgell <tridge@samba.org>2009-03-26 22:10:32 +1100
commit7eb7f423d048e869a19d560ab0d1ba3b51b62fa9 (patch)
tree18cb17db10e10a8d0f27d5a8e48ada2dfc16fae7
parent3f37342bc0e7c26b6a61490706fe8cec3e6d491e (diff)
parent56d74b62126083dd7e2a60d1b48b03e1b1798c90 (diff)
downloadsamba-7eb7f423d048e869a19d560ab0d1ba3b51b62fa9.tar.gz
samba-7eb7f423d048e869a19d560ab0d1ba3b51b62fa9.tar.bz2
samba-7eb7f423d048e869a19d560ab0d1ba3b51b62fa9.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
-rw-r--r--source3/Makefile.in4
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/lib/avahi.c7
-rw-r--r--source3/lib/netapi/cm.c5
-rw-r--r--source3/lib/netapi/user.c18
-rw-r--r--source3/rpc_parse/parse_misc.c19
-rw-r--r--source3/smbd/nttrans.c4
-rw-r--r--source3/smbd/reply.c6
-rw-r--r--source3/smbd/trans2.c2
-rw-r--r--source3/utils/net_rpc_printer.c9
10 files changed, 42 insertions, 33 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 4ea043a046..1c9c0c1204 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1396,7 +1396,7 @@ bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARE
$(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \
$(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) $(AVAHI_LIBS) \
$(POPT_LIBS) @SMBD_LIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
- $(WINBIND_LIBS)
+ $(WINBIND_LIBS) $(ZLIB_LIBS)
bin/nmbd@EXEEXT@: $(BINARY_PREREQS) $(NMBD_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
@echo Linking $@
@@ -1408,7 +1408,7 @@ bin/swat@EXEEXT@: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@
@echo Linking $@
@$(CC) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \
$(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) $(POPT_LIBS) $(KRB5LIBS) \
- $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
+ $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS) $(ZLIB_LIBS)
bin/rpcclient@EXEEXT@: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
@echo Linking $@
diff --git a/source3/include/proto.h b/source3/include/proto.h
index d619c3ba00..77be0aba09 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5695,7 +5695,6 @@ bool smb_io_system_time(const char *desc, prs_struct *ps, int depth, SYSTEMTIME
bool make_systemtime(SYSTEMTIME *systime, struct tm *unixtime);
bool smb_io_uuid(const char *desc, struct GUID *uuid,
prs_struct *ps, int depth);
-void init_unistr(UNISTR *str, const char *buf);
void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags);
/* The following definitions come from rpc_parse/parse_prs.c */
diff --git a/source3/lib/avahi.c b/source3/lib/avahi.c
index ac9867a1fc..269b329e64 100644
--- a/source3/lib/avahi.c
+++ b/source3/lib/avahi.c
@@ -207,6 +207,13 @@ static void avahi_timeout_update(AvahiTimeout *t, const struct timeval *tv)
{
TALLOC_FREE(t->te);
+ if (tv == NULL) {
+ /*
+ * Disable this timer
+ */
+ return;
+ }
+
t->te = tevent_add_timer(t->ctx->ev, t, *tv, avahi_timeout_handler, t);
/*
* No failure mode defined here
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index b676ae63dd..d28b2b2126 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -57,6 +57,11 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
false, false,
PROTOCOL_NT1,
0, 0x20);
+ if (cli_ipc) {
+ cli_set_username(cli_ipc, ctx->username);
+ cli_set_password(cli_ipc, ctx->password);
+ cli_set_domain(cli_ipc, ctx->workgroup);
+ }
TALLOC_FREE(auth_info);
if (!cli_ipc) {
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index e760a8b1de..1cbb883169 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -1497,6 +1497,9 @@ WERROR NetQueryDisplayInformation_r(struct libnetapi_ctx *ctx,
NTSTATUS status = NT_STATUS_OK;
WERROR werr;
+ WERROR werr_tmp;
+
+ *r->out.entries_read = 0;
ZERO_STRUCT(connect_handle);
ZERO_STRUCT(domain_handle);
@@ -1540,15 +1543,18 @@ WERROR NetQueryDisplayInformation_r(struct libnetapi_ctx *ctx,
&total_size,
&returned_size,
&info);
- if (!NT_STATUS_IS_OK(status)) {
- werr = ntstatus_to_werror(status);
+ werr = ntstatus_to_werror(status);
+ if (NT_STATUS_IS_ERR(status)) {
goto done;
}
- werr = convert_samr_dispinfo_to_NET_DISPLAY(ctx, &info,
- r->in.level,
- r->out.entries_read,
- r->out.buffer);
+ werr_tmp = convert_samr_dispinfo_to_NET_DISPLAY(ctx, &info,
+ r->in.level,
+ r->out.entries_read,
+ r->out.buffer);
+ if (!W_ERROR_IS_OK(werr_tmp)) {
+ werr = werr_tmp;
+ }
done:
/* if last query */
if (NT_STATUS_IS_OK(status) ||
diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c
index ffbd67befe..1ea4ecf46f 100644
--- a/source3/rpc_parse/parse_misc.c
+++ b/source3/rpc_parse/parse_misc.c
@@ -129,25 +129,6 @@ bool smb_io_uuid(const char *desc, struct GUID *uuid,
}
/*******************************************************************
- Inits a UNISTR structure.
-********************************************************************/
-
-void init_unistr(UNISTR *str, const char *buf)
-{
- size_t len;
-
- if (buf == NULL) {
- str->buffer = NULL;
- return;
- }
-
- len = rpcstr_push_talloc(talloc_tos(), &str->buffer, buf);
- if (len == (size_t)-1) {
- str->buffer = NULL;
- }
-}
-
-/*******************************************************************
Inits a UNISTR2 structure.
********************************************************************/
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 628fc1bd32..7e75eea6b4 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -441,6 +441,8 @@ void reply_ntcreate_and_X(struct smb_request *req)
START_PROFILE(SMBntcreateX);
+ SET_STAT_INVALID(sbuf);
+
if (req->wct < 24) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
return;
@@ -865,6 +867,8 @@ static void call_nt_transact_create(connection_struct *conn,
uint8_t oplock_granted;
TALLOC_CTX *ctx = talloc_tos();
+ SET_STAT_INVALID(sbuf);
+
DEBUG(5,("call_nt_transact_create\n"));
/*
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 6f19a58178..16eb4a7fd7 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1606,6 +1606,8 @@ void reply_open(struct smb_request *req)
START_PROFILE(SMBopen);
+ SET_STAT_INVALID(sbuf);
+
if (req->wct < 2) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
END_PROFILE(SMBopen);
@@ -1741,6 +1743,8 @@ void reply_open_and_X(struct smb_request *req)
return;
}
+ SET_STAT_INVALID(sbuf);
+
open_flags = SVAL(req->vwv+2, 0);
deny_mode = SVAL(req->vwv+3, 0);
smb_attr = SVAL(req->vwv+5, 0);
@@ -1945,6 +1949,7 @@ void reply_mknew(struct smb_request *req)
START_PROFILE(SMBcreate);
ZERO_STRUCT(ft);
+ SET_STAT_INVALID(sbuf);
if (req->wct < 3) {
reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
@@ -2123,6 +2128,7 @@ void reply_ctemp(struct smb_request *req)
return;
}
+ SET_STAT_INVALID(sbuf);
SMB_VFS_STAT(conn,fname,&sbuf);
/* We should fail if file does not exist. */
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index df01a39893..04b1145e58 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -895,6 +895,8 @@ static void call_trans2open(connection_struct *conn,
uint32 create_options = 0;
TALLOC_CTX *ctx = talloc_tos();
+ SET_STAT_INVALID(sbuf);
+
/*
* Ensure we have enough parameters to perform the operation.
*/
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 1d0e9a38be..9721628f02 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -2260,14 +2260,13 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c,
info_dst.info2.secdesc = NULL;
#if 0
- if (asprintf(&devicename, "\\\\%s\\%s", longname,
- printername) < 0) {
+ info_dst.info2.devmode.devicename =
+ talloc_asprintf(mem_ctx, "\\\\%s\\%s",
+ longname, printername);
+ if (!info_dst.info2.devmode.devicename) {
nt_status = NT_STATUS_NO_MEMORY;
goto done;
}
-
- init_unistr(&ctr_dst.printers_2->devmode->devicename,
- devicename);
#endif
if (!net_spoolss_setprinter(pipe_hnd_dst, mem_ctx, &hnd_dst,
level, &info_dst))