diff options
author | NeilBrown <neilb@suse.de> | 2022-07-26 09:45:30 +0300 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2022-07-30 03:17:00 +0300 |
commit | 93adc1e391a761441d783828b93979b38093d011 (patch) | |
tree | abfbb27d3829acd77df8003f1b1fc83f85e273e3 /fs/nfsd/nfs4acl.c | |
parent | 7fe2a71dda349a1afa75781f0cc7975be9784d15 (diff) | |
download | linux-93adc1e391a761441d783828b93979b38093d011.tar.xz |
NFSD: set attributes when creating symlinks
The NFS protocol includes attributes when creating symlinks.
Linux does store attributes for symlinks and allows them to be set,
though they are not used for permission checking.
NFSD currently doesn't set standard (struct iattr) attributes when
creating symlinks, but for NFSv4 it does set ACLs and security labels.
This is inconsistent.
To improve consistency, pass the provided attributes into nfsd_symlink()
and call nfsd_create_setattr() to set them.
NOTE: this results in a behaviour change for all NFS versions when the
client sends non-default attributes with a SYMLINK request. With the
Linux client, the only attributes are:
attr.ia_mode = S_IFLNK | S_IRWXUGO;
attr.ia_valid = ATTR_MODE;
so the final outcome will be unchanged. Other clients might sent
different attributes, and if they did they probably expect them to be
honoured.
We ignore any error from nfsd_create_setattr(). It isn't really clear
what should be done if a file is successfully created, but the
attributes cannot be set. NFS doesn't allow partial success to be
reported. Reporting failure is probably more misleading than reporting
success, so the status is ignored.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/nfs4acl.c')
0 files changed, 0 insertions, 0 deletions