Re: [AppArmor 32/45] Enable LSM hooks to distinguish operations on file descriptors from operations on pathnames

Andreas Gruenbacher
2007-10-26T22:06:32Z

On Friday 26 October 2007 22:58:11 Miklos Szeredi wrote:
> For special files, f_op->fsetattr will be NULL, since
> init_special_inode() will set up i_fop that way.
>
> So the filesystem's fsetattr() will only be called for regular files
> and/or directories, depending on how it sets up i_fop.
>
> With the ia_file thing, the filesystem would receive the struct file
> pointer in all cases. So the posted patch would break AFS and FUSE,
> because they unconditionally use ia_file if available and don't check
> the file type.

Ah okay, that's what you mean. That's much cleaner than ia_file indeed.

> They could check the file type, but still the interface would be ugly.

Agreed, that would be ugly.

> Ah, so if we kept ATTR_FILE and got rid of iattr_file, would that be OK
> for AppArmor?

No problem, yes.

Thanks,
Andreas