Changeset 98955


Ignore:
Timestamp:
Oct 22, 2012, 1:10:15 PM (12 years ago)
Author:
jmr@…
Message:

python27: update posixmodule.c.ed to fix crash in os.getgroups (#36085)

Location:
trunk/dports/lang/python27
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/python27/Portfile

    r91931 r98955  
    99# Remember to keep py27-tkinter and py27-gdbm's versions sync'd with this
    1010version             2.7.3
     11revision            1
    1112
    1213set major           [lindex [split $version .] 0]
  • trunk/dports/lang/python27/files/posixmodule.c.ed

    r74208 r98955  
     1g/^posix_setuid *(//^[  ]*uid_t/s/uid_t/int/
     2g/^posix_seteuid *(//^[         ]*uid_t/s/uid_t/int/
     3g/^posix_setegid *(//^[         ]*gid_t/s/gid_t/int/
     4g/^posix_setreuid *(//^[        ]*uid_t/s/uid_t/int/
     5g/^posix_setregid *(//^[        ]*gid_t/s/gid_t/int/
     6g/^posix_setgid *(//^[  ]*gid_t/s/gid_t/int/
    17/PyInt_FromLong((long)st->st_uid)/s//PyInt_FromLong((long)(int)st->st_uid)/
    28/PyInt_FromLong((long)st->st_gid)/s//PyInt_FromLong((long)(int)st->st_gid)/
     
    814/return PyInt_FromLong((long)geteuid());/s//return PyInt_FromLong((long)(int)geteuid());/
    915/return PyInt_FromLong((long)getgid());/s//return PyInt_FromLong((long)(int)getgid());/
    10 /^posix_getgroups/-1i
    11 #include <pwd.h>
    12 int getgrouplist_2(const char *name, gid_t basegid, gid_t **groups);
    13 
    14 .
    15 /gid_t grouplist\[MAX_GROUPS\];/c
    16         gid_t *grouplist = NULL;
    17         struct passwd *pw;
    18 .
    19 /n = getgroups(MAX_GROUPS, grouplist);/c
    20         if ((pw = getpwuid(getuid())) == NULL) {
    21             errno = EINVAL;
    22             posix_error();
    23             return NULL;
    24         }
    25         n = getgrouplist_2(pw->pw_name, pw->pw_gid, &grouplist);
    26 .
    27 /if (n < 0)/c
    28         if (n < 0) {
    29             errno = EINVAL;
    30 .
    31 /return result;/i
    32     if (grouplist) free(grouplist);
    33 .
     16/PyInt_FromLong((long)alt_grouplist\[i\]);/s//PyInt_FromLong((long)(int)alt_grouplist[i]);/
    3417/return PyInt_FromLong((long)getuid());/s//return PyInt_FromLong((long)(int)getuid());/
    3518/^posix_setgroups/a
Note: See TracChangeset for help on using the changeset viewer.