#include <signal.h>
#define ENSC_WRAPPERS_FCNTL 1
+#define ENSC_WRAPPERS_UNISTD 1
#include <wrappers.h>
#define MNTPOINT "/etc"
if (mnt->mask & MS_NODEV)
argv[idx++] = mnt->data;
else {
- char const tmp[strlen(mnt->data) + sizeof("nodev,")];
+ char * tmp = alloca(strlen(mnt->data) + sizeof("nodev,"));
strcpy(tmp, "nodev,");
strcat(tmp, mnt->data);
argv[idx++] = tmp;
}
}
else
- argv[idx++] = 'nodev';
+ argv[idx++] = "nodev";
if (mnt->type) {
argv[idx++] = "-t";
return false;
if (mnt->flag & (MS_BIND|MS_MOVE)) {
+ unsigned long flag = mnt->flag;
+ if ((flag & MS_NODEV)==0) flag |= MS_NODEV;
+
if (mount(mnt->src, ".",
mnt->type ? mnt->type : "",
- mnt->flag, mnt->data)==-1) {
+ flag, mnt->data)==-1) {
perror("secure-mount: mount()");
return false;
}
info->data = buf;
MOVE_TO_NEXT_FIELD(buf, true);
- if (strcmp(info->type, "swap")==0) return prIGNORE;
- if (strcmp(info->type, "none")==0) info->type = 0;
-
info->flag = MS_NODEV;
info->mask = 0;
info->xflag = 0;
+
+ if (strcmp(info->type, "swap") ==0) return prIGNORE;
+ else if (strcmp(info->type, "none") ==0) info->type = 0;
+ else if (strcmp(info->type, "devpts")==0) info->mask |= MS_NODEV;
+
if (col) *col = err_col;
if (!transformOptionList(info,col)) return prFAIL;
if (info->xflag & XFLAG_NOAUTO) return prIGNORE;
buf[len++] = ':';
len += utilvserver_fmt_uint(buf+len, col_nr);
WRITE_STR(fd, fname);
- write(fd, buf, len);
+ Vwrite(fd, buf, len);
}
case prIGNORE : break;
case prDOIT : {
bool is_rootfs = (strcmp(mnt.dst, "/")==0);
- chdir("/");
+ Echdir("/");
if (( is_rootfs && opt->rootfs==rfsNO) ||
(!is_rootfs && opt->rootfs==rfsONLY)) { /* ignore the entry */ }
else if (!mountSingle(&mnt, opt)) {