[PATCH] vfs_crossrename, zfs chmod can safely fail with aclmode=restrict

Jeremy Allison jra at samba.org
Mon Jul 7 14:46:24 MDT 2014


On Fri, Jun 27, 2014 at 05:05:33PM -0700, Jeremy Allison wrote:
> On Tue, Jun 24, 2014 at 12:54:27AM +0200, CurlyMo wrote:
> > When a user runs a ZFS filesystem with aclmode=restrict, then all
> > chmod operations will be restricted by ZFS and fail with "Operation
> > not permitted". In the vfs crossrename module, a move will fail when
> > the chmod operation returns an error and will therefor lead to
> > undefined behavior on a ZFS filesystem with aclmode=restrict.
> > 
> > This patch alters the chmod condition to only return a failed move
> > when the errno is anything other than EPERM. This was already done
> > in the chown operation in this vfs module. It was tested to work
> > with samba 3.6.24
> > 
> > --- vfs_crossrename.c.old	2014-06-23 08:03:27.000000000 +0200
> > +++ vfs_crossrename.c.new	2014-06-24 00:00:20.159739000 +0200
> > @@ -104,9 +104,9 @@
> >  	 */
> > 
> >  #if defined(HAVE_FCHMOD)
> > -	if (fchmod (ofd, source_stats.st_ex_mode & 07777))
> > +	if (fchmod (ofd, source_stats.st_ex_mode & 07777) == -1 && (errno
> > != EPERM))
> >  #else
> > -	if (chmod (dest, source_stats.st_ex_mode & 07777))
> > +	if (chmod (dest, source_stats.st_ex_mode & 07777) == -1 && (errno
> > != EPERM))
> >  #endif
> >  		goto err;
> 
> Thanks CurlyMo, looks good to me.
> 
> Can I get a second Team reviewer for the attached patch ?

Ping - anyone from the Team will review ?


More information about the samba-technical mailing list