Diff for /embedaddon/mpd/src/auth.c between versions 1.1 and 1.1.1.2

version 1.1, 2012/02/21 23:32:47 version 1.1.1.2, 2013/07/22 08:44:29
Line 179  ACLDestroy(struct acl *acl) Line 179  ACLDestroy(struct acl *acl)
   
 void    authparamsInit(struct authparams *ap) {  void    authparamsInit(struct authparams *ap) {
     memset(ap,0,sizeof(struct authparams));      memset(ap,0,sizeof(struct authparams));
       ap->eapmsg = NULL;
       ap->state = NULL;
       ap->class = NULL;
     ap->msdomain = NULL;      ap->msdomain = NULL;
 #ifdef SIOCSIFDESCR  #ifdef SIOCSIFDESCR
     ap->ifdescr = NULL;      ap->ifdescr = NULL;
Line 602  AuthDataNew(Link l)  Line 605  AuthDataNew(Link l) 
     Auth        a = &l->lcp.auth;        Auth        a = &l->lcp.auth;  
   
     auth = Malloc(MB_AUTH, sizeof(*auth));      auth = Malloc(MB_AUTH, sizeof(*auth));
       auth->reply_message = NULL;
       auth->mschap_error = NULL;
       auth->mschapv2resp = NULL;
     auth->conf = l->lcp.auth.conf;      auth->conf = l->lcp.auth.conf;
     if (l->lcp.auth.conf.extauth_script)      if (l->lcp.auth.conf.extauth_script)
         auth->conf.extauth_script = Mstrdup(MB_AUTH, l->lcp.auth.conf.extauth_script);          auth->conf.extauth_script = Mstrdup(MB_AUTH, l->lcp.auth.conf.extauth_script);
Line 613  AuthDataNew(Link l)  Line 619  AuthDataNew(Link l) 
     strlcpy(auth->info.session_id, l->session_id, sizeof(auth->info.session_id));      strlcpy(auth->info.session_id, l->session_id, sizeof(auth->info.session_id));
     strlcpy(auth->info.peer_ident, l->lcp.peer_ident, sizeof(l->lcp.peer_ident));      strlcpy(auth->info.peer_ident, l->lcp.peer_ident, sizeof(l->lcp.peer_ident));
     auth->info.originate = l->originate;      auth->info.originate = l->originate;
       auth->info.downReason = NULL;
   
     if (l->bund) {      if (l->bund) {
         strlcpy(auth->info.ifname, l->bund->iface.ifname, sizeof(auth->info.ifname));          strlcpy(auth->info.ifname, l->bund->iface.ifname, sizeof(auth->info.ifname));
Line 725  AuthStat(Context ctx, int ac, char *av[], void *arg) Line 732  AuthStat(Context ctx, int ac, char *av[], void *arg)
     Printf("\tInterface descr.: \"%s\"\r\n",       Printf("\tInterface descr.: \"%s\"\r\n", 
         au->params.ifdescr != NULL ? au->params.ifdescr : "<none>");          au->params.ifdescr != NULL ? au->params.ifdescr : "<none>");
 #endif  #endif
   #ifdef SIOCAIFGROUP
     Printf("\tInterface group : %s\r\n", au->params.ifgroup);      Printf("\tInterface group : %s\r\n", au->params.ifgroup);
   #endif
     Printf("\tIP range        : %s\r\n", (au->params.range_valid)?      Printf("\tIP range        : %s\r\n", (au->params.range_valid)?
         u_rangetoa(&au->params.range,buf,sizeof(buf)):"");          u_rangetoa(&au->params.range,buf,sizeof(buf)):"");
     Printf("\tIP pool         : %s\r\n", au->params.ippool);      Printf("\tIP pool         : %s\r\n", au->params.ippool);
Line 898  AuthAccountStart(Link l, int type) Line 907  AuthAccountStart(Link l, int type)
   
         if (paction_start(&a->acct_thread, &gGiantMutex, AuthAccount,           if (paction_start(&a->acct_thread, &gGiantMutex, AuthAccount, 
                 AuthAccountFinish, auth) == -1) {                  AuthAccountFinish, auth) == -1) {
            Log(LG_ERR, ("[%s] ACCT: Couldn't start thread: %d",             Perror("[%s] ACCT: Couldn't start thread", l->name);
                l->name, errno)); 
             AuthDataDestroy(auth);              AuthDataDestroy(auth);
         }          }
     }      }
Line 1119  AuthAsyncStart(Link l, AuthData auth) Line 1127  AuthAsyncStart(Link l, AuthData auth)
   
     if (paction_start(&a->thread, &gGiantMutex, AuthAsync,       if (paction_start(&a->thread, &gGiantMutex, AuthAsync, 
         AuthAsyncFinish, auth) == -1) {          AuthAsyncFinish, auth) == -1) {
        Log(LG_ERR, ("[%s] AUTH: Couldn't start thread: %d",         Perror("[%s] AUTH: Couldn't start thread", l->name);
            l->name, errno)); 
         auth->status = AUTH_STATUS_FAIL;          auth->status = AUTH_STATUS_FAIL;
         auth->why_fail = AUTH_FAIL_NOT_EXPECTED;          auth->why_fail = AUTH_FAIL_NOT_EXPECTED;
         auth->finish(l, auth);          auth->finish(l, auth);
Line 1337  AuthSystem(AuthData auth) Line 1344  AuthSystem(AuthData auth)
     err=errno;      err=errno;
     GIANT_MUTEX_UNLOCK(); /* We must release lock before Log() */      GIANT_MUTEX_UNLOCK(); /* We must release lock before Log() */
     if (err)      if (err)
      Perror("[%s] AUTH: Error retrieving passwd", auth->info.lnkname);      Log(LG_ERR, ("[%s] AUTH: Error retrieving passwd: %s",
         auth->info.lnkname, strerror(err)));
     else      else
       Log(LG_AUTH, ("[%s] AUTH: User \"%s\" not found in the systems database",        Log(LG_AUTH, ("[%s] AUTH: User \"%s\" not found in the systems database",
         auth->info.lnkname, auth->params.authname));          auth->info.lnkname, auth->params.authname));
Line 1500  AuthPAM(AuthData auth) Line 1508  AuthPAM(AuthData auth)
         return;          return;
     }      }
           
    if (pam_start("mpd", auth->params.authname, &pamc, &pamh) != PAM_SUCCESS) {    if (pam_start(gPamService, auth->params.authname, &pamc, &pamh) != PAM_SUCCESS) {
         Log(LG_ERR, ("[%s] AUTH: PAM error", auth->info.lnkname));          Log(LG_ERR, ("[%s] AUTH: PAM error", auth->info.lnkname));
         auth->status = AUTH_STATUS_FAIL;          auth->status = AUTH_STATUS_FAIL;
         auth->why_fail = AUTH_FAIL_NOT_EXPECTED;          auth->why_fail = AUTH_FAIL_NOT_EXPECTED;
Line 1569  AuthPAMAcct(AuthData auth) Line 1577  AuthPAMAcct(AuthData auth)
         return (0);          return (0);
     }      }
   
    if (pam_start("mpd", auth->params.authname, &pamc, &pamh) != PAM_SUCCESS) {    if (pam_start(gPamService, auth->params.authname, &pamc, &pamh) != PAM_SUCCESS) {
         Log(LG_ERR, ("[%s] ACCT: PAM error", auth->info.lnkname));          Log(LG_ERR, ("[%s] ACCT: PAM error", auth->info.lnkname));
         return (-1);          return (-1);
     }      }

Removed from v.1.1  
changed lines
  Added in v.1.1.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>