Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot Resolver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
140
Issues
140
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot Resolver
Commits
bc3e363d
Commit
bc3e363d
authored
Sep 30, 2015
by
Marek Vavruša
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
daemon: check that keyfile is readable and use abspath
parent
1cac016b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
daemon/main.c
daemon/main.c
+5
-4
No files found.
daemon/main.c
View file @
bc3e363d
...
...
@@ -197,7 +197,8 @@ int main(int argc, char **argv)
int
forks
=
1
;
array_t
(
char
*
)
addr_set
;
array_init
(
addr_set
);
const
char
*
keyfile
=
NULL
;
char
*
keyfile
=
NULL
;
static
char
keyfile_buf
[
PATH_MAX
+
1
];
/* Long options. */
int
c
=
0
,
li
=
0
,
ret
=
0
;
...
...
@@ -225,9 +226,9 @@ int main(int argc, char **argv)
}
break
;
case
'k'
:
keyfile
=
optarg
;
if
(
access
(
optarg
,
R
_OK
)
!=
0
)
{
log_error
(
"[system] keyfile '%s': not readable
\n
"
,
optarg
);
keyfile
=
realpath
(
optarg
,
keyfile_buf
)
;
if
(
!
keyfile
||
access
(
optarg
,
R_OK
|
W
_OK
)
!=
0
)
{
log_error
(
"[system] keyfile '%s': not readable
/writeable
\n
"
,
optarg
);
return
EXIT_FAILURE
;
}
break
;
...
...
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