mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
Linux: Use current_creds() if stashed creds fail
If we can't use our stashed credentials (because SELinux hates us, most likely), then fall back to trying the processes current credentials instead of just oopsing. Change-Id: Ib3676ff66f8400e86cccb97fb207a5f094ceb4ad Reviewed-on: http://gerrit.openafs.org/1283 Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
762c8b41ed
commit
bcdb5220e2
@ -56,6 +56,8 @@ afs_linux_raw_open(afs_dcache_id_t *ainode)
|
|||||||
#if defined(STRUCT_TASK_HAS_CRED)
|
#if defined(STRUCT_TASK_HAS_CRED)
|
||||||
/* Use stashed credentials - prevent selinux/apparmor problems */
|
/* Use stashed credentials - prevent selinux/apparmor problems */
|
||||||
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds);
|
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds);
|
||||||
|
if (IS_ERR(filp))
|
||||||
|
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred());
|
||||||
#else
|
#else
|
||||||
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
|
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user