projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2541b18
)
swaroop: take ownership of config file if we're run as root.
author
Carl Hetherington
<cth@carlh.net>
Thu, 27 Sep 2018 14:49:32 +0000
(15:49 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 27 Sep 2018 14:49:32 +0000
(15:49 +0100)
src/lib/config.cc
patch
|
blob
|
history
diff --git
a/src/lib/config.cc
b/src/lib/config.cc
index e1d5b958d1af3da9413247aabd4ab4fe4412b0a2..fbf0e3b632a7f303a4aed17ec20e0b62b8d7f59f 100644
(file)
--- a/
src/lib/config.cc
+++ b/
src/lib/config.cc
@@
-229,6
+229,14
@@
void
Config::read ()
try
{
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+ if (geteuid() == 0) {
+ /* Take ownership of the config file if we're root */
+ chown (config_file().string().c_str(), 0, 0);
+ chmod (config_file().string().c_str(), 0644);
+ }
+#endif
+
cxml::Document f ("Config");
f.read_file (config_file ());