Bug 155788 - ports security/cfsd startup -- multiple problems
Summary: ports security/cfsd startup -- multiple problems
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: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-22 17:00 UTC by System Administrator
Modified: 2013-05-16 19:30 UTC (History)
0 users

See Also:


Attachments
file.diff (761 bytes, patch)
2011-03-22 17:00 UTC, System Administrator
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description System Administrator 2011-03-22 17:00:01 UTC
The cfsd port's startup file: /usr/local/etc/rc.d/cfsd has two
problems:

     -- [Serious] The mount command defaults to tcp mounts and tests
        ipv6 even though the cfs daemon only listens on ipv4 and udp.

     -- [Somewhat serious] It's missing the '# KEYWORD: shutdown'
        which causes it to generate a spurious error at startup time.

     -- [Minor] The startup script should allow the user to control
        the location of the cfsd-bootstrap directory.

Fix: The following patch set addresses all three issues.

Diff finished.  Tue Mar 22 12:52:12 2011





Diff finished.  Tue Mar 22 12:41:35 2011--686B9wBpDFG7QOhoHlP1FpegfEceQfgvpIcbRMMb71mtM6l9
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -c /usr/ports/security/cfs/files/cfsd.sh.in.orig /usr/ports/security/cfs/files/cfsd.sh.in
*** /usr/ports/security/cfs/files/cfsd.sh.in.orig	Fri Mar 26 20:14:40 2010
--- /usr/ports/security/cfs/files/cfsd.sh.in	Tue Mar 22 12:47:59 2011
***************
*** 5,10 ****
--- 5,11 ----
  
  # PROVIDE: cfsd
  # REQUIRE: mountd
+ # KEYWORD: shutdown
  
  #
  # Add the following line to /etc/rc.conf to enable cfsd:
***************
*** 15,20 ****
--- 16,22 ----
  #
  # cfsd_port="3049"		# the port to listen to
  # cfsd_mountpoint="/crypt"	# the CFS mountpoint
+ # cfsd_bootstrap="%%CFSD_BOOTSTRAP%%"
  #
  
  . /etc/rc.subr
***************
*** 29,35 ****
  cfsd_poststart()
  {
  	if [ -n "$cfsd_mountpoint" ]; then
! 		mount -o port="$cfsd_port",nfsv2 localhost:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
  	fi
  }
  
--- 31,37 ----
  cfsd_poststart()
  {
  	if [ -n "$cfsd_mountpoint" ]; then
! 		mount -o port="$cfsd_port",nfsv2,udp "127.0.0.1:$cfsd_bootstrap" "$cfsd_mountpoint"
  	fi
  }
  
***************
*** 44,51 ****
  : ${cfsd_enable="NO"}
  : ${cfsd_port="3049"}
  : ${cfsd_mountpoint="/crypt"}
  
  command_args="$cfsd_port >/dev/null 2>&1"
! required_dirs="%%CFSD_BOOTSTRAP%% $cfsd_mountpoint"
  
  run_rc_command "$1"
--- 46,54 ----
  : ${cfsd_enable="NO"}
  : ${cfsd_port="3049"}
  : ${cfsd_mountpoint="/crypt"}
+ : ${cfsd_bootstrap="%%CFSD_BOOTSTRAP%%"}
  
  command_args="$cfsd_port >/dev/null 2>&1"
! required_dirs="$cfsd_bootstrap $cfsd_mountpoint"
  
  run_rc_command "$1"
How-To-Repeat: 
Install the port, follow the "pkg_info -D -x cfsd" instructions and
try to start the daemon.
Comment 1 dfilter service freebsd_committer freebsd_triage 2011-09-04 17:57:45 UTC
crees       2011-09-04 16:57:30 UTC

  FreeBSD ports repository

  Modified files:
    security/cfs         Makefile 
  Log:
  Mark deprecated; broken for two years with no fix.
  
  Expires on 4/Nov
  
  PR:             ports/137378 ports/155788
  
  Revision  Changes    Path
  1.28      +4 -0      ports/security/cfs/Makefile
_______________________________________________
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 2 Rene Ladan freebsd_committer freebsd_triage 2011-10-05 00:18:12 UTC
State Changed
From-To: open->closed

Port expired and removed.
Comment 3 dfilter service freebsd_committer freebsd_triage 2013-05-16 19:22:16 UTC
Author: crees
Date: Thu May 16 18:22:08 2013
New Revision: 318325
URL: http://svnweb.freebsd.org/changeset/ports/318325

Log:
  Use explicit IP for localhost rather than DNS name; this causes ipv6 attempts
  
  PR:		ports/155788
  Submitted by:	System Administrator <root@naboo.vindaloo.com>
  
  Pass flag to mount to disable lockd
  
  PR:		ports/137378
  Submitted by:	kib

Modified:
  head/security/cfs/files/cfsd.in
  head/security/cfs/files/pkg-message.in

Modified: head/security/cfs/files/cfsd.in
==============================================================================
--- head/security/cfs/files/cfsd.in	Thu May 16 17:34:12 2013	(r318324)
+++ head/security/cfs/files/cfsd.in	Thu May 16 18:22:08 2013	(r318325)
@@ -4,6 +4,7 @@
 #
 # PROVIDE: cfsd
 # REQUIRE: mountd
+# KEYWORD: shutdown
 #
 # Add the following line to /etc/rc.conf to enable cfsd:
 #
@@ -22,7 +23,7 @@ rcvar=cfsd_enable
 
 load_rc_config $name
 
-: ${cfsd_enable=no}
+: ${cfsd_enable:=no}
 : ${cfsd_port=3049}
 : ${cfsd_mountpoint=/crypt}
 
@@ -35,7 +36,7 @@ stop_precmd=cfsd_prestop
 cfsd_poststart()
 {
 	if [ -n "$cfsd_mountpoint" ]; then
-		mount -o port="$cfsd_port",mntudp,nfsv2 localhost:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
+		mount -o port="$cfsd_port",udp,nfsv2,nolockd 127.0.0.1:%%CFSD_BOOTSTRAP%% "$cfsd_mountpoint"
 	fi
 }
 

Modified: head/security/cfs/files/pkg-message.in
==============================================================================
--- head/security/cfs/files/pkg-message.in	Thu May 16 17:34:12 2013	(r318324)
+++ head/security/cfs/files/pkg-message.in	Thu May 16 18:22:08 2013	(r318325)
@@ -3,7 +3,7 @@ Quick start instructions:
 
   - add the following entry to /etc/exports:
 
-    %%CFSD_BOOTSTRAP%% localhost
+    %%CFSD_BOOTSTRAP%% 127.0.0.1
 
   - create the default CFS mountpoint (if you want to use a different
     mountpoint, set the cfsd_mountpoint variable in /etc/rc.conf):
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"