Skip to content
Commits on Source (344)
......@@ -25,7 +25,7 @@
########################################################
SAMBA_VERSION_MAJOR=4
SAMBA_VERSION_MINOR=10
SAMBA_VERSION_RELEASE=0
SAMBA_VERSION_RELEASE=7
########################################################
# If a official release has a serious bug #
......
This diff is collapsed.
......@@ -1115,7 +1115,7 @@ _PUBLIC_ void cli_credentials_get_ntlm_username_domain(struct cli_credentials *c
const char **username,
const char **domain)
{
if (cred->principal_obtained > cred->username_obtained) {
if (cred->principal_obtained >= cred->username_obtained) {
*domain = talloc_strdup(mem_ctx, "");
*username = cli_credentials_get_principal(cred, mem_ctx);
} else {
......
......@@ -342,6 +342,22 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
}
}
if (DEBUGLEVEL >= 10) {
struct CHALLENGE_MESSAGE *challenge =
talloc(ntlmssp_state, struct CHALLENGE_MESSAGE);
if (challenge != NULL) {
NTSTATUS status;
challenge->NegotiateFlags = chal_flags;
status = ntlmssp_pull_CHALLENGE_MESSAGE(
&in, challenge, challenge);
if (NT_STATUS_IS_OK(status)) {
NDR_PRINT_DEBUG(CHALLENGE_MESSAGE,
challenge);
}
TALLOC_FREE(challenge);
}
}
if (chal_flags & NTLMSSP_TARGET_TYPE_SERVER) {
ntlmssp_state->server.is_standalone = true;
} else {
......@@ -702,6 +718,22 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security *gensec_security,
return nt_status;
}
if (DEBUGLEVEL >= 10) {
struct AUTHENTICATE_MESSAGE *authenticate =
talloc(ntlmssp_state, struct AUTHENTICATE_MESSAGE);
if (authenticate != NULL) {
NTSTATUS status;
authenticate->NegotiateFlags = ntlmssp_state->neg_flags;
status = ntlmssp_pull_AUTHENTICATE_MESSAGE(
out, authenticate, authenticate);
if (NT_STATUS_IS_OK(status)) {
NDR_PRINT_DEBUG(AUTHENTICATE_MESSAGE,
authenticate);
}
TALLOC_FREE(authenticate);
}
}
/*
* We always include the MIC, even without:
* av_flags->Value.AvFlags |= NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE;
......
......@@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
import os, sys, inspect
VERSION="2.0.8"
VERSION="2.0.17"
REVISION="x"
GIT="x"
INSTALL="x"
......
# Samba automatic dependency handling and project rules
import os, sys, re, time
import os, sys, re
from waflib import Build, Options, Logs, Utils, Errors
from waflib.Logs import debug
......@@ -1102,8 +1102,7 @@ def check_project_rules(bld):
if not force_project_rules and load_samba_deps(bld, tgt_list):
return
global tstart
tstart = time.clock()
timer = Utils.Timer()
bld.new_rules = True
Logs.info("Checking project rules ...")
......@@ -1112,26 +1111,26 @@ def check_project_rules(bld):
expand_subsystem_deps(bld)
debug("deps: expand_subsystem_deps: %f" % (time.clock() - tstart))
debug("deps: expand_subsystem_deps: %s" % str(timer))
replace_grouping_libraries(bld, tgt_list)
debug("deps: replace_grouping_libraries: %f" % (time.clock() - tstart))
debug("deps: replace_grouping_libraries: %s" % str(timer))
build_direct_deps(bld, tgt_list)
debug("deps: build_direct_deps: %f" % (time.clock() - tstart))
debug("deps: build_direct_deps: %s" % str(timer))
break_dependency_loops(bld, tgt_list)
debug("deps: break_dependency_loops: %f" % (time.clock() - tstart))
debug("deps: break_dependency_loops: %s" % str(timer))
if Options.options.SHOWDEPS:
show_dependencies(bld, Options.options.SHOWDEPS, set())
calculate_final_deps(bld, tgt_list, loops)
debug("deps: calculate_final_deps: %f" % (time.clock() - tstart))
debug("deps: calculate_final_deps: %s" % str(timer))
if Options.options.SHOW_DUPLICATES:
show_object_duplicates(bld, tgt_list)
......@@ -1140,7 +1139,7 @@ def check_project_rules(bld):
for f in [ build_dependencies, build_includes, add_init_functions ]:
debug('deps: project rules checking %s', f)
for t in tgt_list: f(t)
debug("deps: %s: %f" % (f, time.clock() - tstart))
debug("deps: %s: %s" % (f, str(timer)))
debug('deps: project rules stage1 completed')
......@@ -1148,17 +1147,17 @@ def check_project_rules(bld):
Logs.error("Duplicate sources present - aborting")
sys.exit(1)
debug("deps: check_duplicate_sources: %f" % (time.clock() - tstart))
debug("deps: check_duplicate_sources: %s" % str(timer))
if not bld.check_group_ordering(tgt_list):
Logs.error("Bad group ordering - aborting")
sys.exit(1)
debug("deps: check_group_ordering: %f" % (time.clock() - tstart))
debug("deps: check_group_ordering: %s" % str(timer))
show_final_deps(bld, tgt_list)
debug("deps: show_final_deps: %f" % (time.clock() - tstart))
debug("deps: show_final_deps: %s" % str(timer))
debug('deps: project rules checking completed - %u targets checked',
len(tgt_list))
......@@ -1166,7 +1165,7 @@ def check_project_rules(bld):
if not bld.is_install:
save_samba_deps(bld, tgt_list)
debug("deps: save_samba_deps: %f" % (time.clock() - tstart))
debug("deps: save_samba_deps: %s" % str(timer))
Logs.info("Project rules pass")
......
......@@ -37,7 +37,7 @@ LIB_PATH="shared"
os.environ['PYTHONUNBUFFERED'] = '1'
if Context.HEXVERSION not in (0x2000800,):
if Context.HEXVERSION not in (0x2001100,):
Logs.error('''
Please use the version of waf that comes with Samba, not
a system installed version. See http://wiki.samba.org/index.php/Waf
......
......@@ -27,7 +27,6 @@ tests/takeover/ctdb_takeover.pyc
tests/eventscripts/var
tests/eventscripts/etc/iproute2
tests/eventscripts/etc-ctdb/policy_routing
include/ctdb_version.h
packaging/RPM/ctdb.spec
doc/*.[1-7]
doc/*.[1-7].html
......@@ -117,7 +117,8 @@ int event_script_get_list(TALLOC_CTX *mem_ctx,
}
*out = script_list;
return 0;
ret = 0;
goto done;
nomem:
ret = ENOMEM;
......
......@@ -295,13 +295,22 @@ again:
proc->result.sig = WTERMSIG(status);
}
/* Confirm that all data has been read from the pipe */
if (proc->fd != -1) {
proc_read_handler(ev, proc->fde, 0, proc);
TALLOC_FREE(proc->fde);
proc->fd = -1;
}
DLIST_REMOVE(run_ctx->plist, proc);
/* Active run_proc request */
if (proc->req != NULL) {
run_proc_done(proc->req);
} else {
talloc_free(proc);
}
DLIST_REMOVE(run_ctx->plist, proc);
goto again;
}
......@@ -419,6 +428,7 @@ static void run_proc_done(struct tevent_req *req)
if (state->proc->output != NULL) {
state->output = talloc_steal(state, state->proc->output);
}
talloc_steal(state, state->proc);
tevent_req_done(req);
}
......
......@@ -893,7 +893,7 @@ static void sock_daemon_run_socket_fail(struct tevent_req *subreq)
subreq, struct tevent_req);
struct sock_daemon_run_state *state = tevent_req_data(
req, struct sock_daemon_run_state);
const char *sockpath = NULL;
const char *sockpath = "INVALID";
int ret = 0;
bool status;
......
/*
CTDB version string
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/>.
*/
#include "ctdb_version.h"
const char ctdb_version_string[] = CTDB_VERSION_STRING;
/*
CTDB version string
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/>.
*/
extern const char ctdb_version_string[];
......@@ -2,6 +2,7 @@
Description=CTDB
Documentation=man:ctdbd(1) man:ctdb(7)
After=network-online.target time-sync.target
ConditionFileNotEmpty=/etc/ctdb/nodes
[Service]
Type=forking
......
......@@ -33,15 +33,16 @@ fi
load_system_config ()
{
if [ -z "$1" ] ; then
return
fi
for _i ; do
if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/$1" ]; then
. "${CTDB_SYS_ETCDIR}/sysconfig/$1"
elif [ -f "${CTDB_SYS_ETCDIR}/default/$1" ]; then
. "${CTDB_SYS_ETCDIR}/default/$1"
if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/${_i}" ]; then
. "${CTDB_SYS_ETCDIR}/sysconfig/${_i}"
return
elif [ -f "${CTDB_SYS_ETCDIR}/default/${_i}" ]; then
. "${CTDB_SYS_ETCDIR}/default/${_i}"
return
fi
done
}
# load_script_options [ component script ]
......
......@@ -2,6 +2,6 @@
version="1"
restart_every=2
unhealthy_after=6
service_stop_cmd="killall -q -9 rpc.statd"
service_start_cmd="rpc.statd ${STATD_HA_CALLOUT:+-H} $STATD_HA_CALLOUT ${STATD_HOSTNAME:+-n} $STATD_HOSTNAME ${STATD_PORT:+-p} $STATD_PORT ${STATD_OUTGOING_PORT:+-o} $STATD_OUTGOING_PORT"
service_stop_cmd="$CTDB_NFS_CALLOUT stop status"
service_start_cmd="$CTDB_NFS_CALLOUT start status"
service_debug_cmd="program_stack_traces rpc.statd 5"
......@@ -2,6 +2,6 @@
version="1"
restart_every=2
unhealthy_after=6
service_stop_cmd="killall -q -9 rpc.mountd"
service_start_cmd="rpc.mountd $RPCMOUNTDOPTS ${MOUNTD_PORT:+-p} $MOUNTD_PORT"
service_stop_cmd="$CTDB_NFS_CALLOUT stop mountd"
service_start_cmd="$CTDB_NFS_CALLOUT start mountd"
service_debug_cmd="program_stack_traces rpc.mountd 5"
......@@ -2,6 +2,6 @@
version="1"
restart_every=2
unhealthy_after=6
service_stop_cmd="killall -q -9 rpc.rquotad"
service_start_cmd="rpc.rquotad ${RQUOTAD_PORT:+-p} $RQUOTAD_PORT"
service_stop_cmd="$CTDB_NFS_CALLOUT stop rquotad"
service_start_cmd="$CTDB_NFS_CALLOUT start rquotad"
service_debug_cmd="program_stack_traces rpc.rquotad 5"
......@@ -12,20 +12,66 @@ set -e
# hook for testing.
nfs_exports_file="${CTDB_NFS_EXPORTS_FILE:-/var/lib/nfs/etab}"
# Red Hat
# As above, edit the default value below. CTDB_NFS_DISTRO_STYLE is a
# test variable only.
nfs_distro_style="${CTDB_NFS_DISTRO_STYLE:-sysvinit-redhat}"
case "$nfs_distro_style" in
systemd-*)
# Defaults
nfs_service="nfs-server"
nfs_lock_service="rpc-statd"
nfs_mountd_service="nfs-mountd"
nfs_status_service="rpc-statd"
nfs_rquotad_service="rpc-rquotad"
nfs_config="/etc/sysconfig/nfs"
nfs_rquotad_config="" # Not use with systemd, restart via service
case "$nfs_distro_style" in
*-redhat|*-suse)
: # Defaults only
;;
*-debian)
nfs_rquotad_service="quotarpc"
;;
*)
echo "Internal error"
exit 1
esac
;;
sysvinit-*)
# Defaults
nfs_service="nfs"
nfslock_service="nfslock"
nfs_lock_service=""
nfs_mountd_service=""
nfs_status_service=""
nfs_rquotad_service=""
nfs_config="/etc/sysconfig/nfs"
nfs_rquotad_config="$nfs_config"
# SUSE
#nfs_service="nfsserver"
#nfslock_service=""
#nfs_config="/etc/sysconfig/nfs"
case "$nfs_distro_style" in
*-redhat)
nfs_lock_service="nfslock"
;;
*-suse)
nfs_service="nfsserver"
;;
*-debian)
nfs_service="nfs-kernel-server"
nfs_config="/etc/default/nfs-kernel-server"
nfs_rquotad_config="/etc/default/quota"
;;
*)
echo "Internal error"
exit 1
esac
;;
# Debian
#nfs_service="nfs-kernel-server"
#nfslock_service=""
#nfs_config="/etc/default/nfs-kernel-server"
*)
echo "Internal error"
exit 1
esac
# Override for unit testing
if [ -z "$PROCFS_PATH" ] ; then
......@@ -46,6 +92,16 @@ EOF
exit 1
}
##################################################
nfs_load_config ()
{
_config="${1:-${nfs_config}}"
if [ -r "$_config" ] ; then
. "$_config"
fi
}
##################################################
# Basic service stop and start
......@@ -54,14 +110,19 @@ basic_stop ()
{
case "$1" in
nfs)
if [ -n "$nfs_rquotad_service" ] ; then
service "$nfs_rquotad_service" stop
fi
service "$nfs_service" stop
if [ -n "$nfslock_service" ] ; then
service "$nfslock_service" stop
if [ -n "$nfs_lock_service" ] ; then
service "$nfs_lock_service" stop
fi
;;
nfslock)
if [ -n "$nfslock_service" ] ; then
service "$nfslock_service" stop
if [ -n "$nfs_lock_service" ] ; then
service "$nfs_lock_service" stop
else
service "$nfs_service" stop
fi
......@@ -75,14 +136,19 @@ basic_start ()
{
case "$1" in
nfs)
if [ -n "$nfslock_service" ] ; then
service "$nfslock_service" start
if [ -n "$nfs_lock_service" ] ; then
service "$nfs_lock_service" start
fi
service "$nfs_service" start
if [ -n "$nfs_rquotad_service" ] ; then
service "$nfs_rquotad_service" start
fi
;;
nfslock)
if [ -n "$nfslock_service" ] ; then
service "$nfslock_service" start
if [ -n "$nfs_lock_service" ] ; then
service "$nfs_lock_service" start
else
service "$nfs_service" start
fi
......@@ -106,6 +172,33 @@ service_stop ()
nlockmgr)
basic_stop "nfslock" >/dev/null 2>&1 || true
;;
mountd)
if [ -n "$nfs_mountd_service" ] ; then
service "$nfs_mountd_service" stop
return
fi
# Default to stopping by hand
killall -q -9 rpc.mountd
;;
rquotad)
if [ -n "$nfs_rquotad_service" ] ; then
service "$nfs_rquotad_service" stop
return
fi
# Default to stopping by hand
killall -q -9 rpc.rquotad
;;
status)
if [ -n "$nfs_status_service" ] ; then
service "$nfs_status_service" stop
return
fi
# Default to stopping by hand
killall -q -9 rpc.statd
;;
*)
usage
esac
......@@ -120,6 +213,56 @@ service_start ()
nlockmgr)
basic_start "nfslock"
;;
mountd)
if [ -n "$nfs_mountd_service" ] ; then
service "$nfs_mountd_service" start
return
fi
# Default to starting by hand
nfs_load_config
if [ -z "$RPCMOUNTDOPTS" ] ; then
RPCMOUNTDOPTS="${MOUNTD_PORT:+-p }$MOUNTD_PORT"
fi
# shellcheck disable=SC2086
rpc.mountd $RPCMOUNTDOPTS
;;
rquotad)
if [ -n "$nfs_rquotad_service" ] ; then
service "$nfs_rquotad_service" start
return
fi
# Default to starting by hand
nfs_load_config "$nfs_rquotad_config"
if [ -z "$RPCRQUOTADOPTS" ] ; then
RPCRQUOTADOPTS="${RQUOTAD_PORT:+-p }$RQUOTAD_PORT"
fi
# shellcheck disable=SC2086
rpc.rquotad $RPCRQUOTADOPTS
;;
status)
if [ -n "$nfs_status_service" ] ; then
service "$nfs_status_service" start
return
fi
# Default to starting by hand
nfs_load_config
# Red Hat uses STATDARG, Debian uses STATDOPTS
opts="${STATDARG:-${STATDOPTS:-''}}"
if [ -z "$opts" ] ; then
# shellcheck disable=SC2086
set -- \
${STATD_HA_CALLOUT:+-H} $STATD_HA_CALLOUT \
${STATD_HOSTNAME:+-n} $STATD_HOSTNAME \
${STATD_PORT:+-p} $STATD_PORT \
${STATD_OUTGOING_PORT:+-o} $STATD_OUTGOING_PORT
opts="$*"
fi
# shellcheck disable=SC2086
rpc.statd $opts
;;
*)
usage
esac
......@@ -138,7 +281,7 @@ nfs_startup ()
basic_stop "nfs" || true
basic_start "nfs"
_f="${PROCFS_PATH}/sys/net/ipv4/tcp_tw_recycle"
if [ "$_f" ] ; then
if [ -f "$_f" ] ; then
echo 1 >"$_f"
fi
}
......@@ -149,9 +292,7 @@ nfs_startup ()
nfs_check_thread_count ()
{
# Load NFS configuration to get desired number of threads.
if [ -r "$nfs_config" ] ; then
. "$nfs_config"
fi
nfs_load_config
# If $RPCNFSDCOUNT/$USE_KERNEL_NFSD_NUMBER isn't set then we could
# guess the default from the initscript. However, let's just
......
......@@ -20,7 +20,8 @@ die ()
exit 1
}
load_system_config "nfs"
# Try different variables to find config file for NFS_HOSTNAME
load_system_config "nfs" "nfs-common"
[ -n "$NFS_HOSTNAME" ] || \
die "NFS_HOSTNAME is not configured. statd-callout failed"
......