Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#20339 - wireshark installs dumpcap with wrong/fixed gid

Attached to Project: Arch Linux
Opened by Heiko Baums (cyberpatrol) - Monday, 02 August 2010, 08:35 GMT
Last edited by Ionut Biru (wonder) - Monday, 02 August 2010, 09:35 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
wireshark 1.2.10-1 installs /usr/bin/dumpcap with the fixed gid 150 instead of the groupname wireshark.

People who just update wireshark and don't install it for the first time had to create the group wireshark and run setcap by themselves to be able to use previous versions as an unprivileged user. So the group wireshark doesn't have the gid 150 on every system. On most systems wireshark has a different gid. It has only the gid 150 if wireshark is installed for the first time.

From the PKGBUILD:
#wireshark uid group is 150
chgrp 150 "${pkgdir}/usr/bin/dumpcap"

From wireshark.install:
getent group wireshark >/dev/null 2>&1 || groupadd -g 150 wireshark &>/dev/null

So the group wireshark is only created if it doesn't exist.

So either replace
#wireshark uid group is 150
chgrp 150 "${pkgdir}/usr/bin/dumpcap"
by
chgrp wireshark "${pkgdir}/usr/bin/dumpcap"
in the PKGBUILD or
getent group wireshark >/dev/null 2>&1 || groupadd -g 150 wireshark &>/dev/null
by
groupdel wireshark || groupadd -g 150 wireshark &>/dev/null
in wireshark.install.

In the last case wireshark.install should print a note, that the group wireshark was deleted and freshly created with a new, fixed gid, and that users who were members of the group wireshark need to be added to this group again.
This task depends upon

Closed by  Ionut Biru (wonder)
Monday, 02 August 2010, 09:35 GMT
Reason for closing:  Implemented
Additional comments about closing:  1.2.10-2
Comment by Ionut Biru (wonder) - Monday, 02 August 2010, 08:40 GMT
1) we can't use chgrp wireshark in PKGBUILD because the group doesn't exits
2) for people who update wireshark that should work because we have
post_upgrade() {
post_install $1
}

which means that after extracting the files, run post_install function, in which we add group and setcap.
Comment by Heiko Baums (cyberpatrol) - Monday, 02 August 2010, 09:01 GMT
post_upgrade() {
post_install $1
}

doesn't work because of this line in post_install():
getent group wireshark >/dev/null 2>&1 || groupadd -g 150 wireshark &>/dev/null

This creates the group wireshark with gid 150 only if the group wireshark isn't already existing. If the group wireshark is already existing then this group isn't touched and doesn't have/get the gid 150. So chgrp 150 "${pkgdir}/usr/bin/dumpcap" from the PKGBUILD sets the gid of this file to a non-existing gid for people who update wireshark.

So if chgrp wireshark is not possible in the PKGBUILD (are you really sure that this is not possible?) then the already existing group wireshark should be deleted and recreated with the gid 150. Means the line

getent group wireshark >/dev/null 2>&1 || groupadd -g 150 wireshark &>/dev/null

in the PKGBUILD needs to be replaced by the lines

groupdel wireshark
groupadd -g 150 wireshark &>/dev/null

so that it is ensured that the group wireshark has the gid 150 also on systems on which wireshark is updated.
Comment by Ionut Biru (wonder) - Monday, 02 August 2010, 09:05 GMT
we didn't had this implemented at all in < 1.2.9 and is not my job to adjust _your_ modifications.

if we did had it using other gid, i definitely used groupmod to change gid in an if
Comment by Heiko Baums (cyberpatrol) - Monday, 02 August 2010, 09:10 GMT
I just remembered the command groupmod.

So instead of replacing the line

getent group wireshark >/dev/null 2>&1 || groupadd -g 150 wireshark &>/dev/null

in wireshark.install by

groupdel wireshark
groupadd -g 150 wireshark &>/dev/null

it's better to replace it by

getent group wireshark >/dev/null 2>&1 && groupmod -g 150 wireshark || groupadd -g 150 wireshark &>/dev/null

If the group wireshark is already existing its gid is changed to 150 otherwise the group wireshark is created with the gid 150.
Comment by Heiko Baums (cyberpatrol) - Monday, 02 August 2010, 09:11 GMT
But it's also not your job to destroy my modifications. So if you implement something which needed to be done manually by the user in previous versions you have to respect these modifications and not to destroy them.

Loading...