Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a750e77c
Commit
a750e77c
authored
Oct 17, 2007
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CIFS] acl support part 4
Signed-off-by:
Steve French
<
sfrench@us.ibm.com
>
parent
d5d18501
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+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
No files found.
fs/cifs/cifsacl.c
View file @
a750e77c
...
...
@@ -95,23 +95,24 @@ int match_sid(struct cifs_sid *ctsid)
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
i
;
int
num_subauth
,
num_sat
,
num_saw
;
if
((
!
ctsid
)
||
(
!
cwsid
))
return
(
-
1
);
return
(
0
);
/* compare the revision */
if
(
ctsid
->
revision
!=
cwsid
->
revision
)
return
(
-
1
);
return
(
0
);
/* compare all of the six auth values */
for
(
i
=
0
;
i
<
6
;
++
i
)
{
if
(
ctsid
->
authority
[
i
]
!=
cwsid
->
authority
[
i
])
return
(
-
1
);
return
(
0
);
}
/* compare all of the subauth values if any */
...
...
@@ -121,11 +122,11 @@ int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid)
if
(
num_subauth
)
{
for
(
i
=
0
;
i
<
num_subauth
;
++
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)
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
num_aces
=
0
;
...
...
@@ -219,7 +221,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl)
cifscred->aces = kmalloc(num_aces *
sizeof(struct cifs_ace *), GFP_KERNEL);*/
for
(
i
=
0
;
i
<
num_aces
;
++
i
)
{
ppntace
[
i
]
=
(
struct
cifs_ntace
*
)
(
acl_base
+
acl_size
);
...
...
@@ -317,7 +318,7 @@ int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len)
if
(
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->gid = group_sid_ptr->rid;
...
...
fs/cifs/cifsacl.h
View file @
a750e77c
...
...
@@ -23,9 +23,18 @@
#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 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
{
__le16
revision
;
/* revision level */
__le16
type
;
...
...
fs/cifs/cifspdu.h
View file @
a750e77c
...
...
@@ -215,6 +215,12 @@
/* file_execute, file_read_attributes*/
/* 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
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment