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
e1a25f0c
Commit
e1a25f0c
authored
10 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'bug13295_v2_025' into maint-0.2.5
parents
87576e82
09951bea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
changes/13295
+5
-0
5 additions, 0 deletions
changes/13295
src/common/sandbox.c
+21
-0
21 additions, 0 deletions
src/common/sandbox.c
src/common/sandbox.h
+2
-0
2 additions, 0 deletions
src/common/sandbox.h
src/tools/tor-resolve.c
+2
-0
2 additions, 0 deletions
src/tools/tor-resolve.c
with
30 additions
and
0 deletions
changes/13295
0 → 100644
+
5
−
0
View file @
e1a25f0c
o Minor bugfixes:
- Disable sandbox name resolver cache when running tor-resolve:
tor-resolve doesn't use the sandbox code, and turning it on was
breaking attempts to do tor-resolve on a non-default server on
Linux. Fixes bug 13295; bugfix on 0.2.5.3-alpha.
This diff is collapsed.
Click to expand it.
src/common/sandbox.c
+
21
−
0
View file @
e1a25f0c
...
...
@@ -1385,6 +1385,18 @@ HT_GENERATE(getaddrinfo_cache, cached_getaddrinfo_item_t, node,
cached_getaddrinfo_items_eq
,
0
.
6
,
tor_malloc_
,
tor_realloc_
,
tor_free_
);
/** If true, don't try to cache getaddrinfo results. */
static
int
sandbox_getaddrinfo_cache_disabled
=
0
;
/** Tell the sandbox layer not to try to cache getaddrinfo results. Used as in
* tor-resolve, when we have no intention of initializing crypto or of
* installing the sandbox.*/
void
sandbox_disable_getaddrinfo_cache
(
void
)
{
sandbox_getaddrinfo_cache_disabled
=
1
;
}
int
sandbox_getaddrinfo
(
const
char
*
name
,
const
char
*
servname
,
const
struct
addrinfo
*
hints
,
...
...
@@ -1393,6 +1405,10 @@ sandbox_getaddrinfo(const char *name, const char *servname,
int
err
;
struct
cached_getaddrinfo_item_t
search
,
*
item
;
if
(
sandbox_getaddrinfo_cache_disabled
)
{
return
getaddrinfo
(
name
,
NULL
,
hints
,
res
);
}
if
(
servname
!=
NULL
)
{
log_warn
(
LD_BUG
,
"called with non-NULL servname"
);
return
EAI_NONAME
;
...
...
@@ -1834,5 +1850,10 @@ sandbox_is_active(void)
{
return
0
;
}
void
sandbox_disable_getaddrinfo_cache
(
void
)
{
}
#endif
This diff is collapsed.
Click to expand it.
src/common/sandbox.h
+
2
−
0
View file @
e1a25f0c
...
...
@@ -208,5 +208,7 @@ int sandbox_init(sandbox_cfg_t* cfg);
/** Return true iff the sandbox is turned on. */
int
sandbox_is_active
(
void
);
void
sandbox_disable_getaddrinfo_cache
(
void
);
#endif
/* SANDBOX_H_ */
This diff is collapsed.
Click to expand it.
src/tools/tor-resolve.c
+
2
−
0
View file @
e1a25f0c
...
...
@@ -8,6 +8,7 @@
#include
"../common/util.h"
#include
"address.h"
#include
"../common/torlog.h"
#include
"sandbox.h"
#include
<stdio.h>
#include
<stdlib.h>
...
...
@@ -344,6 +345,7 @@ main(int argc, char **argv)
log_severity_list_t
*
s
=
tor_malloc_zero
(
sizeof
(
log_severity_list_t
));
init_logging
();
sandbox_disable_getaddrinfo_cache
();
arg
=
&
argv
[
1
];
n_args
=
argc
-
1
;
...
...
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