summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tcfs/gentcfskey.c4
-rw-r--r--usr.bin/tcfs/tcfs_dbmaint.c24
-rw-r--r--usr.bin/tcfs/tcfs_getfspath.c4
-rw-r--r--usr.bin/tcfs/tcfs_getstatus.c3
-rw-r--r--usr.bin/tcfs/tcfs_keymaint.c13
-rw-r--r--usr.bin/tcfs/tcfsaddgroup.c65
-rw-r--r--usr.bin/tcfs/tcfsadduser.c4
-rw-r--r--usr.bin/tcfs/tcfsflag.c5
-rw-r--r--usr.bin/tcfs/tcfsgenkey.c10
-rw-r--r--usr.bin/tcfs/tcfsmng.c6
-rw-r--r--usr.bin/tcfs/tcfsputkey.c10
-rw-r--r--usr.bin/tcfs/tcfsrmgroup.c9
-rw-r--r--usr.bin/tcfs/tcfsrmuser.c4
-rw-r--r--usr.bin/tcfs/tcfsrun.c4
-rw-r--r--usr.bin/tcfs/tcfstat.c2
-rw-r--r--usr.bin/tcfs/tcfsuse.c4
16 files changed, 95 insertions, 76 deletions
diff --git a/usr.bin/tcfs/gentcfskey.c b/usr.bin/tcfs/gentcfskey.c
index 9247cc621bd..098d49980b0 100644
--- a/usr.bin/tcfs/gentcfskey.c
+++ b/usr.bin/tcfs/gentcfskey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gentcfskey.c,v 1.2 2000/06/19 20:35:47 fgsch Exp $ */
+/* $OpenBSD: gentcfskey.c,v 1.3 2000/06/19 23:06:24 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -25,7 +25,7 @@
#include "tcfsdefines.h"
u_char *
-gentcfskey (void)
+gentcfskey(void)
{
u_char *buff;
MD5_CTX ctx, ctx2;
diff --git a/usr.bin/tcfs/tcfs_dbmaint.c b/usr.bin/tcfs/tcfs_dbmaint.c
index 5a30e5e207b..fd8758ed39f 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.7 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfs_dbmaint.c,v 1.8 2000/06/19 23:06:24 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -52,7 +52,7 @@ tcfsgpwdbr_new(tcfsgpwdb **new)
}
int
-tcfspwdbr_edit (tcfspwdb **tmp, int flags, ...)
+tcfspwdbr_edit(tcfspwdb **tmp, int flags, ...)
{
va_list argv;
char *d;
@@ -101,18 +101,21 @@ tcfsgpwdbr_edit(tcfsgpwdb **tmp, int flags, ...)
if (flags & F_GID) {
gid_t d;
+
d = va_arg(argv, gid_t);
(*tmp)->gid = d;
}
if (flags & F_MEMBERS) {
int d;
+
d = va_arg(argv, int);
(*tmp)->n = d;
}
if (flags & F_THRESHOLD) {
int d;
+
d = va_arg(argv, int);
(*tmp)->soglia = d;
}
@@ -239,7 +242,8 @@ tcfs_ggetpwnam(char *user, gid_t gid, tcfsgpwdb **dest)
if (!pdb)
return (NULL);
- key = (char*)calloc(strlen(user)+4/*gid lenght*/+1/*null*/,sizeof(char));
+ key = (char *)calloc(strlen(user) + 4 /* gid length */ + 1 /* null */,
+ sizeof(char));
if (!key)
return (NULL);
@@ -358,7 +362,7 @@ tcfs_rmgroup(gid_t gid)
while (dbkey.data) {
char *tmp;
- tmp = (char*)calloc(1024, sizeof(char));
+ tmp = (char *)calloc(1024, sizeof(char));
sprintf(tmp, "\33%d\0", gid);
if (strstr(dbkey.data, tmp)) {
@@ -413,7 +417,7 @@ tcfs_chgpwd(char *user, char *old, char *new)
tcfspwdb *user_info = NULL;
unsigned char *key;
- key = (unsigned char*)calloc(UUKEYSIZE + 1, sizeof(char));
+ key = (unsigned char *)calloc(UUKEYSIZE + 1, sizeof(char));
if (!tcfs_getpwnam(user, &user_info))
return (0);
@@ -436,12 +440,12 @@ tcfs_chgpwd(char *user, char *old, char *new)
int
tcfs_chgpassword(char *user, char *old, char *new)
{
- int error1=0;
+ int error1 = 0;
DB *gpdb;
DBT found, key;
unsigned char *ckey;
- ckey = (unsigned char*)calloc(UUGKEYSIZE + 1, sizeof(char));
+ ckey = (unsigned char *)calloc(UUGKEYSIZE + 1, sizeof(char));
if (!ckey)
return (0);
@@ -466,10 +470,12 @@ tcfs_chgpassword(char *user, char *old, char *new)
gpdb->get(gpdb, &key, &found, 0);
- if (!tcfs_decrypt_key(old, ((tcfsgpwdb *)found.data)->gkey, ckey, GKEYSIZE))
+ if (!tcfs_decrypt_key(old, ((tcfsgpwdb *)found.data)->gkey,
+ ckey, GKEYSIZE))
return (0);
- if (!tcfs_encrypt_key(new, ckey, GKEYSIZE, ((tcfsgpwdb *)found.data)->gkey, UUGKEYSIZE + 1))
+ if (!tcfs_encrypt_key(new, ckey, GKEYSIZE,
+ ((tcfsgpwdb *)found.data)->gkey, UUGKEYSIZE + 1))
return (0);
if (gpdb->put(gpdb, &key, &found, 0)) {
diff --git a/usr.bin/tcfs/tcfs_getfspath.c b/usr.bin/tcfs/tcfs_getfspath.c
index 08e9998a793..045130d860b 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.3 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfs_getfspath.c,v 1.4 2000/06/19 23:06:24 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -98,5 +98,5 @@ tcfs_get_label(char *label2search, char *path, int *ciphernumber)
out:
fclose(fp);
- return found;
+ return (found);
}
diff --git a/usr.bin/tcfs/tcfs_getstatus.c b/usr.bin/tcfs/tcfs_getstatus.c
index 2fbb195cd48..7d6deed3b0b 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.3 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfs_getstatus.c,v 1.4 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -37,5 +37,6 @@ tcfs_getstatus(char *filesystem, struct tcfs_status *st)
x.cmd = TCFS_GET_STATUS;
i = tcfs_callfunction(filesystem, &x);
*st = x.st;
+
return (i);
}
diff --git a/usr.bin/tcfs/tcfs_keymaint.c b/usr.bin/tcfs/tcfs_keymaint.c
index 5e6d34d9422..188c60a0e76 100644
--- a/usr.bin/tcfs/tcfs_keymaint.c
+++ b/usr.bin/tcfs/tcfs_keymaint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfs_keymaint.c,v 1.8 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfs_keymaint.c,v 1.9 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -51,7 +51,7 @@ tcfs_callfunction(char *filesystem, struct tcfs_args *arg)
int i;
if (tcfs_verify_fs(filesystem))
- i = mount("tcfs", filesystem, MNT_UPDATE, (void*)arg);
+ i = mount("tcfs", filesystem, MNT_UPDATE, (void *)arg);
else
i = -1;
@@ -62,7 +62,7 @@ int
tcfs_decrypt_key(char *pwd, u_char *t, u_char *tk, int tklen)
{
char pass[_PASSWORD_LEN];
- char tcfskey[2*KEYSIZE], iv[8];
+ char tcfskey[KEYSIZE * 2], iv[8];
blf_ctx ctx;
int len;
@@ -138,6 +138,7 @@ int
tcfs_user_enable(char *filesystem, uid_t user, u_char *key)
{
struct tcfs_args a;
+
a.user = user;
memcpy(a.tcfs_key, key, sizeof(a.tcfs_key));
a.cmd = TCFS_PUT_UIDKEY;
@@ -149,6 +150,7 @@ int
tcfs_user_disable(char *filesystem, uid_t user)
{
struct tcfs_args a;
+
a.user = user;
a.cmd = TCFS_RM_UIDKEY;
@@ -159,6 +161,7 @@ int
tcfs_proc_enable(char *filesystem, uid_t user, pid_t pid, char *key)
{
struct tcfs_args a;
+
a.user = user;
a.cmd = TCFS_PUT_PIDKEY;
a.proc = pid;
@@ -171,6 +174,7 @@ int
tcfs_proc_disable(char *filesystem, uid_t user, pid_t pid)
{
struct tcfs_args a;
+
a.user = user;
a.cmd = TCFS_RM_PIDKEY;
a.proc = pid;
@@ -183,6 +187,7 @@ tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid,
int tre, char *key)
{
struct tcfs_args a;
+
a.cmd = TCFS_PUT_GIDKEY;
a.user = uid;
a.group = gid;
@@ -195,6 +200,7 @@ tcfs_group_enable(char *filesystem, uid_t uid, gid_t gid,
int tcfs_group_disable(char *filesystem, uid_t uid, gid_t gid)
{
struct tcfs_args a;
+
a.cmd = TCFS_RM_GIDKEY;
a.user = uid;
a.group = gid;
@@ -202,4 +208,3 @@ int tcfs_group_disable(char *filesystem, uid_t uid, gid_t gid)
return (tcfs_callfunction(filesystem, &a));
}
-
diff --git a/usr.bin/tcfs/tcfsaddgroup.c b/usr.bin/tcfs/tcfsaddgroup.c
index b8a16ce8c87..1e41d70b8ce 100644
--- a/usr.bin/tcfs/tcfsaddgroup.c
+++ b/usr.bin/tcfs/tcfsaddgroup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsaddgroup.c,v 1.8 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfsaddgroup.c,v 1.9 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -35,7 +35,7 @@ Add a TCFS group to the TCFS group database.
int threshold;
unsigned char coeff[KEYSIZE][256];
-unsigned char *S=NULL; /* Pointer to a 64-bit TCFS group key */
+unsigned char *S = NULL; /* Pointer to a 64-bit TCFS group key */
union bobbit
{
@@ -86,14 +86,14 @@ gencoeff(void)
unsigned char *
gengrpkey(char *login)
{
- int x1, i, j, k=0;
+ int x1, i, j, k = 0;
unsigned int x;
unsigned char *res = NULL;
unsigned int tmp;
union bobbit obits;
- res = (unsigned char*)calloc(KEYSIZE + KEYSIZE/8, sizeof(char));
+ res = (unsigned char *)calloc(KEYSIZE + KEYSIZE / 8, sizeof(char));
if (!res)
tcfs_error(ER_MEM, NULL);
@@ -122,28 +122,28 @@ gengrpkey(char *login)
#endif
switch (i % 8) {
case 0:
- obits.bf.b1=tmp>>8;
+ obits.bf.b1 = tmp >> 8;
break;
case 1:
- obits.bf.b2=tmp>>8;
+ obits.bf.b2 = tmp >> 8;
break;
case 2:
- obits.bf.b3=tmp>>8;
+ obits.bf.b3 = tmp >> 8;
break;
case 3:
- obits.bf.b4=tmp>>8;
+ obits.bf.b4 = tmp >> 8;
break;
case 4:
- obits.bf.b5=tmp>>8;
+ obits.bf.b5 = tmp >> 8;
break;
case 5:
- obits.bf.b6=tmp>>8;
+ obits.bf.b6 = tmp >> 8;
break;
case 6:
- obits.bf.b7=tmp>>8;
+ obits.bf.b7 = tmp >> 8;
break;
case 7:
- obits.bf.b8=tmp>>8;
+ obits.bf.b8 = tmp >> 8;
break;
}
@@ -191,7 +191,8 @@ addgroup_main(int argn, char *argv[])
group_id = getgrnam(optarg);
if (!group_id)
- tcfs_error(ER_CUSTOM, "Nonexistent group.");
+ tcfs_error(ER_CUSTOM,
+ "Nonexistent group.");
gid = group_id->gr_gid;
}
@@ -209,7 +210,8 @@ addgroup_main(int argn, char *argv[])
be_verbose = TRUE;
break;
default:
- fprintf(stderr, "Try %s --help for more information.\n", argv[0]);
+ fprintf(stderr,
+ "Try %s --help for more information.\n", argv[0]);
exit(ER_UNKOPT);
}
@@ -220,11 +222,11 @@ addgroup_main(int argn, char *argv[])
char *buff = NULL;
int len;
- buff = (char*)calloc(2048, sizeof(char));
+ buff = (char *)calloc(2048, sizeof(char));
if (!buff)
tcfs_error(ER_MEM, NULL);
- printf("Group id [or name] of the TCFS group to add to the database: ");
+ printf("Group ID (or name) of TCFS group to add to the database: ");
fgets(buff, 2048, stdin);
len = strlen(buff) - 1;
buff[len] = buff[len] == '\n' ? 0 : buff[len];
@@ -250,7 +252,7 @@ addgroup_main(int argn, char *argv[])
char *buff = NULL;
int len;
- buff = (char*)calloc(2048, sizeof(char));
+ buff = (char *)calloc(2048, sizeof(char));
if (!buff)
tcfs_error(ER_MEM, NULL);
@@ -267,7 +269,7 @@ addgroup_main(int argn, char *argv[])
char *buff = NULL;
int len;
- buff = (char*)calloc(2048, sizeof(char));
+ buff = (char *)calloc(2048, sizeof(char));
if (!buff)
tcfs_error(ER_MEM, NULL);
@@ -313,13 +315,14 @@ addgroup_main(int argn, char *argv[])
char *user = NULL, *passwd = NULL;
unsigned char *newkey = NULL, *cryptedkey = NULL;
tcfsgpwdb *tmp = NULL;
- int tmpmemb = temp_members, cont=0;
+ int tmpmemb = temp_members, cont = 0;
- group_info[members-1] = (tcfsgpwdb *)calloc(1, sizeof(tcfsgpwdb));
+ group_info[members - 1] = (tcfsgpwdb *)calloc(1,
+ sizeof(tcfsgpwdb));
- group_info[members-1]->gid = gid;
- group_info[members-1]->n = members;
- group_info[members-1]->soglia = threshold;
+ group_info[members - 1]->gid = gid;
+ group_info[members - 1]->n = members;
+ group_info[members - 1]->soglia = threshold;
if (!unix_auth(&user, &passwd, FALSE)) {
fprintf(stderr, "Invalid password or the user does not exist.\n");
@@ -341,13 +344,13 @@ addgroup_main(int argn, char *argv[])
if (cont)
continue;
- strcpy(group_info[members-1]->user, user);
+ strcpy(group_info[members - 1]->user, user);
- newkey = (unsigned char*)calloc(GKEYSIZE + 1, sizeof(char));
+ newkey = (unsigned char *)calloc(GKEYSIZE + 1, sizeof(char));
if (!newkey)
tcfs_error(ER_MEM, NULL);
- cryptedkey = (unsigned char*)calloc(UUGKEYSIZE, sizeof(char));
+ cryptedkey = (unsigned char *)calloc(UUGKEYSIZE, sizeof(char));
if (!cryptedkey)
tcfs_error(ER_MEM, NULL);
@@ -375,17 +378,17 @@ addgroup_main(int argn, char *argv[])
while (members) {
if (be_verbose)
printf("Creating a new entry for group %d and user %s in the TCFS database...\n",
- group_info[members-1]->gid,
- group_info[members-1]->user);
+ group_info[members - 1]->gid,
+ group_info[members - 1]->user);
- if (!tcfs_gputpwnam(group_info[members-1]->user,
- group_info[members-1], U_NEW)) {
+ if (!tcfs_gputpwnam(group_info[members - 1]->user,
+ group_info[members - 1], U_NEW)) {
/* TODO: Remove the group entries saved before */
tcfs_error(ER_CUSTOM, "Error: cannot add a user to the group.");
}
if (be_verbose)
- printf("TCFS group entry for user %s created.\n", group_info[members-1]->user);
+ printf("TCFS group entry for user %s created.\n", group_info[members - 1]->user);
members--;
}
diff --git a/usr.bin/tcfs/tcfsadduser.c b/usr.bin/tcfs/tcfsadduser.c
index d0fd5fb5a94..fa2c6b1be15 100644
--- a/usr.bin/tcfs/tcfsadduser.c
+++ b/usr.bin/tcfs/tcfsadduser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsadduser.c,v 1.4 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfsadduser.c,v 1.5 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -41,7 +41,7 @@ adduser_main(int argn, char *argv[])
/*
* Going to check the arguments
*/
- while ((val = getopt(argn, argv, "g:l:hv"))!=EOF)
+ while ((val = getopt(argn, argv, "g:l:hv")) != EOF)
switch (val) {
case 'l':
strlcpy(user, optarg, sizeof(user));
diff --git a/usr.bin/tcfs/tcfsflag.c b/usr.bin/tcfs/tcfsflag.c
index e19f96d60e8..43ddff8d630 100644
--- a/usr.bin/tcfs/tcfsflag.c
+++ b/usr.bin/tcfs/tcfsflag.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsflag.c,v 1.5 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfsflag.c,v 1.6 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -70,8 +70,7 @@ flags_main(int argc, char *argv[])
switch(cmd) {
case 'r':
- printf("%s x:%d g:%d\n", argv[2],
- FI_CFLAG(&i), FI_GSHAR(&i));
+ printf("%s x:%d g:%d\n", argv[2], FI_CFLAG(&i), FI_GSHAR(&i));
exit(0);
case 'x':
if (flag == -1)
diff --git a/usr.bin/tcfs/tcfsgenkey.c b/usr.bin/tcfs/tcfsgenkey.c
index a244b17f150..072081e338b 100644
--- a/usr.bin/tcfs/tcfsgenkey.c
+++ b/usr.bin/tcfs/tcfsgenkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsgenkey.c,v 1.6 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfsgenkey.c,v 1.7 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -65,7 +65,8 @@ genkey_main(int argn, char *argv[])
tcfs_error(ER_CUSTOM, "Who are you?!");
if (!tcfs_getpwnam(user, &user_info))
- tcfs_error(ER_CUSTOM, "You do not have an entry in the TCFS key database.");
+ tcfs_error(ER_CUSTOM,
+ "You do not have an entry in the TCFS key database.");
if (strlen(user_info->upw))
tcfs_error(ER_CUSTOM, "You already have a TCFS key.");
@@ -78,12 +79,13 @@ genkey_main(int argn, char *argv[])
/*
* Encrypt the generated key with user password
*/
- cryptedkey = (char*)calloc(UUKEYSIZE + 1, sizeof(char));
+ cryptedkey = (char *)calloc(UUKEYSIZE + 1, sizeof(char));
if (!cryptedkey)
tcfs_error(ER_MEM, NULL);
- if (!tcfs_encrypt_key(passwd, newkey, KEYSIZE, cryptedkey, UUKEYSIZE + 1))
+ if (!tcfs_encrypt_key(passwd, newkey, KEYSIZE, cryptedkey,
+ UUKEYSIZE + 1))
tcfs_error(ER_MEM, NULL);
/*
diff --git a/usr.bin/tcfs/tcfsmng.c b/usr.bin/tcfs/tcfsmng.c
index 888a026f96a..eb3951e87d6 100644
--- a/usr.bin/tcfs/tcfsmng.c
+++ b/usr.bin/tcfs/tcfsmng.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsmng.c,v 1.3 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfsmng.c,v 1.4 2000/06/19 23:06:25 aaron Exp $ */
/*
* Copyright 2000 Niels Provos <provos@citi.umich.edu>
@@ -54,7 +54,7 @@ usage(char *name)
fprintf(stderr, "Usage: %s <subcmd> [arguments]\n", name);
fprintf(stderr, "Possible sub commands:");
- for (i = sizeof(subcmds)/sizeof(struct subprg) - 1; i >= 0; i--)
+ for (i = sizeof(subcmds) / sizeof(struct subprg) - 1; i >= 0; i--)
fprintf(stderr, " %s", subcmds[i].name);
fprintf(stderr, "\n");
}
@@ -70,7 +70,7 @@ main (int argc, char **argv)
exit(1);
}
- for (i = sizeof(subcmds)/sizeof(struct subprg) - 1; i >= 0; i--) {
+ for (i = sizeof(subcmds) / sizeof(struct subprg) - 1; i >= 0; i--) {
if (!strcmp(argv[1], subcmds[i].name))
return (*subcmds[i].function)(argc - 1, argv + 1);
}
diff --git a/usr.bin/tcfs/tcfsputkey.c b/usr.bin/tcfs/tcfsputkey.c
index 5764505c794..ab1f0f53a9b 100644
--- a/usr.bin/tcfs/tcfsputkey.c
+++ b/usr.bin/tcfs/tcfsputkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsputkey.c,v 1.7 2000/06/19 22:42:28 aaron Exp $ */
+/* $OpenBSD: tcfsputkey.c,v 1.8 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -67,9 +67,11 @@ putkey_main(int argc, char *argv[])
gid = atoi(optarg);
if (!gid && optarg[0] != 0) {
struct group *grp;
+
grp = (struct group *)getgrnam(optarg);
if (!grp)
- tcfs_error(ER_CUSTOM, "Nonexistant group\n");
+ tcfs_error(ER_CUSTOM,
+ "Nonexistant group\n");
gid = grp->gr_gid;
}
break;
@@ -117,7 +119,7 @@ putkey_main(int argc, char *argv[])
if (!strlen(ginfo->gkey))
tcfs_error(ER_CUSTOM, "Invalid default key");
- tcfskey = (char*)malloc(UUKEYSIZE);
+ tcfskey = (char *)malloc(UUKEYSIZE);
if (!tcfskey)
tcfs_error(ER_MEM, NULL);
@@ -152,7 +154,7 @@ putkey_main(int argc, char *argv[])
if (!strlen(info->upw))
tcfs_error(ER_CUSTOM, "Invalid default key");
- tcfskey = (char*)malloc(UUKEYSIZE);
+ tcfskey = (char *)malloc(UUKEYSIZE);
if (!tcfskey)
tcfs_error(ER_MEM, NULL);
diff --git a/usr.bin/tcfs/tcfsrmgroup.c b/usr.bin/tcfs/tcfsrmgroup.c
index d00ca8f2f9d..d5f869ad0e3 100644
--- a/usr.bin/tcfs/tcfsrmgroup.c
+++ b/usr.bin/tcfs/tcfsrmgroup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsrmgroup.c,v 1.6 2000/06/19 22:42:29 aaron Exp $ */
+/* $OpenBSD: tcfsrmgroup.c,v 1.7 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -59,7 +59,8 @@ rmgroup_main(int argn, char *argv[])
be_verbose = TRUE;
break;
default:
- fprintf(stderr, "Try %s --help for more informations.\n", argv[0]);
+ fprintf(stderr,
+ "Try %s --help for more informations.\n", argv[0]);
exit(ER_UNKOPT);
}
@@ -70,11 +71,11 @@ rmgroup_main(int argn, char *argv[])
char *buff = NULL;
int len;
- buff = (char*)calloc(2048, sizeof(char));
+ buff = (char *)calloc(2048, sizeof(char));
if (!buff)
tcfs_error(ER_MEM, NULL);
- printf("Group id of the TCFS group to remove from the database: ");
+ printf("Group ID of the TCFS group to remove from the database: ");
fgets(buff, 2048, stdin);
len = strlen(buff) - 1;
buff[len] = buff[len] == '\n' ? 0 : buff[len];
diff --git a/usr.bin/tcfs/tcfsrmuser.c b/usr.bin/tcfs/tcfsrmuser.c
index bacd3f2f6e9..407788996d7 100644
--- a/usr.bin/tcfs/tcfsrmuser.c
+++ b/usr.bin/tcfs/tcfsrmuser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsrmuser.c,v 1.5 2000/06/19 22:42:29 aaron Exp $ */
+/* $OpenBSD: tcfsrmuser.c,v 1.6 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -47,7 +47,7 @@ rmuser_main(int argn, char *argv[])
err(1, NULL);
while ((val = getopt(argn, argv, "l:hv")) != EOF)
- switch (val) {
+ switch (val) {
case 'l':
strlcpy(user, optarg, LOGIN_NAME_MAX + 1);
have_user = TRUE;
diff --git a/usr.bin/tcfs/tcfsrun.c b/usr.bin/tcfs/tcfsrun.c
index 03da06748b1..0014a95868c 100644
--- a/usr.bin/tcfs/tcfsrun.c
+++ b/usr.bin/tcfs/tcfsrun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcfsrun.c,v 1.5 2000/06/19 22:42:29 aaron Exp $ */
+/* $OpenBSD: tcfsrun.c,v 1.6 2000/06/19 23:06:25 aaron Exp $ */
/*
* Transparent Cryptographic File System (TCFS) for NetBSD
@@ -54,7 +54,7 @@ run_main(int argc, char *argv[], char *envp[])
"filesystem label not found!\n");
exit(1);
}
- havefspath=1;
+ havefspath = 1;
break;
}
}
diff --git a/usr.bin/tcfs/tcfstat.c b/usr.bin/tcfs/tcfstat.c
index 71565335979..4033b0d1524 100644
--- a/usr.bin/tcfs/tcfstat.c
+++ b/usr.bin/tcfs/tcfstat.c
@@ -28,7 +28,7 @@ int
stat_main(int argc, char *argv[], char *envp[])
{
struct tcfs_status st;
- int e, es, ok=0;
+ int e, es, ok = 0;
char filesystem[MAXPATHLEN];
if (argc == 3 && !strcmp("-p", argv[1])) {
diff --git a/usr.bin/tcfs/tcfsuse.c b/usr.bin/tcfs/tcfsuse.c
index db82b42dcc6..50e2c6804e1 100644
--- a/usr.bin/tcfs/tcfsuse.c
+++ b/usr.bin/tcfs/tcfsuse.c
@@ -57,7 +57,7 @@ usage(char *name)
fprintf(stderr, "Possible sub commands:");
- for (i = sizeof(subcmds)/sizeof(struct subprg) - 1; i >= 0; i--)
+ for (i = sizeof(subcmds) / sizeof(struct subprg) - 1; i >= 0; i--)
fprintf(stderr, " %s", subcmds[i].name);
fprintf(stderr, "\n");
@@ -74,7 +74,7 @@ main (int argc, char **argv)
exit(1);
}
- for (i = sizeof(subcmds)/sizeof(struct subprg) - 1; i >= 0; i--) {
+ for (i = sizeof(subcmds) / sizeof(struct subprg) - 1; i >= 0; i--) {
if (!strcmp(argv[1], subcmds[i].name))
return (*subcmds[i].function)(argc - 1, argv + 1);
}