Bug 114952 - net-mgmt/net-snmp4 rc script starts snmpd without being enabled
Summary: net-mgmt/net-snmp4 rc script starts snmpd without being enabled
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Rong-En Fan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-27 04:00 UTC by Chris Cowart
Modified: 2007-07-27 13:00 UTC (History)
0 users

See Also:


Attachments
file.diff (1.89 KB, patch)
2007-07-27 04:00 UTC, Chris Cowart
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cowart 2007-07-27 04:00:02 UTC
I'm referring to the port Makefile with FreeBSD Id:
$FreeBSD: ports/net-mgmt/net-snmp4/Makefile,v 1.105 2007/06/21 06:59:36 rafan Exp $

Line 139 of the Makefile installs files/snmpd.sh.sample into /usr/local/etc/rc.d/snmpd.sh.

This is *not* a FreeBSD-style rc script. It simply switches on "$1" for the word start or stop and performs that action. It does *not* use /etc/rc.subr to determine whether snmpd has been enabled. 

As a result, snmpd will be started during boot on any machine where the port net-mgmt/net-snmp4 is installed. Some would consider this to be a security problem.

Fix: I've included a patch that creates a FreeBSD-style rc script in files and updates the port to install it.

Patch attached with submission follows:
Comment 1 Rong-En Fan freebsd_committer freebsd_triage 2007-07-27 12:43:31 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rafan

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2007-07-27 12:59:34 UTC
rafan       2007-07-27 11:59:29 UTC

  FreeBSD ports repository

  Modified files:
    net-mgmt/net-snmp4   Makefile pkg-plist 
  Added files:
    net-mgmt/net-snmp4/files snmpd.in 
  Removed files:
    net-mgmt/net-snmp4/files snmpd.sh.sample 
  Log:
  - Convert to rc.d style script
  - Bump PORTREVISION
  
  Note that I changed few places of the patch to match Porter's Handbook.
  
  PR:             ports/114952
  Submitted by:   Chris Cowart <ccowart at rescomp.berkeley.edu>
  
  Revision  Changes    Path
  1.106     +2 -6      ports/net-mgmt/net-snmp4/Makefile
  1.1       +26 -0     ports/net-mgmt/net-snmp4/files/snmpd.in (new)
  1.2       +0 -20     ports/net-mgmt/net-snmp4/files/snmpd.sh.sample (dead)
  1.24      +0 -1      ports/net-mgmt/net-snmp4/pkg-plist
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Rong-En Fan freebsd_committer freebsd_triage 2007-07-27 12:59:41 UTC
State Changed
From-To: open->closed

Committed with changes. Thanks.