#include <sys/types.h>#include <sys/stat.h>#include <sys/wait.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <fcntl.h>#include <limits.h>#include <errno.h>#include <ctype.h>#include <time.h>#include <stdio.h>Include dependency graph for test34.c:

Go to the source code of this file.
Defines | |
| #define | MAX_ERROR 4 |
| #define | ITERATIONS 4 |
| #define | N 100 |
| #define | ALL_RWXB (S_IRWXU | S_IRWXG | S_IRWXO) |
| #define | ALL_SETB (S_ISUID | S_ISGID) |
| #define | ALL_BITS (ALL_RWXB | ALL_SETB) |
| #define | System(cmd) if (system(cmd) != 0) printf("``%s'' failed\n", cmd) |
| #define | Chdir(dir) if (chdir(dir) != 0) printf("Can't goto %s\n", dir) |
| #define | Stat(a, b) if (stat(a,b) != 0) printf("Can't stat %s\n", a) |
| #define | Mkfifo(f) if (mkfifo(f,0777)!=0) printf("Can't make fifo %s\n", f) |
| #define | Mkdir(f) if (mkdir(f,0777)!=0) printf("Can't make dir %s\n", f) |
| #define | Creat(f) if (close(creat(f,0777))!=0) printf("Can't creat %s\n",f) |
| #define | PASSWD_FILE "/etc/passwd" |
Functions | |
| _PROTOTYPE (void main,(int argc, char *argv[])) | |
| _PROTOTYPE (void test34a,(void)) | |
| _PROTOTYPE (mode_t mode,(char *file_name)) | |
| _PROTOTYPE (void e,(int number)) | |
| _PROTOTYPE (void getids,(uid_t *uid, gid_t *gid)) | |
| void | main (int argc, argv) |
| void | test34a () |
| void | test34b () |
| void | test34c () |
| void | makelongnames () |
| void | e (int n) |
| void | quit () |
| void | getids (uid_t *r_uid, gid_t *r_gid) |
Variables | |
| int | errct = 0 |
| int | subtest = 1 |
| int | superuser |
| int | I_can_chown |
| char | MaxName [NAME_MAX+1] |
| char | MaxPath [PATH_MAX] |
| char | NameTooLong [NAME_MAX+2] |
| char | PathTooLong [PATH_MAX+1] |
|
|
Definition at line 28 of file test34.c. Referenced by test34a(). |
|
|
Definition at line 26 of file test34.c. Referenced by test34a(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 34 of file test34.c. Referenced by dump_dir(), test34b(), test34c(), and test35c(). |
|
|
|
|
|
|
|
|
Definition at line 38 of file test34.c. Referenced by getids(). |
|
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Definition at line 565 of file test34.c. References chdir, errct, errno, exit(), MAX_ERROR, perror(), printf, subtest, and system(). |
|
||||||||||||
|
Definition at line 603 of file test34.c. References fclose(), fgets(), fopen(), fp, gid, i, isdigit, N, ngid, nuid, NULL, p, PASSWD_FILE, perror(), printf, strchr, and uid. |
|
||||||||||||
|
Definition at line 59 of file test34.c. References atoi, chdir, exit(), fflush(), fprintf(), geteuid, i, I_can_chown, ITERATIONS, m, makelongnames(), printf, stderr, stdout, superuser, sync, System, system(), test34a(), test34b(), test34c(), and umask. |
|
|
|
|
|
Definition at line 583 of file test34.c. References Chdir, errct, exit(), printf, System, and system(). |
|
|
Definition at line 95 of file test34.c. References ALL_BITS, ALL_RWXB, chmod, cnt, Creat, e, gid, mod, stat::st_atime, stat::st_ctime, stat::st_mode, stat::st_mtime, Stat, subtest, superuser, time, time_t, and uid. Referenced by main(). |
|
|
Definition at line 282 of file test34.c. References chmod, Creat, e, MaxName, MaxPath, Mkdir, Mkfifo, mod, stat::st_atime, stat::st_ctime, stat::st_mode, stat::st_mtime, Stat, strlen(), subtest, superuser, time, and time_t. Referenced by main(). |
|
|
Definition at line 396 of file test34.c. References alarm, chmod, chown, Creat, e, EACCES, ENAMETOOLONG, ENOENT, ENOTDIR, EPERM, errno, exit(), fork, getegid, geteuid, getids(), gid, I_can_chown, Mkdir, Mkfifo, NameTooLong, PathTooLong, printf, S_IXUSR, setgid, setuid, st, stat::st_mode, stat::st_uid, Stat, strlen(), subtest, superuser, System, system(), uid, and wait. Referenced by main(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.4.6