[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Tue Jan 23 05:37:02 UTC 2018
The branch, master has been updated
via c57cce1 libcli/resolve: Make functions static
via 30ff05c libcli/resolve: Make functions static
via ca3745d libcli/resolve: Fix typos
via 8993342 dsgetdcname: Fix a signed/unsigned hickup
via 0050d1b libnmb: Fix two signed/unsigned hickups
via e4dc85b libnmb: tsocket_address_unix_from_path deals fine with NULL
via e8e09d7 libnmb: Remove a pointless struct member
via c404d58 libsmb: Give unexpected.c its own header
from 39a6ea7 waf: Fix NFS quota support with libtirpc
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit c57cce1b973ec3a6ffd1a230fccaaa02c28c9e04
Author: Volker Lendecke <vl at samba.org>
Date: Sat Jan 13 17:41:01 2018 +0100
libcli/resolve: Make functions static
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 Jan 23 06:36:36 CET 2018 on sn-devel-144
commit 30ff05c660d07eee0ec4d190734438d068c6337c
Author: Volker Lendecke <vl at samba.org>
Date: Sat Jan 13 17:39:24 2018 +0100
libcli/resolve: Make functions static
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit ca3745db305a14713ab2a709968379fbf332d015
Author: Volker Lendecke <vl at samba.org>
Date: Sat Jan 13 17:38:16 2018 +0100
libcli/resolve: Fix typos
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 8993342965987c58bc16baf9680c6fb9f2d11286
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 5 17:11:43 2018 +0100
dsgetdcname: Fix a signed/unsigned hickup
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 0050d1b9a73cdff455d8a93f6aed6dbb964be096
Author: Volker Lendecke <vl at samba.org>
Date: Thu Jan 18 13:28:30 2018 +0100
libnmb: Fix two signed/unsigned hickups
Two warnings less
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e4dc85b69c2a57e99156d7cd60e84ff6c550fb52
Author: Volker Lendecke <vl at samba.org>
Date: Tue Jan 16 15:04:06 2018 +0100
libnmb: tsocket_address_unix_from_path deals fine with NULL
Other callers use NULL instead of "". Streamline it a bit
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit e8e09d72ce780a9462d164d7e97a379bfc951980
Author: Volker Lendecke <vl at samba.org>
Date: Tue Jan 16 15:07:47 2018 +0100
libnmb: Remove a pointless struct member
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit c404d58830758bde11499bc1771070e76c6eecfe
Author: Volker Lendecke <vl at samba.org>
Date: Mon Jan 15 16:12:15 2018 +0100
libsmb: Give unexpected.c its own header
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/libsmb/clidgram.c | 1 +
source3/libsmb/dsgetdcname.c | 3 ++-
source3/libsmb/namequery.c | 1 +
source3/libsmb/nmblib.h | 22 ------------------
source3/libsmb/unexpected.c | 19 ++++++++--------
source3/libsmb/unexpected.h | 49 ++++++++++++++++++++++++++++++++++++++++
source3/nmbd/nmbd_packets.c | 1 +
source4/libcli/resolve/bcast.c | 19 ++++++++--------
source4/libcli/resolve/lmhosts.c | 23 ++++++++++---------
9 files changed, 86 insertions(+), 52 deletions(-)
create mode 100644 source3/libsmb/unexpected.h
Changeset truncated at 500 lines:
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index d8fa1c6..8f0dba3 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -24,6 +24,7 @@
#include "../lib/util/tevent_ntstatus.h"
#include "libsmb/clidgram.h"
#include "libsmb/nmblib.h"
+#include "libsmb/unexpected.h"
#include "messages.h"
#include "librpc/gen_ndr/samr.h"
#include "../lib/util/pidfile.h"
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index ce0cc89..f15456a 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -500,7 +500,8 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx,
struct ip_service_name **returned_dclist,
int *return_count)
{
- int i, j;
+ int i;
+ size_t j;
NTSTATUS status;
struct dns_rr_srv *dcs = NULL;
int numdcs = 0;
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 4b41546..6107e8f 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -26,6 +26,7 @@
#include "lib/async_req/async_sock.h"
#include "lib/tsocket/tsocket.h"
#include "libsmb/nmblib.h"
+#include "libsmb/unexpected.h"
#include "../libcli/nbt/libnbt.h"
#include "libads/kerberos_proto.h"
diff --git a/source3/libsmb/nmblib.h b/source3/libsmb/nmblib.h
index d8290dc..7e1e40c 100644
--- a/source3/libsmb/nmblib.h
+++ b/source3/libsmb/nmblib.h
@@ -27,28 +27,6 @@
#include "nameserv.h"
-struct nb_packet_server;
-struct nb_packet_reader;
-
-NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- int max_clients,
- struct nb_packet_server **presult);
-void nb_packet_dispatch(struct nb_packet_server *server,
- struct packet_struct *p);
-struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- enum packet_type type,
- int trn_id,
- const char *mailslot_name);
-NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
- struct nb_packet_reader **preader);
-struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct nb_packet_reader *reader);
-NTSTATUS nb_packet_read_recv(struct tevent_req *req,
- struct packet_struct **ppacket);
-
/* The following definitions come from libsmb/nmblib.c */
void debug_nmb_packet(struct packet_struct *p);
diff --git a/source3/libsmb/unexpected.c b/source3/libsmb/unexpected.c
index dd9ff7a..16d1f67 100644
--- a/source3/libsmb/unexpected.c
+++ b/source3/libsmb/unexpected.c
@@ -19,10 +19,11 @@
*/
#include "includes.h"
+#include "libsmb/unexpected.h"
#include "../lib/util/tevent_ntstatus.h"
#include "lib/util_tsock.h"
-#include "lib/tsocket/tsocket.h"
#include "libsmb/nmblib.h"
+#include "lib/tsocket/tsocket.h"
#include "lib/util/sys_rw.h"
static const char *nmbd_socket_dir(void)
@@ -256,7 +257,8 @@ static void nb_packet_got_query(struct tevent_req *req)
/* Take care of alignment */
memcpy(&q, buf, sizeof(q));
- if (nread != sizeof(struct nb_packet_query) + q.mailslot_namelen) {
+ if ((size_t)nread !=
+ sizeof(struct nb_packet_query) + q.mailslot_namelen) {
DEBUG(10, ("nb_packet_got_query: Invalid mailslot namelength\n"));
TALLOC_FREE(client);
return;
@@ -480,7 +482,6 @@ struct nb_packet_reader_state {
struct nb_packet_query query;
const char *mailslot_name;
struct iovec iov[2];
- char c;
struct nb_packet_reader *reader;
};
@@ -520,7 +521,7 @@ struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- ret = tsocket_address_unix_from_path(state, "", &laddr);
+ ret = tsocket_address_unix_from_path(state, NULL, &laddr);
if (ret != 0) {
tevent_req_nterror(req, map_nt_error_from_unix(errno));
return tevent_req_post(req, ev);
@@ -595,13 +596,14 @@ static void nb_packet_reader_sent_query(struct tevent_req *subreq)
tevent_req_nterror(req, map_nt_error_from_unix(err));
return;
}
- if (written != sizeof(state->query) + state->query.mailslot_namelen) {
+ if ((size_t)written !=
+ sizeof(state->query) + state->query.mailslot_namelen) {
tevent_req_nterror(req, NT_STATUS_UNEXPECTED_IO_ERROR);
return;
}
subreq = tstream_read_packet_send(state, state->ev,
state->reader->sock,
- sizeof(state->c), NULL, NULL);
+ 1, NULL, NULL);
if (tevent_req_nomem(subreq, req)) {
return;
}
@@ -626,9 +628,8 @@ static void nb_packet_reader_got_ack(struct tevent_req *subreq)
tevent_req_nterror(req, map_nt_error_from_unix(err));
return;
}
- if (nread != sizeof(state->c)) {
- DEBUG(10, ("read = %d, expected %d\n", (int)nread,
- (int)sizeof(state->c)));
+ if (nread != 1) {
+ DBG_DEBUG("read = %zd, expected 1\n", nread);
tevent_req_nterror(req, NT_STATUS_UNEXPECTED_IO_ERROR);
return;
}
diff --git a/source3/libsmb/unexpected.h b/source3/libsmb/unexpected.h
new file mode 100644
index 0000000..a40a507
--- /dev/null
+++ b/source3/libsmb/unexpected.h
@@ -0,0 +1,49 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * Copyright (C) Volker Lendecke 2018
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __LIBSMB_UNEXPECTED_H__
+#define __LIBSMB_UNEXPECTED_H__
+
+#include "replace.h"
+#include <tevent.h>
+#include "libcli/util/ntstatus.h"
+#include "nameserv.h"
+
+struct nb_packet_server;
+struct nb_packet_reader;
+
+NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ int max_clients,
+ struct nb_packet_server **presult);
+void nb_packet_dispatch(struct nb_packet_server *server,
+ struct packet_struct *p);
+struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ enum packet_type type,
+ int trn_id,
+ const char *mailslot_name);
+NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ struct nb_packet_reader **preader);
+struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct nb_packet_reader *reader);
+NTSTATUS nb_packet_read_recv(struct tevent_req *req,
+ struct packet_struct **ppacket);
+
+#endif
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index de5ae1e..2b7cc82 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -24,6 +24,7 @@
#include "../lib/util/select.h"
#include "system/select.h"
#include "libsmb/libsmb.h"
+#include "libsmb/unexpected.h"
extern int ClientNMB;
extern int ClientDGRAM;
diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c
index 787d048..277a82d 100644
--- a/source4/libcli/resolve/bcast.c
+++ b/source4/libcli/resolve/bcast.c
@@ -35,11 +35,12 @@ struct resolve_bcast_data {
/**
broadcast name resolution method - async send
*/
-struct composite_context *resolve_name_bcast_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *event_ctx,
- void *userdata, uint32_t flags,
- uint16_t port,
- struct nbt_name *name)
+static struct composite_context *resolve_name_bcast_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *event_ctx,
+ void *userdata, uint32_t flags,
+ uint16_t port,
+ struct nbt_name *name)
{
int num_interfaces;
const char **address_list;
@@ -85,10 +86,10 @@ struct composite_context *resolve_name_bcast_send(TALLOC_CTX *mem_ctx,
/*
broadcast name resolution method - recv side
*/
-NTSTATUS resolve_name_bcast_recv(struct composite_context *c,
- TALLOC_CTX *mem_ctx,
- struct socket_address ***addrs,
- char ***names)
+static NTSTATUS resolve_name_bcast_recv(struct composite_context *c,
+ TALLOC_CTX *mem_ctx,
+ struct socket_address ***addrs,
+ char ***names)
{
NTSTATUS status = resolve_name_nbtlist_recv(c, mem_ctx, addrs, names);
if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
diff --git a/source4/libcli/resolve/lmhosts.c b/source4/libcli/resolve/lmhosts.c
index 21cc3e4..400cf79 100644
--- a/source4/libcli/resolve/lmhosts.c
+++ b/source4/libcli/resolve/lmhosts.c
@@ -1,7 +1,7 @@
/*
Unix SMB/CIFS implementation.
- broadcast name resolution module
+ lmhosts name resolution module
Copyright (C) Andrew Tridgell 1994-1998,2005
Copyright (C) Jeremy Allison 2007
@@ -38,16 +38,17 @@ struct resolve_lmhosts_state {
};
/**
- broadcast name resolution method - async send
+ lmhosts name resolution method - async send
*/
/*
general name resolution - async send
*/
-struct composite_context *resolve_name_lmhosts_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *event_ctx,
- void *userdata, uint32_t flags,
- uint16_t port,
- struct nbt_name *name)
+static struct composite_context *resolve_name_lmhosts_send(
+ TALLOC_CTX *mem_ctx,
+ struct tevent_context *event_ctx,
+ void *userdata, uint32_t flags,
+ uint16_t port,
+ struct nbt_name *name)
{
struct composite_context *c;
struct resolve_lmhosts_state *state;
@@ -101,10 +102,10 @@ struct composite_context *resolve_name_lmhosts_send(TALLOC_CTX *mem_ctx,
/*
general name resolution method - recv side
*/
-NTSTATUS resolve_name_lmhosts_recv(struct composite_context *c,
- TALLOC_CTX *mem_ctx,
- struct socket_address ***addrs,
- char ***names)
+static NTSTATUS resolve_name_lmhosts_recv(struct composite_context *c,
+ TALLOC_CTX *mem_ctx,
+ struct socket_address ***addrs,
+ char ***names)
{
NTSTATUS status;
--
Samba Shared Repository
More information about the samba-cvs
mailing list