Page MenuHomeFreeBSD

D26957.diff
No OneTemporary

D26957.diff

Index: usr.bin/sockstat/sockstat.c
===================================================================
--- usr.bin/sockstat/sockstat.c
+++ usr.bin/sockstat/sockstat.c
@@ -1367,10 +1367,19 @@
usage();
if (opt_j > 0) {
+ char buf[MAXPATHLEN];
+
switch (jail_getvnet(opt_j)) {
case -1:
- errx(2, "%s", jail_errmsg);
+ errx(2, "Unable to get jail vnet: %s", jail_errmsg);
case JAIL_SYS_NEW:
+ if (snprintf(buf, sizeof(buf), "%d", opt_j) < 0)
+ err(3, "snprintf()");
+ if (jail_getv(0, "jid", buf, "path", buf, NULL) < 0)
+ errx(3, "Unable to get jail path: %s",
+ jail_errmsg);
+ if (chdir(buf) < 0)
+ err(3, "Unable to chdir to jail path");
if (jail_attach(opt_j) < 0)
err(3, "jail_attach()");
/* Set back to -1 for normal output in vnet jail. */

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 19, 3:56 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15921075
Default Alt Text
D26957.diff (796 B)

Event Timeline