Re: [audio/umurmur] umurmurd "switching" to the last group found in group(5) file

2023-02-28 Thread Omar Polo
On 2023/02/28 15:41:08 +, Raf Czlonka  wrote:
> Hi Omar,
> 
> On Tue, Feb 28, 2023 at 02:06:28PM GMT, Omar Polo wrote:
> > On 2023/02/28 13:34:23 +, Raf Czlonka  wrote:
> > > Hello,
> > > 
> > > This is what is being written to /var/log/daemon after fresh install of
>  ^^^
> 
> > Can you try again with this diff applied?  it should fix the issue.
> 
> Yup, I can confirm this patch fixes the issue, thanks!

Thanks for testing.  I've sent the diff upstream[0] and will commit
the fix soon, provided that nobody objects it.

[0]: 

> > I'm not familiar with this daemon, when I start it i don't have any
> > logs in /var/logs/messages and if I manually run with -d I don't see
> > the "Switching to user" log :/
> 
> As per above - it's in /var/log/daemon, not /var/log/messages

Ooops!  Indeed, I have the expected output in /var/log/daemon.




Re: [audio/umurmur] umurmurd "switching" to the last group found in group(5) file

2023-02-28 Thread Raf Czlonka
Hi Omar,

On Tue, Feb 28, 2023 at 02:06:28PM GMT, Omar Polo wrote:
> On 2023/02/28 13:34:23 +, Raf Czlonka  wrote:
> > Hello,
> > 
> > This is what is being written to /var/log/daemon after fresh install of
 ^^^

> Can you try again with this diff applied?  it should fix the issue.

Yup, I can confirm this patch fixes the issue, thanks!

> I'm not familiar with this daemon, when I start it i don't have any
> logs in /var/logs/messages and if I manually run with -d I don't see
> the "Switching to user" log :/

As per above - it's in /var/log/daemon, not /var/log/messages

Thanks again!

Raf



Re: [audio/umurmur] umurmurd "switching" to the last group found in group(5) file

2023-02-28 Thread Omar Polo
On 2023/02/28 13:34:23 +, Raf Czlonka  wrote:
> Hello,
> 
> This is what is being written to /var/log/daemon after fresh install of
> umurmur:
> 
>   Feb 26 13:38:06 foo uMurmurd[34340]: OpenSSL library initialized 
> (version: LibreSSL 3.7.1)
>   Feb 26 13:38:06 foo uMurmurd[34340]: Setting default channel 'Lobby'
>   Feb 26 13:38:06 foo uMurmurd[34340]: Adding channel 'Lobby' parent 
> 'Root'
>   Feb 26 13:38:06 foo uMurmurd[34340]: Adding channel 'Silent' parent 
> 'Root'
>   Feb 26 13:38:06 foo uMurmurd[34340]: Adding channel 'Red team' parent 
> 'Lobby'
>   Feb 26 13:38:06 foo uMurmurd[34340]: Adding channel 'Blue team' parent 
> 'Lobby'
>   Feb 26 13:38:06 foo uMurmurd[34340]: Adding channel link 'Lobby' -> 
> 'Red team'
>   Feb 26 13:38:06 foo uMurmurd[34340]: Adding channel link 'Lobby' -> 
> 'Blue team'
>   Feb 26 13:38:06 foo uMurmurd[34340]: Switch to user '_umurmur' group 
> '_umurmur'
>   Feb 26 13:38:06 foo uMurmurd[34340]: uMurmur version 0.2.20 ('Bonkers') 
> protocol version 1.2.4
>   Feb 26 13:38:06 foo uMurmurd[34340]: Visit 
> https://github.com/umurmur/umurmur
> 
> After an upgrade to the latest snapshot and having installed gotd,
> I've noticed an odd and misleading information produced by umurmurd:
> 
>   Feb 27 12:14:45 foo uMurmurd[57309]: OpenSSL library initialized 
> (version: LibreSSL 3.7.1)
>   Feb 27 12:14:45 foo uMurmurd[57309]: Setting default channel 'Lobby'
>   Feb 27 12:14:45 foo uMurmurd[57309]: Adding channel 'Lobby' parent 
> 'Root'
>   Feb 27 12:14:45 foo uMurmurd[57309]: Adding channel 'Silent' parent 
> 'Root'
>   Feb 27 12:14:45 foo uMurmurd[57309]: Adding channel 'Red team' parent 
> 'Lobby'
>   Feb 27 12:14:45 foo uMurmurd[57309]: Adding channel 'Blue team' parent 
> 'Lobby'
>   Feb 27 12:14:45 foo uMurmurd[57309]: Adding channel link 'Lobby' -> 
> 'Red team'
>   Feb 27 12:14:45 foo uMurmurd[57309]: Adding channel link 'Lobby' -> 
> 'Blue team'
>   Feb 27 12:14:45 foo uMurmurd[57309]: Switch to user '_umurmur' group 
> '_gotd'
>   Feb 27 12:14:45 foo uMurmurd[57309]: uMurmur version 0.2.20 ('Bonkers') 
> protocol version 1.2.4
>   Feb 27 12:14:46 foo uMurmurd[57309]: Visit 
> https://github.com/umurmur/umurmur
> 
> In case this isn't clear - this is the line in question:
> 
>   Feb 27 12:14:45 foo uMurmurd[57309]: Switch to user '_umurmur' group 
> '_gotd'
> 
> Why would umurmurd switch to group _gotd?
> 
> Given that it was the last piece of software I installed or, rather,
> it was the last group added to the system, it must be related, no?
> 
>   $ tail -n 1 /etc/group 
>   _gotd:*:501:
> 
> A quick test confirmed it - umurmurd says that it switches to a
> particular group and, as it happens, said group is simply the last
> entry found in group(5) file; I've added a 'git' user, with a
> corresponding group:
> 
>   $ tail -n 2 /etc/group 
>   _gotd:*:501:
>   git:*:999:
> 
> and sure enough:
> 
>   Feb 28 09:44:14 foo uMurmurd[42595]: OpenSSL library initialized 
> (version: LibreSSL 3.7.1)
>   Feb 28 09:44:14 foo uMurmurd[42595]: Setting default channel 'Lobby'
>   Feb 28 09:44:15 foo uMurmurd[42595]: Adding channel 'Lobby' parent 
> 'Root'
>   Feb 28 09:44:15 foo uMurmurd[42595]: Adding channel 'Silent' parent 
> 'Root'
>   Feb 28 09:44:15 foo uMurmurd[42595]: Adding channel 'Red team' parent 
> 'Lobby'
>   Feb 28 09:44:15 foo uMurmurd[42595]: Adding channel 'Blue team' parent 
> 'Lobby'
>   Feb 28 09:44:15 foo uMurmurd[42595]: Adding channel link 'Lobby' -> 
> 'Red team'
>   Feb 28 09:44:15 foo uMurmurd[42595]: Adding channel link 'Lobby' -> 
> 'Blue team'
>   Feb 28 09:44:15 foo uMurmurd[42595]: Switch to user '_umurmur' group 
> 'git'
>   Feb 28 09:44:15 foo uMurmurd[42595]: uMurmur version 0.2.20 ('Bonkers') 
> protocol version 1.2.4
>   Feb 28 09:44:15 foo uMurmurd[42595]: Visit 
> https://github.com/umurmur/umurmur
> 
> What's odd, though, is that umurmur does *not* seem to be switching
> to that group - it only says it does:
> 
>   $ pgrep -G git -l
>   $ echo $?
>   1
>   $ pgrep -G _umurmur -l
>   42595 umurmurd
> 
> So it looks like it is only _pretty printing_ that's broken.
> 
> Cheers,
> 
> Raf
> 
> P.S. I'm not subscribed to this mailing list so please CC me if need be.

This is because they call getgrnam() to get group info, then call
initgroups() (which will call getgrouplist() and invalidate the data
pointed by the previous call to getgrnam()) and print it.  luckily the
pointer returned by getgrnam() is only kept around for printing to the
logs.

Can you try again with this diff applied?  it should fix the issue.
Alternatively commenting the `groupname = "_umurmur"` in the config
file should have a similar effect.

I'm not familiar with this daemon, when I start it i don't have any
logs in /var/logs/messages and if I manually run with -d I don't see
the "Switching