updated .gitignore and main.c
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 5s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 10s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 8s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Make (push) Successful in 5s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-CMake (push) Successful in 10s
Prepare Build and Testing executable binary / Prepare-Build-Testing-With-Meson (push) Successful in 8s
This commit is contained in:
@@ -4,3 +4,5 @@ sudo.pkg
|
|||||||
sudo.pkg.gz
|
sudo.pkg.gz
|
||||||
build
|
build
|
||||||
.cache
|
.cache
|
||||||
|
*.o
|
||||||
|
sudo
|
||||||
|
|||||||
+2
-5
@@ -16,17 +16,14 @@ void die(char *argv0, char *obj, char *msg) {
|
|||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
gid_t gid;
|
gid_t gid;
|
||||||
// char *endp;
|
|
||||||
/* Command line parsing */
|
/* Command line parsing */
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
fprintf(stderr, "Usage: %s COMMAND [ARG...]\n",
|
fprintf(stderr, "Usage: %s COMMAND [ARG...]\n",
|
||||||
argv[0]==NULL ? "sugexec" : argv[0]);
|
argv[0]==NULL ? "sugexec" : argv[0]);
|
||||||
exit(127);
|
exit(127);
|
||||||
}
|
}
|
||||||
uid = 0;//strtoul(argv[1], &endp, 0);
|
uid = 0;
|
||||||
// if (*endp) die(argv[0], argv[1], "Bad uid");
|
gid = 0;
|
||||||
gid = 0;//strtoul(argv[2], &endp, 0);
|
|
||||||
// if (*endp) die(argv[0], argv[2], "Bad gid");
|
|
||||||
/* Drop to specified user and group */
|
/* Drop to specified user and group */
|
||||||
if (setgid(gid)) die(argv[0], "setgid", NULL);
|
if (setgid(gid)) die(argv[0], "setgid", NULL);
|
||||||
if (setgroups(0, NULL)) die(argv[0], "setgroups", NULL);
|
if (setgroups(0, NULL)) die(argv[0], "setgroups", NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user