int argc;
char *argv[];
{
+ char buffer[PATH_MAX + 1];
int n, mask;
sync();
if (geteuid() == 0 || getuid() == 0) {
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test17", NULL);
+ realpath(argv[0], buffer);
+ execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
printf("Test 17 cannot run as root; test aborted\n");
exit(1);
}
/* "test.c", created by Rene Montsma and Menno Wilcke */
-_PROTOTYPE(int main, (void));
+_PROTOTYPE(int main, (int argc, char **argv));
_PROTOTYPE(void test, (void));
_PROTOTYPE(void test01, (void));
_PROTOTYPE(void test02, (void));
/*****************************************************************************
* TEST *
****************************************************************************/
-int main()
+int main(int argc, char **argv)
{
+ char buffer[PATH_MAX + 1];
int n;
if (geteuid() == 0 || getuid() == 0) {
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test18", NULL);
+ realpath(argv[0], buffer);
+ execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
printf("Test 18 cannot run as root; test aborted\n");
exit(1);
}
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
+#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
int argc;
char *argv[];
{
+ char buffer[PATH_MAX + 1];
int i, m;
m = (argc == 2 ? atoi(argv[1]) : 0xFFFF);
if (geteuid() == 0 || getuid() == 0) {
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test19", NULL);
+ realpath(argv[0], buffer);
+ execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
printf("Test 19 cannot run as root; test aborted\n");
exit(1);
}
char *argv[];
{
+ char buffer[PATH_MAX + 1];
int i, m = 0xFFFF;
sync();
if (geteuid() == 0 || getuid() == 0) {
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test21", NULL);
+ realpath(argv[0], buffer);
+ execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
printf("Test 21 cannot run as root; test aborted\n");
exit(1);
}
int argc;
char *argv[];
{
+ char buffer[PATH_MAX + 1];
int i, m = 0xFFFF;
sync();
if (geteuid() == 0 || getuid() == 0) {
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test25", NULL);
+ realpath(argv[0], buffer);
+ execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
printf("Test 25 cannot run as root; test aborted\n");
exit(1);
}
int argc;
char *argv[];
{
+ char buffer[PATH_MAX + 1];
int i, m = 0xFFFF;
sync();
if (geteuid() == 0 || getuid() == 0) {
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test3", NULL);
+ realpath(argv[0], buffer);
+ execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
printf("Test 3 cannot run as root; test aborted\n");
exit(1);
}
int argc;
char *argv[];
{
+ char buffer[PATH_MAX + 1];
int i, m = 0xFFFF;
sync();
if (geteuid() == 0 || getuid() == 0) {
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", "/usr/src/test/test6", NULL);
+ realpath(argv[0], buffer);
+ execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
printf("Test 6 cannot run as root; test aborted\n");
exit(1);
}