summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2007-08-21 16:10:34 +0000
committerWilliam Jon McCann <mccann@src.gnome.org>2007-08-21 16:10:34 +0000
commitd826466c4231993bc40e430e3828e3cc0e3424e5 (patch)
treeac1b66bded36c49d84c215328c73989c20027de4
parent9d0888fedf2ee1ff59e5d47789b01d960c7e804c (diff)
downloadgdm-d826466c4231993bc40e430e3828e3cc0e3424e5.tar.gz
Some Solaris build fixes. Patch from Brian Cameron <brian.cameron@sun.com>
2007-08-21 William Jon McCann <mccann@jhu.edu> * acconfig.h: * acinclude.m4: * common/gdm-address.c: * configure.ac: * daemon/Makefile.am: * daemon/factory-slave-main.c: * daemon/gdm-server.c: (server_child_setup): * daemon/main.c: (main): * daemon/product-slave-main.c: * daemon/session-worker-main.c: * daemon/simple-slave-main.c: * daemon/test-session.c: (on_secret_info_query): Some Solaris build fixes. Patch from Brian Cameron <brian.cameron@sun.com> svn path=/branches/mccann-gobject/; revision=5174
-rw-r--r--ChangeLog17
-rw-r--r--acconfig.h1
-rw-r--r--acinclude.m4245
-rw-r--r--common/gdm-address.c4
-rw-r--r--configure.ac26
-rw-r--r--daemon/Makefile.am2
-rw-r--r--daemon/factory-slave-main.c1
-rw-r--r--daemon/gdm-server.c11
-rw-r--r--daemon/main.c5
-rw-r--r--daemon/product-slave-main.c1
-rw-r--r--daemon/session-worker-main.c1
-rw-r--r--daemon/simple-slave-main.c1
-rw-r--r--daemon/test-session.c4
13 files changed, 304 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d7dc90a..c40dc49a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2007-08-21 William Jon McCann <mccann@jhu.edu>
+
+ * acconfig.h:
+ * acinclude.m4:
+ * common/gdm-address.c:
+ * configure.ac:
+ * daemon/Makefile.am:
+ * daemon/factory-slave-main.c:
+ * daemon/gdm-server.c: (server_child_setup):
+ * daemon/main.c: (main):
+ * daemon/product-slave-main.c:
+ * daemon/session-worker-main.c:
+ * daemon/simple-slave-main.c:
+ * daemon/test-session.c: (on_secret_info_query):
+ Some Solaris build fixes.
+ Patch from Brian Cameron <brian.cameron@sun.com>
+
2007-08-03 William Jon McCann <mccann@jhu.edu>
* daemon/gdm-display-factory.c: (gdm_display_factory_start),
diff --git a/acconfig.h b/acconfig.h
index f892e850..591ca179 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -37,6 +37,7 @@
#undef HAVE_SYS_SOCKIO_H
#undef HAVE_TCPWRAPPERS
#undef HAVE_UNSETENV
+#undef HAVE_UT_SYSLEN
#undef HAVE_XINERAMA
#undef HAVE_XFREE_XINERAMA
#undef HAVE_XINPUT
diff --git a/acinclude.m4 b/acinclude.m4
index d6c9e330..970dbec2 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -41,3 +41,248 @@ AC_DEFUN([AS_AC_EXPAND],
prefix=$prefix_save
exec_prefix=$exec_prefix_save
])
+
+dnl Checks for availability of various utmp fields
+dnl
+dnl Original code by Bernhard Rosenkraenzer (bero@linux.net.eu.org), 1998.
+dnl Modifications by Timur Bakeyev (timur@gnu.org), 1999.
+dnl Patched from http://bugzilla.gnome.org/show_bug.cgi?id=937
+dnl
+
+dnl GDM_CHECK_UTMP()
+dnl Test for presence of the field and define HAVE_UT_UT_field macro
+dnl Taken from vte/gnome-pty-helper's GPH_CHECK_UTMP
+
+AC_DEFUN([GDM_CHECK_UTMP],[
+
+AC_CHECK_HEADERS(sys/time.h utmp.h utmpx.h)
+AC_HEADER_TIME
+
+if test "$ac_cv_header_utmpx_h" = "yes"; then
+ AC_DEFINE(UTMP,[struct utmpx],[Define to the name of a structure which holds utmp data.])
+else
+ AC_DEFINE(UTMP,[struct utmp],[Define to the name of a structure which holds utmp data.])
+fi
+
+dnl some systems (BSD4.4-like) require time.h to be included before utmp.h :/
+AC_MSG_CHECKING(for ut_host field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_host;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_HOST,1,[Define if your utmp struct contains a ut_host field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_pid field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; int i; i=ut.ut_pid;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_PID,1,[Define if your utmp struct contains a ut_pid field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_id field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_id;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_ID,1,[Define if your utmp struct contains a ut_id field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_name field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_name;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_NAME,1,[Define if your utmp struct contains a ut_name field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_type field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; int i; i=(int) ut.ut_type;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_TYPE,1,[Define if your utmp struct contains a ut_type field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_exit.e_termination field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_exit.e_termination=0;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_EXIT_E_TERMINATION,1,[Define if your utmp struct contains a ut_exit.e_termination field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_user field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; char *p; p=ut.ut_user;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_USER,1,[Define if your utmp struct contains a ut_user field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_time field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_time=0;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_TIME,1,[Define if your utmp struct contains a ut_time field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_tv field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_tv.tv_sec=0; ut.ut_tv.tv_usec=0; ],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_TV,1,[Define if your utmp struct contains a ut_tv field.])
+fi
+AC_MSG_RESULT($result)
+
+AC_MSG_CHECKING(for ut_syslen field in the utmp structure)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
+#ifdef HAVE_UTMPX_H
+#include <utmpx.h>
+#endif],[UTMP ut; ut.ut_syslen=0;],result=yes,result=no)
+if test "$result" = "yes"; then
+ AC_DEFINE(HAVE_UT_UT_SYSLEN,1,[Define if your utmp struct contains a ut_syslen field.])
+fi
+AC_MSG_RESULT($result)
+
+])
diff --git a/common/gdm-address.c b/common/gdm-address.c
index 36cbbf34..d376610a 100644
--- a/common/gdm-address.c
+++ b/common/gdm-address.c
@@ -26,6 +26,10 @@
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
+#ifdef HAS_SYS_SOCKET
+#include <sys/socket.h>
+#endif
+#include <netdb.h>
#ifndef G_OS_WIN32
#include <sys/socket.h>
diff --git a/configure.ac b/configure.ac
index 63242d40..f6cf91d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -245,6 +245,7 @@ dnl ## internationalization support
AM_GLIB_GNU_GETTEXT
EXTRA_DAEMON_LIBS=""
+EXTRA_SLAVE_LIBS=""
EXTRA_CHOOSER_LIBS=""
EXTRA_XNEST_LIBS=""
EXTRA_FLEXI_LIBS=""
@@ -255,6 +256,7 @@ EXTRA_GREETER_LIBS=""
AC_CHECK_FUNC(socket,,[
AC_CHECK_LIB(socket,socket, [
EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lsocket"
+ EXTRA_SLAVE_LIBS="$EXTRA_SLAVE_LIBS -lsocket"
EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lsocket"
EXTRA_XNEST_LIBS="$EXTRA_XNEST_LIBS -lsocket"
EXTRA_FLEXI_LIBS="$EXTRA_FLEXI_LIBS -lsocket"
@@ -263,6 +265,7 @@ AC_CHECK_FUNC(socket,,[
AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_LIB(nsl,gethostbyname, [
EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -lnsl"
+ EXTRA_SLAVE_LIBS="$EXTRA_SLAVE_LIBS -lnsl"
EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lnsl"])])
AC_CHECK_FUNC(sched_yield,[
AC_DEFINE(HAVE_SCHED_YIELD)],[
@@ -274,6 +277,20 @@ AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton, [
EXTRA_CHOOSER_LIBS="$EXTRA_CHOOSER_LIBS -lresolv"])])
+AC_MSG_CHECKING(if utmpx structure has ut_syslen field)
+AC_TRY_COMPILE([
+ #include <utmpx.h>],[
+ struct utmpx record;
+ record.ut_syslen = sizeof (record.ut_host);
+ ],
+ have_ut_syslen=yes,
+ have_ut_syslen=no
+ )
+if test x$have_ut_syslen = xyes; then
+ AC_DEFINE(HAVE_UT_SYSLEN)
+fi
+AC_MSG_RESULT($have_ut_syslen)
+
COMMON_GNOME_LIBS="libgdmcommon-ui.a"
AC_SUBST(COMMON_GNOME_LIBS)
@@ -441,6 +458,14 @@ AC_CHECK_HEADERS(sys/sockio.h, [
AC_CHECK_HEADERS(libgen.h, [
AC_DEFINE(HAVE_LIBGEN_H)])
+#
+# Check for utmp stuff
+#
+AC_CHECK_HEADERS(utmp.h utmpx.h libutil.h sys/param.h)
+AC_CHECK_FUNC(getutmpx updwtmpx)
+AC_CHECK_LIB(util,login)
+AC_CHECK_LIB(util,logout)
+GDM_CHECK_UTMP
#
# Xdmcp checking
@@ -940,6 +965,7 @@ AC_CHECK_LIB(secdb, chkauthattr, [
# Subst the extra libs
#
AC_SUBST(EXTRA_DAEMON_LIBS)
+AC_SUBST(EXTRA_SLAVE_LIBS)
AC_SUBST(EXTRA_CHOOSER_LIBS)
AC_SUBST(EXTRA_XNEST_LIBS)
AC_SUBST(EXTRA_FLEXI_LIBS)
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index c73c3e6a..cab6f0a9 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -113,6 +113,7 @@ gdm_simple_slave_SOURCES = \
$(NULL)
gdm_simple_slave_LDFLAGS = \
+ $(EXTRA_SLAVE_LIBS) \
$(PAM_LIBS) \
$(NULL)
@@ -191,6 +192,7 @@ gdm_product_slave_SOURCES = \
$(NULL)
gdm_product_slave_LDFLAGS = \
+ $(EXTRA_SLAVE_LIBS) \
$(PAM_LIBS) \
$(NULL)
diff --git a/daemon/factory-slave-main.c b/daemon/factory-slave-main.c
index 22b9b2c0..9f740d73 100644
--- a/daemon/factory-slave-main.c
+++ b/daemon/factory-slave-main.c
@@ -29,6 +29,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
+#include <locale.h>
#include <glib.h>
#include <glib/gi18n.h>
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
index 79874c71..72a3053a 100644
--- a/daemon/gdm-server.c
+++ b/daemon/gdm-server.c
@@ -31,6 +31,7 @@
#include <ctype.h>
#include <pwd.h>
#include <grp.h>
+#include <signal.h>
#include <glib.h>
#include <glib/gi18n.h>
@@ -461,16 +462,6 @@ server_child_setup (GdmServer *server)
setpgid (0, 0);
change_user (server);
-
-#if sun
- {
- /* Remove old communication pipe, if present */
- char old_pipe[MAXPATHLEN];
-
- sprintf (old_pipe, "%s/%d", SDTLOGIN_DIR, server->priv->display_name);
- g_unlink (old_pipe);
- }
-#endif
}
static void
diff --git a/daemon/main.c b/daemon/main.c
index c57ca172..1ef6c841 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -639,11 +639,6 @@ main (int argc,
g_chdir (AUTHDIR);
-#ifdef __sun
- g_unlink (SDTLOGIN_DIR);
- g_mkdir (SDTLOGIN_DIR, 0700);
-#endif
-
manager = gdm_manager_new ();
if (manager == NULL) {
diff --git a/daemon/product-slave-main.c b/daemon/product-slave-main.c
index 7cbd9602..0c626300 100644
--- a/daemon/product-slave-main.c
+++ b/daemon/product-slave-main.c
@@ -29,6 +29,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
+#include <locale.h>
#include <glib.h>
#include <glib/gi18n.h>
diff --git a/daemon/session-worker-main.c b/daemon/session-worker-main.c
index 2cb5671b..d435faa2 100644
--- a/daemon/session-worker-main.c
+++ b/daemon/session-worker-main.c
@@ -29,6 +29,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
+#include <locale.h>
#include <glib.h>
#include <glib/gi18n.h>
diff --git a/daemon/simple-slave-main.c b/daemon/simple-slave-main.c
index f3bf3a9e..34e79dd2 100644
--- a/daemon/simple-slave-main.c
+++ b/daemon/simple-slave-main.c
@@ -29,6 +29,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
+#include <locale.h>
#include <glib.h>
#include <glib/gi18n.h>
diff --git a/daemon/test-session.c b/daemon/test-session.c
index 6782aef0..29fca1b8 100644
--- a/daemon/test-session.c
+++ b/daemon/test-session.c
@@ -145,7 +145,11 @@ on_secret_info_query (GdmSession *session,
const char *query_text)
{
char answer[1024];
+#ifdef __sun
+ struct termios io_info;
+#else
struct termio io_info;
+#endif
g_print ("%s", query_text);