From owner-freebsd-bugs Thu Mar 8 1:22:45 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 948F037B719 for ; Thu, 8 Mar 2001 01:21:21 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f289LL857625; Thu, 8 Mar 2001 01:21:21 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A375B37B719 for ; Thu, 8 Mar 2001 01:12:56 -0800 (PST) (envelope-from nobody@FreeBSD.org) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f289Cus56989; Thu, 8 Mar 2001 01:12:56 -0800 (PST) (envelope-from nobody) Message-Id: <200103080912.f289Cus56989@freefall.freebsd.org> Date: Thu, 8 Mar 2001 01:12:56 -0800 (PST) From: davidx@viasoft.com.cn To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: kern/25605: sysctl for enable/disable ctrl+alt+del key Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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