summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2000-06-19 01:36:18 +0000
committerNiels Provos <provos@cvs.openbsd.org>2000-06-19 01:36:18 +0000
commit55f5d292b91fa6d17dd224298d10134892db0598 (patch)
tree553432da23282a6170f964ba90cef3be969493d4 /usr.bin
parent3b20956f604a4792c36fd1133244540f8be418e8 (diff)
make flags work
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tcfs/tcfs_flags.c14
-rw-r--r--usr.bin/tcfs/tcfsflag.c7
2 files changed, 13 insertions, 8 deletions
diff --git a/usr.bin/tcfs/tcfs_flags.c b/usr.bin/tcfs/tcfs_flags.c
index 3a3bb94f49b..b48b0cbf35d 100644
--- a/usr.bin/tcfs/tcfs_flags.c
+++ b/usr.bin/tcfs/tcfs_flags.c
@@ -45,19 +45,21 @@ tcfs_getflags(int fd)
tcfs_flags
tcfs_setflags(int fd, tcfs_flags x)
{
- tcfs_flags r,n;
+ tcfs_flags r, n;
r = tcfs_getflags(fd);
if (r.flag == -1) {
- r.flag = -1;
- return r;
+ r.flag = -1;
+ return r;
}
n = x;
- FI_SET_SP(&n,FI_SPURE(&r));
+ FI_SET_SP(&n, FI_SPURE(&r));
- if (fchflags(fd, n.flag))
- r.flag = -1;
+ if (fchflags(fd, n.flag)) {
+ perror("fchflags");
+ r.flag = -1;
+ }
return r;
}
diff --git a/usr.bin/tcfs/tcfsflag.c b/usr.bin/tcfs/tcfsflag.c
index 6b8dd73782e..dbb8b9cc6fa 100644
--- a/usr.bin/tcfs/tcfsflag.c
+++ b/usr.bin/tcfs/tcfsflag.c
@@ -35,6 +35,9 @@ flags_main(int argc, char *argv[])
int fd;
tcfs_flags i;
+ seteuid(getuid());
+ setuid(getuid());
+
if (argc < 3) {
fprintf (stderr, "tcfsflags {r,x,g} file\n\n");
exit(1);
@@ -66,9 +69,9 @@ flags_main(int argc, char *argv[])
break;
}
- i = tcfs_setflags(fd,i);
+ i = tcfs_setflags(fd, i);
if (i.flag == -1) {
- fprintf(stderr,"setflags error\n");
+ fprintf(stderr, "setflags error\n");
exit(1);
}
close(fd);