View Issue Details

IDProjectCategoryView StatusLast Update
0009032Kali LinuxKali Package Bugpublic2024-12-19 19:30
Reporterhlein Assigned Tosteev  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Fixed in Versionkali-dev 
Summary0009032: nmap - privilege wrapper breaks --resume
Description

In https://gitlab.com/kalilinux/packages/nmap/-/commit/b6f4293f7f9c4099e38e5958ec37075c9e6cfdf4 a wrapper was added to allow nonroot users to run nmap with the necessary filecaps to do raw sockets, etc. without being root. Great!

However... it breaks nmap --resume:

$ nmap --resume foo.gnmap
Cannot use --resume with other options. Usage: nmap --resume <filename>
QUITTING!

This is because the wrapper injects the --privileged argument whenever run as non-root:

#!/usr/bin/env sh

set -e

if [ $(id -u) -eq 0 ]; then
exec /usr/lib/nmap/nmap "$@"
else
exec /usr/lib/nmap/nmap --privileged "$@"
fi

...Which is why nmap gets started with more args than it expected. But resume mode will find and respect that --privileged was in the saved command-line, so we don't need to add it. Since --resume must be the first arg, we can easily just test for it:

if [ $(id -u) -eq 0 -o "$1" = "--resume" ]; then

That seems to work fine here.

Activities

steev

steev

2024-12-14 22:51

manager   ~0020167

Last edited: 2024-12-15 06:00

Good catch, I will get this fixed up asap (unless you want to submit a merge request before I get to it this coming week!) - just a note, -o is not POSIX compliant, in case you want to do the merge request.

steev

steev

2024-12-19 19:30

manager   ~0020179

I have just pushed out 7.94+git20230807.3be01efb1+dfsg-4kali4 which will take a while to make it through the checks, but all things going right, it should be in kali-rolling either the end of this week or early next week.

Issue History

Date Modified Username Field Change
2024-12-13 19:24 hlein New Issue
2024-12-14 22:51 steev Note Added: 0020167
2024-12-14 22:51 steev Assigned To => steev
2024-12-14 22:51 steev Status new => assigned
2024-12-15 06:00 steev Note Edited: 0020167
2024-12-19 19:30 steev Note Added: 0020179
2024-12-19 19:30 steev Status assigned => resolved
2024-12-19 19:30 steev Resolution open => fixed
2024-12-19 19:30 steev Fixed in Version => kali-dev