diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-06-19 20:06:20 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-06-19 20:06:20 +0000 |
commit | a523e997c1a51cdd8790b5baa5063f9ae4d337ec (patch) | |
tree | c38e0ea9f178648ec3c5ef20ffa7f24b65fa045b /usr.bin/tcfs | |
parent | dfe75051c4e14d14e779991125bd2e52b3976c53 (diff) |
add missing headers, declare missing functions remove unused vars, KNF;
more to come.
Diffstat (limited to 'usr.bin/tcfs')
-rw-r--r-- | usr.bin/tcfs/tcfs_dbmaint.c | 11 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfs_keymaint.c | 12 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsaddgroup.c | 4 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsdefines.h | 2 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsgenkey.c | 1 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfslib.h | 40 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsputkey.c | 12 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsrmgroup.c | 3 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsrmkey.c | 12 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsrmuser.c | 6 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfsrun.c | 16 | ||||
-rw-r--r-- | usr.bin/tcfs/tcfstat.c | 6 | ||||
-rw-r--r-- | usr.bin/tcfs/unix_auth.c | 7 |
13 files changed, 72 insertions, 60 deletions
diff --git a/usr.bin/tcfs/tcfs_dbmaint.c b/usr.bin/tcfs/tcfs_dbmaint.c index 9eb26c9fb01..4c399861bea 100644 --- a/usr.bin/tcfs/tcfs_dbmaint.c +++ b/usr.bin/tcfs/tcfs_dbmaint.c @@ -123,7 +123,6 @@ int tcfspwdbr_read (tcfspwdb *t, int flags,...) { va_list argv; - int r; char *d; va_start (argv, flags); @@ -148,7 +147,6 @@ int tcfsgpwdbr_read (tcfsgpwdb *t, int flags,...) { va_list argv; - int r; char *d; va_start (argv, flags); @@ -228,7 +226,7 @@ tcfs_ggetpwnam (char *user, gid_t gid, tcfsgpwdb **dest) { DB *pdb; DBT srchkey, r; - char *key, *buf; + char *key; int res; if (!*dest) @@ -305,8 +303,7 @@ tcfs_gputpwnam (char *user, tcfsgpwdb *src, int flags) DB *pdb; static DBT srchkey, d; int open_flag = 0; - char *key, *buf; - char *tmp; + char *key; open_flag = O_RDWR|O_EXCL; if (access (TCFSGPWDB, F_OK) < 0) @@ -386,7 +383,7 @@ tcfs_rmgroup (gid_t gid) int tcfs_group_chgpwd (char *user, gid_t gid, char *old, char *new) { - tcfsgpwdb *group_info; + tcfsgpwdb *group_info = NULL; unsigned char *key; key = (unsigned char *)calloc(UUGKEYSIZE + 1, sizeof (char)); @@ -438,7 +435,7 @@ tcfs_chgpwd (char *user, char *old, char *new) int tcfs_chgpassword (char *user, char *old, char *new) { - int error1=0, error2=0; + int error1=0; DB *gpdb; DBT found, key; unsigned char *ckey; diff --git a/usr.bin/tcfs/tcfs_keymaint.c b/usr.bin/tcfs/tcfs_keymaint.c index d3d8f834eb1..939de309322 100644 --- a/usr.bin/tcfs/tcfs_keymaint.c +++ b/usr.bin/tcfs/tcfs_keymaint.c @@ -10,14 +10,15 @@ * Base utility set v0.1 */ -#include <ctype.h> -#include <pwd.h> -#include <unistd.h> #include <sys/types.h> #include <sys/param.h> #include <sys/mount.h> #include <sys/ucred.h> #include <blf.h> +#include <ctype.h> +#include <pwd.h> +#include <string.h> +#include <unistd.h> #include <miscfs/tcfs/tcfs.h> #include <miscfs/tcfs/tcfs_cmd.h> @@ -57,10 +58,10 @@ tcfs_callfunction(char *filesystem, struct tcfs_args *arg) int tcfs_decrypt_key (char *pwd, u_char *t, u_char *tk, int tklen) { - int i = 0, len; - char pass[_PASSWORD_LEN], *cypher; + char pass[_PASSWORD_LEN]; char tcfskey[2*KEYSIZE], iv[8]; blf_ctx ctx; + int len; if (!tk) return 0; @@ -97,7 +98,6 @@ tcfs_decrypt_key (char *pwd, u_char *t, u_char *tk, int tklen) int tcfs_encrypt_key (char *pw, u_char *key, int klen, u_char *ek, int eklen) { - int i = 0; char pass[_PASSWORD_LEN], iv[8]; blf_ctx ctx; int res; diff --git a/usr.bin/tcfs/tcfsaddgroup.c b/usr.bin/tcfs/tcfsaddgroup.c index 7c81ba3cd18..38a471301b3 100644 --- a/usr.bin/tcfs/tcfsaddgroup.c +++ b/usr.bin/tcfs/tcfsaddgroup.c @@ -83,7 +83,7 @@ gencoeff (void) unsigned char * gengrpkey (char *login) { - int l, x1, i, j, k=0; + int x1, i, j, k=0; unsigned int x; unsigned char *res = NULL; @@ -164,7 +164,7 @@ gengrpkey (char *login) int addgroup_main (int argn, char *argv[]) { - int index, val; + int val; gid_t gid; int have_gid = FALSE, have_members = FALSE, have_threshold = FALSE; int be_verbose = FALSE; diff --git a/usr.bin/tcfs/tcfsdefines.h b/usr.bin/tcfs/tcfsdefines.h index 28dc9d526e9..c56d1ab05db 100644 --- a/usr.bin/tcfs/tcfsdefines.h +++ b/usr.bin/tcfs/tcfsdefines.h @@ -32,5 +32,3 @@ typedef struct { } tcfs_flags; #endif /* _TCFSDEFINES_H_ */ - - diff --git a/usr.bin/tcfs/tcfsgenkey.c b/usr.bin/tcfs/tcfsgenkey.c index 54833865582..4107e0d360b 100644 --- a/usr.bin/tcfs/tcfsgenkey.c +++ b/usr.bin/tcfs/tcfsgenkey.c @@ -11,6 +11,7 @@ */ #include <stdio.h> +#include <stdlib.h> #include <strings.h> #include <miscfs/tcfs/tcfs.h> diff --git a/usr.bin/tcfs/tcfslib.h b/usr.bin/tcfs/tcfslib.h index 337cb6c31b5..354b93b7d6c 100644 --- a/usr.bin/tcfs/tcfslib.h +++ b/usr.bin/tcfs/tcfslib.h @@ -14,21 +14,29 @@ #include "tcfsdefines.h" #include "tcfspwdb.h" -extern int tcfspwdbr_new (tcfspwdb **p); -extern int tcfspwdbr_edit (tcfspwdb **p, int i, ...); -extern int tcfspwdbr_read (tcfspwdb *p, int i, ...); -extern void tcfspwdbr_dispose (tcfspwdb *p); -extern int tcfsgpwdbr_new (tcfsgpwdb **p); -extern int tcfsgpwdbr_edit (tcfsgpwdb **p, int i, ...); -extern int tcfsgpwdbr_read (tcfsgpwdb *p, int i, ...); -extern void tcfsgpwdbr_dispose (tcfsgpwdb *p); -extern int tcfs_chgpwd (char *u, char *o, char *p); -extern int tcfs_group_chgpwd (char *u, gid_t gid, char *o, char *p); -extern int tcfs_chgpassword (char *u, char *o, char *p); -extern int tcfs_decrypt_key (char *pwd, u_char *t, u_char *tk, int tklen); -extern int tcfs_encrypt_key (char *pwd, u_char *key, int klen, u_char *ek, int eklen); -extern char *tcfs_decode (char *t, int *l); -extern char *tcfs_encode (char *t, int l); -extern char *gentcfskey (void); +extern int tcfspwdbr_new __P((tcfspwdb **)); +extern int tcfspwdbr_edit __P((tcfspwdb **, int, ...)); +extern int tcfspwdbr_read __P((tcfspwdb *, int, ...)); +extern void tcfspwdbr_dispose __P((tcfspwdb *)); +extern int tcfsgpwdbr_new __P((tcfsgpwdb **)); +extern int tcfsgpwdbr_edit __P((tcfsgpwdb **, int, ...)); +extern int tcfsgpwdbr_read __P((tcfsgpwdb *, int, ...)); +extern void tcfsgpwdbr_dispose __P((tcfsgpwdb *)); +extern int tcfs_chgpwd __P((char *, char *, char *)); +extern int tcfs_group_chgpwd __P((char *, gid_t, char *, char *)); +extern int tcfs_chgpassword __P((char *, char *, char *)); +extern int tcfs_decrypt_key __P((char *, u_char *, u_char *, int)); +extern int tcfs_encrypt_key __P((char *, u_char *, int, u_char *, int)); +extern char *tcfs_decode __P((char *, int *)); +extern char *tcfs_encode __P((char *, int )); +extern char *gentcfskey __P((void)); +extern int tcfs_getstatus __P((char *, struct tcfs_status *)); +extern int tcfs_getfspath __P((char *, char *)); +extern int tcfs_proc_enable __P((char *, uid_t, pid_t, char *)); +extern int tcfs_proc_disable __P((char *, uid_t, pid_t)); +extern int tcfs_user_enable __P((char *, uid_t, u_char *)); +extern int tcfs_user_disable __P((char *, uid_t)); +extern int tcfs_group_enable __P((char *, uid_t, gid_t, int, char *)); +extern int tcfs_group_disable __P((char *, uid_t, gid_t)); diff --git a/usr.bin/tcfs/tcfsputkey.c b/usr.bin/tcfs/tcfsputkey.c index b8ce0a53d8a..feb780b08bc 100644 --- a/usr.bin/tcfs/tcfsputkey.c +++ b/usr.bin/tcfs/tcfsputkey.c @@ -10,15 +10,16 @@ * Base utility set v0.1 */ -#include <stdio.h> #include <sys/types.h> #include <sys/param.h> +#include <sys/mount.h> #include <ctype.h> +#include <des.h> #include <pwd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <unistd.h> -#include <sys/param.h> -#include <sys/mount.h> -#include <des.h> #include <miscfs/tcfs/tcfs.h> #include "tcfslib.h" @@ -33,7 +34,7 @@ char *putkey_usage= int putkey_main(int argc, char *argv[]) { - u_char *key,*fs,*user,*password,*tcfskey; + u_char *user,*password,*tcfskey; uid_t uid; gid_t gid; int es, treshold; @@ -43,7 +44,6 @@ putkey_main(int argc, char *argv[]) char fslabel[MAXPATHLEN], fspath[MAXPATHLEN]; int def = TRUE, havempname = FALSE, havefsname = FALSE; int isgroupkey = FALSE; - int havefs = FALSE; int havename = FALSE, havefspath = FALSE, havekey = FALSE; while ((x = getopt(argc,argv,"kf:p:g:")) != EOF) { diff --git a/usr.bin/tcfs/tcfsrmgroup.c b/usr.bin/tcfs/tcfsrmgroup.c index 4081e03fb91..ccb7893e674 100644 --- a/usr.bin/tcfs/tcfsrmgroup.c +++ b/usr.bin/tcfs/tcfsrmgroup.c @@ -10,8 +10,9 @@ * Base utility set v0.1 */ -#include <stdio.h> #include <grp.h> +#include <stdio.h> +#include <stdlib.h> #include <miscfs/tcfs/tcfs.h> #include "tcfslib.h" diff --git a/usr.bin/tcfs/tcfsrmkey.c b/usr.bin/tcfs/tcfsrmkey.c index a8349e7a5b9..ac455962f9e 100644 --- a/usr.bin/tcfs/tcfsrmkey.c +++ b/usr.bin/tcfs/tcfsrmkey.c @@ -10,14 +10,16 @@ * Base utility set v0.1 */ -#include <stdio.h> #include <sys/types.h> -#include <ctype.h> -#include <pwd.h> -#include <unistd.h> #include <sys/param.h> #include <sys/mount.h> +#include <ctype.h> #include <des.h> +#include <pwd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include <miscfs/tcfs/tcfs.h> #include "tcfslib.h" @@ -32,14 +34,12 @@ char *rmkey_usage= int rmkey_main(int argc, char *argv[]) { - char *fs; uid_t uid; gid_t gid; int es; char x; char fslabel[MAXPATHLEN], fspath[MAXPATHLEN]; int havempname = FALSE, havefsname = FALSE, isgroupkey = FALSE; - int havefs = FALSE; int havename = FALSE, havefspath = FALSE; while ((x = getopt(argc,argv,"f:p:g:")) != EOF) { diff --git a/usr.bin/tcfs/tcfsrmuser.c b/usr.bin/tcfs/tcfsrmuser.c index a8752f43b81..423682f76a6 100644 --- a/usr.bin/tcfs/tcfsrmuser.c +++ b/usr.bin/tcfs/tcfsrmuser.c @@ -11,9 +11,11 @@ */ +#include <err.h> #include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <unistd.h> -#include <err.h> #include <miscfs/tcfs/tcfs.h> #include "tcfslib.h" @@ -31,7 +33,7 @@ rmuser_main (int argn, char *argv[]) { int have_user = FALSE; int be_verbose = FALSE; - char *user, *passwd; + char *user; tcfspwdb *user_info; int val; diff --git a/usr.bin/tcfs/tcfsrun.c b/usr.bin/tcfs/tcfsrun.c index 0010561f9ba..335f906bfcb 100644 --- a/usr.bin/tcfs/tcfsrun.c +++ b/usr.bin/tcfs/tcfsrun.c @@ -10,17 +10,19 @@ * Base utility set v0.1 */ -#include <stdio.h> #include <sys/types.h> -#include <ctype.h> -#include <pwd.h> -#include <unistd.h> #include <sys/param.h> #include <sys/mount.h> #include <sys/wait.h> +#include <ctype.h> #include <des.h> +#include <pwd.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> #include <miscfs/tcfs/tcfs.h> +#include "tcfslib.h" char *cmd_def="/bin/sh"; char *run_usage = "usage: tcfsrun [-p mount-point | -f fs-label] [cmd] [args...]"; @@ -28,11 +30,11 @@ char *run_usage = "usage: tcfsrun [-p mount-point | -f fs-label] [cmd] [args...] int run_main(int argc, char *argv[], char *envp[]) { - char *key, *fs, *cmd, x; - char *args, fspath[MAXPATHLEN], cmdname[MAXPATHLEN]; + char *key, *cmd, x; + char fspath[MAXPATHLEN], cmdname[MAXPATHLEN]; uid_t uid; pid_t pid; - int es,i = 1; + int es; int havefspath = 0,havecmd = 0; uid = getuid(); diff --git a/usr.bin/tcfs/tcfstat.c b/usr.bin/tcfs/tcfstat.c index 39557ff6db6..e6195e7861d 100644 --- a/usr.bin/tcfs/tcfstat.c +++ b/usr.bin/tcfs/tcfstat.c @@ -10,15 +10,17 @@ * Base utility set v0.1 */ -#include <stdio.h> #include <sys/types.h> -#include <unistd.h> #include <sys/param.h> #include <sys/mount.h> #include <sys/wait.h> #include <des.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> #include <miscfs/tcfs/tcfs.h> +#include "tcfslib.h" char *stat_usage= "usage: tcfstat [-p mount-point | fs-label]"; diff --git a/usr.bin/tcfs/unix_auth.c b/usr.bin/tcfs/unix_auth.c index 9b9a6215b21..80d8ed44e0a 100644 --- a/usr.bin/tcfs/unix_auth.c +++ b/usr.bin/tcfs/unix_auth.c @@ -10,12 +10,13 @@ * Base utility set v0.1 */ -#include <stdio.h> -#include <unistd.h> #include <sys/param.h> #include <limits.h> -#include <string.h> #include <pwd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> #include <miscfs/tcfs/tcfs.h> #include "tcfslib.h" |