Commit 0eb790e3 authored by David Howells's avatar David Howells Committed by James Morris

CRED: Wrap task credential accesses in the autofs4 filesystem

Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.

Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().

Change some task->e?[ug]id to task_e?[ug]id().  In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Reviewed-by: default avatarJames Morris <jmorris@namei.org>
Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
Cc: Ian Kent <raven@themaw.net>
Cc: autofs@linux.kernel.org
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 73c646e4
...@@ -235,8 +235,8 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid, ...@@ -235,8 +235,8 @@ static int parse_options(char *options, int *pipefd, uid_t *uid, gid_t *gid,
substring_t args[MAX_OPT_ARGS]; substring_t args[MAX_OPT_ARGS];
int option; int option;
*uid = current->uid; *uid = current_uid();
*gid = current->gid; *gid = current_gid();
*pgrp = task_pgrp_nr(current); *pgrp = task_pgrp_nr(current);
*minproto = AUTOFS_MIN_PROTO_VERSION; *minproto = AUTOFS_MIN_PROTO_VERSION;
......
...@@ -391,8 +391,8 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, ...@@ -391,8 +391,8 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
memcpy(&wq->name, &qstr, sizeof(struct qstr)); memcpy(&wq->name, &qstr, sizeof(struct qstr));
wq->dev = autofs4_get_dev(sbi); wq->dev = autofs4_get_dev(sbi);
wq->ino = autofs4_get_ino(sbi); wq->ino = autofs4_get_ino(sbi);
wq->uid = current->uid; wq->uid = current_uid();
wq->gid = current->gid; wq->gid = current_gid();
wq->pid = current->pid; wq->pid = current->pid;
wq->tgid = current->tgid; wq->tgid = current->tgid;
wq->status = -EINTR; /* Status return if interrupted */ wq->status = -EINTR; /* Status return if interrupted */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment