summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJob Snijders <job@cvs.openbsd.org>2024-01-26 18:11:50 +0000
committerJob Snijders <job@cvs.openbsd.org>2024-01-26 18:11:50 +0000
commitcce255a4dd575e3ece1031929aed5f14f11110b2 (patch)
tree79d643c7216fc2fc91275ab9d1c55e7dabf7bf15 /usr.sbin
parent945000c396d1c557c3eac63fafbb6502abee5bf8 (diff)
Add a -V flag to bgplgd
OK claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgplgd/Makefile3
-rw-r--r--usr.sbin/bgplgd/bgplgd.87
-rw-r--r--usr.sbin/bgplgd/slowcgi.c8
3 files changed, 13 insertions, 5 deletions
diff --git a/usr.sbin/bgplgd/Makefile b/usr.sbin/bgplgd/Makefile
index 6944734671c..e35428e30a4 100644
--- a/usr.sbin/bgplgd/Makefile
+++ b/usr.sbin/bgplgd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2022/06/28 16:11:30 claudio Exp $
+# $OpenBSD: Makefile,v 1.2 2024/01/26 18:11:49 job Exp $
PROG= bgplgd
SRCS= bgplgd.c slowcgi.c qs.c
@@ -7,6 +7,7 @@ CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes
CLFAGS+= -Wmissing-declarations -Wredundant-decls
CFLAGS+= -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+= -Wsign-compare
+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../bgpd
LDADD= -levent
DPADD= ${LIBEVENT}
MAN= bgplgd.8
diff --git a/usr.sbin/bgplgd/bgplgd.8 b/usr.sbin/bgplgd/bgplgd.8
index a6a1a184bf8..2b62b77853f 100644
--- a/usr.sbin/bgplgd/bgplgd.8
+++ b/usr.sbin/bgplgd/bgplgd.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bgplgd.8,v 1.7 2023/03/13 17:31:28 claudio Exp $
+.\" $OpenBSD: bgplgd.8,v 1.8 2024/01/26 18:11:49 job Exp $
.\"
.\" Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: March 13 2023 $
+.Dd $Mdocdate: January 26 2024 $
.Dt BGPLGD 8
.Os
.Sh NAME
@@ -27,6 +27,7 @@
.Op Fl S Ar socket
.Op Fl s Ar socket
.Op Fl U Ar user
+.Op Fl V
.Sh DESCRIPTION
.Nm
is a server which implements the FastCGI Protocol to execute
@@ -80,6 +81,8 @@ Change the owner of
to
.Ar user
and its primary group instead of the default www:www.
+.It Fl V
+Show the version and exit.
.El
.Pp
.Nm
diff --git a/usr.sbin/bgplgd/slowcgi.c b/usr.sbin/bgplgd/slowcgi.c
index f20eb8afdd7..ffe51bd54fa 100644
--- a/usr.sbin/bgplgd/slowcgi.c
+++ b/usr.sbin/bgplgd/slowcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slowcgi.c,v 1.6 2023/03/31 09:55:39 claudio Exp $ */
+/* $OpenBSD: slowcgi.c,v 1.7 2024/01/26 18:11:49 job Exp $ */
/*
* Copyright (c) 2020 Claudio Jeker <claudio@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -44,6 +44,7 @@
#include "slowcgi.h"
#include "bgplgd.h"
#include "http.h"
+#include "version.h"
#define TIMEOUT_DEFAULT 30
#define WWW_USER "www"
@@ -300,7 +301,7 @@ main(int argc, char *argv[])
}
}
- while ((c = getopt(argc, argv, "dp:S:s:U:u:")) != -1) {
+ while ((c = getopt(argc, argv, "dp:S:s:U:u:V")) != -1) {
switch (c) {
case 'd':
debug++;
@@ -317,6 +318,9 @@ main(int argc, char *argv[])
case 'U':
sock_user = optarg;
break;
+ case 'V':
+ fprintf(stderr, "OpenBGPD %s\n", BGPD_VERSION);
+ return 0;
default:
usage();
/* NOTREACHED */