summaryrefslogtreecommitdiff
path: root/libexec/makekey
diff options
context:
space:
mode:
authortls <tls@NetBSD.org>1997-04-29 21:19:05 +0000
committertls <tls@NetBSD.org>1997-04-29 21:19:05 +0000
commit037708cbd4616ccd0d7d0381ebd3964d6696c188 (patch)
tree97394ec34bf465a031e8cfd2c1679dbb11d0fb17 /libexec/makekey
parent80eef670d5af594d8df40b5f63b5610c1ed2911f (diff)
Sync to 4.4BSD-Lite2
Diffstat (limited to 'libexec/makekey')
-rw-r--r--libexec/makekey/Makefile4
-rw-r--r--libexec/makekey/makekey.812
-rw-r--r--libexec/makekey/makekey.c33
3 files changed, 23 insertions, 26 deletions
diff --git a/libexec/makekey/Makefile b/libexec/makekey/Makefile
index 6332290c644..0502f21a55a 100644
--- a/libexec/makekey/Makefile
+++ b/libexec/makekey/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.3 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.5 1994/12/22 10:27:29 cgd Exp $
+# from: @(#)Makefile 8.1 (Berkeley) 6/4/93
+# $Id: Makefile,v 1.6 1997/04/29 21:19:05 tls Exp $
PROG= makekey
MAN= makekey.8
diff --git a/libexec/makekey/makekey.8 b/libexec/makekey/makekey.8
index d861aeb70db..57c5480b886 100644
--- a/libexec/makekey/makekey.8
+++ b/libexec/makekey/makekey.8
@@ -1,5 +1,5 @@
-.\" Copyright (c) 1990, 1991 The Regents of the University of California.
-.\" All rights reserved.
+.\" Copyright (c) 1990, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +29,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)makekey.8 6.5 (Berkeley) 7/1/91
-.\" $Id: makekey.8,v 1.3 1993/11/30 00:10:17 jtc Exp $
+.\" from: @(#)makekey.8 8.2 (Berkeley) 12/11/93
+.\" $NetBSD: makekey.8,v 1.4 1997/04/29 21:19:08 tls Exp $
.\"
-.Dd July 1, 1991
+.Dd December 11, 1993
.Dt MAKEKEY 8
.Os
.Sh NAME
@@ -42,7 +42,7 @@
.Nm makekey
.Sh DESCRIPTION
.Nm Makekey
-encypts a key and salt which it reads from the standard input
+encrypts a key and salt which it reads from the standard input
and writes the result to the standard output.
The key is expected to be
ten bytes; the salt is expected to be two bytes.
diff --git a/libexec/makekey/makekey.c b/libexec/makekey/makekey.c
index 5611376c60a..0d378523d19 100644
--- a/libexec/makekey/makekey.c
+++ b/libexec/makekey/makekey.c
@@ -1,6 +1,6 @@
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,24 +32,28 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1990 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1990, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)makekey.c 5.3 (Berkeley) 2/25/91";*/
-static char rcsid[] = "$Id: makekey.c,v 1.2 1993/08/01 18:30:05 mycroft Exp $";
+/*static char sccsid[] = "from: @(#)makekey.c 8.1 (Berkeley) 6/4/93";*/
+static char rcsid[] = "$NetBSD: makekey.c,v 1.3 1997/04/29 21:19:09 tls Exp $";
#endif /* not lint */
+#include <sys/types.h>
+
+#include <err.h>
#include <errno.h>
-#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
-static void error(), get();
+static void get __P((char *, int));
+int
main()
{
int len;
@@ -59,7 +63,7 @@ main()
get(salt, sizeof(salt) - 1);
len = strlen(r = crypt(key, salt));
if (write(STDOUT_FILENO, r, len) != len)
- error();
+ err(1, "stdout");
exit(0);
}
@@ -75,12 +79,5 @@ get(bp, len)
return;
if (nr >= 0)
errno = EFTYPE;
- error();
-}
-
-static void
-error()
-{
- (void)fprintf(stderr, "makekey: %s\n", strerror(errno));
- exit(1);
+ err(1, "stdin");
}