Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cruft-ng
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Jochen Sprickerhof
cruft-ng
Commits
7d54cf6f
Commit
7d54cf6f
authored
8 months ago
by
Alexandre Detiste
Browse files
Options
Downloads
Patches
Plain Diff
run "plocate --null /" (Closes: #1070216)
parent
65703de7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plocate.cc
+7
-9
7 additions, 9 deletions
plocate.cc
with
7 additions
and
9 deletions
plocate.cc
+
7
−
9
View file @
7d54cf6f
...
...
@@ -10,11 +10,6 @@
#include
"locate.h"
#include
"python.h"
// build fail on hurd-i386
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
static
void
read_ignores
(
vector
<
string
>&
ignores
,
const
string
&
ignore_path
)
{
ifstream
ignore_file
(
ignore_path
);
...
...
@@ -49,15 +44,17 @@ int read_locate(vector<string>& fs, const string& ignore_path)
fs
.
emplace_back
(
"/root"
);
fs
.
emplace_back
(
"/tmp"
);
char
buf
[
PATH_MAX
];
char
*
buf
=
NULL
;
size_t
len
=
0
;
FILE
*
fp
;
if
((
fp
=
popen
(
"plocate /"
,
"r"
))
==
nullptr
)
return
1
;
while
(
f
get
s
(
buf
,
sizeof
(
buf
),
fp
)
)
if
((
fp
=
popen
(
"plocate
--null
/"
,
"r"
))
==
nullptr
)
return
1
;
while
(
get
delim
(
&
buf
,
&
len
,
0
,
fp
)
!=
-
1
)
{
auto
len
=
strlen
(
buf
);
if
(
len
==
0
)
continue
;
string_view
filename
{
buf
,
len
-
1
};
// trim trailing newline
string_view
filename
{
buf
,
len
};
auto
toplevel
{
filename
.
substr
(
0
,
filename
.
find
(
'/'
,
1
))
};
if
(
toplevel
==
"/dev"
or
(
toplevel
==
"/home"
/* and dirname != "/home" */
)
...
...
@@ -87,6 +84,7 @@ int read_locate(vector<string>& fs, const string& ignore_path)
if
(
!
pyc_has_py
(
string
{
filename
},
debug
))
fs
.
emplace_back
(
filename
);
}
free
(
buf
);
pclose
(
fp
);
// default PRUNEPATH in /etc/updatedb.conf
...
...
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