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
d70029d5
Commit
d70029d5
authored
Oct 16, 2002
by
Maksim Krasnyanskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Users must have CAP_NET_ADMIN capability in order to create
or destroy devices.
parent
a1bed4d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
net/bluetooth/rfcomm/tty.c
net/bluetooth/rfcomm/tty.c
+13
-0
No files found.
net/bluetooth/rfcomm/tty.c
View file @
d70029d5
...
...
@@ -266,6 +266,9 @@ static struct sk_buff *rfcomm_wmalloc(struct rfcomm_dev *dev, unsigned long size
}
/* ---- Device IOCTLs ---- */
#define NOCAP_FLAGS ((1 << RFCOMM_REUSE_DLC) | (1 << RFCOMM_RELEASE_ONHUP))
static
int
rfcomm_create_dev
(
struct
sock
*
sk
,
unsigned
long
arg
)
{
struct
rfcomm_dev_req
req
;
...
...
@@ -277,7 +280,14 @@ static int rfcomm_create_dev(struct sock *sk, unsigned long arg)
BT_DBG
(
"sk %p dev_id %id flags 0x%x"
,
sk
,
req
.
dev_id
,
req
.
flags
);
if
(
req
.
flags
!=
NOCAP_FLAGS
&&
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
if
(
req
.
flags
&
(
1
<<
RFCOMM_REUSE_DLC
))
{
/* Socket must be connected */
if
(
sk
->
state
!=
BT_CONNECTED
)
return
-
EBADFD
;
dlc
=
rfcomm_pi
(
sk
)
->
dlc
;
rfcomm_dlc_hold
(
dlc
);
}
else
{
...
...
@@ -311,6 +321,9 @@ static int rfcomm_release_dev(unsigned long arg)
BT_DBG
(
"dev_id %id flags 0x%x"
,
req
.
dev_id
,
req
.
flags
);
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
if
(
!
(
dev
=
rfcomm_dev_get
(
req
.
dev_id
)))
return
-
ENODEV
;
...
...
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