summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_install/sign/stand.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-10-04 21:46:31 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-10-04 21:46:31 +0000
commit5dfe2b009511b15f852b0bc0512140ae1e9371a3 (patch)
tree6fa4684c7daf902f4709d0217155c0916d1c885a /usr.sbin/pkg_install/sign/stand.c
parentcd21bf5152aa75fa8a13091c4ba85f3c16b9d1a9 (diff)
Synch with current development:
* signatures no longer deal with zcat. Instead, we sign the gzip file itself (stripped of the signature part of the header, of course). Thanks Angelos. Niels seems to think passing the header itself to sign is not a problem, even though no-one cares about checking it ? * gzip header handling revamped: can write to memory. Will eliminate some pipes later on. Can stack signatures. * taken out specific signature schemes (e.g., pgp and sha1). Code is now signature scheme independent, mostly, and writes with client data from memory, e.g., check.c can invoke several checks in parallel without needing to fork. * need the full set of popen-like functionalities (keep track of opened file descriptors to avoid passing them down to children) * remove simple_check.c, functionality absorbed elsewhere. To do: * re-check message output and what to do with unsigned/unchecked/verified packages, * check pkg_add implementation and remove extra-pipe in asynchronous checking, * control over what to do when several signatures are stacked... Simple way would be to disable that for now (possibility for release) * get the code through a linter again.
Diffstat (limited to 'usr.sbin/pkg_install/sign/stand.c')
-rw-r--r--usr.sbin/pkg_install/sign/stand.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/usr.sbin/pkg_install/sign/stand.c b/usr.sbin/pkg_install/sign/stand.c
new file mode 100644
index 00000000000..4788a79ced3
--- /dev/null
+++ b/usr.sbin/pkg_install/sign/stand.c
@@ -0,0 +1,54 @@
+#include "stand.h"
+
+#ifdef BSD4_4
+#include <string.h>
+#include <stdio.h>
+#include <errno.h>
+#include <stdarg.h>
+
+/* shortened version of warn */
+static const char *program_name;
+
+void
+set_program_name(n)
+ const char *n;
+{
+ if ((program_name = strrchr(n, '/')) != NULL)
+ program_name++;
+ else
+ program_name = n;
+}
+
+void
+warn(const char *fmt, ...)
+{
+ va_list ap;
+ int interrno;
+
+ va_start(ap, fmt);
+
+ interrno = errno;
+ (void)fprintf(stderr, "%s", program_name);
+ if (fmt != NULL) {
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, ": ");
+ }
+ (void)fprintf(stderr, "%s\n", strerror(interrno));
+
+ va_end(ap);
+}
+
+void
+warnx(const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ (void)fprintf(stderr, "%s", program_name);
+ if (fmt != NULL)
+ (void)vfprintf(stderr, fmt, ap);
+ (void)fprintf(stderr, "\n");
+ va_end(ap);
+}
+
+#endif