git: ab7858d90eba - stable/15 - ngctl: Fix build without JAIL
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 11 Sep 2025 04:02:32 UTC
The branch stable/15 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=ab7858d90eba6d8b5829ad974da91ee30dcf92f4
commit ab7858d90eba6d8b5829ad974da91ee30dcf92f4
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-09-10 04:00:05 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-09-11 04:01:37 +0000
ngctl: Fix build without JAIL
Reported by: Michael Dexter
Fixes: 72d01e62b082 netgraph: teach ngctl to attach and run itself in a jail
MFC after: 1 day
(cherry picked from commit 685e60e860d61f6e1bcf981f5c30647e0c025702)
---
usr.sbin/ngctl/main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c
index b32e4f878b6e..b86f1ca27e71 100644
--- a/usr.sbin/ngctl/main.c
+++ b/usr.sbin/ngctl/main.c
@@ -144,7 +144,9 @@ main(int ac, char *av[])
char name[NG_NODESIZ];
int interactive = isatty(0) && isatty(1);
FILE *fp = NULL;
+#ifdef JAIL
const char *jail_name = NULL;
+#endif
int ch, rtn = 0;
/* Set default node name */
@@ -181,6 +183,7 @@ main(int ac, char *av[])
ac -= optind;
av += optind;
+#ifdef JAIL
if (jail_name != NULL) {
int jid;
@@ -196,6 +199,7 @@ main(int ac, char *av[])
errx((errno == EPERM) ? EX_NOPERM : EX_OSERR,
"cannot attach to jail");
}
+#endif
/* Create a new socket node */
if (NgMkSockNode(name, &csock, &dsock) < 0)