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
Kirill Smelkov
linux
Commits
f12ef882
Commit
f12ef882
authored
Feb 28, 2004
by
Nathan Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] Fix the by-handle attr list interface (used by xfsdump) for security attrs.
SGI Modid: xfs-linux:xfs-kern:167038a
parent
89d5f798
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
fs/xfs/linux/xfs_iops.c
fs/xfs/linux/xfs_iops.c
+1
-2
fs/xfs/xfs_attr.h
fs/xfs/xfs_attr.h
+5
-1
fs/xfs/xfs_attr_leaf.c
fs/xfs/xfs_attr_leaf.c
+19
-3
No files found.
fs/xfs/linux/xfs_iops.c
View file @
f12ef882
...
...
@@ -630,8 +630,7 @@ linvfs_listxattr(
if
(
!
size
)
xflags
|=
ATTR_KERNOVAL
;
if
(
capable
(
CAP_SYS_ADMIN
))
xflags
|=
ATTR_KERNFULLS
;
xflags
|=
capable
(
CAP_SYS_ADMIN
)
?
ATTR_KERNFULLS
:
ATTR_KERNORMALS
;
error
=
attr_generic_list
(
vp
,
data
,
size
,
xflags
,
&
result
);
if
(
error
<
0
)
...
...
fs/xfs/xfs_attr.h
View file @
f12ef882
...
...
@@ -91,10 +91,14 @@ extern int attr_generic_list(struct vnode *, void *, size_t, int, ssize_t *);
#define ATTR_CREATE 0x0010
/* pure create: fail if attr already exists */
#define ATTR_REPLACE 0x0020
/* pure set: fail if attr does not exist */
#define ATTR_SYSTEM 0x0100
/* use attrs in system (pseudo) namespace */
#define ATTR_KERNOTIME 0x1000
/* [kernel] don't update inode timestamps */
#define ATTR_KERNOVAL 0x2000
/* [kernel] get attr size only, not value */
#define ATTR_KERNAMELS 0x4000
/* [kernel] list attr names (simple list) */
#define ATTR_KERNFULLS 0x8000
/* [kernel] full attr list, ie. root+user */
#define ATTR_KERNORMALS 0x0800
/* [kernel] normal attr list: user+secure */
#define ATTR_KERNROOTLS 0x8000
/* [kernel] include root in the attr list */
#define ATTR_KERNFULLS (ATTR_KERNORMALS|ATTR_KERNROOTLS)
/*
* The maximum size (into the kernel or returned from the kernel) of an
...
...
fs/xfs/xfs_attr_leaf.c
View file @
f12ef882
...
...
@@ -460,9 +460,15 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
i
<
INT_GET
(
sf
->
hdr
.
count
,
ARCH_CONVERT
);
i
++
)
{
attrnames_t
*
namesp
;
if
(((
context
->
flags
&
ATTR_SECURE
)
!=
0
)
!=
((
sfe
->
flags
&
XFS_ATTR_SECURE
)
!=
0
)
&&
!
(
context
->
flags
&
ATTR_KERNORMALS
))
{
sfe
=
XFS_ATTR_SF_NEXTENTRY
(
sfe
);
continue
;
}
if
(((
context
->
flags
&
ATTR_ROOT
)
!=
0
)
!=
((
sfe
->
flags
&
XFS_ATTR_ROOT
)
!=
0
)
&&
!
(
context
->
flags
&
ATTR_KERN
FUL
LS
))
{
!
(
context
->
flags
&
ATTR_KERN
ROOT
LS
))
{
sfe
=
XFS_ATTR_SF_NEXTENTRY
(
sfe
);
continue
;
}
...
...
@@ -511,9 +517,15 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
kmem_free
(
sbuf
,
sbsize
);
return
XFS_ERROR
(
EFSCORRUPTED
);
}
if
(((
context
->
flags
&
ATTR_SECURE
)
!=
0
)
!=
((
sfe
->
flags
&
XFS_ATTR_SECURE
)
!=
0
)
&&
!
(
context
->
flags
&
ATTR_KERNORMALS
))
{
sfe
=
XFS_ATTR_SF_NEXTENTRY
(
sfe
);
continue
;
}
if
(((
context
->
flags
&
ATTR_ROOT
)
!=
0
)
!=
((
sfe
->
flags
&
XFS_ATTR_ROOT
)
!=
0
)
&&
!
(
context
->
flags
&
ATTR_KERN
FUL
LS
))
{
!
(
context
->
flags
&
ATTR_KERN
ROOT
LS
))
{
sfe
=
XFS_ATTR_SF_NEXTENTRY
(
sfe
);
continue
;
}
...
...
@@ -2309,9 +2321,13 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
if
(
entry
->
flags
&
XFS_ATTR_INCOMPLETE
)
continue
;
/* skip incomplete entries */
if
(((
context
->
flags
&
ATTR_SECURE
)
!=
0
)
!=
((
entry
->
flags
&
XFS_ATTR_SECURE
)
!=
0
)
&&
!
(
context
->
flags
&
ATTR_KERNORMALS
))
continue
;
/* skip non-matching entries */
if
(((
context
->
flags
&
ATTR_ROOT
)
!=
0
)
!=
((
entry
->
flags
&
XFS_ATTR_ROOT
)
!=
0
)
&&
!
(
context
->
flags
&
ATTR_KERN
FUL
LS
))
!
(
context
->
flags
&
ATTR_KERN
ROOT
LS
))
continue
;
/* skip non-matching entries */
namesp
=
(
entry
->
flags
&
XFS_ATTR_SECURE
)
?
&
attr_secure
:
...
...
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