[Libsysio-commit] HEAD: libsysio/src chmod.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-11-20 17:38:25
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27643/src Modified Files: chmod.c Log Message: Now, check that the file permissions allow the {f}chmod operation. Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- chmod.c 26 Oct 2007 19:48:23 -0000 1.18 +++ chmod.c 20 Nov 2007 17:38:19 -0000 1.19 @@ -61,6 +61,9 @@ do_chmod(struct pnode *pno, mode_t mode) struct intnl_stat stbuf; unsigned mask; + if (!_sysio_permitted(pno, W_OK)) + return -EPERM; + (void )memset(&stbuf, 0, sizeof(struct intnl_stat)); stbuf.st_mode = mode & 07777; mask = SETATTR_MODE; |