diff options
author | marcus <marcus@FreeBSD.org> | 2009-06-01 04:00:18 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2009-06-01 04:00:18 +0800 |
commit | 8dbbe52bb416d8dc0f80ab3bee5c97e2d42caf8a (patch) | |
tree | 73890d2bb62cedcdd8ddce50a8110a9cda7db12e /x11 | |
parent | fe20ed0783c17a798e28411660606d8df45dbd2f (diff) | |
download | freebsd-ports-gnome-8dbbe52bb416d8dc0f80ab3bee5c97e2d42caf8a.tar.gz freebsd-ports-gnome-8dbbe52bb416d8dc0f80ab3bee5c97e2d42caf8a.tar.zst freebsd-ports-gnome-8dbbe52bb416d8dc0f80ab3bee5c97e2d42caf8a.zip |
* Fix hardcoded use of /usr/local.
* Re-add support for reading /etc/login.conf. [1]
PR: 133793 [1]
Submitted by: thomas [1]
Diffstat (limited to 'x11')
-rw-r--r-- | x11/gdm/Makefile | 4 | ||||
-rw-r--r-- | x11/gdm/files/patch-daemon_Makefile.in | 20 | ||||
-rw-r--r-- | x11/gdm/files/patch-daemon_gdm-session-worker.c | 62 |
3 files changed, 75 insertions, 11 deletions
diff --git a/x11/gdm/Makefile b/x11/gdm/Makefile index ba88d04917d5..6b3a6d205ea0 100644 --- a/x11/gdm/Makefile +++ b/x11/gdm/Makefile @@ -8,7 +8,7 @@ PORTNAME= gdm PORTVERSION= 2.26.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11 gnome MASTER_SITES= GNOME DIST_SUBDIR= gnome2 @@ -68,7 +68,7 @@ CONFIGURE_ARGS+= --disable-ipv6 post-patch: @${REINPLACE_CMD} -e 's|root:root|root:wheel|g' \ ${WRKSRC}/data/Makefile.in - @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \ ${WRKSRC}/daemon/gdm-session-worker.c \ ${WRKSRC}/data/gconf.path @${REINPLACE_CMD} -e 's|/bin/true|/usr/bin/true|g' \ diff --git a/x11/gdm/files/patch-daemon_Makefile.in b/x11/gdm/files/patch-daemon_Makefile.in index 9186a23e387f..137352970a91 100644 --- a/x11/gdm/files/patch-daemon_Makefile.in +++ b/x11/gdm/files/patch-daemon_Makefile.in @@ -1,10 +1,18 @@ ---- daemon/Makefile.in.orig 2007-11-02 20:54:53.000000000 -0400 -+++ daemon/Makefile.in 2007-11-02 20:55:08.000000000 -0400 -@@ -451,6 +451,7 @@ test_session_SOURCES = \ - - test_session_LDADD = \ +--- daemon/Makefile.in.orig 2009-05-31 15:51:18.000000000 -0400 ++++ daemon/Makefile.in 2009-05-31 15:56:32.000000000 -0400 +@@ -525,6 +525,7 @@ test_session_LDADD = \ + $(XLIB_LIBS) \ + $(EXTRA_DAEMON_LIBS) \ $(DAEMON_LIBS) \ + $(EXTRA_DAEMON_LIBS) \ $(PAM_LIBS) \ - $(top_builddir)/common/libgdmcommon.la \ $(NULL) + +@@ -660,6 +661,7 @@ gdm_session_worker_SOURCES = session-wor + gdm_session_worker_LDFLAGS = \ + $(XLIB_LIBS) \ + $(PAM_LIBS) \ ++ $(EXTRA_DAEMON_LIBS) \ + $(NULL) + + gdm_session_worker_LDADD = \ diff --git a/x11/gdm/files/patch-daemon_gdm-session-worker.c b/x11/gdm/files/patch-daemon_gdm-session-worker.c index 5f3a1b9ee2f0..0c56d5da4419 100644 --- a/x11/gdm/files/patch-daemon_gdm-session-worker.c +++ b/x11/gdm/files/patch-daemon_gdm-session-worker.c @@ -1,6 +1,16 @@ ---- daemon/gdm-session-worker.c.orig 2008-07-30 19:15:47.000000000 -0400 -+++ daemon/gdm-session-worker.c 2008-08-25 12:50:00.000000000 -0400 -@@ -332,7 +332,7 @@ gdm_session_execute (const char *file, +--- daemon/gdm-session-worker.c.orig 2009-04-14 10:01:14.000000000 -0400 ++++ daemon/gdm-session-worker.c 2009-05-31 15:52:10.000000000 -0400 +@@ -31,6 +31,9 @@ + #include <errno.h> + #include <grp.h> + #include <pwd.h> ++#ifdef HAVE_LOGINCAP ++#include <login_cap.h> ++#endif + + #include <security/pam_appl.h> + +@@ -332,7 +335,7 @@ gdm_session_execute (const char *file, * what to search if PATH is unset. POSIX may, dunno. */ @@ -9,3 +19,49 @@ } len = strlen (file) + 1; +@@ -1757,11 +1760,12 @@ gdm_session_worker_start_user_session (G + char **environment; + char *home_dir; + int fd; ++#ifdef HAVE_LOGINCAP ++ char *login = worker->priv->username; ++ struct passwd *pwent = getpwnam (login); ++#endif + +- if (setuid (worker->priv->uid) < 0) { +- g_debug ("GdmSessionWorker: could not reset uid - %s", g_strerror (errno)); +- _exit (1); +- } ++ /* Call setsid() before setusercontext() */ + + if (setsid () < 0) { + g_debug ("GdmSessionWorker: could not set pid '%u' as leader of new session and process group - %s", +@@ -1769,6 +1773,28 @@ gdm_session_worker_start_user_session (G + _exit (2); + } + ++#ifdef HAVE_LOGINCAP ++ if (setusercontext (NULL, pwent, pwent->pw_uid, ++ LOGIN_SETLOGIN | LOGIN_SETPATH | ++ LOGIN_SETPRIORITY | LOGIN_SETRESOURCES | ++ LOGIN_SETUMASK | LOGIN_SETUSER | ++ LOGIN_SETENV) < 0) { ++ g_debug ("%s: setusercontext () failed for %s. " ++ "Aborting.", "gdm_session_worker_start_user_session", ++ login ? login : "(null)"); ++ } ++ ++ /* Propagate PATH environment variable from user context to child processes */ ++ ++ gdm_session_worker_set_environment_variable (worker, "PATH", getenv ("PATH")); ++ ++#else ++ if (setuid (worker->priv->uid) < 0) { ++ g_debug ("GdmSessionWorker: could not reset uid - %s", g_strerror (errno)); ++ _exit (1); ++ } ++#endif ++ + environment = gdm_session_worker_get_environment (worker); + + g_assert (geteuid () == getuid ()); |