summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2000-06-20 07:58:58 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2000-06-20 07:58:58 +0000
commit776a1f06ae8b7106a529b3cbf5c4b3c5e70dfcb9 (patch)
treeb73ea229545e20b76e0f41e174a053098909a408 /usr.bin
parentc3c99f121a3abe960ffe947542b04d7d0f22f28e (diff)
add openbsd tags. rearrange headers as per style(9) and indent.
replace some strcpy by strlcpy.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tcfs/Makefile.inc2
-rw-r--r--usr.bin/tcfs/gentcfskey.c12
-rw-r--r--usr.bin/tcfs/tcfs_dbmaint.c14
-rw-r--r--usr.bin/tcfs/tcfs_flags.c20
-rw-r--r--usr.bin/tcfs/tcfs_getfspath.c10
-rw-r--r--usr.bin/tcfs/tcfs_getstatus.c13
-rw-r--r--usr.bin/tcfs/tcfsflag.c15
7 files changed, 44 insertions, 42 deletions
diff --git a/usr.bin/tcfs/Makefile.inc b/usr.bin/tcfs/Makefile.inc
index bc62c39a36d..12a4fcba977 100644
--- a/usr.bin/tcfs/Makefile.inc
+++ b/usr.bin/tcfs/Makefile.inc
@@ -1,3 +1,5 @@
+# $OpenBSD: Makefile.inc,v 1.2 2000/06/20 07:58:55 fgsch Exp $
+
CFLAGS+= -I${.CURDIR}/..
.include <bsd.obj.mk>
diff --git a/usr.bin/tcfs/gentcfskey.c b/usr.bin/tcfs/gentcfskey.c
index 098d49980b0..c0e429207fd 100644
--- a/usr.bin/tcfs/gentcfskey.c
+++ b/usr.bin/tcfs/gentcfskey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gentcfskey.c,v 1.3 2000/06/19 23:06:24 aaron Exp $ */
+/* $OpenBSD: gentcfskey.c,v 1.4 2000/06/20 07:58:56 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -12,14 +12,14 @@
* Base utility set v0.1
*/
-#include <stdio.h>
#include <sys/time.h>
-#include <termios.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <fcntl.h>
#include <err.h>
+#include <fcntl.h>
#include <md5.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <termios.h>
+#include <unistd.h>
#include <miscfs/tcfs/tcfs.h>
#include "tcfsdefines.h"
diff --git a/usr.bin/tcfs/tcfs_dbmaint.c b/usr.bin/tcfs/tcfs_dbmaint.c
index a753f4bfdf6..6ffb88f0dd5 100644
--- a/usr.bin/tcfs/tcfs_dbmaint.c
+++ b/usr.bin/tcfs/tcfs_dbmaint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfs_dbmaint.c,v 1.10 2000/06/20 07:33:51 fgsch Exp $ */
+/* $OpenBSD: tcfs_dbmaint.c,v 1.11 2000/06/20 07:58:57 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -12,16 +12,16 @@
* Base utility set v0.1
*/
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <db.h>
+#include <fcntl.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <stdarg.h>
#include <string.h>
-#include <db.h>
#include <syslog.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
+#include <unistd.h>
#include <miscfs/tcfs/tcfs.h>
#include "tcfslib.h"
diff --git a/usr.bin/tcfs/tcfs_flags.c b/usr.bin/tcfs/tcfs_flags.c
index cc87f87ca1b..acb7bb0139d 100644
--- a/usr.bin/tcfs/tcfs_flags.c
+++ b/usr.bin/tcfs/tcfs_flags.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfs_flags.c,v 1.5 2000/06/20 01:29:14 provos Exp $ */
+/* $OpenBSD: tcfs_flags.c,v 1.6 2000/06/20 07:58:57 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -12,17 +12,17 @@
* Base utility set v0.1
*/
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
#include <pwd.h>
+#include <stdio.h>
#include <unistd.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
#include <miscfs/tcfs/tcfs.h>
#include <miscfs/tcfs/tcfs_fileinfo.h>
@@ -34,9 +34,9 @@ tcfs_getflags(int fd)
tcfs_flags r;
struct stat s;
- if (fstat(fd, &s) < 0) {
+ if (fstat(fd, &s) < 0)
r.flag = -1;
- } else
+ else
r.flag = s.st_flags;
return (r);
diff --git a/usr.bin/tcfs/tcfs_getfspath.c b/usr.bin/tcfs/tcfs_getfspath.c
index e80cd6dc3fb..3c69ec18dd1 100644
--- a/usr.bin/tcfs/tcfs_getfspath.c
+++ b/usr.bin/tcfs/tcfs_getfspath.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfs_getfspath.c,v 1.5 2000/06/20 07:09:45 fgsch Exp $ */
+/* $OpenBSD: tcfs_getfspath.c,v 1.6 2000/06/20 07:58:57 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -12,10 +12,10 @@
* Base utility set v0.1
*/
+#include <fstab.h>
#include <stdio.h>
-#include <strings.h>
#include <stdlib.h>
-#include <fstab.h>
+#include <strings.h>
#include <miscfs/tcfs/tcfs.h>
#include "tcfslib.h"
@@ -30,7 +30,7 @@ tcfs_label_getcipher(char *label)
if (tcfs_get_label(label, NULL, &ciphernum))
return (ciphernum);
- return (-1);
+ return (-1);
}
int
@@ -79,7 +79,7 @@ tcfs_get_label(char *label2search, char *path, int *ciphernumber)
break;
if (path) {
- strcpy(path, mountpoint);
+ strlcpy(path, mountpoint, sizeof(*path));
found = 1;
}
diff --git a/usr.bin/tcfs/tcfs_getstatus.c b/usr.bin/tcfs/tcfs_getstatus.c
index 1475392f190..5c135d9ff0e 100644
--- a/usr.bin/tcfs/tcfs_getstatus.c
+++ b/usr.bin/tcfs/tcfs_getstatus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfs_getstatus.c,v 1.6 2000/06/20 07:09:46 fgsch Exp $ */
+/* $OpenBSD: tcfs_getstatus.c,v 1.7 2000/06/20 07:58:57 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -12,17 +12,18 @@
* Base utility set v0.1
*/
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/param.h>
+#include <sys/ucred.h>
#include <ctype.h>
#include <pwd.h>
#include <unistd.h>
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/mount.h>
+
#include <miscfs/tcfs/tcfs.h>
#include <miscfs/tcfs/tcfs_cmd.h>
-#include "tcfsdefines.h"
-#include <sys/ucred.h>
+#include "tcfsdefines.h"
#include "tcfslib.h"
#include "tcfspwdb.h"
diff --git a/usr.bin/tcfs/tcfsflag.c b/usr.bin/tcfs/tcfsflag.c
index 92779d5cbe4..321204382f2 100644
--- a/usr.bin/tcfs/tcfsflag.c
+++ b/usr.bin/tcfs/tcfsflag.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsflag.c,v 1.7 2000/06/20 01:29:14 provos Exp $ */
+/* $OpenBSD: tcfsflag.c,v 1.8 2000/06/20 07:58:57 fgsch Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -12,16 +12,16 @@
* Base utility set v0.1
*/
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/param.h>
+#include <sys/wait.h>
#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
#include <pwd.h>
+#include <stdio.h>
#include <unistd.h>
-#include <sys/param.h>
-#include <sys/mount.h>
-#include <sys/wait.h>
#include <miscfs/tcfs/tcfs.h>
#include <miscfs/tcfs/tcfs_fileinfo.h>
@@ -95,4 +95,3 @@ flags_main(int argc, char *argv[])
exit(0);
}
-