summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/replace/crypt.m41
-rw-r--r--lib/replace/replace.h2
-rw-r--r--lib/zlib/infback.c26
-rw-r--r--lib/zlib/inffast.c10
-rw-r--r--lib/zlib/inflate.c44
-rw-r--r--lib/zlib/inflate.h4
-rwxr-xr-xselftest/selftest.pl1
-rw-r--r--source4/scripting/python/samba/provision.py19
-rwxr-xr-xsource4/selftest/tests.sh2
-rw-r--r--source4/setup/provision.zone4
10 files changed, 65 insertions, 48 deletions
diff --git a/lib/replace/crypt.m4 b/lib/replace/crypt.m4
index 0b31ae4964..047766d470 100644
--- a/lib/replace/crypt.m4
+++ b/lib/replace/crypt.m4
@@ -1,5 +1,6 @@
###############################################
# test for where we get crypt() from
+AC_CHECK_HEADERS(crypt.h)
AC_SEARCH_LIBS_EXT(crypt, [crypt],
[test "$ac_cv_search_crypt" = "none required" || CRYPT_LIBS="-lcrypt"
AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])],
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index 57ebeb5d2f..af1208a8fc 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -632,7 +632,9 @@ typedef int bool;
char *ufc_crypt(const char *key, const char *salt);
#define crypt ufc_crypt
#else
+#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
+#endif
#endif /* _LIBREPLACE_REPLACE_H */
diff --git a/lib/zlib/infback.c b/lib/zlib/infback.c
index 5680937f34..284d523a6d 100644
--- a/lib/zlib/infback.c
+++ b/lib/zlib/infback.c
@@ -309,7 +309,7 @@ void FAR *out_desc;
break;
case 3:
strm->msg = "invalid block type";
- state->mode = BAD;
+ state->mode = BAD_DATA;
}
DROPBITS(2);
break;
@@ -320,7 +320,7 @@ void FAR *out_desc;
NEEDBITS(32);
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
strm->msg = "invalid stored block lengths";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->length = (unsigned)hold & 0xffff;
@@ -358,7 +358,7 @@ void FAR *out_desc;
#ifndef PKZIP_BUG_WORKAROUND
if (state->nlen > 286 || state->ndist > 30) {
strm->msg = "too many length or distance symbols";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
#endif
@@ -380,7 +380,7 @@ void FAR *out_desc;
&(state->lenbits), state->work);
if (ret) {
strm->msg = "invalid code lengths set";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
Tracev((stderr, "inflate: code lengths ok\n"));
@@ -404,7 +404,7 @@ void FAR *out_desc;
DROPBITS(this.bits);
if (state->have == 0) {
strm->msg = "invalid bit length repeat";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
len = (unsigned)(state->lens[state->have - 1]);
@@ -427,7 +427,7 @@ void FAR *out_desc;
}
if (state->have + copy > state->nlen + state->ndist) {
strm->msg = "invalid bit length repeat";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
while (copy--)
@@ -436,7 +436,7 @@ void FAR *out_desc;
}
/* handle error breaks in while */
- if (state->mode == BAD) break;
+ if (state->mode == BAD_DATA) break;
/* build code tables */
state->next = state->codes;
@@ -446,7 +446,7 @@ void FAR *out_desc;
&(state->lenbits), state->work);
if (ret) {
strm->msg = "invalid literal/lengths set";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->distcode = (code const FAR *)(state->next);
@@ -455,7 +455,7 @@ void FAR *out_desc;
&(state->next), &(state->distbits), state->work);
if (ret) {
strm->msg = "invalid distances set";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
Tracev((stderr, "inflate: codes ok\n"));
@@ -513,7 +513,7 @@ void FAR *out_desc;
/* invalid code */
if (this.op & 64) {
strm->msg = "invalid literal/length code";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
@@ -545,7 +545,7 @@ void FAR *out_desc;
DROPBITS(this.bits);
if (this.op & 64) {
strm->msg = "invalid distance code";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->offset = (unsigned)this.val;
@@ -560,7 +560,7 @@ void FAR *out_desc;
if (state->offset > state->wsize - (state->whave < state->wsize ?
left : 0)) {
strm->msg = "invalid distance too far back";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
Tracevv((stderr, "inflate: distance %u\n", state->offset));
@@ -595,7 +595,7 @@ void FAR *out_desc;
}
goto inf_leave;
- case BAD:
+ case BAD_DATA:
ret = Z_DATA_ERROR;
goto inf_leave;
diff --git a/lib/zlib/inffast.c b/lib/zlib/inffast.c
index bfc727694a..687dfa054b 100644
--- a/lib/zlib/inffast.c
+++ b/lib/zlib/inffast.c
@@ -49,7 +49,7 @@
LEN -- ran out of enough output space or enough available input
TYPE -- reached end of block code, inflate() to interpret next block
- BAD -- error in block data
+ BAD_DATA -- error in block data
Notes:
@@ -176,7 +176,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
#ifdef INFLATE_STRICT
if (dist > dmax) {
strm->msg = (char *)"invalid distance too far back";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
#endif
@@ -188,7 +188,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
op = dist - op; /* distance back in window */
if (op > whave) {
strm->msg = "invalid distance too far back";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
from = window - OFF;
@@ -264,7 +264,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
else {
strm->msg = "invalid distance code";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
}
@@ -279,7 +279,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
}
else {
strm->msg = "invalid literal/length code";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
} while (in < last && out < end);
diff --git a/lib/zlib/inflate.c b/lib/zlib/inflate.c
index ccbfac804d..bcaca0d773 100644
--- a/lib/zlib/inflate.c
+++ b/lib/zlib/inflate.c
@@ -609,19 +609,19 @@ int flush;
#endif
((BITS(8) << 8) + (hold >> 8)) % 31) {
strm->msg = "incorrect header check";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
if (BITS(4) != Z_DEFLATED) {
strm->msg = "unknown compression method";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
DROPBITS(4);
len = BITS(4) + 8;
if (len > state->wbits) {
strm->msg = "invalid window size";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->dmax = 1U << len;
@@ -636,12 +636,12 @@ int flush;
state->flags = (int)(hold);
if ((state->flags & 0xff) != Z_DEFLATED) {
strm->msg = "unknown compression method";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
if (state->flags & 0xe000) {
strm->msg = "unknown header flags set";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
if (state->head != Z_NULL)
@@ -745,7 +745,7 @@ int flush;
NEEDBITS(16);
if (hold != (state->check & 0xffff)) {
strm->msg = "header crc mismatch";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
INITBITS();
@@ -800,7 +800,7 @@ int flush;
break;
case 3:
strm->msg = "invalid block type";
- state->mode = BAD;
+ state->mode = BAD_DATA;
}
DROPBITS(2);
break;
@@ -809,7 +809,7 @@ int flush;
NEEDBITS(32);
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
strm->msg = "invalid stored block lengths";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->length = (unsigned)hold & 0xffff;
@@ -845,7 +845,7 @@ int flush;
#ifndef PKZIP_BUG_WORKAROUND
if (state->nlen > 286 || state->ndist > 30) {
strm->msg = "too many length or distance symbols";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
#endif
@@ -867,7 +867,7 @@ int flush;
&(state->lenbits), state->work);
if (ret) {
strm->msg = "invalid code lengths set";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
Tracev((stderr, "inflate: code lengths ok\n"));
@@ -891,7 +891,7 @@ int flush;
DROPBITS(this.bits);
if (state->have == 0) {
strm->msg = "invalid bit length repeat";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
len = state->lens[state->have - 1];
@@ -914,7 +914,7 @@ int flush;
}
if (state->have + copy > state->nlen + state->ndist) {
strm->msg = "invalid bit length repeat";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
while (copy--)
@@ -923,7 +923,7 @@ int flush;
}
/* handle error breaks in while */
- if (state->mode == BAD) break;
+ if (state->mode == BAD_DATA) break;
/* build code tables */
state->next = state->codes;
@@ -933,7 +933,7 @@ int flush;
&(state->lenbits), state->work);
if (ret) {
strm->msg = "invalid literal/lengths set";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->distcode = (code const FAR *)(state->next);
@@ -942,7 +942,7 @@ int flush;
&(state->next), &(state->distbits), state->work);
if (ret) {
strm->msg = "invalid distances set";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
Tracev((stderr, "inflate: codes ok\n"));
@@ -985,7 +985,7 @@ int flush;
}
if (this.op & 64) {
strm->msg = "invalid literal/length code";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->extra = (unsigned)(this.op) & 15;
@@ -1017,7 +1017,7 @@ int flush;
DROPBITS(this.bits);
if (this.op & 64) {
strm->msg = "invalid distance code";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
state->offset = (unsigned)this.val;
@@ -1032,13 +1032,13 @@ int flush;
#ifdef INFLATE_STRICT
if (state->offset > state->dmax) {
strm->msg = "invalid distance too far back";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
#endif
if (state->offset > state->whave + out - left) {
strm->msg = "invalid distance too far back";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
Tracevv((stderr, "inflate: distance %u\n", state->offset));
@@ -1090,7 +1090,7 @@ int flush;
#endif
REVERSE(hold)) != state->check) {
strm->msg = "incorrect data check";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
INITBITS();
@@ -1103,7 +1103,7 @@ int flush;
NEEDBITS(32);
if (hold != (state->total & 0xffffffffUL)) {
strm->msg = "incorrect length check";
- state->mode = BAD;
+ state->mode = BAD_DATA;
break;
}
INITBITS();
@@ -1114,7 +1114,7 @@ int flush;
case DONE:
ret = Z_STREAM_END;
goto inf_leave;
- case BAD:
+ case BAD_DATA:
ret = Z_DATA_ERROR;
goto inf_leave;
case MEM:
diff --git a/lib/zlib/inflate.h b/lib/zlib/inflate.h
index 07bd3e78a7..25b6538bc2 100644
--- a/lib/zlib/inflate.h
+++ b/lib/zlib/inflate.h
@@ -45,7 +45,7 @@ typedef enum {
CHECK, /* i: waiting for 32-bit check value */
LENGTH, /* i: waiting for 32-bit length (gzip) */
DONE, /* finished check, done -- remain here until reset */
- BAD, /* got a data error -- remain here until reset */
+ BAD_DATA, /* got a data error -- remain here until reset */
MEM, /* got an inflate() memory error -- remain here until reset */
SYNC /* looking for synchronization bytes to restart inflate() */
} inflate_mode;
@@ -53,7 +53,7 @@ typedef enum {
/*
State transitions between above modes -
- (most modes can go to the BAD or MEM mode -- not shown for clarity)
+ (most modes can go to the BAD_DATA or MEM mode -- not shown for clarity)
Process header:
HEAD -> (gzip) or (zlib)
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index d1e9c8d6c8..60eabe41d6 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -533,6 +533,7 @@ my $interfaces = join(',', ("127.0.0.6/8",
"127.0.0.11/8"));
my $conffile = "$prefix_abs/client/client.conf";
+$ENV{SMB_CONF_PATH} = $conffile;
sub write_clientconf($$)
{
diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py
index 4764d0cafa..823d5e6ff6 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -959,13 +959,16 @@ def provision(setup_dir, message, session_info,
paths = provision_paths_from_lp(lp, names.dnsdomain)
if hostip is None:
- hostip = socket.getaddrinfo(names.hostname, None, socket.AF_INET, socket.AI_CANONNAME, socket.IPPROTO_IP)[0][-1][0]
+ try:
+ hostip = socket.getaddrinfo(names.hostname, None, socket.AF_INET, socket.AI_CANONNAME, socket.IPPROTO_IP)[0][-1][0]
+ except socket.gaierror, (socket.EAI_NODATA, msg):
+ hostip = None
if hostip6 is None:
try:
hostip6 = socket.getaddrinfo(names.hostname, None, socket.AF_INET6, socket.AI_CANONNAME, socket.IPPROTO_IP)[0][-1][0]
- except socket.gaierror:
- pass
+ except socket.gaierror, (socket.EAI_NODATA, msg):
+ hostip6 = None
if serverrole is None:
serverrole = lp.get("server role")
@@ -1426,12 +1429,20 @@ def create_zone_file(path, setup_path, dnsdomain, domaindn,
hostip6_base_line = ""
hostip6_host_line = ""
+ if hostip is not None:
+ hostip_base_line = " IN A " + hostip
+ hostip_host_line = hostname + " IN A " + hostip
+ else:
+ hostip_base_line = ""
+ hostip_host_line = ""
+
setup_file(setup_path("provision.zone"), path, {
"DNSPASS_B64": b64encode(dnspass),
"HOSTNAME": hostname,
"DNSDOMAIN": dnsdomain,
"REALM": realm,
- "HOSTIP": hostip,
+ "HOSTIP_BASE_LINE": hostip_base_line,
+ "HOSTIP_HOST_LINE": hostip_host_line,
"DOMAINGUID": domainguid,
"DATESTRING": time.strftime("%Y%m%d%H"),
"DEFAULTSITE": DEFAULTSITE,
diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh
index b02b7bb890..42bc8141c6 100755
--- a/source4/selftest/tests.sh
+++ b/source4/selftest/tests.sh
@@ -81,7 +81,9 @@ smb4torture="$samba4bindir/smbtorture $TORTURE_OPTIONS"
echo "OPTIONS $TORTURE_OPTIONS"
SMB_CONF_PATH="$conffile"
+export SMB_CONF_PATH
CONFIGURATION="--configfile=$conffile"
+export CONFIGURATION
# Simple tests for LDAP and CLDAP
diff --git a/source4/setup/provision.zone b/source4/setup/provision.zone
index 17ae3bb47a..e7d600df87 100644
--- a/source4/setup/provision.zone
+++ b/source4/setup/provision.zone
@@ -10,10 +10,10 @@ $TTL 1W
1W ) ; minimum
IN NS ${HOSTNAME}
${HOSTIP6_BASE_LINE}
- IN A ${HOSTIP}
+${HOSTIP_BASE_LINE}
;
${HOSTIP6_HOST_LINE}
-${HOSTNAME} IN A ${HOSTIP}
+${HOSTIP_HOST_LINE}
gc._msdcs IN CNAME ${HOSTNAME}
${HOSTGUID}._msdcs IN CNAME ${HOSTNAME}
;