Skip to content
This repository
Browse code

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

…ped version number.
  • Loading branch information...
commit 4562319372a56a8b5e484be57791082aa703d8b8 1 parent 3b2dfa0
Michał Siejak authored
1  Makefile
@@ -51,6 +51,7 @@ install: installdirs
51 51
 	$(INSTALL_PROGRAM) xlshd $(DESTDIR)$(sbindir)
52 52
 	$(INSTALL_DATA) etc/xlshrc $(DESTDIR)$(sysconfdir)/xlsh
53 53
 	$(INSTALL_DATA) etc/Xresources $(DESTDIR)$(sysconfdir)/xlsh
  54
+	$(INSTALL_DATA) etc/pam.d/xlshd $(DESTDIR)$(sysconfdir)/pam.d
54 55
 
55 56
 install-strip: installdirs
56 57
 	$(INSTALL_PROGRAM_STRIP) xlsh $(DESTDIR)$(sbindir)
2  README
@@ -7,7 +7,7 @@ A simple login shell with readline functionality and PAM integration.
7 7
 
8 8
 Features:
9 9
  * Small and simple, written entirely in C.
10  
- * Easily hackable because of compact codebase (~950 source lines).
  10
+ * Easily hackable because of compact codebase (~1000 source lines).
11 11
  * Uses PAM for authorization and session management.
12 12
  * Entirely keyboard driven display manager replacement (when used with xlshd)
13 13
    without the need for any fat libraries or GUI toolkits.
8  etc/pam.d/xlshd
... ...
@@ -0,0 +1,8 @@
  1
+#%PAM-1.0
  2
+auth		required	pam_unix.so
  3
+auth		required	pam_nologin.so
  4
+auth		required	pam_env.so
  5
+account		required	pam_unix.so
  6
+password	required	pam_unix.so
  7
+session		required	pam_unix.so
  8
+session		required	pam_limits.so
2  include/config.h
@@ -22,6 +22,8 @@
22 22
 #define XLSH_XTTY_NAME "X11"
23 23
 #define XLSH_DATEFMT   "%Y-%m-%d"
24 24
 #define XLSH_TIMEFMT   "%H:%M"
  25
+#define XLSH_PAM_TTY   "login"
  26
+#define XLSH_PAM_X11   "xlshd"
25 27
 
26 28
 #define XLSH_COMPLETION_SHOWROOT 1
27 29
 #define XLSH_COMPLETION_MINUID   1000
2  include/libxlsh.h
@@ -8,7 +8,7 @@
8 8
 #define __XLSH_LIBXLSH_H
9 9
 
10 10
 #define XLSH_VERSION_API    2
11  
-#define XLSH_VERSION_STRING "0.2.0"
  11
+#define XLSH_VERSION_STRING "0.2.1"
12 12
 
13 13
 #define XLSH_EOK       0x00
14 14
 #define XLSH_EFATAL    0x01
4  src/xlsh.c
@@ -347,7 +347,7 @@ int xlsh_session_tty(const char* user, const char* shell)
347 347
   char user_shell[PATH_MAX];
348 348
   char user_shell_name[PATH_MAX];
349 349
   
350  
-  if(xlsh_session_open("login", user, &pam_handle) != XLSH_EOK) {
  350
+  if(xlsh_session_open(XLSH_PAM_TTY, user, &pam_handle) != XLSH_EOK) {
351 351
     fprintf(stderr, "Authorization failed\n");
352 352
     return XLSH_ERROR;
353 353
   }
@@ -393,7 +393,7 @@ int xlsh_session_x(const char* user, const char* shell)
393 393
   pam_handle_t* pam_handle;
394 394
   
395 395
   if((proc_session = fork()) == 0) {
396  
-    if(xlsh_session_open("login", user, &pam_handle) != XLSH_EOK) {
  396
+    if(xlsh_session_open(XLSH_PAM_X11, user, &pam_handle) != XLSH_EOK) {
397 397
       fprintf(stderr, "Authorization failed\n");
398 398
       exit(EXIT_FAILURE);
399 399
     }

0 notes on commit 4562319

Please sign in to comment.
Something went wrong with that request. Please try again.