/[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.72 by gray, Fri Sep 20 14:15:26 2002 UTC revision 1.73 by gray, Fri Apr 18 05:27:10 2003 UTC
# Line 117  check_user_name(p) Line 117  check_user_name(p)
117          return *p;          return *p;
118  }  }
119    
120  static pthread_mutex_t pwd_mutex = PTHREAD_MUTEX_INITIALIZER;  LOCK_DECLARE(lock)
121    
122  /*  /*
123   * Check the users password against UNIX password database.   * Check the users password against UNIX password database.
# Line 144  unix_pass(name, passwd) Line 144  unix_pass(name, passwd)
144          struct pr_passwd *pr_pw;          struct pr_passwd *pr_pw;
145  #endif  #endif
146                    
147          pthread_cleanup_push((void (*)(void*))pthread_mutex_unlock,          LOCK_SET(lock);
                              &pwd_mutex);  
         pthread_mutex_lock(&pwd_mutex);  
148    
149  #if defined(OSFC2)  #if defined(OSFC2)
150          if (pr_pw = getprpwnam(name))          if (pr_pw = getprpwnam(name))
# Line 195  unix_pass(name, passwd) Line 193  unix_pass(name, passwd)
193                  else                  else
194                          encrypted_pass = estrdup(encrypted_pass);                          encrypted_pass = estrdup(encrypted_pass);
195          }          }
196          pthread_cleanup_pop(1);          
197            LOCK_RELEASE(lock);
198    
199          if (!encrypted_pass)          if (!encrypted_pass)
200                  return -1;                  return -1;
# Line 480  rad_auth_init(radreq, activefd) Line 479  rad_auth_init(radreq, activefd)
479           */           */
480          if (!huntgroup_access(radreq)) {          if (!huntgroup_access(radreq)) {
481                  radlog_req(L_NOTICE, radreq, _("No huntgroup access"));                  radlog_req(L_NOTICE, radreq, _("No huntgroup access"));
482                  rad_send_reply(RT_AUTHENTICATION_REJECT, radreq,                  radius_send_reply(RT_AUTHENTICATION_REJECT, radreq,
483                                 radreq->request, NULL, activefd);                                    radreq->request, NULL, activefd);
484                  return -1;                  return -1;
485          }          }
486    
# Line 829  sfn_init(m) Line 828  sfn_init(m)
828                  break;                  break;
829    
830          default:          default:
831                  rad_send_reply(radreq->server_code,                  radius_send_reply(radreq->server_code,
832                                 radreq,                                    radreq,
833                                 radreq->server_reply,                                    radreq->server_reply,
834                                 NULL,                                    NULL,
835                                 m->activefd);                                    m->activefd);
836                  newstate(as_stop);                  newstate(as_stop);
837                  return;                  return;
838          }          }
# Line 1278  sfn_menu_challenge(m) Line 1277  sfn_menu_challenge(m)
1277          msg = get_menu(m->check_pair->avp_strvalue);          msg = get_menu(m->check_pair->avp_strvalue);
1278          snprintf(state_value, sizeof(state_value),          snprintf(state_value, sizeof(state_value),
1279                     "MENU=%s", m->check_pair->avp_strvalue);                     "MENU=%s", m->check_pair->avp_strvalue);
1280          send_challenge(m->req, msg, state_value, m->activefd);          radius_send_challenge(m->req, msg, state_value, m->activefd);
1281                    
1282          debug(1,          debug(1,
1283                ("sending challenge (menu %s) to %s",                ("sending challenge (menu %s) to %s",
# Line 1295  sfn_ack(m) Line 1294  sfn_ack(m)
1294                    
1295          stat_inc(auth, m->req->ipaddr, num_accepts);          stat_inc(auth, m->req->ipaddr, num_accepts);
1296    
1297          rad_send_reply(RT_AUTHENTICATION_ACK,          radius_send_reply(RT_AUTHENTICATION_ACK,
1298                         m->req,                            m->req,
1299                         m->user_reply,                            m->user_reply,
1300                         auth_finish_msg(m),                            auth_finish_msg(m),
1301                         m->activefd);                            m->activefd);
1302                    
1303          if (is_log_mode(m, RLOG_AUTH)) {          if (is_log_mode(m, RLOG_AUTH)) {
1304                  auth_log(m, _("Login OK"),                  auth_log(m, _("Login OK"),
# Line 1319  sfn_reject(m) Line 1318  sfn_reject(m)
1318          AUTH_MACH *m;          AUTH_MACH *m;
1319  {  {
1320          debug(1, ("REJECT: %s", m->namepair->avp_strvalue));          debug(1, ("REJECT: %s", m->namepair->avp_strvalue));
1321          rad_send_reply(RT_AUTHENTICATION_REJECT,          radius_send_reply(RT_AUTHENTICATION_REJECT,
1322                         m->req,                            m->req,
1323                         m->user_reply,                            m->user_reply,
1324                         auth_finish_msg(m),                            auth_finish_msg(m),
1325                         m->activefd);                            m->activefd);
1326          stat_inc(auth, m->req->ipaddr, num_rejects);          stat_inc(auth, m->req->ipaddr, num_rejects);
1327  }  }
1328    

Legend:
Removed from v.1.72  
changed lines
  Added in v.1.73

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