Ignore:
Timestamp:
Jul 16, 2008, 3:36:51 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • lock.c: do not build PTY locking mechanism if PAM isn't present.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/lock.c

    r2495 r2538  
    2323#include <sys/wait.h>
    2424#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
    2831
    2932#include "neercs.h"
    3033
     34#if defined USE_LOCK
    3135static int convpam(int num_msg, const struct pam_message **msg,
    3236                   struct pam_response **resp, void *appdata_ptr);
     37#endif
    3338
    3439int update_lock(int c, struct screen_list *screen_list)
    3540{
    3641    int refresh = 0;
     42
     43#if defined USE_LOCK
    3744    if(!screen_list->locked) return 0;
    3845
     
    7077        }
    7178    }
     79#endif
     80
    7281    return refresh;
    7382}
     
    7584void draw_lock(struct screen_list *screen_list)
    7685{
     86#if defined USE_LOCK
    7787    unsigned int i;
    7888    char buffer[1024];
     
    122132        cucul_printf(cv, x, y, "Error : %s", screen_list->lockmsg);
    123133    }
    124 }
    125 
    126 
     134#endif
     135}
     136
     137
     138#if defined USE_LOCK
    127139
    128140/* FIXME, handle this without assuming this is a password auth */
     
    155167    return (PAM_SUCCESS);
    156168}
    157 
     169#endif
    158170
    159171int validate_lock(struct screen_list *screen_list, char *user, char *pass)
    160172{
     173#if USE_LOCK
    161174    int ret;
    162175    pam_handle_t *pamh=NULL;
     
    200213
    201214    ret = pam_end(pamh, PAM_SUCCESS);
     215#endif
     216
    202217    return 1;
    203218}
Note: See TracChangeset for help on using the changeset viewer.