- NEED_ROOT_OR_IS_DEVICE (filename, -1);
-
- is_dev = strncmp (filename, "/dev/", 5) == 0;
+ is_dev = STRPREFIX (filename, "/dev/");
+ if (!is_dev) {
+ if (!root_mounted || filename[0] != '/') {
+ cancel_receive ();
+ reply_with_error ("root must be mounted and path must be absolute");
+ return -1;
+ }
+ }