/[radius]/radius/radiusd/auth.c
ViewVC logotype

Diff of /radius/radiusd/auth.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.79 by gray, Fri Jun 13 07:26:37 2003 UTC revision 1.80 by gray, Thu Jun 19 12:39:42 2003 UTC
# Line 120  int Line 120  int
120  unix_pass(char *name, char *passwd)  unix_pass(char *name, char *passwd)
121  {  {
122          int rc;          int rc;
         struct passwd *pwd;  
123          char *encpw;          char *encpw;
124          int pwlen;          int pwlen;
125          char *encrypted_pass = NULL;          char *encrypted_pass = NULL;
# Line 150  unix_pass(char *name, char *passwd) Line 149  unix_pass(char *name, char *passwd)
149                  encrypted_pass = spwd->sp_pwdp;                  encrypted_pass = spwd->sp_pwdp;
150  # endif /* M_UNIX */  # endif /* M_UNIX */
151  #else /* !OSFC2 && !PWD_SHADOW */  #else /* !OSFC2 && !PWD_SHADOW */
152          /* Get encrypted password from password file */          {
153          if (pwd = getpwnam(name))                  struct passwd *pwd;
154                  encrypted_pass = pwd->pw_passwd;  
155                    /* Get encrypted password from password file */
156                    if (pwd = getpwnam(name))
157                            encrypted_pass = pwd->pw_passwd;
158            }
159  #endif /* OSFC2 */  #endif /* OSFC2 */
160    
161          if (encrypted_pass) {          if (encrypted_pass) {
# Line 513  typedef struct auth_mach { Line 516  typedef struct auth_mach {
516          char       *user_msg;          char       *user_msg;
517          struct obstack msg_stack;          struct obstack msg_stack;
518                    
519          char       *clid;          const char *clid;
520          enum auth_state state;          enum auth_state state;
521  } AUTH_MACH;  } AUTH_MACH;
522    
# Line 545  struct auth_state_s { Line 548  struct auth_state_s {
548  };  };
549    
550  struct auth_state_s states[] = {  struct auth_state_s states[] = {
551          as_init,         as_validate,          { as_init,         as_validate,
552                           0,               L_null,     sfn_init,                           0,               L_null,     sfn_init },
553    
554          as_validate,     as_disable,          { as_validate,     as_disable,
555                           0,               L_null,     sfn_validate,                           0,               L_null,     sfn_validate },
556                    
557          as_disable,      as_realmuse,          { as_disable,      as_realmuse,
558                           0,               L_null,     sfn_disable,                           0,               L_null,     sfn_disable },
559                    
560          as_realmuse,     as_simuse,          { as_realmuse,     as_simuse,
561                           0,               L_null,     sfn_realmuse,                           0,               L_null,     sfn_realmuse },
562                    
563          as_simuse,       as_time,          { as_simuse,       as_time,
564                           DA_SIMULTANEOUS_USE, L_check, sfn_simuse,                           DA_SIMULTANEOUS_USE, L_check, sfn_simuse },
565                    
566          as_time,         as_eval,          { as_time,         as_eval,
567                           DA_LOGIN_TIME,   L_check, sfn_time,                           DA_LOGIN_TIME,   L_check, sfn_time },
568                    
569          as_eval,         as_scheme,          { as_eval,         as_scheme,
570                           0,               L_null,  sfn_eval_reply,                           0,               L_null,  sfn_eval_reply },
571    
572          as_scheme,       as_ipaddr,          { as_scheme,       as_ipaddr,
573                           DA_SCHEME_PROCEDURE, L_reply, sfn_scheme,                           DA_SCHEME_PROCEDURE, L_reply, sfn_scheme },
574                    
575          as_ipaddr,       as_exec_wait,          { as_ipaddr,       as_exec_wait,
576                           0,               L_null, sfn_ipaddr,                           0,               L_null, sfn_ipaddr },
577                    
578          as_exec_wait,    as_cleanup_cbkid,          { as_exec_wait,    as_cleanup_cbkid,
579                           DA_EXEC_PROGRAM_WAIT, L_reply, sfn_exec_wait,                           DA_EXEC_PROGRAM_WAIT, L_reply, sfn_exec_wait },
580                    
581          as_cleanup_cbkid,as_menu_challenge,          { as_cleanup_cbkid,as_menu_challenge,
582                           DA_CALLBACK_ID,  L_reply, sfn_cleanup_cbkid,                           DA_CALLBACK_ID,  L_reply, sfn_cleanup_cbkid },
583                    
584          as_menu_challenge,         as_ack,          { as_menu_challenge,         as_ack,
585                           DA_MENU,         L_reply, sfn_menu_challenge,                           DA_MENU,         L_reply, sfn_menu_challenge },
586                    
587          as_ack,          as_exec_nowait,          { as_ack,          as_exec_nowait,
588                           0,               L_null, sfn_ack,                           0,               L_null, sfn_ack },
589                    
590          as_exec_nowait,  as_stop,          { as_exec_nowait,  as_stop,
591                           DA_EXEC_PROGRAM, L_reply, sfn_exec_nowait,                           DA_EXEC_PROGRAM, L_reply, sfn_exec_nowait },
592                    
593          as_stop,         as_stop,          { as_stop,         as_stop,
594                           0,               L_null, NULL,                           0,               L_null, NULL },
595                    
596          as_reject,       as_stop,          { as_reject,       as_stop,
597                           0,               L_null, sfn_reject,                           0,               L_null, sfn_reject },
598  };  };
599    
 static void auth_log(AUTH_MACH *m, char *diag, char *pass, char *reason,  
                      char *addstr);  
600  static int is_log_mode(AUTH_MACH *m, int mask);  static int is_log_mode(AUTH_MACH *m, int mask);
601  static void auth_format_msg(AUTH_MACH *m, int msg_id);  static void auth_format_msg(AUTH_MACH *m, int msg_id);
602  static char *auth_finish_msg(AUTH_MACH *m);  static char *auth_finish_msg(AUTH_MACH *m);
603    
604  void  static void
605  auth_log(AUTH_MACH *m, char *diag, char *pass, char *reason, char *addstr)  auth_log(AUTH_MACH *m, const char *diag, const char *pass,
606             const char *reason, const char *addstr)
607  {  {
608          if (reason)          if (reason)
609                  radlog_req(L_NOTICE, m->req,                  radlog_req(L_NOTICE, m->req,
# Line 914  sfn_validate(AUTH_MACH *m) Line 916  sfn_validate(AUTH_MACH *m)
916  {  {
917          RADIUS_REQ *radreq = m->req;          RADIUS_REQ *radreq = m->req;
918          int rc;          int rc;
         char *reason = NULL;  
919                    
920          rc = rad_check_password(radreq,          rc = rad_check_password(radreq,
921                                  m->user_check, m->namepair,                                  m->user_check, m->namepair,

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26