version 1.4, 2000/06/19 20:35:48 |
version 1.5, 2000/06/19 22:42:28 |
|
|
#include "tcfsdefines.h" |
#include "tcfsdefines.h" |
|
|
tcfs_flags tcfs_getflags(int); |
tcfs_flags tcfs_getflags(int); |
tcfs_flags tcfs_setflags(int,tcfs_flags); |
tcfs_flags tcfs_setflags(int, tcfs_flags); |
|
|
int |
int |
flags_main(int argc, char *argv[]) |
flags_main(int argc, char *argv[]) |
|
|
setuid(getuid()); |
setuid(getuid()); |
|
|
if (argc < 3) { |
if (argc < 3) { |
fprintf (stderr, "tcfsflags [op]{r,x,g} file\n" |
fprintf(stderr, "tcfsflags [op]{r,x,g} file\n" |
"\t op can either be + or -.\n\n"); |
"\t op can either be + or -.\n\n"); |
exit(1); |
exit(1); |
} |
} |
|
|
fd = open(argv[2],O_RDONLY); |
fd = open(argv[2], O_RDONLY); |
if (!fd) { |
if (!fd) { |
fprintf(stderr, "open failed\n"); |
fprintf(stderr, "open failed\n"); |
exit(1); |
exit(1); |
|
|
|
|
i = tcfs_getflags(fd); |
i = tcfs_getflags(fd); |
if (i.flag == -1) { |
if (i.flag == -1) { |
fprintf(stderr,"getflags error\n"); |
fprintf(stderr, "getflags error\n"); |
close(fd); |
close(fd); |
exit(1); |
exit(1); |
} |
} |