diff options
Diffstat (limited to 'bin')
-rw-r--r--[-rwxr-xr-x] | bin/bbackupd/bbackupd-config.in | 0 | ||||
-rw-r--r-- | bin/bbstoreaccounts/bbstoreaccounts.cpp | 24 | ||||
-rw-r--r--[-rwxr-xr-x] | bin/bbstored/bbstored-certs.in | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | bin/bbstored/bbstored-config.in | 0 |
4 files changed, 20 insertions, 4 deletions
diff --git a/bin/bbackupd/bbackupd-config.in b/bin/bbackupd/bbackupd-config.in index 43f63b4e..43f63b4e 100755..100644 --- a/bin/bbackupd/bbackupd-config.in +++ b/bin/bbackupd/bbackupd-config.in diff --git a/bin/bbstoreaccounts/bbstoreaccounts.cpp b/bin/bbstoreaccounts/bbstoreaccounts.cpp index 6a173680..1d4252fd 100644 --- a/bin/bbstoreaccounts/bbstoreaccounts.cpp +++ b/bin/bbstoreaccounts/bbstoreaccounts.cpp @@ -130,19 +130,35 @@ int main(int argc, const char *argv[]) // Read in the configuration file std::string errs; - std::auto_ptr<Configuration> config( + std::auto_ptr<Configuration> apConfig( Configuration::LoadAndVerify (configFilename, &BackupConfigFileVerify, errs)); - if(config.get() == 0 || !errs.empty()) + if(apConfig.get() == 0 || !errs.empty()) { BOX_ERROR("Invalid configuration file " << configFilename << ":" << errs); } +#ifndef WIN32 + // Handle changing to a different user, to match bbstored, to ensure that files don't end up + // owned by the wrong user. + const Configuration &serverConfig( + apConfig->GetSubConfiguration("Server")); + + if(serverConfig.KeyExists("User")) + { + // Config file specifies an user -- look up + UnixUser daemonUser(serverConfig.GetKeyValue("User").c_str()); + + // Change the process ID + daemonUser.ChangeProcessUser(); // temporary=false + } +#endif + // Initialise the raid file controller RaidFileController &rcontroller(RaidFileController::GetController()); - rcontroller.Initialise(config->GetKeyValue("RaidFileConf").c_str()); + rcontroller.Initialise(apConfig->GetKeyValue("RaidFileConf").c_str()); // Then... check we have two arguments if(argc < 2) @@ -158,7 +174,7 @@ int main(int argc, const char *argv[]) } std::string command = argv[0]; - BackupStoreAccountsControl control(*config, machineReadableOutput); + BackupStoreAccountsControl control(*apConfig, machineReadableOutput); // Now do the command. if(command == "create") diff --git a/bin/bbstored/bbstored-certs.in b/bin/bbstored/bbstored-certs.in index 10072a87..10072a87 100755..100644 --- a/bin/bbstored/bbstored-certs.in +++ b/bin/bbstored/bbstored-certs.in diff --git a/bin/bbstored/bbstored-config.in b/bin/bbstored/bbstored-config.in index 1efaf668..1efaf668 100755..100644 --- a/bin/bbstored/bbstored-config.in +++ b/bin/bbstored/bbstored-config.in |