diff -crN ./gdm/config/PostSession.in /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/PostSession.in
*** ./gdm/config/PostSession.in	Fri Jul 18 23:10:01 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/PostSession.in	Fri Mar  5 20:23:46 2004
***************
*** 1,9 ****
  #!/bin/sh
  
! PATH=@X_PATH@:$PATH:/bin:/usr/bin
  
! SESSREG=`which sessreg 2>/dev/null`
  if [ x$SESSREG != x ] ; then
! 	$SESSREG -d -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l $DISPLAY $USER
  fi
  exit 0
--- 1,14 ----
  #!/bin/sh
  
! # sessreg is installed in /usr/lib/X11/xdm on AIX
! PATH=/usr/lib/X11/xdm:@X_PATH@:$PATH:/bin:/usr/bin
  
! PORT=`echo $DISPLAY | /usr/bin/sed "s/\./_/g" | /usr/bin/sed "s/:/_/g" | /usr/bin/cut -c1-8`
! 
! # AIX which is not suitable for Linux/Gnome/gdm  - use ksh whence builtin
! SESSREG=`whence sessreg 2>/dev/null`
  if [ x$SESSREG != x ] ; then
! 	# use same strategy as /usr/lib/X11/xdm/TakeConsole
! 	$SESSREG -d -l gdm/$PORT $USER
  fi
  exit 0
diff -crN ./gdm/config/PreSession.in /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/PreSession.in
*** ./gdm/config/PreSession.in	Fri Jul 18 23:10:01 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/PreSession.in	Fri Mar  5 20:23:28 2004
***************
*** 6,29 ****
  #
  # Note that output goes into the .xsession-errors file for easy debugging
  #
! PATH=@X_PATH@:$PATH:/bin:/usr/bin
  
! XSETROOT=`which xsetroot 2>/dev/null`
  if [ x$XSETROOT != x ] ; then
  	$XSETROOT -cursor_name left_ptr -solid "#363047"
  fi
  
  
- SESSREG=`which sessreg 2>/dev/null`
- if [ x$SESSREG != x ] ; then
- 	# some output for easy debugging
- 	echo "$0: Registering your session with wtmp and utmp"
- 	echo "$0: running: $SESSREG -a -w /var/log/wtmp -u /var/run/utmp -x \"$X_SERVERS\" -h \"$REMOTE_HOST\" -l $DISPLAY $USER"
  
! 	exec $SESSREG -a -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l $DISPLAY $USER
! 	# this is not reached
! fi
  
  # some output for easy debugging
  echo "$0: could not find the sessreg utility, cannot update wtmp and utmp"
  exit 0
--- 6,57 ----
  #
  # Note that output goes into the .xsession-errors file for easy debugging
  #
! # sessreg is installed in /usr/lib/X11/xdm on AIX
! PATH=/usr/lib/X11/xdm:@X_PATH@:$PATH:/bin:/usr/bin
  
! # AIX which is not suitable for Linux/Gnome/gdm  - use ksh whence builtin
! XSETROOT=`whence xsetroot 2>/dev/null`
  if [ x$XSETROOT != x ] ; then
  	$XSETROOT -cursor_name left_ptr -solid "#363047"
  fi
  
+ # use same strategy as /usr/lib/X11/xdm/GiveConsole
+ PORT=`echo $DISPLAY | /usr/bin/sed "s/\./_/g" | /usr/bin/sed "s/:/_/g" | /usr/bin/cut -c1-8`
  
  
! # AIX which is not suitable for Linux/Gnome/gdm  - use ksh whence builtin
! SESSREG=`whence sessreg 2>/dev/null`
  
+ if [ x$SESSREG = x ] ; then
  # some output for easy debugging
  echo "$0: could not find the sessreg utility, cannot update wtmp and utmp"
  exit 0
+ fi
+ 
+ 
+ if [ -n "$PORT" ]; then
+     # Create a fake device for the gdm login port.
+     # This makes finger happy.
+     if [ ! -d /dev/gdm ]; then
+         /usr/bin/mkdir /dev/gdm
+         /usr/bin/chmod 755 /dev/gdm
+     fi
+     if [ -f /dev/gdm/$PORT ]; then
+         /usr/bin/rm /dev/gdm/$PORT
+     fi
+     /usr/bin/touch /dev/gdm/$PORT
+     /usr/bin/chmod 644 /dev/gdm/$PORT
+ 
+     # Extract the hostname (if present) from the DISPLAY name.
+     HOST=`echo $DISPLAY | /usr/bin/cut -d":" -f1`
+ 
+     # Use sessreg to add the /etc/utmp and /usr/adm/wtmp entries
+     # for this login session.
+     # use same strategy as /usr/lib/X11/xdm/TakeConsole
+     if [ -n "$HOST" ]; then
+         $SESSREG -a -l gdm/$PORT -h $HOST $USER
+     else
+         $SESSREG -a -l gdm/$PORT $USER
+     fi
+ fi
+ 
diff -crN ./gdm/config/Xsession.in /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/Xsession.in
*** ./gdm/config/Xsession.in	Mon Aug 18 19:31:08 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/Xsession.in	Fri Mar  5 19:58:03 2004
***************
*** 51,57 ****
    fi
  }
  
! zenity=`which zenity 2>/dev/null`
  
  command="$1"
  
--- 51,58 ----
    fi
  }
  
! # AIX which is not suitable for Linux/Gnome/gdm  - use ksh whence builtin
! zenity=`whence zenity 2>/dev/null`
  
  command="$1"
  
***************
*** 72,78 ****
  # works for ALL sessions (except ones named 'Failsafe')
  
  # clean up after xbanner
! freetemp=`which freetemp 2>/dev/null`
  if [ -n "$freetemp" ] ; then
  	$freetemp
  fi
--- 73,80 ----
  # works for ALL sessions (except ones named 'Failsafe')
  
  # clean up after xbanner
! # AIX which is not suitable for Linux/Gnome/gdm  - use ksh whence builtin
! freetemp=`whence freetemp 2>/dev/null`
  if [ -n "$freetemp" ] ; then
  	$freetemp
  fi
***************
*** 207,213 ****
  fi
  
  # add ssh-agent if found
! sshagent=`which ssh-agent 2>/dev/null`
  if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
      command="$sshagent -- $command"
  elif [ -z "$sshagent" ] ; then
--- 209,216 ----
  fi
  
  # add ssh-agent if found
! # AIX which is not suitable for Linux/Gnome/gdm  - use ksh whence builtin
! sshagent=`whence ssh-agent 2>/dev/null`
  if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then
      command="$sshagent -- $command"
  elif [ -z "$sshagent" ] ; then
diff -crN ./gdm/config/gdm.conf.in /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/gdm.conf.in
*** ./gdm/config/gdm.conf.in	Wed Aug 20 19:40:45 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/config/gdm.conf.in	Thu Feb 19 15:26:59 2004
***************
*** 154,160 ****
  # Note: Anytime we find a -query or -indirect on the command line we do
  # not add a "-nolisten tcp", as then the query just wouldn't work, so
  # this setting only affects truly local sessions.
! #DisallowTCP=true
  
  # XDMCP is the protocol that allows remote login.  If you want to log into
  # gdm remotely (I'd never turn this on on open network, use ssh for such
--- 154,160 ----
  # Note: Anytime we find a -query or -indirect on the command line we do
  # not add a "-nolisten tcp", as then the query just wouldn't work, so
  # this setting only affects truly local sessions.
! DisallowTCP=@DISALLOW_TCP@
  
  # XDMCP is the protocol that allows remote login.  If you want to log into
  # gdm remotely (I'd never turn this on on open network, use ssh for such
***************
*** 167,173 ****
  # allow local access is another alternative but not the safest.
  # Firewalling port 177 is the safest if you wish to have xdmcp on.
  # Read the manual for more notes on the security of XDMCP.
! Enable=false
  # Honour indirect queries, we run a chooser for these, and then redirect
  # the user to the chosen host.  Otherwise we just log the user in locally.
  HonorIndirect=true
--- 167,173 ----
  # allow local access is another alternative but not the safest.
  # Firewalling port 177 is the safest if you wish to have xdmcp on.
  # Read the manual for more notes on the security of XDMCP.
! Enable=true
  # Honour indirect queries, we run a chooser for these, and then redirect
  # the user to the chosen host.  Otherwise we just log the user in locally.
  HonorIndirect=true
***************
*** 349,355 ****
  # Definition of the standard X server.
  [server-Standard]
  name=Standard server
! command=@X_SERVER@
  flexible=true
  
  # To use this server type you should add -query host or -indirect host
--- 349,355 ----
  # Definition of the standard X server.
  [server-Standard]
  name=Standard server
! command=@X_SERVER@ @X_NEEDED_ARGS@
  flexible=true
  
  # To use this server type you should add -query host or -indirect host
diff -crN ./gdm/configure.in /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/configure.in
*** ./gdm/configure.in	Wed Aug 27 02:12:55 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/configure.in	Mon Mar  1 14:58:47 2004
***************
*** 103,114 ****
  AM_PROG_LIBTOOL
  
  AC_PATH_XTRA
! AC_CHECK_TYPE(socklen_t,size_t)
! AC_CHECK_FUNCS([setresuid setenv unsetenv clearenv])
  
  GNOME_COMPILE_WARNINGS
  CFLAGS="$CFLAGS $WARN_CFLAGS"
  
  PKG_CHECK_MODULES(DAEMON, gtk+-2.0 >= $GTK_REQUIRED)
  AC_SUBST(DAEMON_CFLAGS)
  AC_SUBST(DAEMON_LIBS)
--- 103,120 ----
  AM_PROG_LIBTOOL
  
  AC_PATH_XTRA
! AC_CHECK_TYPE(socklen_t,size_t,sys/types.h sys/socket.h)
! AC_CHECK_FUNCS([setresuid setenv unsetenv clearenv getusershell])
  
  GNOME_COMPILE_WARNINGS
  CFLAGS="$CFLAGS $WARN_CFLAGS"
  
+ AC_CHECK_LIB(popt, poptGetArg, POPT_LIBS=-lpopt,
+         [AC_CHECK_HEADER(popt.h, , AC_MSG_ERROR([[
+ *** Couldn't find popt. Please download and install from
+ *** ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/ and try again.]]))])
+ AC_SUBST(POPT_LIBS)
+ 
  PKG_CHECK_MODULES(DAEMON, gtk+-2.0 >= $GTK_REQUIRED)
  AC_SUBST(DAEMON_CFLAGS)
  AC_SUBST(DAEMON_LIBS)
***************
*** 236,245 ****
--- 242,301 ----
    	fi
    fi
  
+   # Check How to handle authentication with the functions 'loginrestrictions',
+   # 'passwdexpired', 'chpass', 'setpwdb', 'getuserpw', 'putuserpw' and 'endpwdb'
+   AC_CHECK_FUNCS(loginrestrictions)
+   can_clear_admchg_flag=yes
+   AC_CHECK_FUNCS([passwdexpired chpass setpwdb getuserpw putuserpw endpwdb],
+   		  ,can_clear_admchg_flag=no)
+   if test x$can_clear_admchg_flag = xyes ; then
+     AC_COMPILE_IFELSE([
+       #if !defined(S_READ) || !defined(S_WRITE) || !defined(PW_ADMCHG)
+       choke me
+       #endif
+       ],
+       ,[AC_CHECK_HEADERS(
+ 	usersec.h
+ 	,[AC_COMPILE_IFELSE([
+ 	  #include <usersec.h>
+ 	  #if !defined(S_READ) || !defined(S_WRITE) || !defined(PW_ADMCHG)
+ 	  choke me
+ 	  #endif
+ 	  ],
+ 	  ,
+ 	  can_clear_admchg_flag=no
+ 	)]
+ 	,can_clear_admchg_flag=no
+       )]
+     )
+   fi
+   if test x$can_clear_admchg_flag = xyes ; then
+     AC_DEFINE(CAN_CLEAR_ADMCHG,,[Define this variable if the code to clear
+     	      the ADMCHG flag can be compiled])
+   fi
  fi
  
  AC_SUBST(VRFY)
  
+ dnl Check if we can use the setpenv function to add specialvariable
+ dnl to the environment (such as the /etc/environment file under AIX)
+ AC_LINK_IFELSE([
+ 	AC_LANG_PROGRAM([[
+ 		#ifdef HAVE_USERSEC_H
+ 		#include <usersec.h>
+ 		#endif
+ 		]],[[
+ 		return (setpenv(NULL, (PENV_INIT | PENV_NOEXEC), NULL, NULL));
+ 		]])],
+ 	can_use_setpenv=yes,
+ 	can_use_setpenv=no)
+ 
+ if test x$can_use_setpenv = xyes ; then
+ 	AC_DEFINE(CAN_USE_SETPENV,,[Define this variable if the code to use
+ 		the setpenv function can be compiled and used])
+ fi
+ 
+ 
  #
  # Can we use BSD's setusercontext
  #
***************
*** 448,453 ****
--- 504,535 ----
  AC_SUBST(EXTRA_CHOOSER_LIBS)
  
  #
+ # X11 specific flags (not XFree86)
+ #
+ 
+ AC_MSG_CHECKING([parameters to pass to the X server])
+ case "$host_os" in
+    aix*)
+       DISALLOW_TCP="false"
+       AC_SUBST(DISALLOW_TCP)
+       X_NEEDED_ARGS="-force -T # +kb +accessx"
+       AC_SUBST(X_NEEDED_ARGS, [$X_NEEDED_ARGS])
+       AC_MSG_RESULT([AIX: $X_NEEDED_ARGS])
+       AC_MSG_WARN([
+ Specific arguments for AIX X server: 
+   -force = Start X server from standard tty (not a LFT, hidden option),
+   -T     = Disable Ctrl-Alt-Backspace to kill X
+ Uncomment followings if needed (Accessibility features)
+   +kb    = XKb extension
+   +accessx = accessX extension])
+       ;;
+    *)
+       DISALLOW_TCP="false"
+       AC_SUBST(DISALLOW_TCP)
+       AC_MSG_RESULT([None])
+ esac
+ 
+ #
  # Configuration file foo, we need to get expanded versions of a bunch of things
  # if you actually know how to code shell then fix this :-) 
  # Stolen mostly from GConf
diff -crN ./gdm/daemon/Makefile.am /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/Makefile.am
*** ./gdm/daemon/Makefile.am	Fri Jul 11 01:36:05 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/Makefile.am	Mon Nov 24 14:24:53 2003
***************
*** 68,76 ****
  	-lXau					\
  	-lX11					\
  	-lXext					\
- 	-lpopt					\
  	$(XINERAMA_LIBS)			\
  	$(INTLLIBS)				\
  	-L$(top_builddir)/vicious-extensions	\
  	-lvicious
  
--- 68,76 ----
  	-lXau					\
  	-lX11					\
  	-lXext					\
  	$(XINERAMA_LIBS)			\
  	$(INTLLIBS)				\
+ 	$(POPT_LIBS)				\
  	-L$(top_builddir)/vicious-extensions	\
  	-lvicious
  
diff -crN ./gdm/daemon/gdm.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/gdm.c
*** ./gdm/daemon/gdm.c	Sat Aug 23 00:52:42 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/gdm.c	Mon Nov 24 14:38:25 2003
***************
*** 764,769 ****
--- 764,770 ----
  		      GdmServAuthDir, gdm_root_user (), GdmGroup);
      }
  
+     statbuf.st_mode &= 0xFFFF;
      if G_UNLIKELY (statbuf.st_mode != (S_IFDIR|S_IRWXU|S_IRWXG|S_ISVTX))  {
  	    char *s = g_strdup_printf
  		    (_("Server Authorization directory "
***************
*** 2923,2929 ****
  	display->socket_conn = conn;
  	display->xnest_disp = g_strdup (xnest_disp);
  	display->xnest_auth_file = g_strdup (xnest_auth_file);
! 	gdm_connection_set_close_notify (conn, display, close_conn);
  	displays = g_slist_append (displays, display);
  	if ( ! gdm_display_manage (display)) {
  		gdm_display_unmanage (display);
--- 2924,2930 ----
  	display->socket_conn = conn;
  	display->xnest_disp = g_strdup (xnest_disp);
  	display->xnest_auth_file = g_strdup (xnest_auth_file);
! 	gdm_connection_set_close_notify (conn, display, (void*)close_conn);
  	displays = g_slist_append (displays, display);
  	if ( ! gdm_display_manage (display)) {
  		gdm_display_unmanage (display);
diff -crN ./gdm/daemon/misc.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/misc.c
*** ./gdm/daemon/misc.c	Sat Aug 23 00:49:50 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/misc.c	Thu Oct 16 17:22:49 2003
***************
*** 238,248 ****
--- 238,254 ----
  		char *env = environ[i];
  		if (strncmp (env, "LC_", 3) == 0 ||
  		    strncmp (env, "LANG", 4) == 0 ||
+ 		    strncmp (env, "TZ", 3) == 0 ||
  		    strncmp (env, "LINGUAS", 7) == 0)
  			envs = g_list_prepend (envs, g_strdup (env));
+ 		/* linux specific */
  		if (preserve_ld_vars &&
  		    strncmp (env, "LD_", 3) == 0)
  			envs = g_list_prepend (envs, g_strdup (env));
+ 		/* aix specific */
+ 		if (preserve_ld_vars &&
+ 		    strcmp (env, "LIBPATH") == 0)
+ 			envs = g_list_prepend (envs, g_strdup (env));
  	}
  
  	ve_clearenv ();
***************
*** 268,273 ****
--- 274,283 ----
  		if (preserve_ld_vars &&
  		    strncmp (env, "LD_", 3) == 0)
  			envs = g_list_prepend (envs, g_strdup (env));
+ 		/* aix specific */
+ 		if (preserve_ld_vars &&
+ 		    strcmp (env, "LIBPATH") == 0)
+ 			envs = g_list_prepend (envs, g_strdup (env));
  	}
  
  	ve_clearenv ();
diff -crN ./gdm/daemon/slave.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/slave.c
*** ./gdm/daemon/slave.c	Fri Aug 29 20:03:10 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/slave.c	Mon Mar  1 14:59:56 2004
***************
*** 49,54 ****
--- 49,59 ----
  #elif HAVE_SOLARIS_XINERAMA
  #include <X11/extensions/xinerama.h>
  #endif
+ 
+ #if defined(CAN_USE_SETPENV) && defined(HAVE_USERSEC_H)
+ #include <usersec.h>
+ #endif
+ 
  #include <signal.h>
  #include <pwd.h>
  #include <grp.h>
***************
*** 2972,2977 ****
--- 2977,2987 ----
  	VeConfig *dmrc = NULL;
  	char *argv[4];
  
+ #ifdef CAN_USE_SETPENV
+ 	extern char **newenv;
+ 	int i;
+ #endif
+ 
  	gdm_unset_signals ();
  	if G_UNLIKELY (setsid() < 0)
  		/* should never happen */
***************
*** 3262,3267 ****
--- 3272,3292 ----
  		_exit (66);
  	}
  
+ #ifdef CAN_USE_SETPENV
+ 	/* Call the function setpenv which instanciates the extern variable "newenv" */
+ 	setpenv (login, (PENV_INIT | PENV_NOEXEC), NULL, NULL);
+ 	
+ 	/* Add the content of the "newenv" variable to the environment */
+ 	for (i=0; newenv[i] != NULL; i++) {
+ 		char *env_str = newenv[i];
+ 		/* Replace the '=' character with a '\0' character */
+ 		char *p = strchr (env_str, '=');
+ 		*p = '\0';
+ 		/* Add the variable to the env */
+ 		ve_setenv (env_str, &p[1], TRUE);
+ 	}
+ #endif
+ 
  	IGNORE_EINTR (execv (argv[0], argv));
  
  	/* will go to .xsession-errors */
diff -crN ./gdm/daemon/verify-crypt.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/verify-crypt.c
*** ./gdm/daemon/verify-crypt.c	Tue Jul 29 21:01:09 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/daemon/verify-crypt.c	Tue Jan 13 16:11:58 2004
***************
*** 25,30 ****
--- 25,34 ----
  #include <sys/types.h>
  #include <unistd.h>
  
+ #if defined(CAN_CLEAR_ADMCHG) && defined(HAVE_USERSEC_H)
+ #  include <usersec.h>
+ #endif /* CAN_CLEAR_ADMCHG && HAVE_USERSEC_H */
+ 
  #ifdef HAVE_CRYPT
  #  include <crypt.h>
  #endif /* HAVE_CRYPT */
***************
*** 103,108 ****
--- 107,121 ----
  {
      gchar *login, *passwd, *ppasswd;
      struct passwd *pwent;
+ #if defined(HAVE_PASSWDEXPIRED) && defined(HAVE_CHPASS) \
+     || defined(HAVE_LOGINRESTRICTIONS)
+     gchar *message = NULL;
+ #endif
+ #if defined(HAVE_PASSWDEXPIRED) && defined(HAVE_CHPASS)
+     gchar *info_msg = NULL, *response = NULL;
+     gint reEnter, ret;
+     struct userpw *upwd;
+ #endif
  
      if (local)
  	    gdm_slave_greeter_ctl_no_ret (GDM_STARTTIMER, "");
***************
*** 208,213 ****
--- 221,250 ----
  	    return NULL;
      }
  
+ #ifdef HAVE_LOGINRESTRICTIONS
+ 
+     /* Check with the 'loginrestrictions' function
+        if the user has been disallowed */
+     if (loginrestrictions (login, 0, NULL, &message) != 0) {
+ 	    gdm_error (_("User %s not allowed to log in"), login);
+ 	    gdm_slave_greeter_ctl_no_ret (GDM_ERRBOX,
+ 					  _("\nThe system administrator "
+ 					    "has disabled your "
+ 					    "account."));
+ 	    g_free (login);
+ 	    g_free (passwd);
+ 	    g_free (ppasswd);
+ 	    if (message != NULL)
+ 		    free (message);
+ 	    return NULL;
+     }
+     
+     if (message != NULL)
+ 	    free (message);
+     message = NULL;
+ 
+ #else /* ! HAVE_LOGINRESTRICTIONS */
+ 
      /* check for the standard method of disallowing users */
      if (pwent->pw_shell != NULL &&
  	(strcmp (pwent->pw_shell, "/sbin/nologin") == 0 ||
***************
*** 226,234 ****
--- 263,279 ----
  	    return NULL;
      }	
  
+ #endif /* HAVE_LOGINRESTRICTIONS */
+ 
      g_free (passwd);
      g_free (ppasswd);
  
+     if ( ! gdm_slave_check_user_wants_to_log_in (login)) {
+ 	    g_free (login);
+ 	    login = NULL;
+ 	    goto authenticate_again;
+     }
+ 
      if ( ! gdm_setup_gids (login, pwent->pw_gid)) {
  	    gdm_error (_("Cannot set user group for %s"), login);
  	    gdm_slave_greeter_ctl_no_ret (GDM_ERRBOX,
***************
*** 239,244 ****
--- 284,389 ----
  	    return NULL;
      }
      
+ #if defined(HAVE_PASSWDEXPIRED) && defined (HAVE_CHPASS)
+ 
+     switch (passwdexpired (login, &info_msg)) {
+     case 1 :
+ 	    gdm_error (_("Password of %s has expired"), login);
+ 	    gdm_error_box (d, GTK_MESSAGE_ERROR,
+ 			   _("You are required to change your password.\n"
+ 			     "Please choose a new one."));
+ 	    g_free (info_msg);
+ 
+ 	    do {
+ 		    ret = chpass (login, response, &reEnter, &message);
+ 		    g_free (response);
+ 
+ 		    if (ret != 1) {
+ 			    if (ret != 0) {
+ 				    gdm_slave_greeter_ctl_no_ret (GDM_ERRBOX,
+ 								  _("\nCannot change your password, "
+ 								    "you will not be able to log in, "
+ 								    "please try again later or contact "
+ 								    "your system administrator."));
+ 			    } else if ((reEnter != 0) && (message)) {
+ 				    response = gdm_slave_greeter_ctl (GDM_NOECHO, message);
+ 				    if (response == NULL)
+ 					    response = g_strdup ("");
+ 			    }
+ 		    }
+ 
+ 		    g_free(message);
+ 		    message = NULL;
+ 
+ 	    } while ( ((reEnter != 0) && (ret == 0))
+ 		      || (ret ==1) );
+ 
+ 	    g_free (response);
+ 	    g_free (message);
+ 
+ 	    if ((ret != 0) || (reEnter != 0)) {
+ 		    return NULL;
+ 	    }
+ 
+ #if defined(CAN_CLEAR_ADMCHG)
+ 	    /* The password is changed by root, clear the ADM_CHG
+ 	       flag in the passwd file */
+ 	    ret = setpwdb (S_READ | S_WRITE);
+ 	    if (!ret) {
+ 	      upwd = getuserpw (login);
+ 	      if (upwd == NULL) {
+ 		    ret = -1;
+ 	      }
+ 	      else {
+ 		upwd->upw_flags &= ~PW_ADMCHG;
+ 		ret = putuserpw (upwd);
+ 		if (!ret) {
+ 		  ret = endpwdb ();
+ 		}
+ 	      }
+ 	    }
+ 	    
+ 	    if (ret) {
+ 	      gdm_error_box (d, GTK_MESSAGE_WARNING,
+ 			_("\nYour password has been changed but you "
+ 			"may have to change it again, please try again "
+ 			"later or contact your system administrator."));
+ 	    }
+ 
+ #else /* !CAN_CLEAR_ADMCHG */
+ 	    gdm_error_box (d, GTK_MESSAGE_WARNING,
+ 		_("\nYour password has been changed but you "
+ 		"may have to change it again, please try again "
+ 		"later or contact your system administrator."));
+ 
+ #endif /* CAN_CLEAR_ADMCHG */
+ 	    break;
+ 
+     case 2 :
+ 	    gdm_error (_("Password of %s has expired"), login);
+ 	    gdm_error_box (d, GTK_MESSAGE_ERROR,
+ 			   _("Your password has expired.\n"
+ 			     "Only a system administrator can now change it"));
+ 	    g_free (info_msg);
+ 	    return NULL;
+ 	    break;    
+ 
+     case -1 :
+ 	    gdm_error (_("Internal error on passwdexpired"));
+ 	    gdm_error_box (d, GTK_MESSAGE_ERROR,
+ 			   _("An internal error occured, you will not be able to log in.\n"
+ 			     "Please try again later or contact your system administrator."));
+ 	    g_free (info_msg);
+ 	    return NULL;
+ 	    break;    
+ 
+     default :
+ 	    g_free (info_msg);
+ 	    break;
+     }
+ 
+ #endif /* HAVE_PASSWDEXPIRED && HAVE_CHPASS */
+ 
      return login;
  }
  
diff -crN ./gdm/gui/Makefile.am /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/Makefile.am
*** ./gdm/gui/Makefile.am	Wed Aug 20 20:45:29 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/Makefile.am	Thu Oct 16 17:23:13 2003
***************
*** 1,3 ****
--- 1,4 ----
+ 
  SUBDIRS = . greeter modules
  
  ## Process this file with automake to produce makefile.in
***************
*** 102,108 ****
  gdmsetup_LDFLAGS = -export-dynamic
  gdmsetup_LDADD = \
  	$(GUI_LIBS)		\
! 	-lXau			\
  	-lX11			\
  	$(INTLLIBS)		\
  	-L$(top_builddir)/vicious-extensions	\
--- 103,109 ----
  gdmsetup_LDFLAGS = -export-dynamic
  gdmsetup_LDADD = \
  	$(GUI_LIBS)		\
! 	$(X_LIBS)		\
  	-lX11			\
  	$(INTLLIBS)		\
  	-L$(top_builddir)/vicious-extensions	\
***************
*** 116,129 ****
  
  gdmXnestchooser_LDADD = \
  	$(GUI_LIBS)		\
  	-lXau			\
  	-lX11			\
- 	$(INTLLIBS)		\
  	-L$(top_builddir)/vicious-extensions	\
  	-lviciousui-gnome
  
  gdmflexiserver_LDADD = \
  	$(GUI_LIBS)		\
  	-lXau			\
  	$(INTLLIBS)		\
  	-L$(top_builddir)/vicious-extensions	\
--- 117,134 ----
  
  gdmXnestchooser_LDADD = \
  	$(GUI_LIBS)		\
+ 	$(POPT_LIBS)		\
+ 	$(INTLLIBS)		\
  	-lXau			\
  	-lX11			\
  	-L$(top_builddir)/vicious-extensions	\
  	-lviciousui-gnome
  
  gdmflexiserver_LDADD = \
  	$(GUI_LIBS)		\
+ 	$(POPT_LIBS)		\
+ 	$(X_LIBS)		\
+ 	-lX11			\
  	-lXau			\
  	$(INTLLIBS)		\
  	-L$(top_builddir)/vicious-extensions	\
diff -crN ./gdm/gui/gdmlogin.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/gdmlogin.c
*** ./gdm/gui/gdmlogin.c	Tue Aug 19 02:17:10 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/gdmlogin.c	Thu Oct 16 17:23:22 2003
***************
*** 18,32 ****
  
  #include <config.h>
  
  #include <libgnome/libgnome.h>
  #include <libgnomeui/libgnomeui.h>
- #include <math.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <sys/stat.h>
  #include <sys/types.h>
  #include <sys/wait.h>
  #include <fcntl.h>
  #include <unistd.h>
  #include <syslog.h>
--- 18,36 ----
  
  #include <config.h>
  
+ /* for GtkCList */
+ #undef GTK_DISABLE_DEPRECATED
+ 
+ #include <math.h>
  #include <libgnome/libgnome.h>
  #include <libgnomeui/libgnomeui.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
  #include <sys/stat.h>
  #include <sys/types.h>
  #include <sys/wait.h>
+ #include <sys/param.h>
  #include <fcntl.h>
  #include <unistd.h>
  #include <syslog.h>
***************
*** 3184,3189 ****
--- 3188,3194 ----
  static gboolean
  gdm_login_check_shell (const gchar *usersh)
  {
+ #if HAVE_GETUSERSHELL
      gint found = 0;
      gchar *csh;
  
***************
*** 3196,3201 ****
--- 3201,3236 ----
      endusershell ();
  
      return (found);
+ #else
+ 
+ #   define SHELLS	"/etc/shells"
+ 
+     gint found = 0;
+     gchar newshell[MAXPATHLEN];
+     FILE* fd;
+ 
+ 
+     fd = fopen(SHELLS, "r");
+     if (fd == NULL)
+     {
+ 	/* if file doesn't exist, all shells are accepted */
+         return 1;
+     }
+     
+     while (fscanf(fd, "%s", newshell) != EOF)
+     {
+        if (! strcmp (newshell, usersh) )
+        {
+            found = 1;
+            break;
+        }
+     }
+     fclose(fd);
+ 
+ 
+     return found;
+ #endif
+ 
  }
  
  
diff -crN ./gdm/gui/greeter/greeter_item.h /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/greeter/greeter_item.h
*** ./gdm/gui/greeter/greeter_item.h	Thu Aug 14 23:00:00 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/greeter/greeter_item.h	Thu Nov 13 16:57:20 2003
***************
*** 5,15 ****
  
  typedef struct _GreeterItemInfo GreeterItemInfo;
  typedef struct _GreeterItemListItem GreeterItemListItem;
! typedef enum _GreeterItemState GreeterItemState;
! typedef enum _GreeterItemType GreeterItemType;
! typedef enum _GreeterItemSizeType GreeterItemSizeType;
! typedef enum _GreeterItemPosType GreeterItemPosType;
! typedef enum _GreeterItemShowModes GreeterItemShowModes;
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
--- 5,15 ----
  
  typedef struct _GreeterItemInfo GreeterItemInfo;
  typedef struct _GreeterItemListItem GreeterItemListItem;
! #typedef enum _GreeterItemState GreeterItemState;
! #typedef enum _GreeterItemType GreeterItemType;
! #typedef enum _GreeterItemSizeType GreeterItemSizeType;
! #typedef enum _GreeterItemPosType GreeterItemPosType;
! #typedef enum _GreeterItemShowModes GreeterItemShowModes;
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
***************
*** 17,24 ****
    GREETER_ITEM_STATE_NORMAL,
    GREETER_ITEM_STATE_PRELIGHT,
    GREETER_ITEM_STATE_ACTIVE,
!   GREETER_ITEM_STATE_MAX,
  };
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
--- 17,25 ----
    GREETER_ITEM_STATE_NORMAL,
    GREETER_ITEM_STATE_PRELIGHT,
    GREETER_ITEM_STATE_ACTIVE,
!   GREETER_ITEM_STATE_MAX
  };
+ typedef enum _GreeterItemState GreeterItemState;
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
***************
*** 28,35 ****
    GREETER_ITEM_TYPE_PIXMAP,
    GREETER_ITEM_TYPE_LABEL,
    GREETER_ITEM_TYPE_ENTRY,
!   GREETER_ITEM_TYPE_LIST,
  };
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
--- 29,37 ----
    GREETER_ITEM_TYPE_PIXMAP,
    GREETER_ITEM_TYPE_LABEL,
    GREETER_ITEM_TYPE_ENTRY,
!   GREETER_ITEM_TYPE_LIST
  };
+ typedef enum _GreeterItemType GreeterItemType;
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
***************
*** 37,52 ****
    GREETER_ITEM_SIZE_UNSET,
    GREETER_ITEM_SIZE_ABSOLUTE,
    GREETER_ITEM_SIZE_RELATIVE,
!   GREETER_ITEM_SIZE_BOX,
  };
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
  enum _GreeterItemPosType {
    GREETER_ITEM_POS_UNSET,
    GREETER_ITEM_POS_ABSOLUTE,
!   GREETER_ITEM_POS_RELATIVE,
  };
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
--- 39,56 ----
    GREETER_ITEM_SIZE_UNSET,
    GREETER_ITEM_SIZE_ABSOLUTE,
    GREETER_ITEM_SIZE_RELATIVE,
!   GREETER_ITEM_SIZE_BOX
  };
+ typedef enum _GreeterItemSizeType GreeterItemSizeType;
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
  enum _GreeterItemPosType {
    GREETER_ITEM_POS_UNSET,
    GREETER_ITEM_POS_ABSOLUTE,
!   GREETER_ITEM_POS_RELATIVE
  };
+ typedef enum _GreeterItemPosType GreeterItemPosType;
  
  /* Make sure to adjust the bitfield in the structure if
     you make this larger */
***************
*** 60,65 ****
--- 64,70 ----
    GREETER_ITEM_SHOW_FLEXI = (1<<1) | (1<<2),
    GREETER_ITEM_SHOW_REMOTE = 1<<3
  };
+ typedef enum _GreeterItemShowModes GreeterItemShowModes;
  
  struct _GreeterItemInfo {
    GreeterItemInfo *parent;
***************
*** 67,74 ****
    GtkAnchorType anchor;
    double x;
    double y;
!   GreeterItemPosType x_type:2;
!   GreeterItemPosType y_type:2;
    gboolean x_negative:1; /* needed for -0 */
    gboolean y_negative:1; /* needed for -0 */
  
--- 72,79 ----
    GtkAnchorType anchor;
    double x;
    double y;
!   int x_type:2;	/* GreeterItemPosType */
!   int y_type:2; /* GreeterItemPosType */
    gboolean x_negative:1; /* needed for -0 */
    gboolean y_negative:1; /* needed for -0 */
  
***************
*** 76,88 ****
    gboolean expand:1;
  
    /* The item type */
!   GreeterItemType item_type:4;
  
!   GreeterItemShowModes show_modes:4;
    char *show_type; /* timed, system, config, chooser, halt, suspend, reboot */
    
!   GreeterItemSizeType width_type:2;
!   GreeterItemSizeType height_type:2;
    double width;
    double height;
  
--- 81,93 ----
    gboolean expand:1;
  
    /* The item type */
!   int item_type:4; /*GreeterItemType*/
  
!   int show_modes:4; /*GreeterItemShowModes*/
    char *show_type; /* timed, system, config, chooser, halt, suspend, reboot */
    
!   int width_type:2; /*GreeterItemSizeType*/
!   int height_type:2; /*GreeterItemSizeType*/
    double width;
    double height;
  
***************
*** 126,133 ****
    GList *box_children;
    
    /* Runtime state: */
!   GreeterItemState state:2;
!   GreeterItemState base_state:2;
    gboolean mouse_down:1;
    gboolean mouse_over:1;
  
--- 131,138 ----
    GList *box_children;
    
    /* Runtime state: */
!   int state:2; /*GreeterItemState*/
!   int base_state:2; /*GreeterItemState*/
    gboolean mouse_down:1;
    gboolean mouse_over:1;
  
diff -crN ./gdm/gui/greeter/greeter_parser.h /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/greeter/greeter_parser.h
*** ./gdm/gui/greeter/greeter_parser.h	Thu Jul 17 21:54:11 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/gui/greeter/greeter_parser.h	Thu Oct 16 17:23:49 2003
***************
*** 10,16 ****
    GREETER_PARSER_ERROR_NO_FILE,
    GREETER_PARSER_ERROR_BAD_XML,
    GREETER_PARSER_ERROR_WRONG_TYPE,
!   GREETER_PARSER_ERROR_BAD_SPEC,
  } GreeterParseError;
  
  #define GREETER_PARSER_ERROR greeter_parser_error_quark()
--- 10,16 ----
    GREETER_PARSER_ERROR_NO_FILE,
    GREETER_PARSER_ERROR_BAD_XML,
    GREETER_PARSER_ERROR_WRONG_TYPE,
!   GREETER_PARSER_ERROR_BAD_SPEC
  } GreeterParseError;
  
  #define GREETER_PARSER_ERROR greeter_parser_error_quark()
diff -crN ./gdm/utils/Makefile.am /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/utils/Makefile.am
*** ./gdm/utils/Makefile.am	Fri Jul 18 23:26:52 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/utils/Makefile.am	Thu Oct 16 17:23:57 2003
***************
*** 1,3 ****
--- 1,4 ----
+ 
  ## Process this file with automake to produce makefile.in
  DEFS = @DEFS@ -DGDM_CONFIG_FILE=\"@sysconfdir@/gdm/gdm.conf\" \
  	-DGDM_FACTORY_CONFIG_FILE=\"@sysconfdir@/gdm/factory-gdm.conf\" \
diff -crN ./gdm/vicious-extensions/ve-misc.c /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/vicious-extensions/ve-misc.c
*** ./gdm/vicious-extensions/ve-misc.c	Fri Jul 11 00:27:02 2003
--- /gestconf/project/GNOME_ACL/GNOME/build/sh_build_GNOME/src/./gdm/vicious-extensions/ve-misc.c	Thu Nov 13 16:58:00 2003
***************
*** 370,376 ****
  void
  ve_unsetenv (const char *name)
  {
! #if defined (HAVE_SETENV)
  	unsetenv (name);
  #else
  	extern char **environ;
--- 370,376 ----
  void
  ve_unsetenv (const char *name)
  {
! #if defined (HAVE_UNSETENV)
  	unsetenv (name);
  #else
  	extern char **environ;
