Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
The Tor Project
Core
Tor
Commits
2ceea131
Commit
2ceea131
authored
4 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'tor-gitlab/mr/164'
parents
d4102531
304ae473
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!164
Fix for #40141: %include bug with pattern with */ on glibc < 2.19
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changes/bug40141
+4
-0
4 additions, 0 deletions
changes/bug40141
src/lib/fs/path.c
+12
-1
12 additions, 1 deletion
src/lib/fs/path.c
with
16 additions
and
1 deletion
changes/bug40141
0 → 100644
+
4
−
0
View file @
2ceea131
o Minor bugfixes (configuration):
- Fix bug where %including a pattern ending with */ would include files
and folders (instead of folders only) in versions of glibc < 2.19.
Fixes bug 40141; bugfix on 0.4.5.0-alpha-dev. Patch by Daniel Pinto.
This diff is collapsed.
Click to expand it.
src/lib/fs/path.c
+
12
−
1
View file @
2ceea131
...
...
@@ -598,6 +598,12 @@ tor_glob(const char *pattern)
return
NULL
;
}
// #40141: workaround for bug in glibc < 2.19 where patterns ending in path
// separator match files and folders instead of folders only
size_t
pattern_len
=
strlen
(
pattern
);
bool
dir_only
=
has_glob
(
pattern
)
&&
pattern_len
>
0
&&
pattern
[
pattern_len
-
1
]
==
*
PATH_SEPARATOR
;
result
=
smartlist_new
();
size_t
i
;
for
(
i
=
0
;
i
<
matches
.
gl_pathc
;
i
++
)
{
...
...
@@ -606,7 +612,12 @@ tor_glob(const char *pattern)
if
(
len
>
0
&&
match
[
len
-
1
]
==
*
PATH_SEPARATOR
)
{
match
[
len
-
1
]
=
'\0'
;
}
smartlist_add
(
result
,
match
);
if
(
!
dir_only
||
(
dir_only
&&
is_dir
(
file_status
(
match
))))
{
smartlist_add
(
result
,
match
);
}
else
{
tor_free
(
match
);
}
}
globfree
(
&
matches
);
#else
...
...
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