Skip to content

Commit 31aa712

Browse files
Another diagnostic test
1 parent 43d6bb8 commit 31aa712

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

.github/docker/tshark-test.Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ RUN apt-get update && \
1212
curl && \
1313
rm -rf /var/lib/apt/lists/*
1414

15-
# Debian Trixie ships an empty /usr/share/wireshark/init.lua — Wireshark's Lua subsystem
16-
# silently skips all user -X lua_script: files when init.lua is empty/missing. Replace it
17-
# with the upstream init.lua from the matching Wireshark release branch.
18-
RUN curl -fsSL https://gitlab.com/wireshark/wireshark/-/raw/release-4.4/epan/wslua/init.lua \
19-
-o /usr/share/wireshark/init.lua && \
20-
echo 'disable_lua = false' >> /usr/share/wireshark/init.lua
15+
# Create a non-root user so tshark doesn't run as root. Wireshark's Lua subsystem refuses
16+
# to load user -X lua_script: files when running as root, with no error message.
17+
RUN useradd --create-home --shell /bin/bash tester

.github/tests/Asx-AsxSecurities-Ntp-Itch-v1-05-Test.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,24 @@ tail -20 /usr/share/wireshark/init.lua 2>/dev/null || echo "init.lua not at expe
1515
echo "--- root/superuser refs in init.lua ---"
1616
grep -n -E 'running_superuser|disable_lua|superuser' /usr/share/wireshark/init.lua 2>/dev/null || echo "no matches"
1717

18-
echo "--- minimal lua script test ---"
18+
echo "--- minimal lua script test (as tester user) ---"
1919
cat > /tmp/probe.lua <<'EOF'
2020
local f = io.open("/tmp/probe-touched.log", "w")
2121
if f then f:write("trivial script ran\n"); f:close() end
2222
io.stderr:write("[probe] trivial script ran (stderr)\n")
2323
print("[probe] trivial script ran (print)")
2424
EOF
2525
rm -f /tmp/probe-touched.log
26-
tshark -r "omi-data-packets/Asx/Ntp.Itch.v1.05/AddOrderMessage.pcap" -X "lua_script:/tmp/probe.lua" -T json > /dev/null 2> /tmp/probe.stderr || true
26+
chmod 777 /tmp
27+
chown -R tester:tester . || true
28+
runuser -u tester -- tshark -r "omi-data-packets/Asx/Ntp.Itch.v1.05/AddOrderMessage.pcap" -X "lua_script:/tmp/probe.lua" -T json > /dev/null 2> /tmp/probe.stderr || true
2729
echo "trivial script stderr:"
2830
cat /tmp/probe.stderr
2931
if [ -f /tmp/probe-touched.log ]; then
30-
echo "TRIVIAL PROBE RAN — Lua scripting works in this container"
32+
echo "TRIVIAL PROBE RAN — Lua scripting works as non-root user"
3133
cat /tmp/probe-touched.log
3234
else
33-
echo "TRIVIAL PROBE DID NOT RUN — Lua scripts are completely disabled in this tshark"
35+
echo "TRIVIAL PROBE DID NOT RUN — Lua scripts still disabled"
3436
fi
3537

3638
echo "--- tshark log-level debug for Lua ---"

0 commit comments

Comments
 (0)