summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tcfs/tcfsaddgroup.c7
-rw-r--r--usr.bin/tcfs/tcfserrors.c15
-rw-r--r--usr.bin/tcfs/tcfserrors.h41
-rw-r--r--usr.bin/tcfs/tcfslib.h6
-rw-r--r--usr.bin/tcfs/tcfsputkey.c2
-rw-r--r--usr.bin/tcfs/tcfsrun.c2
6 files changed, 39 insertions, 34 deletions
diff --git a/usr.bin/tcfs/tcfsaddgroup.c b/usr.bin/tcfs/tcfsaddgroup.c
index 38a471301b3..b4568fde688 100644
--- a/usr.bin/tcfs/tcfsaddgroup.c
+++ b/usr.bin/tcfs/tcfsaddgroup.c
@@ -11,11 +11,12 @@
*/
#include <sys/types.h>
+#include <grp.h>
+#include <pwd.h>
#include <stdio.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <pwd.h>
-#include <grp.h>
+#include <string.h>
+#include <unistd.h>
#include <miscfs/tcfs/tcfs.h>
#include "tcfslib.h"
diff --git a/usr.bin/tcfs/tcfserrors.c b/usr.bin/tcfs/tcfserrors.c
index 4cc4515c97b..bbc66fc8dec 100644
--- a/usr.bin/tcfs/tcfserrors.c
+++ b/usr.bin/tcfs/tcfserrors.c
@@ -14,6 +14,21 @@
#include <unistd.h>
#include "tcfserrors.h"
+static char *tcfs_errors_strings[]=
+{
+ "Ok",
+ NULL,
+ "unknow option.",
+ "authentication error.",
+ "out of memory.",
+ "you do not have a TCFS key.",
+ "Who are you?!",
+ "ioctl error while setting permanent flag.",
+ "ioctl error while sending.",
+ "ioctl error while removing key.",
+ "ioctl error while getting key counter."
+};
+
void tcfs_error (int error_type, char *custom_message)
{
if (error_type!=ER_CUSTOM && error_type!=OK)
diff --git a/usr.bin/tcfs/tcfserrors.h b/usr.bin/tcfs/tcfserrors.h
index 68dbe5021e4..9b761ef6c73 100644
--- a/usr.bin/tcfs/tcfserrors.h
+++ b/usr.bin/tcfs/tcfserrors.h
@@ -15,36 +15,19 @@
enum
{
- OK=0, /* Ok, no error */
- ER_CUSTOM, /* Custom error message */
- ER_UNKOPT, /* Unknown command line option */
- ER_AUTH, /* User authentication error */
- ER_MEM, /* Out of memory error */
- ER_TCFS, /* User is not allowed to use TCFS */
- ER_USER, /* User error */
- ER_PERM, /* Error calling TCFS_IOC_PERMANENT ioctl */
- ER_ENABLE, /* Error calling TCFS_IOC_LOGIN ioctl */
- ER_DISABLE, /* Error calling TCFS_IOC_DISABLE ioctl */
- ER_COUNT /* Error calling TCFS_IOC_COUNT ioctl */
+ OK=0, /* Ok, no error */
+ ER_CUSTOM, /* Custom error message */
+ ER_UNKOPT, /* Unknown command line option */
+ ER_AUTH, /* User authentication error */
+ ER_MEM, /* Out of memory error */
+ ER_TCFS, /* User is not allowed to use TCFS */
+ ER_USER, /* User error */
+ ER_PERM, /* Error calling TCFS_IOC_PERMANENT ioctl */
+ ER_ENABLE, /* Error calling TCFS_IOC_LOGIN ioctl */
+ ER_DISABLE, /* Error calling TCFS_IOC_DISABLE ioctl */
+ ER_COUNT /* Error calling TCFS_IOC_COUNT ioctl */
};
-static char *tcfs_errors_strings[]=
-{
- "Ok",
- NULL,
- "unknow option.",
- "authentication error.",
- "out of memory.",
- "you do not have a TCFS key.",
- "Who are you?!",
- "ioctl error while setting permanent flag.",
- "ioctl error while sending.",
- "ioctl error while removing key.",
- "ioctl error while getting key counter."
-};
-
-void tcfs_error (int error_type, char *arg);
+void tcfs_error __P((int, char *));
#endif
-
-/* End of errors.h */
diff --git a/usr.bin/tcfs/tcfslib.h b/usr.bin/tcfs/tcfslib.h
index 354b93b7d6c..5891c45f076 100644
--- a/usr.bin/tcfs/tcfslib.h
+++ b/usr.bin/tcfs/tcfslib.h
@@ -40,3 +40,9 @@ 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));
+
+extern tcfspwdb *
+ tcfs_getpwnam __P((char *, tcfspwdb **));
+extern int tcfs_putpwnam __P((char *, tcfspwdb *, int));
+
+extern int unix_auth __P((char **, char **, int));
diff --git a/usr.bin/tcfs/tcfsputkey.c b/usr.bin/tcfs/tcfsputkey.c
index feb780b08bc..58824a9be89 100644
--- a/usr.bin/tcfs/tcfsputkey.c
+++ b/usr.bin/tcfs/tcfsputkey.c
@@ -34,7 +34,7 @@ char *putkey_usage=
int
putkey_main(int argc, char *argv[])
{
- u_char *user,*password,*tcfskey;
+ char *user,*password,*tcfskey;
uid_t uid;
gid_t gid;
int es, treshold;
diff --git a/usr.bin/tcfs/tcfsrun.c b/usr.bin/tcfs/tcfsrun.c
index 335f906bfcb..7a4babc8b04 100644
--- a/usr.bin/tcfs/tcfsrun.c
+++ b/usr.bin/tcfs/tcfsrun.c
@@ -30,7 +30,7 @@ char *run_usage = "usage: tcfsrun [-p mount-point | -f fs-label] [cmd] [args...]
int
run_main(int argc, char *argv[], char *envp[])
{
- char *key, *cmd, x;
+ char *key, *cmd = NULL, x;
char fspath[MAXPATHLEN], cmdname[MAXPATHLEN];
uid_t uid;
pid_t pid;