New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changed when/where the pidfile of daemons gets created #928
changed when/where the pidfile of daemons gets created #928
Conversation
030b322
to
c4367dd
Compare
9b0bb1f
to
b4aaab5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. We should check if we want to switch the man page creation for the daemons also to be created by sphinx.
752dae7
to
fb73c9b
Compare
a382e73
to
57abb93
Compare
c43af60
to
9c638e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good and very much like what we had discussed.
I have two main areas of concern left:
- when running with
-f
we still accept-p
but ignore it, we should either write the pidfile correctly or deny a combination of-f
and-p
. - on Windows we accept
-p
and then simply ignore it. Maybe we shouldn't accept it in the first place.
Other than that, I would delegate writing the file to daemon_start()
and DeletePidFile()
can be made even simpler.
55ef5eb
to
699eba8
Compare
50451d1
to
9b8892d
Compare
2edef52
to
72a2407
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two minor remarks, mostly concerning messages and documentation.
Before merging the PR, we should also create a matching security advisory in GitHub that we can link to from the CHANGELOG.md. (I'll take care of that)
4f528a6
to
37bcc7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great.
I think we should change the docs, so the user knows that the directive Pid Directory
won't have an effect anymore.
Other than that, I hope I can finish the Security Advise tomorrow, so we can finally merge this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can go one step further with the documentation. I think it is enough if the modern (i.e. 21+) documentation states that this has no effect anymore and tells you how to do it with the parameter.
This directive is optional and specifies a directory in which the Director may put its process Id file. The process Id file is used to shut down Bareos and to prevent multiple copies of Bareos from running simultaneously. Standard shell expansion of the Directory is done when the configuration file is read so that values such as $HOME will be properly expanded. | ||
|
||
The PID directory specified must already exist and be readable and writable by the Bareos daemon referencing it. | ||
|
||
Typically on Linux systems, you will set this to: :file:`/var/run`. If you are not installing Bareos in the system directories, you can use the Working Directory as defined above. | ||
|
||
As of bareos 21, this directive is deprecated. The way to set up a pid file is to do it as an option to the Director binary with the ``-p <file>`` option, where <file> is the path to a pidfile of your choosing. By default, no pidfile is created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This directive is optional and specifies a directory in which the Director may put its process Id file. The process Id file is used to shut down Bareos and to prevent multiple copies of Bareos from running simultaneously. Standard shell expansion of the Directory is done when the configuration file is read so that values such as $HOME will be properly expanded. | |
The PID directory specified must already exist and be readable and writable by the Bareos daemon referencing it. | |
Typically on Linux systems, you will set this to: :file:`/var/run`. If you are not installing Bareos in the system directories, you can use the Working Directory as defined above. | |
As of bareos 21, this directive is deprecated. The way to set up a pid file is to do it as an option to the Director binary with the ``-p <file>`` option, where <file> is the path to a pidfile of your choosing. By default, no pidfile is created. | |
Since :sinceVersion:`21.0.0` this directive has no effect anymore. The way to set up a pid file is to do it as an option to the Director binary with the ``-p <file>`` option, where <file> is the path to a pidfile of your choosing. By default, no pidfile is created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, but shouldn't we keep the old description for users of previous versions?
ad7d2f3
to
8f8884e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The headers in daemon.cc and daemon.h need the newer year.
But the elephant in the room is all the occurances of "Pid Directory" in test- and example-configurations.
I'll take a look at that if you don't mind.
@@ -38,7 +38,10 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year in the header is 2020, should be 2021
@@ -21,6 +21,6 @@ | |||
#ifndef BAREOS_LIB_DAEMON_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year in the header is 2020, should be 2021
8f8884e
to
9978b97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some comments that may be discussed.
1577092
to
b5fbe68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work!
The default is now not to create a pidfile. Daemons can be run with parameter `-p <file>` where <file> is the full path to a pidfile that should be created. Previously pidfiles were created in a rather unsafe manner in a location determined by Bareos' parameters.
This patch deprecates the now unused `Pid Directory` directives and removes the default value.
this patch removes all occurences of Pid Directory from every configuration file and template.
b5fbe68
to
dc0b568
Compare
dc0b568
to
9764f61
Compare
Description:
Fix for CVE-2017-14610 vulnerability, where PID files could be exploited on certain systems under certain circumstances.
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
General
Source code quality
bareos-check-sources --since-merge
does not report any problemsgit status
should not report modifications in the source tree after building and testing