Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 121785

Summary: [PATCH] GNU/kFreeBSD version of /etc/securetty
Product: Gentoo/Alt Reporter: Robert Millan <rmh>
Component: OtherAssignee: Gentoo/BSD Team <bsd+disabled>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: GNU/kFreeBSD   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 539508    
Bug Blocks:    

Description Robert Millan 2006-02-05 23:01:18 UTC
This patch implements handling of multiple /etc/securetty, and adds a version for GNU/kFreeBSD.

Note: after appliing, you need to rename files/securetty to files/securetty.linux.

diff -Nur shadow.old/securetty.kfreebsd shadow/securetty.kfreebsd
--- shadow.old/securetty.kfreebsd	1970-01-01 01:00:00.000000000 +0100
+++ shadow/securetty.kfreebsd	2006-02-06 07:57:43.000000000 +0100
@@ -0,0 +1,18 @@
+# /etc/securetty: list of terminals on which root is allowed to login.
+# See securetty(5) and login(1).
+ttyv0
+ttyv1
+ttyv2
+ttyv3
+ttyv4
+ttyv5
+ttyv6
+ttyv7
+ttyva
+ttyvb
+ttyvc
+ttyvd
+ttyve
+ttyvf
+
+cuaa0
--- shadow-4.0.14-r1.ebuild.old	2006-02-06 07:09:29 +0000
+++ shadow-4.0.14-r1.ebuild	2006-02-06 07:39:14 +0000
@@ -72,6 +72,13 @@
 
 	elibtoolize
 	epunt_cxx
+
+	case ${CHOST} in
+	  *-*-linux*)		suffix="linux" ;;
+	  *-*-kfreebsd*)	suffix="kfreebsd" ;;
+	esac
+        cd "${WORKDIR}"
+        cp "${FILESDIR}"/securetty.${suffix} securetty || die "cp securetty"
 }
 
 src_compile() {
@@ -122,7 +129,7 @@
 	insinto /etc
 	# Using a securetty with devfs device names added
 	# (compat names kept for non-devfs compatibility)
-	insopts -m0600 ; doins "${FILESDIR}"/securetty
+	insopts -m0600 ; doins "${WORKDIR}"/securetty
 	use pam || { insopts -m0600 ; doins etc/login.access ; }
 	use pam || { insopts -m0600 ; doins etc/limits ; }
 	# Output arch-specific cruft
Comment 1 Naohiro Aota gentoo-dev 2011-07-22 11:38:30 UTC
It's been quite long since you filled this bug, so I don't know you still need this patch or not ... but what's the intension of this patch? Gentoo/FreeBSD doesn't use /etc/securetty and I don't think it's necessary on Gentoo/Prefix FreeBSD
Comment 2 SpanKY gentoo-dev 2015-02-14 05:40:59 UTC
we've disabled securetty by default now in shadow.  it's up to users to create & manage the file themselves when they actually want it.