mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
Linux autoconf: fix name for struct cred test
The new macro scheme changes the name of the tested define. Update the code to match. Change-Id: I0e9f04692d8fbb6e9452a9b169c191ce7148349b Reviewed-on: http://gerrit.openafs.org/1868 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
d88b0b9a7b
commit
009b547195
@ -159,7 +159,7 @@ afs_linux_key_alloc(struct key_type *type, const char *desc, uid_t uid,
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
static inline struct key*
|
||||
afs_linux_search_keyring(afs_ucred_t *cred, struct key_type *type)
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ crget(void)
|
||||
if (!tmp)
|
||||
osi_Panic("crget: No more memory for creds!\n");
|
||||
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
get_cred(tmp);
|
||||
#else
|
||||
atomic_set(&tmp->cr_ref, 1);
|
||||
@ -49,7 +49,7 @@ crget(void)
|
||||
void
|
||||
crfree(cred_t * cr)
|
||||
{
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
put_cred(cr);
|
||||
#else
|
||||
if (atomic_dec_and_test(&cr->cr_ref)) {
|
||||
@ -65,7 +65,7 @@ cred_t *
|
||||
crdup(cred_t * cr)
|
||||
{
|
||||
cred_t *tmp = crget();
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
afs_copy_creds(tmp, cr);
|
||||
#else
|
||||
afs_set_cr_uid(tmp, afs_cr_uid(cr));
|
||||
@ -82,7 +82,7 @@ crdup(cred_t * cr)
|
||||
cred_t *
|
||||
crref(void)
|
||||
{
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
return (cred_t *)get_current_cred();
|
||||
#else
|
||||
cred_t *cr = crget();
|
||||
@ -105,7 +105,7 @@ crref(void)
|
||||
void
|
||||
crset(cred_t * cr)
|
||||
{
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
struct cred *new_creds;
|
||||
|
||||
/* If our current task doesn't have identical real and effective
|
||||
|
@ -27,7 +27,7 @@ afs_lock_t afs_xosi; /* lock is for tvattr */
|
||||
extern struct osi_dev cacheDev;
|
||||
extern struct vfsmount *afs_cacheMnt;
|
||||
extern struct super_block *afs_cacheSBp;
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
extern struct cred *cache_creds;
|
||||
#endif
|
||||
|
||||
@ -53,7 +53,7 @@ afs_linux_raw_open(afs_dcache_id_t *ainode)
|
||||
#endif
|
||||
tip->i_flags |= S_NOATIME; /* Disable updating access times. */
|
||||
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
/* Use stashed credentials - prevent selinux/apparmor problems */
|
||||
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds);
|
||||
if (IS_ERR(filp))
|
||||
|
@ -28,7 +28,7 @@ extern rwlock_t tasklist_lock __attribute__((weak));
|
||||
void
|
||||
afs_osi_TraverseProcTable(void)
|
||||
{
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK))
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK))
|
||||
struct task_struct *p;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK)
|
||||
@ -83,7 +83,7 @@ afs_osi_TraverseProcTable(void)
|
||||
* subsequent calls may overwrite the previously returned value.
|
||||
*/
|
||||
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(EXPORTED_RCU_READ_LOCK))
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(EXPORTED_RCU_READ_LOCK))
|
||||
const afs_ucred_t *
|
||||
afs_osi_proc2cred(afs_proc_t * pr)
|
||||
{
|
||||
@ -103,7 +103,7 @@ afs_osi_proc2cred(afs_proc_t * pr)
|
||||
atomic_set(&cr.cr_ref, 1);
|
||||
afs_set_cr_uid(&cr, task_uid(pr));
|
||||
#if defined(AFS_LINUX26_ENV)
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
get_group_info(pr->cred->group_info);
|
||||
set_cr_group_info(&cr, pr->cred->group_info);
|
||||
#else
|
||||
|
@ -129,7 +129,7 @@ afs_setgroups(cred_t **cr, struct group_info *group_info, int change_parent)
|
||||
|
||||
crset(*cr);
|
||||
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_PARENT) && !defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_PARENT) && !defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
if (change_parent) {
|
||||
old_info = current->parent->group_info;
|
||||
get_group_info(group_info);
|
||||
|
@ -144,7 +144,7 @@ static inline long copyinstr(char *from, char *to, int count, int *length) {
|
||||
typedef struct task_struct afs_proc_t;
|
||||
|
||||
/* Credentials. For newer kernels we use the kernel structure directly. */
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
|
||||
typedef struct cred afs_ucred_t;
|
||||
typedef struct cred cred_t;
|
||||
@ -212,7 +212,7 @@ afs_set_cr_group_info(cred_t *cred, struct group_info *group_info) {
|
||||
#define current_session_keyring() (current->signal->session_keyring)
|
||||
#define crhold(c) atomic_inc(&(c)->cr_ref)
|
||||
|
||||
#endif /* defined(STRUCT_TASK_HAS_CRED) */
|
||||
#endif /* defined(STRUCT_TASK_STRUCT_HAS_CRED) */
|
||||
|
||||
#if !defined(current_cred)
|
||||
#define current_gid() (current->gid)
|
||||
|
@ -84,7 +84,7 @@ crref(void)
|
||||
void
|
||||
crset(cred_t * cr)
|
||||
{
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
struct cred *new_creds;
|
||||
|
||||
/* If our current task doesn't have identical real and effective
|
||||
|
@ -62,7 +62,7 @@ afs_linux_raw_open(afs_dcache_id_t *ainode)
|
||||
tip->i_flags |= MS_NOATIME; /* Disable updating access times. */
|
||||
#endif
|
||||
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred());
|
||||
#else
|
||||
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
|
||||
|
@ -26,7 +26,7 @@ extern rwlock_t tasklist_lock __attribute__((weak));
|
||||
void
|
||||
afs_osi_TraverseProcTable(void)
|
||||
{
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK))
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK))
|
||||
struct task_struct *p;
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) && defined(EXPORTED_TASKLIST_LOCK)
|
||||
|
@ -180,7 +180,7 @@ set_cr_group_info(afs_ucred_t *cred, struct group_info *group_info) {
|
||||
#define current_fsgid() (current->fsgid)
|
||||
#define current_fsuid() (current->fsuid)
|
||||
#endif
|
||||
#if defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
#define current_group_info() (current->cred->group_info)
|
||||
#define task_gid(task) (task->cred->gid)
|
||||
#define task_user(task) (task->cred->user)
|
||||
|
@ -1431,7 +1431,7 @@ extern int afsd_dynamic_vcaches;
|
||||
* Linux uses the kernel cred structure if available, with the
|
||||
* wrappers defined in LINUX/osi_machdep.h
|
||||
*/
|
||||
#if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED))
|
||||
#if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED))
|
||||
#define afs_cr_uid(cred) ((cred)->cr_uid)
|
||||
#define afs_cr_gid(cred) ((cred)->cr_gid)
|
||||
#define afs_cr_ruid(cred) ((cred)->cr_ruid)
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "afsincludes.h" /* Afs-based standard headers */
|
||||
#include "afs/afs_stats.h" /* afs statistics */
|
||||
#include "rx/rxstat.h"
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
#include <linux/cred.h>
|
||||
#endif
|
||||
|
||||
@ -54,7 +54,7 @@ static struct vnode *volumeVnode;
|
||||
afs_rwlock_t afs_discon_lock;
|
||||
extern afs_rwlock_t afs_disconDirtyLock;
|
||||
#endif
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
const struct cred *cache_creds;
|
||||
#endif
|
||||
|
||||
@ -158,7 +158,7 @@ afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, afs_int32 ablocks,
|
||||
afs_cacheStats = astatSize;
|
||||
afs_vcacheInit(astatSize);
|
||||
afs_dcacheInit(afiles, ablocks, aDentries, achunk, aflags);
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
/*
|
||||
* Save current credentials for later access to disk cache files.
|
||||
* If selinux, apparmor or other security modules are enabled,
|
||||
@ -722,7 +722,7 @@ shutdown_cache(void)
|
||||
memset(&cacheDev, 0, sizeof(struct osi_dev));
|
||||
osi_dnlc_shutdown();
|
||||
}
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED)
|
||||
#if defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
put_cred(cache_creds);
|
||||
#endif
|
||||
} /*shutdown_cache */
|
||||
|
@ -95,7 +95,7 @@ osi_Init(void)
|
||||
#if defined(AFS_DARWIN80_ENV)
|
||||
afs_osi_cred.cr_ref = 1; /* kauth_cred_get_ref needs 1 existing ref */
|
||||
#else
|
||||
# if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_HAS_CRED))
|
||||
# if !(defined(AFS_LINUX26_ENV) && defined(STRUCT_TASK_STRUCT_HAS_CRED))
|
||||
crhold(&afs_osi_cred); /* don't let it evaporate */
|
||||
# endif
|
||||
#endif
|
||||
|
@ -611,7 +611,7 @@ PagInCred(afs_ucred_t *cred)
|
||||
* With keyrings but no kernel credentials, look at groups first and fall back
|
||||
* to looking at the keyrings.
|
||||
*/
|
||||
# if !defined(STRUCT_TASK_HAS_CRED)
|
||||
# if !defined(STRUCT_TASK_STRUCT_HAS_CRED)
|
||||
pag = osi_get_group_pag(cred);
|
||||
# endif
|
||||
if (pag == NOPAG)
|
||||
|
@ -623,7 +623,7 @@ static size_t afs_GCPAGs_cred_count = 0;
|
||||
/*
|
||||
* LOCKS: afs_GCPAGs_perproc_func requires write lock on afs_xuser
|
||||
*/
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK))
|
||||
#if !defined(LINUX_KEYRING_SUPPORT) && (!defined(STRUCT_TASK_STRUCT_HAS_CRED) || defined(HAVE_LINUX_RCU_READ_LOCK))
|
||||
void
|
||||
afs_GCPAGs_perproc_func(afs_proc_t * pproc)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user