Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Linux programozás nagyházi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eckl, Máté
Linux programozás nagyházi
Commits
320f69a3
Commit
320f69a3
authored
May 27, 2016
by
dnsadmin
Browse files
Options
Downloads
Patches
Plain Diff
Főleg man de pár kiegészítés is
parent
fe064cae
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.cpp
+13
-3
13 additions, 3 deletions
main.cpp
with
13 additions
and
3 deletions
main.cpp
+
13
−
3
View file @
320f69a3
...
@@ -22,6 +22,7 @@
...
@@ -22,6 +22,7 @@
#include
"include/command.h"
#include
"include/command.h"
#define COMM_SOCK_PATH "/var/run/ecklm-dns/"
#define COMM_SOCK_PATH "/var/run/ecklm-dns/"
#define RUNNING_USER "dnsuser"
logger
log_on_demand
;
logger
log_on_demand
;
bool
verbose
=
false
;
bool
verbose
=
false
;
...
@@ -97,7 +98,12 @@ int main(int argc, char *argv[])
...
@@ -97,7 +98,12 @@ int main(int argc, char *argv[])
if
(
verbose
)
if
(
verbose
)
log_on_demand
(
LOG_DEBUG
,
"Current working directory is %s."
,
working_dir
);
log_on_demand
(
LOG_DEBUG
,
"Current working directory is %s."
,
working_dir
);
struct
passwd
*
new_uid
=
getpwnam
(
"dnsuser"
);
passwd
*
new_uid
=
getpwnam
(
RUNNING_USER
);
if
(
new_uid
==
NULL
)
{
log_on_demand
(
LOG_ERR
,
"There is no such user as %s."
,
RUNNING_USER
);
exit
(
EXIT_FAILURE
);
}
if
(
chroot
(
working_dir
)
<
0
)
if
(
chroot
(
working_dir
)
<
0
)
{
{
...
@@ -183,7 +189,11 @@ int main(int argc, char *argv[])
...
@@ -183,7 +189,11 @@ int main(int argc, char *argv[])
void
print_help
()
{
void
print_help
()
{
printf
(
R"(Usage: Runs in foreground mode by default.
printf
(
R"(Usage: Runs in foreground mode by default.
For more info look at the man page.
There must be a working directory which needs to be available
through the whole life of the process and to which the process will chroot.
Therefore and some other reason the server must be run with root privileges.
In daemon mode, the working directory must contain the dns.db file.
Options:
Options:
-d Run as daemon
-d Run as daemon
...
@@ -191,7 +201,7 @@ Options:
...
@@ -191,7 +201,7 @@ Options:
-s Statistics from daemon
-s Statistics from daemon
-k Kill daemon
-k Kill daemon
-w workind_dir Set working directory. Absolute path needed.
-w workind_dir Set working directory. Absolute path needed.
If not the actual PWD will be used.
If not
set,
the actual PWD will be used.
-v Verbose
-v Verbose
-h help
-h help
)"
);
)"
);
...
...
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