int do_fork = -1; /* unknown yet */
uid_t uid = 0;
gid_t gid = 0;
+ const char *rd_path = NULL, *wd_path = NULL;
#ifdef HAVE_LIBSELINUX
bool selinux = 0;
#endif
break;
case 'r':
if (optarg)
- open_target_fd(&root_fd, "root", optarg);
+ rd_path = optarg;
else
do_rd = true;
break;
case 'w':
if (optarg)
- open_target_fd(&wd_fd, "cwd", optarg);
+ wd_path = optarg;
else
do_wd = true;
break;
}
}
+ if (wd_path)
+ open_target_fd(&wd_fd, "cwd", wd_path);
+ if (rd_path)
+ open_target_fd(&root_fd, "root", rd_path);
+
/* Remember the current working directory if I'm not changing it */
if (root_fd >= 0 && wd_fd < 0) {
wd_fd = open(".", O_RDONLY);
0x00000000c0000000-0x00000000dfffffff 512M online yes 12-13
0x00000000e0000000-0x00000000efffffff 256M offline - 14
0x00000000f0000000-0x00000000ffffffff 256M online yes 15
-0x0000000100000000-0x000000010fffffff 256M online no 16
-0x0000000110000000-0x000000011fffffff 256M online no 17
-0x0000000120000000-0x000000012fffffff 256M online yes 18
-0x0000000130000000-0x000000013fffffff 256M online yes 19
+0x0000000100000000-0x000000011fffffff 512M online no 16-17
+0x0000000120000000-0x000000013fffffff 512M online yes 18-19
0x0000000140000000-0x000000017fffffff 1G offline - 20-23
Memory block size: 256M