changeset 14053:c8bc47846d40

3808 sulogin should reset console to text mode Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Richard Lowe <richlowe@richlowe.net>
author Alexander Eremin <a.eremin@nexenta.com>
date Wed, 12 Jun 2013 16:09:30 -0500
parents 1a272fe1337b
children 0978afc523c5
files usr/src/cmd/sulogin/sulogin.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/sulogin/sulogin.c	Tue Jun 11 22:01:53 2013 -0800
+++ b/usr/src/cmd/sulogin/sulogin.c	Wed Jun 12 16:09:30 2013 -0500
@@ -18,6 +18,11 @@
  *
  * CDDL HEADER END
  */
+
+/*
+ * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
+ */
+
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -75,6 +80,7 @@
 #include <nss_dbdefs.h>
 #include <user_attr.h>
 #include <sys/vt.h>
+#include <sys/kd.h>
 
 /*
  * Intervals to sleep after failed login
@@ -442,7 +448,7 @@
 static void
 main_loop(char *devname, boolean_t cttyflag)
 {
-	int		fd, i;
+	int		fd, fb, i;
 	char		*user = NULL;		/* authorized user */
 	char		*pass;			/* password from user */
 	char		*cpass;			/* crypted password */
@@ -478,6 +484,12 @@
 	if (fd > 2)
 		(void) close(fd);
 
+	/* Stop progress bar and reset console mode to text */
+	if ((fb = open("/dev/fb", O_RDONLY)) >= 0) {
+		(void) ioctl(fb, KDSETMODE, KD_RESETTEXT);
+		(void) close(fb);
+	}
+
 	sysmsgfd = fopen("/dev/sysmsg", "w");
 
 	sanitize_tty(fileno(stdin));