TakeConsole 605 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. # Reassign ownership of the console to root, this should disallow
  3. # assignment of console output to any random users's xterm
  4. # $OpenBSD: TakeConsole.in,v 1.1 2021/08/30 15:38:27 matthieu Exp $
  5. #
  6. prefix="/usr/X11R6"
  7. exec_prefix="${prefix}"
  8. chown root /dev/console
  9. chmod 622 /dev/console
  10. if [ -c /dev/drm0 ]; then
  11. chown root /dev/drm0
  12. fi
  13. if [ -c /dev/drmR128 ]; then
  14. chown root /dev/drmR128
  15. fi
  16. if [ -c /dev/dri/card0 ]; then
  17. chown root /dev/dri/card0
  18. fi
  19. if [ -c /dev/dri/renderD128 ]; then
  20. chown root /dev/dri/renderD128
  21. fi
  22. ${exec_prefix}/bin/sessreg -d -l $DISPLAY -u none $USER