[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Oct 14 16:39:01 MDT 2011
The branch, master has been updated
via e02f951 Removed unused variable.
via 7c66373 Remove unused function.
via 7f65594 Fix printf warning.
via f4a41ce Fix const warnings.
via 744dd6b Fix const warnings.
via abe5afc Fix bug with Samba not recognising an 6to4 IPv6 interface.
via acc2870 Fix const warning.
from 15b8efe s3:dbwrap_ctdb: return the number of records in db_ctdb_traverse() for persistent dbs
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit e02f9510d039242ac012658aa67e235c68d45fe1
Author: Jeremy Allison <jra at samba.org>
Date: Fri Oct 14 14:02:39 2011 -0700
Removed unused variable.
Autobuild-User: Jeremy Allison <jra at samba.org>
Autobuild-Date: Sat Oct 15 00:38:28 CEST 2011 on sn-devel-104
commit 7c663731bad107277a2b13616e70eea8cc681d1c
Author: Jeremy Allison <jra at samba.org>
Date: Fri Oct 14 14:01:24 2011 -0700
Remove unused function.
commit 7f655945e4c223c45d6b87c7d5d65e54e7fe84de
Author: Jeremy Allison <jra at samba.org>
Date: Fri Oct 14 13:53:53 2011 -0700
Fix printf warning.
commit f4a41ce5a6f050fd4b46da8d85b4125791d26560
Author: Jeremy Allison <jra at samba.org>
Date: Fri Oct 14 13:51:26 2011 -0700
Fix const warnings.
commit 744dd6bcbe7e078daac150d9e7be60c89985b510
Author: Jeremy Allison <jra at samba.org>
Date: Fri Oct 14 13:48:53 2011 -0700
Fix const warnings.
commit abe5afc580dcaaab70f136904d98fa83bfae7b6e
Author: Matthieu Patou <mat at samba.org>
Date: Fri Oct 14 13:45:48 2011 -0700
Fix bug with Samba not recognising an 6to4 IPv6 interface.
"The 6to4 interface has the flags IFF_POINTTOPOINT interface but no
ifa_dstaddr as it's not at the IPv6 level a point to point interface
(at least from my understanding), as we don't have a IFF_BROADCAST
flag set (I have the impression that this flag is only set on a
interface that has also an IPv4 address) the first test is not valid
also, which result in a skipped interface."
commit acc28706b54f2c7038d0b6cee106d99f1a6797ac
Author: Jeremy Allison <jra at samba.org>
Date: Fri Oct 14 13:20:07 2011 -0700
Fix const warning.
-----------------------------------------------------------------------
Summary of changes:
lib/socket/interfaces.c | 19 ++++++++++++++++---
lib/util/charset/util_unistr_w.c | 8 ++++----
source3/libsmb/cliconnect.c | 2 +-
source3/modules/vfs_scannedonly.c | 1 -
source3/utils/net_registry_check.c | 18 ------------------
source4/torture/smb2/connect.c | 2 +-
6 files changed, 22 insertions(+), 28 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c
index 618714d..775956b 100644
--- a/lib/socket/interfaces.c
+++ b/lib/socket/interfaces.c
@@ -77,7 +77,7 @@ static void make_bcast_or_net(struct sockaddr_storage *pss_out,
bool make_bcast_p)
{
unsigned int i = 0, len = 0;
- char *pmask = NULL;
+ const char *pmask = NULL;
char *p = NULL;
*pss_out = *pss_in;
@@ -85,13 +85,13 @@ static void make_bcast_or_net(struct sockaddr_storage *pss_out,
#if defined(HAVE_IPV6)
if (pss_in->ss_family == AF_INET6) {
p = (char *)&((struct sockaddr_in6 *)pss_out)->sin6_addr;
- pmask = discard_const_p(char, &((struct sockaddr_in6 *)nmask)->sin6_addr);
+ pmask = (const char *)&((const struct sockaddr_in6 *)nmask)->sin6_addr;
len = 16;
}
#endif
if (pss_in->ss_family == AF_INET) {
p = (char *)&((struct sockaddr_in *)pss_out)->sin_addr;
- pmask = discard_const_p(char, &((struct sockaddr_in *)nmask)->sin_addr);
+ pmask = (const char *)&((const struct sockaddr_in *)nmask)->sin_addr;
len = 4;
}
@@ -195,6 +195,19 @@ static int _get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces)
memcpy(&ifaces[total].bcast,
ifptr->ifa_dstaddr,
copy_size);
+#if defined(HAVE_IPV6)
+ } else if (ifptr->ifa_addr->sa_family == AF_INET6) {
+ const struct sockaddr_in6 *sin6 =
+ (const struct sockaddr_in6 *)ifptr->ifa_addr;
+ const struct in6_addr *in6 =
+ (const struct in6_addr *)&sin6->sin6_addr;
+
+ if (IN6_IS_ADDR_LINKLOCAL(in6) || IN6_IS_ADDR_V4COMPAT(in6)) {
+ continue;
+ }
+ /* IPv6 does not have broadcast it uses multicast. */
+ memset(&ifaces[total].bcast, '\0', copy_size);
+#endif
} else {
continue;
}
diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c
index 7e0ece3..72bd198 100644
--- a/lib/util/charset/util_unistr_w.c
+++ b/lib/util/charset/util_unistr_w.c
@@ -130,7 +130,7 @@ smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n)
}
if (!n) {
- return (smb_ucs2_t *)p;
+ return discard_const_p(smb_ucs2_t, p);
}
} while (p-- != s);
return NULL;
@@ -142,7 +142,7 @@ smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n)
smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins)
{
- smb_ucs2_t *r;
+ const smb_ucs2_t *r;
size_t inslen;
if (!s || !*s || !ins || !*ins) {
@@ -150,11 +150,11 @@ smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins)
}
inslen = strlen_w(ins);
- r = (smb_ucs2_t *)s;
+ r = s;
while ((r = strchr_w(r, *ins))) {
if (strncmp_w(r, ins, inslen) == 0) {
- return r;
+ return discard_const_p(smb_ucs2_t, r);
}
r++;
}
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index bba7b03..e4402ba 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1769,7 +1769,7 @@ static ADS_STATUS cli_session_setup_spnego(struct cli_state *cli,
char *principal = NULL;
char *OIDs[ASN1_MAX_OIDS];
int i;
- DATA_BLOB *server_blob;
+ const DATA_BLOB *server_blob;
DATA_BLOB blob = data_blob_null;
const char *p = NULL;
char *account = NULL;
diff --git a/source3/modules/vfs_scannedonly.c b/source3/modules/vfs_scannedonly.c
index c1821bd..df1e140 100644
--- a/source3/modules/vfs_scannedonly.c
+++ b/source3/modules/vfs_scannedonly.c
@@ -382,7 +382,6 @@ static bool scannedonly_allow_access(vfs_handle_struct * handle,
TALLOC_CTX *ctx=talloc_tos();
char *cachefile;
int retval = -1;
- int didloop;
DEBUG(SCANNEDONLY_DEBUG,
("smb_fname->base_name=%s, shortname=%s, base_name=%s\n"
,smb_fname->base_name,shortname,base_name));
diff --git a/source3/utils/net_registry_check.c b/source3/utils/net_registry_check.c
index 9bb7296..2511f53 100644
--- a/source3/utils/net_registry_check.c
+++ b/source3/utils/net_registry_check.c
@@ -253,24 +253,6 @@ static void remove_all(char *str, char c)
*out = '\0';
}
-static void remove_runs(char *str, char c)
-{
- char *out=str;
- while (*str) {
- *out = *str;
- if (*str == c) {
- while (*str == c) {
- str++;
- }
- } else {
- str++;
- }
- out++;
- }
- *out = '\0';
-}
-
-
static char* parent_path(const char *path, char sep)
{
const char *p = strrchr(path, sep);
diff --git a/source4/torture/smb2/connect.c b/source4/torture/smb2/connect.c
index b383a67..0067de0 100644
--- a/source4/torture/smb2/connect.c
+++ b/source4/torture/smb2/connect.c
@@ -75,7 +75,7 @@ static NTSTATUS torture_smb2_write(struct torture_context *tctx, struct smb2_tre
data = data_blob_talloc(tree, NULL, size);
if (size != data.length) {
- printf("data_blob_talloc(%s) failed\n", size);
+ printf("data_blob_talloc(%u) failed\n", (unsigned int)size);
return NT_STATUS_NO_MEMORY;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list