--- heimdal-1.2.dfsg.1.orig/appl/rsh/rshd.c	Tue Aug 19 13:36:17 2003
+++ heimdal-1.2.dfsg.1/appl/rsh/rshd.c	Sat Jul 17 13:41:38 2004
@@ -661,6 +661,21 @@ setup_environment (char ***env, const struct passwd *pwd)
 }
 
 static void
+mount_homedir(char *user)
+{
+	char *cmd;
+
+	cmd = malloc((strlen(user)+strlen("/bin/sh /usr/sbin/univention-mount-homedir ")+1)*sizeof(char));
+
+	sprintf(cmd,"/bin/sh /usr/sbin/univention-mount-homedir %s", user);
+
+	/* FIXME: better use fork and exec */
+	system(cmd);
+
+	free(cmd);
+}
+
+static void
 doit (void)
 {
     u_char buf[BUFSIZ];
@@ -754,6 +769,9 @@ doit (void)
 	syslog(LOG_ERR, "setpcred() failure: %s", strerror(errno));
 #endif /* HAVE_SETPCRED */
 
+
+    mount_homedir ( pwd->pw_name );
+
     /* Apply limits if not root */
     if(pwd->pw_uid != 0) {
 	 const char *file = _PATH_LIMITS_CONF;
