Bug 53687

Summary: tcpdump -Z root immediately exits 1
Product: Sisyphus Reporter: Vitaly Chikunov <vt>
Component: tcpdumpAssignee: Arseny Maslennikov <arseny>
Status: ASSIGNED --- QA Contact: qa-sisyphus
Severity: normal    
Priority: P5 CC: arei, arseny, ldv
Version: unstable   
Hardware: x86   
OS: Linux   

Description Vitaly Chikunov 2025-04-01 06:35:24 MSK
В версии 4.99.4-alt1 ещё можно было делать `-Z root`, чтоб отключить утрату привилегий. tcpdump(8) отмечает:

  -Z user
  --relinquish-privileges=user
      If  tcpdump  is running as root, after opening the capture device
      or input savefile, but before opening any savefiles  for  output,
      change  the user ID to user and the group ID to the primary group
      of user.

      This behavior is enabled by default (-Z tcpdump), and can be dis‐
      abled by -Z root.

С версии 4.99.5-alt1 это поведение больше невозможно отключить при наличии savefile.

  root@x86_64:~# tcpdump -Z root -p -w a
  tcpdump: Chroot without dropping root is insecure
  root@x86_64:~# echo $?
  1

💁‍♂️
Comment 1 Arseny Maslennikov 2025-04-02 14:02:06 MSK
Старый патч https://git.altlinux.org/gears/t/tcpdump.git?p=tcpdump.git;a=commit;h=f4d2a85d068ccbf9ae6dd73774c76ed0d81828ab перестал выполнять свою функцию, надо переделать.