#!/bin/sh
# dbus-daemon wrapper script for dbus-vmstate testing
#
# This script allows to tweak the dbus-daemon policy during the test
# to test different configurations.
#
# 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 2 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 .
#
# Copyright (C) 2019 Red Hat, Inc.
write_config()
{
    CONF="$1"
    cat > "$CONF" <
  session
  unix:tmpdir=$DBUS_VMSTATE_TEST_TMPDIR
  
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
  
  contexts/dbus_contexts
EOF
}
ARGS=
for arg in "$@"
do
    case $arg in
        --config-file=*)
          CONF="${arg#*=}"
          write_config "$CONF"
          ARGS="$ARGS $1"
          shift
        ;;
        *)
          ARGS="$ARGS $1"
          shift
        ;;
    esac
done
exec dbus-daemon $ARGS