Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin J. Thompson
Tor
Commits
6d5b0367
Commit
6d5b0367
authored
11 years ago
by
Cristian Toader
Browse files
Options
Downloads
Patches
Plain Diff
Changes as suggested by nickm
- char* to const char* and name refactoring - workaround for accept4 syscall
parent
8f9d3da1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/compat.c
+1
-1
1 addition, 1 deletion
src/common/compat.c
src/common/sandbox.c
+7
-8
7 additions, 8 deletions
src/common/sandbox.c
src/common/sandbox.h
+1
-1
1 addition, 1 deletion
src/common/sandbox.h
with
9 additions
and
10 deletions
src/common/compat.c
+
1
−
1
View file @
6d5b0367
...
...
@@ -125,7 +125,7 @@ tor_open_cloexec(const char *path, int flags, unsigned mode)
{
int
fd
;
#ifdef O_CLOEXEC
path
=
get_prot_param
(
path
);
path
=
sandbox_intern_string
(
path
);
fd
=
open
(
path
,
flags
|
O_CLOEXEC
,
mode
);
if
(
fd
>=
0
)
return
fd
;
...
...
This diff is collapsed.
Click to expand it.
src/common/sandbox.c
+
7
−
8
View file @
6d5b0367
...
...
@@ -49,6 +49,10 @@ static sandbox_static_cfg_t filter_static[] = {
#endif
{
SCMP_SYS
(
rt_sigaction
),
PARAM_NUM
,
0
,
(
intptr_t
)(
SIGCHLD
),
0
},
{
SCMP_SYS
(
time
),
PARAM_NUM
,
0
,
0
,
0
},
#ifdef __NR_socketcall
{
SCMP_SYS
(
socketcall
),
PARAM_NUM
,
0
,
18
,
0
},
// accept4 workaround
#endif
};
/** Variable used for storing all syscall numbers that will be allowed with the
...
...
@@ -136,7 +140,7 @@ static int filter_nopar_gen[] = {
SCMP_SYS
(
exit
),
// socket syscalls
SCMP_SYS
(
accept4
),
//
SCMP_SYS(accept4),
SCMP_SYS
(
bind
),
SCMP_SYS
(
connect
),
SCMP_SYS
(
getsockname
),
...
...
@@ -149,17 +153,12 @@ static int filter_nopar_gen[] = {
SCMP_SYS
(
setsockopt
),
SCMP_SYS
(
socket
),
SCMP_SYS
(
socketpair
),
#ifdef __NR_socketcall
// SCMP_SYS(socketcall),
#endif
SCMP_SYS
(
recvfrom
),
SCMP_SYS
(
unlink
),
};
char
*
get_prot_param
(
char
*
param
)
const
char
*
sandbox_intern_string
(
char
*
param
)
{
int
i
,
filter_size
;
sandbox_cfg_t
*
elem
;
...
...
This diff is collapsed.
Click to expand it.
src/common/sandbox.h
+
1
−
1
View file @
6d5b0367
...
...
@@ -80,7 +80,7 @@ typedef struct pfd_elem sandbox_cfg_t;
void
sandbox_set_debugging_fd
(
int
fd
);
int
tor_global_sandbox
(
void
);
c
har
*
get_prot_param
(
char
*
param
);
c
onst
char
*
sandbox_intern_string
(
char
*
param
);
sandbox_cfg_t
*
sandbox_cfg_new
();
int
sandbox_cfg_allow_open_filename
(
sandbox_cfg_t
**
cfg
,
char
*
file
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment