Changeset 2538
- Timestamp:
- 07/16/08 15:36:51 (3 months ago)
- Location:
- neercs/trunk
- Files:
-
- 2 modified
-
configure.ac (modified) (2 diffs)
-
src/lock.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
neercs/trunk/configure.ac
r2510 r2538 38 38 AC_CHECK_HEADERS(stdio.h pty.h sys/ioctl.h sys/ptrace.h sys/stat.h sys/syscall.h sys/user.h sys/wait.h linux/kdev_t.h linux/major.h security/pam_appl.h security/pam_misc.h) 39 39 40 AC_CHECK_LIB(pam, pam_authenticate, PAM_LIBS="${PAM_LIBS} -lpam") 40 lock=no 41 AC_CHECK_LIB(pam, pam_authenticate, 42 [PAM_LIBS="${PAM_LIBS} -lpam" 43 lock=yes]) 44 AC_DEFINE(USE_LOCK, 1, [Locking the PTY is supported]) 41 45 AC_SUBST(PAM_LIBS) 42 43 46 44 47 AC_CHECK_LIB(util, forkpty, UTIL_LIBS="${UTIL_LIBS} -lutil") … … 48 51 case $target in 49 52 i?86-*-linux-*|amd64-*-linux-*|x86_64-*-linux-*) 53 AC_DEFINE(USE_GRAB, 1, [Grabbing processes is supported]) 50 54 grab=yes ;; 51 55 *) 52 grab=no ;;56 grab=no ;; 53 57 esac 54 58 AC_MSG_RESULT($grab) 55 if test "$grab" = "yes"; then56 AC_DEFINE(USE_GRAB, 1, [Grabbing processes is supported])57 fi58 59 59 60 if test "${enable_debug}" = "yes"; then -
neercs/trunk/src/lock.c
r2495 r2538 23 23 #include <sys/wait.h> 24 24 #include <sys/types.h> 25 #include <security/pam_appl.h> 26 #include <security/pam_misc.h> 27 #include <pwd.h> 25 26 #if defined USE_LOCK 27 # include <security/pam_appl.h> 28 # include <security/pam_misc.h> 29 # include <pwd.h> 30 #endif 28 31 29 32 #include "neercs.h" 30 33 34 #if defined USE_LOCK 31 35 static int convpam(int num_msg, const struct pam_message **msg, 32 36 struct pam_response **resp, void *appdata_ptr); 37 #endif 33 38 34 39 int update_lock(int c, struct screen_list *screen_list) 35 40 { 36 41 int refresh = 0; 42 43 #if defined USE_LOCK 37 44 if(!screen_list->locked) return 0; 38 45 … … 70 77 } 71 78 } 79 #endif 80 72 81 return refresh; 73 82 } … … 75 84 void draw_lock(struct screen_list *screen_list) 76 85 { 86 #if defined USE_LOCK 77 87 unsigned int i; 78 88 char buffer[1024]; … … 122 132 cucul_printf(cv, x, y, "Error : %s", screen_list->lockmsg); 123 133 } 124 } 125 126 134 #endif 135 } 136 137 138 #if defined USE_LOCK 127 139 128 140 /* FIXME, handle this without assuming this is a password auth */ … … 155 167 return (PAM_SUCCESS); 156 168 } 157 169 #endif 158 170 159 171 int validate_lock(struct screen_list *screen_list, char *user, char *pass) 160 172 { 173 #if USE_LOCK 161 174 int ret; 162 175 pam_handle_t *pamh=NULL; … … 200 213 201 214 ret = pam_end(pamh, PAM_SUCCESS); 215 #endif 216 202 217 return 1; 203 218 }
