mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-28 03:56:48 +03:00
setuid-wrapper.c: Remove tabs
This commit is contained in:
parent
e7ab051cda
commit
a8aa9f3fd4
1 changed files with 6 additions and 6 deletions
|
@ -31,7 +31,7 @@ int main(int argc, char * * argv)
|
||||||
false `X.real' file, to allow arbitrary programs from being
|
false `X.real' file, to allow arbitrary programs from being
|
||||||
executed setuid. */
|
executed setuid. */
|
||||||
assert ((strncmp(self, wrapperDir, sizeof(wrapperDir)) == 0) &&
|
assert ((strncmp(self, wrapperDir, sizeof(wrapperDir)) == 0) &&
|
||||||
(self[strlen(wrapperDir)] == '/'));
|
(self[strlen(wrapperDir)] == '/'));
|
||||||
|
|
||||||
/* Make *really* *really* sure that we were executed as `self',
|
/* Make *really* *really* sure that we were executed as `self',
|
||||||
and not, say, as some other setuid program. That is, our
|
and not, say, as some other setuid program. That is, our
|
||||||
|
@ -42,12 +42,12 @@ int main(int argc, char * * argv)
|
||||||
assert (lstat(self, &st) != -1);
|
assert (lstat(self, &st) != -1);
|
||||||
|
|
||||||
//printf("%d %d\n", st.st_uid, st.st_gid);
|
//printf("%d %d\n", st.st_uid, st.st_gid);
|
||||||
|
|
||||||
assert ((st.st_mode & S_ISUID) == 0 ||
|
assert ((st.st_mode & S_ISUID) == 0 ||
|
||||||
(st.st_uid == geteuid()));
|
(st.st_uid == geteuid()));
|
||||||
|
|
||||||
assert ((st.st_mode & S_ISGID) == 0 ||
|
assert ((st.st_mode & S_ISGID) == 0 ||
|
||||||
st.st_gid == getegid());
|
st.st_gid == getegid());
|
||||||
|
|
||||||
/* And, of course, we shouldn't be writable. */
|
/* And, of course, we shouldn't be writable. */
|
||||||
assert (!(st.st_mode & (S_IWGRP | S_IWOTH)));
|
assert (!(st.st_mode & (S_IWGRP | S_IWOTH)));
|
||||||
|
@ -69,13 +69,13 @@ int main(int argc, char * * argv)
|
||||||
real[len] = 0;
|
real[len] = 0;
|
||||||
|
|
||||||
close(fdSelf);
|
close(fdSelf);
|
||||||
|
|
||||||
//printf("real = %s, len = %d\n", real, len);
|
//printf("real = %s, len = %d\n", real, len);
|
||||||
|
|
||||||
execve(real, argv, environ);
|
execve(real, argv, environ);
|
||||||
|
|
||||||
fprintf(stderr, "%s: cannot run `%s': %s\n",
|
fprintf(stderr, "%s: cannot run `%s': %s\n",
|
||||||
argv[0], real, strerror(errno));
|
argv[0], real, strerror(errno));
|
||||||
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue