X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Fmknod.c;h=d5b8467218b030316453dd1867d191409f096a32;hb=eb7ec6170eca278fb910e18ca1f7ca81c6b507c0;hp=50865a62664ffe41a0d8ab672785b5420fd1da14;hpb=e9c37113104c1cfb234535adc9b52ad3880a41ce;p=libguestfs.git diff --git a/daemon/mknod.c b/daemon/mknod.c index 50865a6..d5b8467 100644 --- a/daemon/mknod.c +++ b/daemon/mknod.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -26,7 +26,7 @@ #include #include -#include "../src/guestfs_protocol.h" +#include "guestfs_protocol.h" #include "daemon.h" #include "actions.h" #include "optgroups.h" @@ -51,6 +51,11 @@ do_mknod (int mode, int devmajor, int devminor, const char *path) #ifdef HAVE_MKNOD int r; + if (mode < 0) { + reply_with_error ("%s: mode is negative", path); + return -1; + } + CHROOT_IN; r = mknod (path, mode, makedev (devmajor, devminor)); CHROOT_OUT;