summaryrefslogtreecommitdiffstats
path: root/libexec/makekey
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-03-18 17:38:43 +0000
committerbde <bde@FreeBSD.org>1995-03-18 17:38:43 +0000
commitaac4af3133491cd1ec8f2cb48ecc35c830325801 (patch)
treea837db909cf824b6a9ebe63858c937df83de69ac /libexec/makekey
parente6facc0d0dc8ba97f07d166721110e0bf24db9e2 (diff)
downloadFreeBSD-src-aac4af3133491cd1ec8f2cb48ecc35c830325801.zip
FreeBSD-src-aac4af3133491cd1ec8f2cb48ecc35c830325801.tar.gz
Restore the 4.4lite version which apparently was clobbered by a repository
copy. The differences are trivial. I have no backups of the clobbered history.
Diffstat (limited to 'libexec/makekey')
-rw-r--r--libexec/makekey/Makefile2
-rw-r--r--libexec/makekey/makekey.810
-rw-r--r--libexec/makekey/makekey.c31
3 files changed, 20 insertions, 23 deletions
diff --git a/libexec/makekey/Makefile b/libexec/makekey/Makefile
index dd07112..47cc1c6 100644
--- a/libexec/makekey/Makefile
+++ b/libexec/makekey/Makefile
@@ -1,4 +1,4 @@
-# @(#)Makefile 5.3 (Berkeley) 5/11/90
+# @(#)Makefile 8.1 (Berkeley) 6/4/93
PROG= makekey
MAN8= makekey.8
diff --git a/libexec/makekey/makekey.8 b/libexec/makekey/makekey.8
index ec9f979..c6ded2d 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,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)makekey.8 6.5 (Berkeley) 7/1/91
+.\" @(#)makekey.8 8.2 (Berkeley) 12/11/93
.\"
-.Dd July 1, 1991
+.Dd December 11, 1993
.Dt MAKEKEY 8
.Os
.Sh NAME
@@ -41,7 +41,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 1a2e149..d786bc9 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,23 +32,27 @@
*/
#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[] = "@(#)makekey.c 5.3 (Berkeley) 2/25/91";
+static char sccsid[] = "@(#)makekey.c 8.1 (Berkeley) 6/4/93";
#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;
@@ -58,7 +62,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);
}
@@ -74,12 +78,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");
}
OpenPOWER on IntegriCloud