My attempts at modifying /etc/ttys gave results inferior
to the supported xdm_flags="", so...

1.  Have
        xdm_flags=""
in /etc/rc.conf.local

2.  Apply this diff, then
        cd xenocara/app/xdm && make -f Makefile.bsd-wrapper build

3.  Add
        printf '%s\0%s' username password > /var/xdm-auto-login
to /etc/rc.local

I grant this diff to the public domain.

Index: xenocara/app/xdm/greeter/greet.c
===================================================================
RCS file: /cvs/xenocara/app/xdm/greeter/greet.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 greet.c
--- xenocara/app/xdm/greeter/greet.c    5 Aug 2007 19:01:03 -0000       1.1.1.2
+++ xenocara/app/xdm/greeter/greet.c    9 Dec 2008 08:34:46 -0000
@@ -69,6 +69,9 @@
 # include "config.h"
 #endif
 
+#include <stdio.h>
+#include <string.h>
+
 #include <X11/Intrinsic.h>
 #include <X11/StringDefs.h>
 #include <X11/Shell.h>
@@ -354,6 +357,21 @@
 {
     XEvent             event;
     Arg                arglist[3];
+
+    {
+       const char *s = "/var/xdm-auto-login";
+       FILE *f;
+       static char b[50];
+
+       if ((f = fopen(s, "r")) != NULL) {
+           bzero(b + fread(b, 1, sizeof(b) - 2, f), 2);
+           fclose(f);
+           remove(s);
+           greet->name = b;
+           greet->password = strchr(b, 0) + 1;
+           return 0;
+       }
+    }
 
     XtSetArg (arglist[0], XtNallowAccess, False);
     XtSetValues (login, arglist, 1);

Reply via email to