Skip to content

Changes

Summary

  1. ttcn3-tcpdump-start.sh: Avoid using dumpcap if it has no access to pcap (details)
Commit 68b805e3135f5ddc09138c45e021538385e5f94c by Pau Espin Pedrol
ttcn3-tcpdump-start.sh: Avoid using dumpcap if it has no access to pcap parent dir

dumpcap seems to be opening the pcap file it writes to *after* dropping
privileges, which means even if running it as root, it will fail to
create the pcap file inside a directory where that same user (even if
root) doesn't have write+execute permissions.

This is exactly what happens when one tries to run the
ttcn3-tcmpdump-start.sh script inside docker with "--cap-add=NET_ADMIN
--cap-add=SYS_RESOURCE" and root user, where it then tells dumpcap to
write to a volume mounted inside docker which was created by the user
outside user, hence with UID=1000 instead of UID=0 inside docker.

Since tcpdump works fine in this setup, simply skip using dumpcap if it
would fail to create the pcap file.

Related: OS#6455
Change-Id: If8ea5bb62f4866042761d3e08fe83179bf10c75a
The file was modified ttcn3-tcpdump-start.sh