diff -Naur gdm-2.14.9.orig/config/gdm.conf.in gdm-2.14.9/config/gdm.conf.in
--- gdm-2.14.9.orig/config/gdm.conf.in	2006-05-12 07:58:21.000000000 +0200
+++ gdm-2.14.9/config/gdm.conf.in	2006-09-22 15:54:31.714074753 +0200
@@ -213,6 +213,8 @@
 # Check if directories are owned by logon user.  Set to false, if you have, for
 # example, home directories owned by some other user.
 CheckDirOwner=true
+# If your HOME is managed by automounter, set to true
+SupportAutomount=false
 # Number of seconds to wait after a failed login
 #RetryDelay=1
 # Maximum size of a file we wish to read.  This makes it hard for a user to DoS
diff -Naur gdm-2.14.9.orig/daemon/filecheck.c gdm-2.14.9/daemon/filecheck.c
--- gdm-2.14.9.orig/daemon/filecheck.c	2006-01-19 00:32:49.000000000 +0100
+++ gdm-2.14.9/daemon/filecheck.c	2006-09-22 00:09:07.614195324 +0200
@@ -48,14 +48,26 @@
 {
     struct stat statbuf;
     gchar *fullpath;
+    gchar *dirautofs;
     int r;
 
     if (ve_string_empty (dir) ||
 	ve_string_empty (file))
 	    return FALSE;
 
+    /* Stat on automounted directory - append the '/.' to dereference mount point.
+       Do this only if GdmSupportAutomount is true (default is false)
+       2006-09-22, Jerzy Borkowski, CAMK */
+    if G_UNLIKELY (gdm_get_value_bool (GDM_KEY_SUPPORT_AUTOMOUNT)) {
+        dirautofs = g_strconcat(dir, "/.", NULL);
+        VE_IGNORE_EINTR (r = stat (dirautofs, &statbuf));
+        g_free(dirautofs);
+    }
     /* Stat directory */
-    VE_IGNORE_EINTR (r = g_stat (dir, &statbuf));
+    else {
+        VE_IGNORE_EINTR (r = stat (dir, &statbuf));
+    }
+            
     if (r < 0) {
 	    if ( ! absentdirok)
 		 syslog (LOG_WARNING, _("%s: Directory %s does not exist."),
diff -Naur gdm-2.14.9.orig/daemon/gdm.h gdm-2.14.9/daemon/gdm.h
--- gdm-2.14.9.orig/daemon/gdm.h	2006-05-12 07:58:21.000000000 +0200
+++ gdm-2.14.9/daemon/gdm.h	2006-09-22 00:11:39.505028712 +0200
@@ -293,6 +293,7 @@
 #define GDM_KEY_USER_MAX_FILE "security/UserMaxFile=65536"
 #define GDM_KEY_RELAX_PERM "security/RelaxPermissions=0"
 #define GDM_KEY_CHECK_DIR_OWNER "security/CheckDirOwner=true"
+#define GDM_KEY_SUPPORT_AUTOMOUNT "security/SupportAutomount=false"
 #define GDM_KEY_RETRY_DELAY "security/RetryDelay=1"
 #define GDM_KEY_DISALLOW_TCP "security/DisallowTCP=true"
 #define GDM_KEY_PAM_STACK "security/PamStack=gdm"
diff -Naur gdm-2.14.9.orig/daemon/gdmconfig.c gdm-2.14.9/daemon/gdmconfig.c
--- gdm-2.14.9.orig/daemon/gdmconfig.c	2006-06-10 00:14:48.000000000 +0200
+++ gdm-2.14.9/daemon/gdmconfig.c	2006-09-22 00:14:33.447175656 +0200
@@ -184,6 +184,7 @@
 static gboolean GdmAllowRemoteRoot = FALSE;
 static gboolean GdmAllowRemoteAutoLogin = FALSE;
 static gboolean GdmCheckDirOwner = TRUE;
+static gboolean GdmSupportAutomount = FALSE;
 static gboolean GdmTimedLoginEnable = FALSE;
 static gboolean GdmDynamicXservers = FALSE;
 static gboolean GdmVTAllocation = TRUE;
@@ -374,6 +375,7 @@
    gdm_config_add_hash (GDM_KEY_CONSOLE_NOTIFY, &GdmConsoleNotify, &bool_type);
    gdm_config_add_hash (GDM_KEY_TIMED_LOGIN_ENABLE, &GdmTimedLoginEnable, &bool_type);
    gdm_config_add_hash (GDM_KEY_CHECK_DIR_OWNER, &GdmCheckDirOwner, &bool_type);
+   gdm_config_add_hash (GDM_KEY_SUPPORT_AUTOMOUNT, &GdmSupportAutomount, &bool_type);
    gdm_config_add_hash (GDM_KEY_XDMCP, &GdmXdmcp, &bool_type);
    gdm_config_add_hash (GDM_KEY_INDIRECT, &GdmIndirect, &bool_type);
    gdm_config_add_hash (GDM_KEY_XDMCP_PROXY, &GdmXdmcpProxy, &bool_type);
diff -Naur gdm-2.14.9.orig/docs/C/gdm.xml gdm-2.14.9/docs/C/gdm.xml
--- gdm-2.14.9.orig/docs/C/gdm.xml	2006-06-12 20:52:59.000000000 +0200
+++ gdm-2.14.9/docs/C/gdm.xml	2006-09-22 00:27:34.188520079 +0200
@@ -2239,6 +2239,21 @@
           </varlistentry>
 
           <varlistentry>
+            <term>SupportAutomount</term>
+            <listitem>
+              <synopsis>SupportAutomount=false</synopsis>
+              <para>
+                By default GDM checks the ownership of the home directories
+                before writing to them, this prevents security issues in case
+                of bad setup.  However, when home directories are managed by
+                automounter, they are often not mounted before they are 
+                accessed. This option works around subtleties of Linux
+                automounter.
+              </para>
+            </listitem>
+          </varlistentry>
+
+          <varlistentry>
             <term>DisallowTCP</term>
             <listitem>
               <synopsis>DisallowTCP=true</synopsis>
