dslinux/user/autologin Makefile autologin.c autologin.conf config.h
amadeus
dslinux_amadeus at user.in-berlin.de
Tue Sep 26 22:38:31 CEST 2006
Update of /cvsroot/dslinux/dslinux/user/autologin
In directory antilope:/tmp/cvs-serv8152/user/autologin
Modified Files:
autologin.c config.h
Added Files:
Makefile autologin.conf
Log Message:
Sorry, these logins driving me crazy
Index: config.h
===================================================================
RCS file: /cvsroot/dslinux/dslinux/user/autologin/config.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- config.h 26 Sep 2006 18:37:22 -0000 1.1
+++ config.h 26 Sep 2006 20:38:29 -0000 1.2
@@ -4,31 +4,31 @@
#undef HAVE_PAM
/* Define if you have the setegid function. */
-#undef HAVE_SETEGID
+#define HAVE_SETEGID 1
/* Define if you have the seteuid function. */
-#undef HAVE_SETEUID
+#define HAVE_SETEUID 1
/* Define if you have the setgid function. */
-#undef HAVE_SETGID
+#define HAVE_SETGID 1
/* Define if you have the setregid function. */
-#undef HAVE_SETREGID
+#define HAVE_SETREGID 1
/* Define if you have the setreuid function. */
-#undef HAVE_SETREUID
+#define HAVE_SETREUID 1
/* Define if you have the setuid function. */
-#undef HAVE_SETUID
+#define HAVE_SETUID 1
/* Define if you have the dl library (-ldl). */
#undef HAVE_LIBDL
/* Name of package */
-#undef PACKAGE
+#define PACKAGE "autologin"
/* Version number of package */
-#undef VERSION
+#define VERSION "1.0.0"
/* be paranoid */
#undef PARANOID
--- NEW FILE: autologin.conf ---
# Start the session as the user specified here.
# This setting is mandatory. If omitted, autologin will not run.
# If autologin was compiled with --enable-paranoid, autologin will
# not run if the user specified has UID or GID 0.
USER=root
# The script or program listed here will be executed as the user
# specified above.
# If this setting is omitted, /bin/sh will be used.
EXEC=/bin/sh
# You can use this setting to turn off autologin even if it is
# installed and the config file exists and is considered safe.
# If this setting is omitted, "yes" is assumed.
AUTOLOGIN=yes
--- NEW FILE: Makefile ---
# Makefile for autologin
EXEC = autologin
OBJS = autologin.o
INCS = config.h
# declare these targets as phony, so make will not try to look
# for files named like them:
.PHONY: all romfs clean
# 'all' is a phony target. It is called when the build process
# enters this directory and wants to build the program.
all: $(EXEC)
# This is the rule that build the executable.
$(EXEC): $(OBJS) $(INCS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS$(LDLIBS_$@))
# The romfs target is also phony. It is used to copy your app
# into the DSLinux filesystem image.
romfs:
$(ROMFSINST) /bin/$(EXEC)
$(ROMFSINST) /etc/autologin.conf
# clean is another phony target that removes every file generated
# during the build.
clean:
rm -f $(EXEC) *.elf *.gdb *.o
Index: autologin.c
===================================================================
RCS file: /cvsroot/dslinux/dslinux/user/autologin/autologin.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- autologin.c 26 Sep 2006 18:37:22 -0000 1.1
+++ autologin.c 26 Sep 2006 20:38:29 -0000 1.2
@@ -10,8 +10,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <pwd.h>
-#define CONFIG "/etc/sysconfig/autologin"
-#define DEFAULT "/usr/X11R6/bin/startx"
+#define CONFIG "/etc/autologin.conf"
+#define DEFAULT "/bin/sh"
#ifdef HAVE_PAM
#include <security/pam_appl.h>
@@ -185,7 +185,9 @@
free(user);
user=NULL;
- execvp(runthis, argv);
+ /* this is neccessary for normal shell execute */
+ execlp(runthis, "-sh", NULL);
+
free(dir); free(shell);
printf("ERROR: Couldn't exec %s: %s\n", runthis, strerror(errno));
return 2;
More information about the dslinux-commit
mailing list