public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 1/4] net/dhcp: Use paths allowed by AppArmor for dnsmasq
Date: Fri, 12 Oct 2018 00:15:24 +0200	[thread overview]
Message-ID: <20181011221524.GA26301@dell5510> (raw)
In-Reply-To: <20181011220525.24628-2-pvorel@suse.cz>

Hi,

> Fixes for --log-facility and --dhcp-leasefile.

> Path for log file expects AppArmor commit
> 025c7dc6 ("dnsmasq: Add permission to open log files").

> NOTE: AppArmor optimization isn't needed for dhcpd.

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
...
> Changing path to /var/log require root, but we run most of network tests
> under root anyway, at least for network  namespaces.
> I didn't add TST_NEEDS_ROOT=1, maybe I should.

...
> +++ b/testcases/network/dhcp/dnsmasq_tests.sh
...


> +log="/var/log/tst_dnsmasq.log"
Another option (instead of writing int /var/log/) is to detect enabled AppArmor
and /etc/apparmor.d/local/.  If enabled and dir exist, then append/create
/etc/apparmor.d/local/usr.sbin.dnsmasq with write permissions to our directory.
But this would require restart AppArmor.

> +
>  common_opt="--no-hosts --no-resolv --dhcp-authoritative \
> -	--log-facility=./tst_dnsmasq.log --interface=$iface0 \
> -	--dhcp-leasefile=tst_dnsmasq.lease --port=0 --conf-file= "
> +	--log-facility=$log --interface=$iface0 \
> +	--dhcp-leasefile=/var/lib/misc/dnsmasq.tst.leases --port=0 --conf-file= "


Kind regards,
Petr

  reply	other threads:[~2018-10-11 22:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 22:05 [LTP] [PATCH 0/4] DHCP tests and AppArmor improvements Petr Vorel
2018-10-11 22:05 ` [LTP] [PATCH 1/4] net/dhcp: Use paths allowed by AppArmor for dnsmasq Petr Vorel
2018-10-11 22:15   ` Petr Vorel [this message]
2018-10-23 14:03   ` Alexey Kodanev
2018-10-23 21:57     ` Petr Vorel
2018-10-24 10:40       ` Alexey Kodanev
2018-10-24 15:53         ` Petr Vorel
2018-10-11 22:05 ` [LTP] [PATCH 2/4] net/dhcp: Move print_dhcp_log() into dhcp library Petr Vorel
2018-10-11 22:05 ` [LTP] [PATCH 3/4] ver_linux: Print AppArmor and SELinux status Petr Vorel
2018-10-11 22:05 ` [LTP] [PATCH 4/4] tst_net.sh: Warn about enabled AppArmor Petr Vorel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181011221524.GA26301@dell5510 \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox