Bug 253702

Summary: net-mgmt/snmptt: Fix upstream bug
Product: Ports & Packages Reporter: Christian Ullrich <chris>
Component: Individual Port(s)Assignee: Neel Chauhan <nc>
Status: Closed FIXED    
Severity: Affects Some People CC: nc, nistor
Priority: --- Flags: bugzilla: maintainer-feedback? (nistor)
nistor: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://sourceforge.net/p/snmptt/bugs/47/
Attachments:
Description Flags
Patch none

Description Christian Ullrich 2021-02-19 20:33:29 UTC
Created attachment 222650 [details]
Patch

This is a fix for an upstream bug. Given the level of activity on the snmptt Sourceforge project, I expect some delay until upstream fixes the bug.

The code attempts to change from the executing user to a configured service user, but it does this by first changing effective, then real uid.

It then briefly looks around curiously before falling flat on its face because the real uid change failed, the process not having root anymore at that point.

The attached patch reverses the order of the operations.
Comment 1 nistor 2021-02-27 22:34:03 UTC
Spoke to developer in email about this patch, all looks good and upstream fixed for new version as well.
Comment 2 Neel Chauhan freebsd_committer freebsd_triage 2021-03-05 19:42:32 UTC
Committed!
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-03-05 19:44:38 UTC
A commit references this bug:

Author: nc
Date: Fri Mar  5 19:44:32 UTC 2021
New revision: 567415
URL: https://svnweb.freebsd.org/changeset/ports/567415

Log:
  net-mgmt/snmptt: Fix upstream bug

  The code attempts to change from the executing user to a configured service
  user, but it does this by first changing effective, then real uid.

  It then briefly looks around curiously before falling flat on its face because
  the real uid change failed, the process not having root anymore at that point.

  PR:		253702
  Submitted by:	Christian Ullrich <chris AT chrullrich DOT net>
  Approved by:	nistor AT snickers DOT org

Changes:
  head/net-mgmt/snmptt/Makefile
  head/net-mgmt/snmptt/files/patch-snmptt