Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107780704
D26957.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
796 B
Referenced Files
None
Subscribers
None
D26957.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D26957: sockstat: chdir to jail path before attaching to vnet jail
Attached
Detach File
Event Timeline
Log In to Comment