~ubuntu-branches/debian/jessie/qemu/jessie

« back to all changes in this revision

Viewing changes to linux-user/linuxload.c

  • Committer: Package Import Robot
  • Author(s): Vagrant Cascadian
  • Date: 2011-10-03 12:29:18 UTC
  • mfrom: (1.2.13) (10.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20111003122918-zc4kv6epchrbgdta
Tags: 0.15.0+dfsg-1
* New upstream version.
* Install new qemu-system, qemu-user and qemu-user-static variants: 
  lm32, microblazeel, s390x, unicore32
* Patch from upstream to set QEMU_INCLUDES before QEMU_CFLAGS.
* Update debian/watch to check http://qemu.org/download.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    return 0;
27
27
}
28
28
 
29
 
static int in_group_p(gid_t g)
30
 
{
31
 
    /* return TRUE if we're in the specified group, FALSE otherwise */
32
 
    int         ngroup;
33
 
    int         i;
34
 
    gid_t       grouplist[NGROUPS];
35
 
 
36
 
    ngroup = getgroups(NGROUPS, grouplist);
37
 
    for(i = 0; i < ngroup; i++) {
38
 
        if(grouplist[i] == g) {
39
 
            return 1;
40
 
        }
41
 
    }
42
 
    return 0;
43
 
}
44
 
 
45
29
static int count(char ** vec)
46
30
{
47
31
    int         i;
57
41
{
58
42
    struct stat         st;
59
43
    int mode;
60
 
    int retval, id_change;
 
44
    int retval;
61
45
 
62
46
    if(fstat(bprm->fd, &st) < 0) {
63
47
        return(-errno);
73
57
 
74
58
    bprm->e_uid = geteuid();
75
59
    bprm->e_gid = getegid();
76
 
    id_change = 0;
77
60
 
78
61
    /* Set-uid? */
79
62
    if(mode & S_ISUID) {
80
63
        bprm->e_uid = st.st_uid;
81
 
        if(bprm->e_uid != geteuid()) {
82
 
            id_change = 1;
83
 
        }
84
64
    }
85
65
 
86
66
    /* Set-gid? */
91
71
     */
92
72
    if ((mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
93
73
        bprm->e_gid = st.st_gid;
94
 
        if (!in_group_p(bprm->e_gid)) {
95
 
                id_change = 1;
96
 
        }
97
74
    }
98
75
 
99
76
    retval = read(bprm->fd, bprm->buf, BPRM_BUF_SIZE);