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
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
|
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
Monday, 02 August 2010, 09:35 GMT
Reason for closing: Implemented
Additional comments about closing: 1.2.10-2
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.
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.
if we did had it using other gid, i definitely used groupmod to change gid in an if
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.