X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fdir.c;h=3a4647cd142990a3e6cb14743cc2c55105004a82;hp=205139b8f0594528c91f73fccfcf910461e42565;hb=9be89728f2a0ff17d54a0dba981015fa6405eb50;hpb=e9c37113104c1cfb234535adc9b52ad3880a41ce;ds=sidebyside diff --git a/daemon/dir.c b/daemon/dir.c index 205139b..3a4647c 100644 --- a/daemon/dir.c +++ b/daemon/dir.c @@ -104,6 +104,11 @@ do_mkdir_mode (const char *path, int mode) { int r; + if (mode < 0) { + reply_with_error ("%s: mode is negative", path); + return -1; + } + CHROOT_IN; r = mkdir (path, mode); CHROOT_OUT;