aboutsummaryrefslogtreecommitdiff
path: root/x11/gdm/files
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2013-03-19 10:40:22 +0000
committerKoop Mast <kwm@FreeBSD.org>2013-03-19 10:40:22 +0000
commit2a3357182d8cb640f374f8c60b71b6c99ec43843 (patch)
tree7a5f4c1c91d14d9fcab2b30589db732cde4a3725 /x11/gdm/files
parent92fdeef4740a0893f904a81b5150a5e3f5604b10 (diff)
downloadports-2a3357182d8cb640f374f8c60b71b6c99ec43843.tar.gz
ports-2a3357182d8cb640f374f8c60b71b6c99ec43843.zip
Notes
Diffstat (limited to 'x11/gdm/files')
-rw-r--r--x11/gdm/files/gdm.in29
-rw-r--r--x11/gdm/files/gdm.pam.in2
-rw-r--r--x11/gdm/files/patch-daemon_gdm-session-worker.c54
3 files changed, 18 insertions, 67 deletions
diff --git a/x11/gdm/files/gdm.in b/x11/gdm/files/gdm.in
index bdc726d08d88..9feb8801fe67 100644
--- a/x11/gdm/files/gdm.in
+++ b/x11/gdm/files/gdm.in
@@ -1,30 +1,26 @@
#!/bin/sh
-
# $FreeBSD$
-# $MCom: ports-stable/x11/gdm/files/gdm.in,v 1.5 2010/07/21 13:50:46 kwm Exp $
-#
+# $MCom: ports/x11/gdm/files/gdm.in,v 1.50 2012/01/15 18:18:36 kwm Exp $
+
# PROVIDE: gdm
# REQUIRE: LOGIN cleanvar moused syscons dbus
#
# Add the following to /etc/rc.conf to start GDM at boot time:
#
# gdm_enable="YES"
+#
. /etc/rc.subr
. %%GNOME_SUBR%%
-export PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin
-
-name="gdm"
-rcvar=gdm_enable
-
-load_rc_config ${name}
-
-gnome_enable=${gnome_enable:-NO}
gdm_enable=${gdm_enable-${gnome_enable}}
gdm_preserve_base_pam_conf=${gdm_preserve_base_pam_conf-NO}
gdm_lang=${gdm_lang-${LANG}}
+export PATH=/bin:/sbin:/usr/bin:/usr/sbin:%%LOCALBASE%%/bin:%%LOCALBASE%%/sbin
+
+name="gdm"
+rcvar=gdm_enable
command="%%PREFIX%%/sbin/${name}"
pidfile="/var/run/${name}.pid"
procname="%%PREFIX%%/sbin/gdm-binary"
@@ -32,14 +28,15 @@ start_cmd="gdm_start"
gdm_start()
{
- local iter
-
+ if ! checkyesno gdm_enable ; then
+ return 0
+ fi
echo "Starting ${name}."
# make sure there is no pam configuration for gdm service in base system
if ! checkyesno gdm_preserve_base_pam_conf && [ -f /etc/pam.d/gdm ]; then
cp -p /etc/pam.d/gdm /etc/pam.d/gdm_disabled
- unlink /etc/pam.d/gdm
+ rm -f /etc/pam.d/gdm
fi
( iter=0
@@ -52,9 +49,6 @@ gdm_start()
done
iter=0
while ! %%LOCALBASE%%/bin/lshal >/dev/null 2>&1 ; do
- if [ ! -x %%LOCALBASE%%/bin/lshal ]; then
- err 1 "%%LOCALBASE%%/bin/lshal is not installed"
- fi
if [ ${iter} -eq 60 ]; then
break
fi
@@ -64,4 +58,5 @@ gdm_start()
LANG=${gdm_lang} ${command} ${gdm_flags} ) &
}
+load_rc_config ${name}
run_rc_command "$1"
diff --git a/x11/gdm/files/gdm.pam.in b/x11/gdm/files/gdm.pam.in
index 52ad31672ad8..d6382bb34a69 100644
--- a/x11/gdm/files/gdm.pam.in
+++ b/x11/gdm/files/gdm.pam.in
@@ -1,6 +1,6 @@
#
# $FreeBSD$
-# $MCom: ports-stable/x11/gdm/files/gdm.pam.in,v 1.3 2010/07/21 13:50:46 kwm Exp $
+# $MCom: ports/x11/gdm/files/gdm.pam.in,v 1.17 2011/06/02 11:58:24 kwm Exp $
#
# PAM configuration for the "gdm" service
#
diff --git a/x11/gdm/files/patch-daemon_gdm-session-worker.c b/x11/gdm/files/patch-daemon_gdm-session-worker.c
index 31baf67050ed..a15c91658554 100644
--- a/x11/gdm/files/patch-daemon_gdm-session-worker.c
+++ b/x11/gdm/files/patch-daemon_gdm-session-worker.c
@@ -1,5 +1,5 @@
---- daemon/gdm-session-worker.c.orig 2010-08-11 13:40:07.000000000 -0400
-+++ daemon/gdm-session-worker.c 2011-08-13 23:37:04.000000000 -0400
+--- daemon/gdm-session-worker.c.orig 2011-06-02 09:50:17.000000000 -0500
++++ daemon/gdm-session-worker.c 2011-06-24 17:59:50.000000000 -0500
@@ -31,6 +31,9 @@
#include <errno.h>
#include <grp.h>
@@ -10,7 +10,7 @@
#ifdef HAVE_LOGINDEVPERM
#include <libdevinfo.h>
-@@ -341,7 +344,7 @@ gdm_session_execute (const char *file,
+@@ -341,7 +344,7 @@
* what to search if PATH is unset. POSIX may, dunno.
*/
@@ -19,50 +19,7 @@
}
len = strlen (file) + 1;
-@@ -1035,17 +1038,6 @@ gdm_cache_copy_file (GdmSessionWorker *w
- error->message);
- g_error_free (error);
- } else {
-- int res;
--
-- res = chown (cachefilename,
-- worker->priv->uid,
-- worker->priv->gid);
-- if (res == -1) {
-- g_warning ("GdmSessionWorker: Error setting owner of cache file: %s",
-- g_strerror (errno));
-- }
--
-- g_chmod (cachefilename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
- g_debug ("Copy successful");
- }
-
-@@ -1183,7 +1175,23 @@ gdm_session_worker_uninitialize_pam (Gdm
- return;
-
- if (worker->priv->state >= GDM_SESSION_WORKER_STATE_SESSION_OPENED) {
-- gdm_session_worker_cache_userfiles (worker);
-+ pid_t pid;
-+
-+ pid = fork ();
-+
-+ if (pid == 0) {
-+ if (setuid (worker->priv->uid) < 0) {
-+ g_debug ("GdmSessionWorker: could not reset uid: %s", g_strerror (errno));
-+ _exit (1);
-+ }
-+
-+ gdm_session_worker_cache_userfiles (worker);
-+ _exit (0);
-+ }
-+
-+ if (pid > 0) {
-+ gdm_wait_on_pid (pid);
-+ }
- pam_close_session (worker->priv->pam_handle, 0);
- gdm_session_auditor_report_logout (worker->priv->auditor);
-
-@@ -2027,15 +2035,16 @@ gdm_session_worker_start_user_session (G
+@@ -2032,15 +2035,16 @@
char *cachedirname;
char *home_dir;
int fd;
@@ -83,7 +40,7 @@
if (setsid () < 0) {
g_debug ("GdmSessionWorker: could not set pid '%u' as leader of new session and process group - %s",
-@@ -2043,6 +2052,26 @@ gdm_session_worker_start_user_session (G
+@@ -2048,6 +2052,25 @@
_exit (2);
}
@@ -93,7 +50,6 @@
+ g_debug ("%s: setusercontext () failed for %s. "
+ "Aborting.", "gdm_session_worker_start_user_session",
+ login ? login : "(null)");
-+ _exit (1);
+ }
+
+ /* Propagate PATH environment variable from user context to child processes */