X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Ffile.c;h=7a0f8f92df193cd4cacd45978ef97e880fabc17f;hb=fbf29976b33a69c64dc7847c54454bf2cfa5fde6;hp=dbdbbaae719d8904165072bdba2f045bea7b217d;hpb=e9c37113104c1cfb234535adc9b52ad3880a41ce;p=libguestfs.git diff --git a/daemon/file.c b/daemon/file.c index dbdbbaa..7a0f8f9 100644 --- a/daemon/file.c +++ b/daemon/file.c @@ -198,6 +198,11 @@ do_chmod (int mode, const char *path) { int r; + if (mode < 0) { + reply_with_error ("%s: mode is negative", path); + return -1; + } + CHROOT_IN; r = chmod (path, mode); CHROOT_OUT;