Permalink
Browse files

Now uses custom PAM config under X (shamelessly stolen from XDM), bum…

…ped version number.
  • Loading branch information...
1 parent 3b2dfa0 commit 4562319372a56a8b5e484be57791082aa703d8b8 @Nadrin committed Oct 19, 2011
Showing with 15 additions and 4 deletions.
  1. +1 −0 Makefile
  2. +1 −1 README
  3. +8 −0 etc/pam.d/xlshd
  4. +2 −0 include/config.h
  5. +1 −1 include/libxlsh.h
  6. +2 −2 src/xlsh.c
View
1 Makefile
@@ -51,6 +51,7 @@ install: installdirs
$(INSTALL_PROGRAM) xlshd $(DESTDIR)$(sbindir)
$(INSTALL_DATA) etc/xlshrc $(DESTDIR)$(sysconfdir)/xlsh
$(INSTALL_DATA) etc/Xresources $(DESTDIR)$(sysconfdir)/xlsh
+ $(INSTALL_DATA) etc/pam.d/xlshd $(DESTDIR)$(sysconfdir)/pam.d
install-strip: installdirs
$(INSTALL_PROGRAM_STRIP) xlsh $(DESTDIR)$(sbindir)
View
2 README
@@ -7,7 +7,7 @@ A simple login shell with readline functionality and PAM integration.
Features:
* Small and simple, written entirely in C.
- * Easily hackable because of compact codebase (~950 source lines).
+ * Easily hackable because of compact codebase (~1000 source lines).
* Uses PAM for authorization and session management.
* Entirely keyboard driven display manager replacement (when used with xlshd)
without the need for any fat libraries or GUI toolkits.
View
8 etc/pam.d/xlshd
@@ -0,0 +1,8 @@
+#%PAM-1.0
+auth required pam_unix.so
+auth required pam_nologin.so
+auth required pam_env.so
+account required pam_unix.so
+password required pam_unix.so
+session required pam_unix.so
+session required pam_limits.so
View
2 include/config.h
@@ -22,6 +22,8 @@
#define XLSH_XTTY_NAME "X11"
#define XLSH_DATEFMT "%Y-%m-%d"
#define XLSH_TIMEFMT "%H:%M"
+#define XLSH_PAM_TTY "login"
+#define XLSH_PAM_X11 "xlshd"
#define XLSH_COMPLETION_SHOWROOT 1
#define XLSH_COMPLETION_MINUID 1000
View
2 include/libxlsh.h
@@ -8,7 +8,7 @@
#define __XLSH_LIBXLSH_H
#define XLSH_VERSION_API 2
-#define XLSH_VERSION_STRING "0.2.0"
+#define XLSH_VERSION_STRING "0.2.1"
#define XLSH_EOK 0x00
#define XLSH_EFATAL 0x01
View
4 src/xlsh.c
@@ -347,7 +347,7 @@ int xlsh_session_tty(const char* user, const char* shell)
char user_shell[PATH_MAX];
char user_shell_name[PATH_MAX];
- if(xlsh_session_open("login", user, &pam_handle) != XLSH_EOK) {
+ if(xlsh_session_open(XLSH_PAM_TTY, user, &pam_handle) != XLSH_EOK) {
fprintf(stderr, "Authorization failed\n");
return XLSH_ERROR;
}
@@ -393,7 +393,7 @@ int xlsh_session_x(const char* user, const char* shell)
pam_handle_t* pam_handle;
if((proc_session = fork()) == 0) {
- if(xlsh_session_open("login", user, &pam_handle) != XLSH_EOK) {
+ if(xlsh_session_open(XLSH_PAM_X11, user, &pam_handle) != XLSH_EOK) {
fprintf(stderr, "Authorization failed\n");
exit(EXIT_FAILURE);
}

0 comments on commit 4562319

Please sign in to comment.