root/trunk/freewrt/package/busybox/patches/310-passwd_access.patch

Revision 3294, 1.2 kB (checked in by tg, 5 years ago)

add comments to some of the diffs

  • busybox-1.4.2/networking/httpd.c

    old new  
    14041404                        if (ENABLE_FEATURE_HTTPD_AUTH_MD5) { 
    14051405                                char *cipher; 
    14061406                                char *pp; 
     1407                                char *ppnew = NULL; 
     1408                                struct passwd * pwd = NULL; 
    14071409 
    14081410                                if (strncmp(p, request, u-request) != 0) { 
    14091411                                        /* user uncompared */ 
     
    14101412                                        continue; 
    14111413                                } 
    14121414                                pp = strchr(p, ':'); 
     1415                                if(pp && pp[1] == '$' && pp[2] == 'p' && 
     1416                                                         pp[3] == '$' && pp[4] && 
     1417                                                         (pwd = getpwnam(&pp[4])) != NULL) { 
     1418                                        if(pwd->pw_passwd && pwd->pw_passwd[0] == '!') { 
     1419                                                prev = NULL; 
     1420                                                continue; 
     1421                                        } 
     1422                                        ppnew = malloc(5 + strlen(pwd->pw_passwd)); 
     1423                                        ppnew[0] = ':'; 
     1424                                        strcpy(ppnew + 1, pwd->pw_passwd); 
     1425                                        pp = ppnew; 
     1426                                } 
    14131427                                if (pp && pp[1] == '$' && pp[2] == '1' && 
    14141428                                                pp[3] == '$' && pp[4]) { 
    14151429                                        pp++; 
     
    14181432                                                goto set_remoteuser_var;   /* Ok */ 
    14191433                                        /* unauthorized */ 
    14201434                                        continue; 
     1435                                } 
     1436                                if (ppnew) { 
     1437                                        free(ppnew); 
     1438                                        ppnew = NULL; 
    14211439                                } 
    14221440                        } 
    14231441 
Note: See TracBrowser for help on using the browser.