X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fupload.c;h=e15eadefd70db50cf7046dc0493afaa7c56011ab;hb=refs%2Ftags%2F1.0.88;hp=7b2ccea55241fbcaffdb8e08b51d7a71989e3f0a;hpb=3e70b34eed5a48640e20fbf6dcba774aaace1f3c;p=libguestfs.git diff --git a/daemon/upload.c b/daemon/upload.c index 7b2ccea..e15eade 100644 --- a/daemon/upload.c +++ b/daemon/upload.c @@ -40,11 +40,11 @@ do_upload (const char *filename) { int err, fd, r, is_dev; - is_dev = STREQLEN (filename, "/dev/", 5); + is_dev = STRPREFIX (filename, "/dev/"); if (!is_dev) { if (!root_mounted || filename[0] != '/') { cancel_receive (); - reply_with_error ("upload: root must be mounted and path must be absolute"); + reply_with_error ("root must be mounted and path must be absolute"); return -1; } } @@ -93,7 +93,7 @@ do_download (const char *filename) int fd, r, is_dev; char buf[GUESTFS_MAX_CHUNK_SIZE]; - is_dev = STREQLEN (filename, "/dev/", 5); + is_dev = STRPREFIX (filename, "/dev/"); if (!is_dev) CHROOT_IN; fd = open (filename, O_RDONLY);