55/* problems. */
66/**********************************************************************/
77# include <stdio.h>
8+ # include <unistd.h>
89# include <fcntl.h>
910# include <stdlib.h>
1011# include <string.h>
1112# include <signal.h>
1213# include <errno.h>
14+ # include <unistd.h>
15+ # include <sys/types.h>
16+ # include <sys/stat.h>
17+ # include <sys/time.h>
18+ # include <sys/mman.h>
19+ # include <sys/ipc.h>
20+ # include <sys/sem.h>
21+ # include <sys/shm.h>
22+ # include <poll.h>
23+ # include <sys/uio.h>
24+ # include <sys/fsuid.h>
25+ # include <sched.h>
26+ # include <sys/file.h>
1327/*# include <sys/vm86.h>*/
1428
1529static int cnt ;
@@ -108,8 +122,8 @@ int main(int argc, char **argv)
108122 x += getuid ();
109123 x += getgid ();
110124 x += setsid ();
111- x += seteuid ();
112- x += setegid ();
125+ x += seteuid (0 );
126+ x += setegid (0 );
113127 lseek (0 , 0 , -1 );
114128 kill (0 , 0 );
115129 signal (99 , 0 );
@@ -118,36 +132,36 @@ int main(int argc, char **argv)
118132// *(int *) 0 = 0;
119133 pipe (0 );
120134 munmap (0 , 0 );
121- mincore (0 , 0 );
122- shmget (0 );
123- shmat (0 );
135+ mincore (0 , 0 , 0 );
136+ shmget (0 , 0 , 0 );
137+ shmat (0 , 0 , 0 );
124138
125139 line = __LINE__ ;
126- poll (-1 , 0 , 0 );
140+ poll (( void * ) -1 , 0 , 0 );
127141 signal (SIGSEGV , SIG_IGN );
128142// ppoll(-1, -1, -1, 0);
129143 signal (SIGSEGV , SIG_DFL );
130144 sched_yield ();
131- readv (-1 , 0 , 0 , 0 );
132- writev (-1 , 0 , 0 , 0 );
145+ readv (-1 , 0 , 0 );
146+ writev (-1 , 0 , 0 );
133147 msync (0 , 0 , 0 );
134148 fsync (-1 );
135149 fdatasync (-1 );
136150 semget (0 , 0 , 0 );
137151 semctl (0 , 0 , 0 );
138- uselib (NULL );
152+ // uselib(NULL);
139153 pivot_root (0 , 0 );
140154 personality (-1 );
141155 setfsuid (-1 );
142156 flock (-1 , 0 );
143- shmdt (0 , 0 , 0 );
157+ shmdt (0 );
144158 times (0 );
145159 mremap (0 , 0 , 0 , 0 , 0 );
146160 madvise (0 , 0 , 0 );
147161 fchown (-1 , 0 , 0 );
148- lchown (0 , 0 , 0 );
149- setreuid ();
150- setregid ();
162+ lchown ("" , 0 , 0 );
163+ setreuid (0 , 0 );
164+ setregid (0 , 0 );
151165 link ("/nonexistant" , "/also-nonexistant" );
152166
153167 do_slow ();
@@ -156,11 +170,10 @@ int main(int argc, char **argv)
156170 rename ("/" , "/" );
157171 mkdir ("/junk/stuff////0" , 0777 );
158172 geteuid ();
159- getsid ();
160- getpgid ();
173+ getsid (0 );
174+ getpgid (0 );
161175 getresuid ();
162176 getresgid ();
163- getpgid ();
164177 ptrace (-1 , 0 , 0 , 0 );
165178 semop (0 , 0 , 0 );
166179 capget (0 , 0 );
@@ -170,7 +183,7 @@ int main(int argc, char **argv)
170183 settimeofday (0 , 0 );
171184 dup (-1 );
172185 dup2 (-1 , -1 );
173- shmctl (0 , 0 , 0 , 0 );
186+ shmctl (0 , 0 , 0 );
174187 execve ("/bin/nothing" , "/bin/nothing" , 0 );
175188 alarm (9999 );
176189 bind (0 , 0 , 0 );
@@ -199,7 +212,7 @@ int main(int argc, char **argv)
199212 sigprocmask (0 , 0 , 0 );
200213 x += open ("/nothing" , 0 );
201214 x += chdir ("/nothing" );
202- x += mknod ("/nothing/nothing" , 0 );
215+ x += mknod ("/nothing/nothing" , 0 , 0 );
203216 x += ioctl ();
204217 execve ("/nothing" , NULL , NULL );
205218 line = __LINE__ ;
@@ -213,7 +226,7 @@ int main(int argc, char **argv)
213226 brk (0 );
214227 sbrk (0 );
215228 line = __LINE__ ;
216- mmap (0 , 0 , 0 , 0 , 0 );
229+ mmap (0 , 0 , 0 , 0 , 0 , 0 );
217230 line = __LINE__ ;
218231 uname (0 );
219232 line = __LINE__ ;
@@ -226,7 +239,7 @@ int main(int argc, char **argv)
226239 umount (0 , 0 , 0 );
227240 swapon (0 , 0 );
228241 swapoff (0 );
229- sethostname (0 );
242+ sethostname (0 , 0 );
230243 line = __LINE__ ;
231244 time (NULL );
232245 unlink ("/nothing" );
0 commit comments