Opened 5 years ago

Closed 5 years ago

#58537 closed defect (fixed)

Wireshark doesn't create group on install

Reported by: dershow Owned by: ra1nb0w
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: ghosthound
Port: wireshark-chmodbpf

Description

I tried to upgrade wireshark2, and I also tried to install wireshark3. Each of them installs wireshark-chmodbpf which has notes that instruct the user to run:

sudo dseditgroup -q -o edit -a [USER] -t user access_bpf

However, when I try that, with my user name, I get:

Group not found.

The port should create this group. If that is not possible, the notes should indicate how a user can do that with any necessary information for the group to function correctly for wireshark. Without that, I can't run wireshark.

Change History (14)

comment:1 Changed 5 years ago by mf2k (Frank Schima)

Cc: ra1nb0w removed
Owner: set to ra1nb0w
Status: newassigned

comment:2 Changed 5 years ago by mf2k (Frank Schima)

I see the same issue.

comment:3 Changed 5 years ago by ghosthound

I did not see this problem, pretty sure that wireshark-chmodbpf created the access_bpf group. I'm on 10.14.5, what macOS rev are you on?

comment:4 Changed 5 years ago by dershow

I am on 10.14.5 as well. Perhaps you already had the group created from a prior version or some other testing or install that you did? I see this:

$ sudo find -x / -group access_bpf -ls
find: -group: access_bpf: no such group

comment:5 Changed 5 years ago by ghosthound

I can think of a few workarounds:

You should be able to:

sudo port install wireshark3 -chmodbpf

and it should install without depending on wireshark-chmodbpf.

You can disable the wireshark-chmodbpf startup item and sudo chgrp wheel /dev/bpf* which should put the /dev/bpf entries back to "default". Presuming your user is a member of group wheel wireshark should then work. In fact, this chmod should work even if you do not disable the wireshark-chmodbpf startup item, you'll just have to do it after every reboot.

comment:6 in reply to:  4 Changed 5 years ago by ghosthound

Replying to dershow:

I am on 10.14.5 as well. Perhaps you already had the group created from a prior version or some other testing or install that you did? I see this:

$ sudo find -x / -group access_bpf -ls
find: -group: access_bpf: no such group

Could be, the timestamp on the group file is from yesterday (which is not definitive proof it was created then). I'll try another system shortly and see what I get.

comment:7 Changed 5 years ago by dershow

I would think that another work around is to just create the group by hand. I know that it can be done, but I am not sure what parameters and details are needed for access_bpf to function correctly and safely? Does it need a specific gid for example?

comment:8 Changed 5 years ago by jmroot (Joshua Root)

The problem is that wireshark-chmodbpf only runs addgroup in pre-destroot. If you get a binary archive, that code never gets run on your machine.

comment:9 Changed 5 years ago by ra1nb0w

I followed other ports. Have you some suggestions on how to place it to avoid the problem? thanks

comment:10 Changed 5 years ago by mf2k (Frank Schima)

As long as it does not hurt to run it multiple times, you can use pre-activate.

comment:11 Changed 5 years ago by jmroot (Joshua Root)

Well the other ports are broken too if they're only doing it at destroot time. Please file tickets against them. :)

Since it only need to be done once per machine, doing it in post-install is also OK (in addition to pre-destroot). Doing it at activation time also works but that potentially means the code runs more often than it needs to.

comment:12 Changed 5 years ago by ra1nb0w

Ok. I create a PR that duplicate the addgroup to port-install. thank you!

comment:14 Changed 5 years ago by ra1nb0w

Resolution: fixed
Status: assignedclosed

In 4e4ff37b8b13d8e1f7aad59855e4a6761e3300d3/macports-ports (master):

wireshark-chmodbpf: fix group creation if installed from binary

fix group creation if installed from the binary package

Closes: #58537

Note: See TracTickets for help on using tickets.