openbsd-ports/x11/xscreensaver/patches/patch-driver_setuid_c
ajacoutot b07103d717 - implement bsd_auth(3) authentication ; benefits:
* no need to run xscreensaver setuid root anymore
* you can use whatever passwd backend you configured in login.conf(5)
  (kerberos, ldap...) to unlock the screen and not just local passwd

Sent upstream.

feedback from millert@
"get it in" jasper@
2008-10-27 19:49:39 +00:00

26 lines
794 B
Plaintext

$OpenBSD: patch-driver_setuid_c,v 1.1 2008/10/27 19:49:39 ajacoutot Exp $
--- driver/setuid.c.orig Thu Feb 9 03:33:29 2006
+++ driver/setuid.c Sun Oct 26 13:48:27 2008
@@ -260,9 +260,21 @@ hack_uid (saver_info *si)
si->orig_uid = strdup (uid_gid_string (euid, egid));
+#ifdef BSD_AUTH
+# ifdef __OpenBSD__ /* needs to run setgid auth (11) */
+ if (uid != euid || egid != 11)
+ if (set_ids_by_number (uid, 11, &si->uid_message) != 0)
+ {
+ fprintf (stderr,
+ "Error: xscreensaver needs to be installed setgid \"auth\" under OpenBSD.\n");
+ saver_exit (si, 1, 0);
+ }
+# endif
+#else /* !BSD_AUTH */
if (uid != euid || gid != egid)
if (set_ids_by_number (uid, gid, &si->uid_message) != 0)
saver_exit (si, 1, 0);
+#endif
}