summaryrefslogtreecommitdiff
path: root/usr.bin/tcfs/tcfstatold.c
blob: 38a377cc766904723b811698dbf5f0b20a37c26d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 *	Transparent Cryptographic File System (TCFS) for NetBSD 
 *	Author and mantainer: 	Luigi Catuogno [luicat@tcfs.unisa.it]
 *	
 *	references:		http://tcfs.dia.unisa.it
 *				tcfs-bsd@tcfs.unisa.it
 */

/*
 *	Base utility set v0.1
 *
 *	  $Source: /cvs/OpenBSD/src/usr.bin/tcfs/Attic/tcfstatold.c,v $
 *	   $State: Exp $
 *	$Revision: 1.1 $
 *	  $Author: provos $
 *	    $Date: 2000/06/18 22:07:24 $
 *
 */

static const char *RCSid="$id: $";

/* RCS_HEADER_ENDS_HERE */



#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 "tcfs.h"

void main(int argc, char *argv[], char *envp[])
{
	struct tcfs_status st;	
	int e;

	if(argc <2)
		{
			fprintf(stderr,"usage: tcfstat <filesystem>\n");
			exit(1);
		}
	
	e=tcfs_getstatus(argv[1],&st);
	if(e==-1)
		{
			fprintf(stderr,"filesystem %s not mounted\n",argv[0]);
			exit(1);
		}
	
	printf("Status: %d; user keys: %d, group keys: %d\n",st.status, st.n_ukey, st.n_gkey);
	printf("TCFS version: %d, Cipher: %s, keysize: %d, cipher version: %d\n",st.tcfs_version, st.cipher_desc, st.cipher_keysize, st.cipher_version);
			
	
}