commit 044ee1a2b24c6095ff533d3c897decadcacbbe97
parent fcd946b3891268f4693ca807ff962bd750fb745f
Author: Raymond Li <hi@raymond.li>
Date: Wed, 25 Sep 2019 12:23:27 -0400
Revert i3@dcfcba3. See i3#231
Diffstat:
3 files changed, 2 insertions(+), 51 deletions(-)
diff --git a/Makefile.am b/Makefile.am
@@ -69,7 +69,3 @@ EXTRA_DIST = \
LICENSE \
README.md \
I3LOCK_VERSION
-
-# SUID the executable so it has permissions to lock TTY switching
-install-exec-hook:
- chmod +s $(DESTDIR)$(bindir)/i3lock$(EXEEXT)
diff --git a/i3lock.1 b/i3lock.1
@@ -29,7 +29,6 @@ i3lock-color \- improved screen locker
.RB [\|\-e\|]
.RB [\|\-f\|]
.RB [\|\-m\|]
-.RB [\|\-l\|]
.SH DESCRIPTION
.B i3lock-color
@@ -135,10 +134,6 @@ your computer with the enter key.
Show the number of failed attempts, if any.
.TP
-.B \-l, \-\-lock-console
-Lock the console to disable TTY switching (Linux only).
-
-.TP
.B \-\-debug
Enables debug logging.
Note, that this will log the password used for authentication to stdout.
diff --git a/i3lock.c b/i3lock.c
@@ -49,11 +49,6 @@
#endif
#include <xcb/xcb_aux.h>
#include <xcb/randr.h>
-#if defined(__linux__)
-#include <fcntl.h>
-#include <linux/vt.h>
-#include <sys/ioctl.h>
-#endif
#include "i3lock.h"
#include "xcb.h"
@@ -1486,7 +1481,6 @@ int main(int argc, char *argv[]) {
{"slideshow-interval", required_argument, NULL, 903},
{"slideshow-random-selection", no_argument, NULL, 904},
- {"lock-console", no_argument, NULL, 'l'},
{NULL, no_argument, NULL, 0}};
if ((pw = getpwuid(getuid())) == NULL)
@@ -1494,7 +1488,7 @@ int main(int argc, char *argv[]) {
if ((username = pw->pw_name) == NULL)
errx(EXIT_FAILURE, "pw->pw_name is NULL.");
- char *optstring = "hvnbdc:p:ui:teI:frsS:kB:ml";
+ char *optstring = "hvnbdc:p:ui:teI:frsS:kB:m";
char *arg = NULL;
int opt = 0;
while ((o = getopt_long(argc, argv, optstring, longopts, &longoptind)) != -1) {
@@ -1550,13 +1544,6 @@ int main(int argc, char *argv[]) {
case 'f':
show_failed_attempts = true;
break;
- case 'l':
- #if defined(__linux__)
- lock_tty_switching = true;
- #else
- errx(EXIT_FAILURE, "TTY switch locking is only supported on Linux.");
- #endif
- break;
case 'r':
if (internal_line_source != 0) {
errx(EXIT_FAILURE, "i3lock-color: Options line-uses-ring and line-uses-inside conflict.");
@@ -2037,7 +2024,7 @@ int main(int argc, char *argv[]) {
break;
default:
errx(EXIT_FAILURE, "Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-u] [-p win|default]"
- " [-i image.png] [-t] [-e] [-f] [-l]\n"
+ " [-i image.png] [-t] [-e] [-f]\n"
"Please see the manpage for a full list of arguments.");
}
}
@@ -2270,21 +2257,6 @@ int main(int argc, char *argv[]) {
if (main_loop == NULL)
errx(EXIT_FAILURE, "Could not initialize libev. Bad LIBEV_FLAGS?");
-#if defined(__linux__)
-
- /* Lock tty switching */
- if (lock_tty_switching) {
- if ((term = open("/dev/console", O_RDWR)) == -1) {
- perror("error locking TTY switching: opening console failed");
- }
-
- if (term != -1 && (ioctl(term, VT_LOCKSWITCH)) == -1) {
- perror("error locking TTY switching: locking console failed");
- }
- }
-
-#endif
-
/* Explicitly call the screen redraw in case "locking…" message was displayed */
auth_state = STATE_AUTH_IDLE;
redraw_screen();
@@ -2325,18 +2297,6 @@ int main(int argc, char *argv[]) {
return 0;
}
-#if defined(__linux__)
- /* Restore tty switching */
- if (lock_tty_switching) {
- if (term != -1 && (ioctl(term, VT_UNLOCKSWITCH)) == -1) {
- perror("error unlocking TTY switching: unlocking console failed");
- }
-
- close(term);
- }
-
-#endif
-
DEBUG("restoring focus to X11 window 0x%08x\n", stolen_focus);
xcb_ungrab_pointer(conn, XCB_CURRENT_TIME);
xcb_ungrab_keyboard(conn, XCB_CURRENT_TIME);