Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
a750e77c
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a750e77c
编写于
10月 17, 2007
作者:
S
Steve French
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CIFS] acl support part 4
Signed-off-by:
N
Steve French
<
sfrench@us.ibm.com
>
上级
d5d18501
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
9 deletion
+25
-9
fs/cifs/cifsacl.c
fs/cifs/cifsacl.c
+10
-9
fs/cifs/cifsacl.h
fs/cifs/cifsacl.h
+9
-0
fs/cifs/cifspdu.h
fs/cifs/cifspdu.h
+6
-0
未找到文件。
fs/cifs/cifsacl.c
浏览文件 @
a750e77c
...
@@ -95,23 +95,24 @@ int match_sid(struct cifs_sid *ctsid)
...
@@ -95,23 +95,24 @@ int match_sid(struct cifs_sid *ctsid)
return
(
-
1
);
return
(
-
1
);
}
}
/* if the two SIDs (roughly equivalent to a UUID for a user or group) are
the same returns 1, if they do not match returns 0 */
int
compare_sids
(
struct
cifs_sid
*
ctsid
,
struct
cifs_sid
*
cwsid
)
int
compare_sids
(
struct
cifs_sid
*
ctsid
,
struct
cifs_sid
*
cwsid
)
{
{
int
i
;
int
i
;
int
num_subauth
,
num_sat
,
num_saw
;
int
num_subauth
,
num_sat
,
num_saw
;
if
((
!
ctsid
)
||
(
!
cwsid
))
if
((
!
ctsid
)
||
(
!
cwsid
))
return
(
-
1
);
return
(
0
);
/* compare the revision */
/* compare the revision */
if
(
ctsid
->
revision
!=
cwsid
->
revision
)
if
(
ctsid
->
revision
!=
cwsid
->
revision
)
return
(
-
1
);
return
(
0
);
/* compare all of the six auth values */
/* compare all of the six auth values */
for
(
i
=
0
;
i
<
6
;
++
i
)
{
for
(
i
=
0
;
i
<
6
;
++
i
)
{
if
(
ctsid
->
authority
[
i
]
!=
cwsid
->
authority
[
i
])
if
(
ctsid
->
authority
[
i
]
!=
cwsid
->
authority
[
i
])
return
(
-
1
);
return
(
0
);
}
}
/* compare all of the subauth values if any */
/* compare all of the subauth values if any */
...
@@ -121,11 +122,11 @@ int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid)
...
@@ -121,11 +122,11 @@ int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid)
if
(
num_subauth
)
{
if
(
num_subauth
)
{
for
(
i
=
0
;
i
<
num_subauth
;
++
i
)
{
for
(
i
=
0
;
i
<
num_subauth
;
++
i
)
{
if
(
ctsid
->
sub_auth
[
i
]
!=
cwsid
->
sub_auth
[
i
])
if
(
ctsid
->
sub_auth
[
i
]
!=
cwsid
->
sub_auth
[
i
])
return
(
-
1
);
return
(
0
);
}
}
}
}
return
(
0
);
/* sids compare/match */
return
(
1
);
/* sids compare/match */
}
}
...
@@ -180,7 +181,8 @@ static void parse_ntace(struct cifs_ntace *pntace, char *end_of_acl)
...
@@ -180,7 +181,8 @@ static void parse_ntace(struct cifs_ntace *pntace, char *end_of_acl)
static
void
parse_dacl
(
struct
cifs_acl
*
pdacl
,
char
*
end_of_acl
)
static
void
parse_dacl
(
struct
cifs_acl
*
pdacl
,
char
*
end_of_acl
,
struct
cifs_sid
*
pownersid
,
struct
cifs_sid
pgrpsid
)
{
{
int
i
;
int
i
;
int
num_aces
=
0
;
int
num_aces
=
0
;
...
@@ -219,7 +221,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl)
...
@@ -219,7 +221,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl)
cifscred->aces = kmalloc(num_aces *
cifscred->aces = kmalloc(num_aces *
sizeof(struct cifs_ace *), GFP_KERNEL);*/
sizeof(struct cifs_ace *), GFP_KERNEL);*/
for
(
i
=
0
;
i
<
num_aces
;
++
i
)
{
for
(
i
=
0
;
i
<
num_aces
;
++
i
)
{
ppntace
[
i
]
=
(
struct
cifs_ntace
*
)
ppntace
[
i
]
=
(
struct
cifs_ntace
*
)
(
acl_base
+
acl_size
);
(
acl_base
+
acl_size
);
...
@@ -317,7 +318,7 @@ int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len)
...
@@ -317,7 +318,7 @@ int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len)
if
(
rc
)
if
(
rc
)
return
rc
;
return
rc
;
parse_dacl
(
dacl_ptr
,
end_of_acl
);
parse_dacl
(
dacl_ptr
,
end_of_acl
,
owner_sid_ptr
,
group_sid_ptr
);
/* cifscred->uid = owner_sid_ptr->rid;
/* cifscred->uid = owner_sid_ptr->rid;
cifscred->gid = group_sid_ptr->rid;
cifscred->gid = group_sid_ptr->rid;
...
...
fs/cifs/cifsacl.h
浏览文件 @
a750e77c
...
@@ -23,9 +23,18 @@
...
@@ -23,9 +23,18 @@
#define _CIFSACL_H
#define _CIFSACL_H
#define NUM_AUTHS 6
/* number of authority fields */
#define NUM_SUBAUTHS 5
/* number of sub authority fields */
#define NUM_WK_SIDS 7
/* number of well known sids */
#define NUM_WK_SIDS 7
/* number of well known sids */
#define SIDNAMELENGTH 20
/* long enough for the ones we care about */
#define SIDNAMELENGTH 20
/* long enough for the ones we care about */
#define READ_BIT 0x4
#define WRITE_BIT 0x2
#define EXEC_BIT 0x1
#define UBITSHIFT 6
#define GBITSHIFT 3
struct
cifs_ntsd
{
struct
cifs_ntsd
{
__le16
revision
;
/* revision level */
__le16
revision
;
/* revision level */
__le16
type
;
__le16
type
;
...
...
fs/cifs/cifspdu.h
浏览文件 @
a750e77c
...
@@ -215,6 +215,12 @@
...
@@ -215,6 +215,12 @@
/* file_execute, file_read_attributes*/
/* file_execute, file_read_attributes*/
/* write_dac, and delete. */
/* write_dac, and delete. */
#define FILE_READ_RIGHTS (FILE_READ_DATA | FILE_READ_EA | FILE_READ_ATTRIBUTES)
#define FILE_WRITE_RIGHTS (FILE_WRITE_DATA | FILE_APPEND_DATA \
| FILE_WRITE_EA | FILE_WRITE_ATTRIBUTES)
#define FILE_EXEC_RIGHTS (FILE_EXECUTE)
/*
/*
* Invalid readdir handle
* Invalid readdir handle
*/
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录