Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
8572b8e2
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8572b8e2
编写于
7月 31, 2010
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SUNRPC: Clean up of rpc_bindcred()
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
58f9612c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
32 deletion
+24
-32
include/linux/sunrpc/auth.h
include/linux/sunrpc/auth.h
+3
-3
net/sunrpc/auth.c
net/sunrpc/auth.c
+17
-20
net/sunrpc/auth_generic.c
net/sunrpc/auth_generic.c
+3
-8
net/sunrpc/clnt.c
net/sunrpc/clnt.c
+1
-1
未找到文件。
include/linux/sunrpc/auth.h
浏览文件 @
8572b8e2
...
...
@@ -106,7 +106,7 @@ struct rpc_credops {
void
(
*
crdestroy
)(
struct
rpc_cred
*
);
int
(
*
crmatch
)(
struct
auth_cred
*
,
struct
rpc_cred
*
,
int
);
void
(
*
crbind
)(
struct
rpc_task
*
,
struct
rpc_cred
*
,
int
);
struct
rpc_cred
*
(
*
crbind
)(
struct
rpc_task
*
,
struct
rpc_cred
*
,
int
);
__be32
*
(
*
crmarshal
)(
struct
rpc_task
*
,
__be32
*
);
int
(
*
crrefresh
)(
struct
rpc_task
*
);
__be32
*
(
*
crvalidate
)(
struct
rpc_task
*
,
__be32
*
);
...
...
@@ -135,8 +135,8 @@ void rpcauth_release(struct rpc_auth *);
struct
rpc_cred
*
rpcauth_lookup_credcache
(
struct
rpc_auth
*
,
struct
auth_cred
*
,
int
);
void
rpcauth_init_cred
(
struct
rpc_cred
*
,
const
struct
auth_cred
*
,
struct
rpc_auth
*
,
const
struct
rpc_credops
*
);
struct
rpc_cred
*
rpcauth_lookupcred
(
struct
rpc_auth
*
,
int
);
void
rpcauth_bindcred
(
struct
rpc_task
*
,
struct
rpc_cred
*
,
int
);
void
rpcauth_generic_bind_cred
(
struct
rpc_task
*
,
struct
rpc_cred
*
,
int
);
int
rpcauth_bindcred
(
struct
rpc_task
*
,
struct
rpc_cred
*
,
int
);
struct
rpc_cred
*
rpcauth_generic_bind_cred
(
struct
rpc_task
*
,
struct
rpc_cred
*
,
int
);
void
put_rpccred
(
struct
rpc_cred
*
);
void
rpcauth_unbindcred
(
struct
rpc_task
*
);
__be32
*
rpcauth_marshcred
(
struct
rpc_task
*
,
__be32
*
);
...
...
net/sunrpc/auth.c
浏览文件 @
8572b8e2
...
...
@@ -444,16 +444,16 @@ rpcauth_init_cred(struct rpc_cred *cred, const struct auth_cred *acred,
}
EXPORT_SYMBOL_GPL
(
rpcauth_init_cred
);
void
struct
rpc_cred
*
rpcauth_generic_bind_cred
(
struct
rpc_task
*
task
,
struct
rpc_cred
*
cred
,
int
lookupflags
)
{
task
->
tk_msg
.
rpc_cred
=
get_rpccred
(
cred
);
dprintk
(
"RPC: %5u holding %s cred %p
\n
"
,
task
->
tk_pid
,
cred
->
cr_auth
->
au_ops
->
au_name
,
cred
);
return
get_rpccred
(
cred
);
}
EXPORT_SYMBOL_GPL
(
rpcauth_generic_bind_cred
);
static
void
static
struct
rpc_cred
*
rpcauth_bind_root_cred
(
struct
rpc_task
*
task
,
int
lookupflags
)
{
struct
rpc_auth
*
auth
=
task
->
tk_client
->
cl_auth
;
...
...
@@ -461,45 +461,42 @@ rpcauth_bind_root_cred(struct rpc_task *task, int lookupflags)
.
uid
=
0
,
.
gid
=
0
,
};
struct
rpc_cred
*
ret
;
dprintk
(
"RPC: %5u looking up %s cred
\n
"
,
task
->
tk_pid
,
task
->
tk_client
->
cl_auth
->
au_ops
->
au_name
);
ret
=
auth
->
au_ops
->
lookup_cred
(
auth
,
&
acred
,
lookupflags
);
if
(
!
IS_ERR
(
ret
))
task
->
tk_msg
.
rpc_cred
=
ret
;
else
task
->
tk_status
=
PTR_ERR
(
ret
);
return
auth
->
au_ops
->
lookup_cred
(
auth
,
&
acred
,
lookupflags
);
}
static
void
static
struct
rpc_cred
*
rpcauth_bind_new_cred
(
struct
rpc_task
*
task
,
int
lookupflags
)
{
struct
rpc_auth
*
auth
=
task
->
tk_client
->
cl_auth
;
struct
rpc_cred
*
ret
;
dprintk
(
"RPC: %5u looking up %s cred
\n
"
,
task
->
tk_pid
,
auth
->
au_ops
->
au_name
);
ret
=
rpcauth_lookupcred
(
auth
,
lookupflags
);
if
(
!
IS_ERR
(
ret
))
task
->
tk_msg
.
rpc_cred
=
ret
;
else
task
->
tk_status
=
PTR_ERR
(
ret
);
return
rpcauth_lookupcred
(
auth
,
lookupflags
);
}
void
int
rpcauth_bindcred
(
struct
rpc_task
*
task
,
struct
rpc_cred
*
cred
,
int
flags
)
{
struct
rpc_cred
*
new
;
int
lookupflags
=
0
;
if
(
flags
&
RPC_TASK_ASYNC
)
lookupflags
|=
RPCAUTH_LOOKUP_NEW
;
if
(
cred
!=
NULL
)
cred
->
cr_ops
->
crbind
(
task
,
cred
,
lookupflags
);
new
=
cred
->
cr_ops
->
crbind
(
task
,
cred
,
lookupflags
);
else
if
(
flags
&
RPC_TASK_ROOTCREDS
)
rpcauth_bind_root_cred
(
task
,
lookupflags
);
new
=
rpcauth_bind_root_cred
(
task
,
lookupflags
);
else
rpcauth_bind_new_cred
(
task
,
lookupflags
);
new
=
rpcauth_bind_new_cred
(
task
,
lookupflags
);
if
(
IS_ERR
(
new
))
return
PTR_ERR
(
new
);
if
(
task
->
tk_msg
.
rpc_cred
!=
NULL
)
put_rpccred
(
task
->
tk_msg
.
rpc_cred
);
task
->
tk_msg
.
rpc_cred
=
new
;
return
0
;
}
void
...
...
net/sunrpc/auth_generic.c
浏览文件 @
8572b8e2
...
...
@@ -54,18 +54,13 @@ struct rpc_cred *rpc_lookup_machine_cred(void)
}
EXPORT_SYMBOL_GPL
(
rpc_lookup_machine_cred
);
static
void
generic_bind_cred
(
struct
rpc_task
*
task
,
struct
rpc_cred
*
cred
,
int
lookupflags
)
static
struct
rpc_cred
*
generic_bind_cred
(
struct
rpc_task
*
task
,
struct
rpc_cred
*
cred
,
int
lookupflags
)
{
struct
rpc_auth
*
auth
=
task
->
tk_client
->
cl_auth
;
struct
auth_cred
*
acred
=
&
container_of
(
cred
,
struct
generic_cred
,
gc_base
)
->
acred
;
struct
rpc_cred
*
ret
;
ret
=
auth
->
au_ops
->
lookup_cred
(
auth
,
acred
,
lookupflags
);
if
(
!
IS_ERR
(
ret
))
task
->
tk_msg
.
rpc_cred
=
ret
;
else
task
->
tk_status
=
PTR_ERR
(
ret
);
return
auth
->
au_ops
->
lookup_cred
(
auth
,
acred
,
lookupflags
);
}
/*
...
...
net/sunrpc/clnt.c
浏览文件 @
8572b8e2
...
...
@@ -606,7 +606,7 @@ rpc_task_set_rpc_message(struct rpc_task *task, const struct rpc_message *msg)
task
->
tk_msg
.
rpc_argp
=
msg
->
rpc_argp
;
task
->
tk_msg
.
rpc_resp
=
msg
->
rpc_resp
;
/* Bind the user cred */
rpcauth_bindcred
(
task
,
msg
->
rpc_cred
,
task
->
tk_flags
);
task
->
tk_status
=
rpcauth_bindcred
(
task
,
msg
->
rpc_cred
,
task
->
tk_flags
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录