diff -Pur at-3.1.7.orig/Makefile at-3.1.7/Makefile
--- at-3.1.7.orig/Makefile	Sat Jun 27 17:01:59 1998
+++ at-3.1.7/Makefile	Sat Jun 27 17:29:47 1998
@@ -71,7 +71,7 @@
 	$(LN_S) -f at atrm
 
 atd: $(RUNOBJECTS)
-	$(CC) $(CFLAGS) -o atd $(RUNOBJECTS) $(LIBS)
+	$(CC) $(CFLAGS) -o atd $(RUNOBJECTS) $(LIBS) -ltmpdir
 
 y.tab.c y.tab.h: parsetime.y
 	$(YACC) -d parsetime.y
diff -Pur at-3.1.7.orig/atd.c at-3.1.7/atd.c
--- at-3.1.7.orig/atd.c	Mon May 26 09:31:36 1997
+++ at-3.1.7/atd.c	Sat Jun 27 17:25:41 1998
@@ -73,6 +73,8 @@
 #include <syslog.h>
 #endif
 
+#include <tmpdir.h>
+
 /* Local headers */
 
 #include "privs.h"
@@ -339,6 +341,9 @@
 
 	    nice((tolower((int) queue) - 'a' + 1) * 2);
 
+	    if (mkusertemp(pentry->pw_name, pentry->pw_uid, pentry->pw_gid))
+		perr("Cannot create temporary directory");
+
 	    if (initgroups(pentry->pw_name, pentry->pw_gid))
 		perr("Cannot delete saved userids");
 
@@ -379,6 +384,9 @@
     if ((buf.st_size != size) || send_mail) {
 
 	PRIV_START
+
+	    if (mkusertemp(pentry->pw_name, pentry->pw_uid, pentry->pw_gid))
+		perr("Cannot create temporary directory");
 
 	    if (initgroups(pentry->pw_name, pentry->pw_gid))
 		perr("Cannot delete saved userids");

