diff options
author | 2000-06-19 01:36:17 +0000 | |
---|---|---|
committer | 2000-06-19 01:36:17 +0000 | |
commit | 376151c91ebe74c4bd1927788a89781bc1c12cb2 (patch) | |
tree | 1feb7a115da483bbf61277b8ac1ae7b46158606f | |
parent | Upload memory ranges for NEW_NONCONTIG code, this one forgotten before 2.7 (diff) | |
download | wireguard-openbsd-376151c91ebe74c4bd1927788a89781bc1c12cb2.tar.xz wireguard-openbsd-376151c91ebe74c4bd1927788a89781bc1c12cb2.zip |
make flags work
-rw-r--r-- | usr.bin/tcfs/tcfs_flags.c | 14 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsflag.c | 7 |
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); |