summaryrefslogtreecommitdiff
path: root/cydo.cpp
blob: 485d6475605df8028cf5802a3a36963595424f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <sysexits.h>
#include <unistd.h>

int main(int argc, char *argv[]) {
    setuid(0);
    setgid(0);

    if (argc < 2 || argv[1][0] != '/')
        argv[0] = "/usr/bin/dpkg";
    else {
        --argc;
        ++argv;
    }

    execv(argv[0], argv);
    return EX_UNAVAILABLE;
}