Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2001 01:12:56 -0800 (PST)
From:      davidx@viasoft.com.cn
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/25605: sysctl for enable/disable ctrl+alt+del key
Message-ID:  <200103080912.f289Cus56989@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         25605
>Category:       kern
>Synopsis:       sysctl for enable/disable ctrl+alt+del key
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 08 01:20:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Xu
>Release:        FreeBSD 4.3-BETA
>Organization:
Viasoft
>Environment:
FreeBSD davidbsd.viasoft.com.cn 4.3-BETA FreeBSD 4.3-BETA #14: Thu Mar  8 16:58:
10 CST 2001     root@davidbsd.viasoft.com.cn:/usr/src/sys/compile/xu  i386
>Description:
FreeBSD does not let me dynamically enable/disable ctrl+alt+del key.
It forces me to re-config and re-compile kernel.
I think we must make life easy. the following patch will let root user 
turn ctrl+alt+del on/off.

davidbsd# sysctl -w machdep.disable_halt_key=1
machdep.disable_halt_key: 0 -> 1
davidbsd#

after turn machdep.disable_halt_key to 1, press ctrl+alt+del can not reboot machine.

>How-To-Repeat:

>Fix:
patch for /sys/dev/syscons/syscons.c

--- syscons.c.orig	Thu Mar  8 16:29:37 2001
+++ syscons.c	Thu Mar  8 16:57:52 2001
@@ -118,6 +118,10 @@
 SYSCTL_INT(_machdep, OID_AUTO, enable_panic_key, CTLFLAG_RW, &enable_panic_key,
 	   0, "");
 
+static	int		disable_halt_key;
+SYSCTL_INT(_machdep, OID_AUTO, disable_halt_key, CTLFLAG_RW, &disable_halt_key,
+	   0, "");
+       
 #define SC_CONSOLECTL	255
 
 #define VIRTUAL_TTY(sc, x) (SC_DEV((sc), (x))->si_tty)
@@ -3100,21 +3104,18 @@
 		break;
 
 	    case RBT:
-#ifndef SC_DISABLE_REBOOT
-		shutdown_nice(0);
-#endif
+	    if (!disable_halt_key)
+			shutdown_nice(0);
 		break;
 
 	    case HALT:
-#ifndef SC_DISABLE_REBOOT
-		shutdown_nice(RB_HALT);
-#endif
+	    if (!disable_halt_key)
+			shutdown_nice(RB_HALT);
 		break;
 
 	    case PDWN:
-#ifndef SC_DISABLE_REBOOT
-		shutdown_nice(RB_HALT|RB_POWEROFF);
-#endif
+	    if (!disable_halt_key)
+			shutdown_nice(RB_HALT|RB_POWEROFF);
 		break;
 
 #if NAPM > 0
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103080912.f289Cus56989>