exit 0
fi
-saved_level=1
-
-get_winbind_loglevel()
-{
- s1=$(${SMBCONTROL} "${CONFIGURATION}" winbind debuglevel)
- # We need to get the all level from output like this:
- # "PID 664474: all:1 tdb:1 printdrivers:1 lanman:1 smb:1 rpc_parse:1 rpc_srv:1 rpc_cli:1 passdb:1 sam:1..."
- # 1. remove PID 664474:
- s2=${s1#PID*: }
- # "all:1 tdb:1 printdrivers:1 lanman:1 smb:1 rpc_parse:1 rpc_srv:1 rpc_cli:1 passdb"
- # 2. remove " tdb:1 printdrivers:1 ..."
- s3=${s2%% *}
- # "all:1"
- # 3. remove "all:"
- saved_level=${s3#all:}
-}
-
# Example of trace line
# [2023/01/25 00:20:33.307038, 5, pid=535581, effective(0, 0), real(0, 0), class=winbind, traceid=78, depth=4] ../../source3/winbindd/wb_group_members.c:310(wb_group_members_send)
test_winbind_call_depth_trace()
{
- get_winbind_loglevel
-
- # If loglevel < 10, set it to 10.
- if [ "$saved_level" -lt 10 ]; then
- ${SMBCONTROL} "${CONFIGURATION}" winbind debug 10
- fi
+ global_inject_conf=$(dirname $SMB_CONF_PATH)/global_inject.conf
+ echo "debug syslog format = no" >$global_inject_conf
+ echo "log level = 10" >>$global_inject_conf
+ ${SMBCONTROL} "${CONFIGURATION}" winbind reload-config
COUNT1=$(grep -c wb_group_members_send "$LOGFILE")
id ADDOMAIN/alice
ret=$?
- # Restore loglevel, if it was changed.
- if [ "$saved_level" -lt 10 ]; then
- ${SMBCONTROL} "${CONFIGURATION}" winbind debug "$saved_level"
- fi
+ echo "" >$global_inject_conf
+ ${SMBCONTROL} "${CONFIGURATION}" winbind reload-config
if [ $ret != 0 ]; then
echo "Command 'id ADDOMAIN/alice' failed!"