Sync with what I'm about to commit upstream.

This commit is contained in:
ajacoutot 2011-11-30 11:13:47 +00:00
parent d01a9d9204
commit 0764d62851
6 changed files with 41 additions and 29 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.41 2011/11/04 09:56:29 jasper Exp $
# $OpenBSD: Makefile,v 1.42 2011/11/30 11:13:47 ajacoutot Exp $
COMMENT= screen saver and locker for GNOME
GNOME_PROJECT= gnome-screensaver
GNOME_VERSION= 3.2.0
REVISION= 3
REVISION= 4
# GPLv3
PERMIT_PACKAGE_CDROM= Yes

View File

@ -1,4 +1,4 @@
/* $OpenBSD: gs-auth-bsdauth.c,v 1.3 2011/09/12 07:28:54 jasper Exp $
/* $OpenBSD: gs-auth-bsdauth.c,v 1.4 2011/11/30 11:13:47 ajacoutot Exp $
* gs-auth-bsdauth.c --- verifying typed passwords with bsd_auth(3)
*
* Copyright (c) 1993-1998 Jamie Zawinski <jwz@jwz.org>
@ -84,11 +84,9 @@ gs_auth_verify_user (const char *username,
}
/* authenticate */
if (res = auth_userokay((char *)username, NULL, "auth-gnome-screensaver", password)) {
return TRUE;
} else {
return FALSE;
}
res = auth_userokay((char *)username, NULL, "auth-gnome-screensaver", password);
return res;
}
gboolean

View File

@ -1,6 +1,9 @@
$OpenBSD: patch-config_h_in,v 1.6 2011/09/12 07:28:54 jasper Exp $
$OpenBSD: patch-config_h_in,v 1.7 2011/11/30 11:13:47 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=651554
From d7ab99c00a01bea870cf51d855ecf320e0d23bac Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@openbsd.org>
Date: Wed, 30 Nov 2011 12:02:48 +0100
Subject: [PATCH] Implement OpenBSD authentication using bsd_auth(3).
--- config.h.in.orig Mon Apr 4 16:29:28 2011
+++ config.h.in Tue May 31 16:06:27 2011

View File

@ -1,6 +1,9 @@
$OpenBSD: patch-configure_ac,v 1.5 2011/09/12 07:28:54 jasper Exp $
$OpenBSD: patch-configure_ac,v 1.6 2011/11/30 11:13:47 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=651554
From d7ab99c00a01bea870cf51d855ecf320e0d23bac Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@openbsd.org>
Date: Wed, 30 Nov 2011 12:02:48 +0100
Subject: [PATCH] Implement OpenBSD authentication using bsd_auth(3).
--- configure.ac.orig Tue Sep 6 21:38:29 2011
+++ configure.ac Thu Sep 8 09:05:00 2011

View File

@ -1,6 +1,9 @@
$OpenBSD: patch-src_Makefile_am,v 1.3 2011/09/12 07:28:54 jasper Exp $
$OpenBSD: patch-src_Makefile_am,v 1.4 2011/11/30 11:13:47 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=651554
From d7ab99c00a01bea870cf51d855ecf320e0d23bac Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@openbsd.org>
Date: Wed, 30 Nov 2011 12:02:48 +0100
Subject: [PATCH] Implement OpenBSD authentication using bsd_auth(3).
--- src/Makefile.am.orig Tue Sep 6 21:33:55 2011
+++ src/Makefile.am Thu Sep 8 09:05:00 2011

View File

@ -1,32 +1,37 @@
$OpenBSD: patch-src_setuid_c,v 1.2 2011/09/12 07:28:54 jasper Exp $
$OpenBSD: patch-src_setuid_c,v 1.3 2011/11/30 11:13:47 ajacoutot Exp $
https://bugzilla.gnome.org/show_bug.cgi?id=651554
From d7ab99c00a01bea870cf51d855ecf320e0d23bac Mon Sep 17 00:00:00 2001
From: Antoine Jacoutot <ajacoutot@openbsd.org>
Date: Wed, 30 Nov 2011 12:02:48 +0100
Subject: [PATCH] Implement OpenBSD authentication using bsd_auth(3).
--- src/setuid.c.orig Wed Apr 30 04:30:08 2008
+++ src/setuid.c Fri May 15 12:15:54 2009
@@ -194,6 +194,21 @@ hack_uid (char **nolock_reason,
--- src/setuid.c.orig Tue Aug 16 15:36:39 2011
+++ src/setuid.c Wed Nov 30 11:57:22 2011
@@ -194,6 +194,23 @@ hack_uid (char **nolock_reason,
*orig_uid = uid_gid_string (euid, egid);
}
+#ifdef HAVE_BSDAUTH /* we need to setgid auth to run the bsd_auth(3) login_* helpers */
+ struct group *authg = getgrnam("auth");
+ if (!authg || !authg->gr_name || !*authg->gr_name) {
+ reason = ("no such group as \"auth\" for bsdauth.\n");
+ {
+ struct group *authg = getgrnam("auth");
+ if (!authg || !authg->gr_name || !*authg->gr_name) {
+ reason = g_strdup ("no such group as \"auth\" for bsdauth.");
+
+ ret = FALSE;
+ goto out;
+ ret = FALSE;
+ goto out;
+ }
+ if (! set_ids_by_number (uid, authg->gr_gid, uid_message)) {
+ reason = ("cannot setgid \"auth\" for bsdauth.");
+ if (! set_ids_by_number (uid, authg->gr_gid, uid_message)) {
+ reason = g_strdup ("cannot setgid \"auth\" for bsdauth.");
+
+ ret = FALSE;
+ goto out;
+ ret = FALSE;
+ goto out;
+ }
+ }
+#else /* !HAVE_BSDAUTH */
if (uid != euid || gid != egid) {
if (! set_ids_by_number (uid, gid, uid_message)) {
reason = g_strdup ("unable to discard privileges.");
@@ -202,6 +217,7 @@ hack_uid (char **nolock_reason,
@@ -202,6 +219,7 @@ hack_uid (char **nolock_reason,
goto out;
}
}