X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fconfig.cc;h=abf0eb42bcf6a19d3d2ab4088c618f65c2f9cfc6;hb=9bda3fda70912d73266a2dbac5470ca23d2ff6fd;hp=5496c0b3c788c9161e59eecc2bb6004adfacc190;hpb=b502b5723f4516bfd33c17a6b71a72831933d212;p=dcpomatic.git diff --git a/src/lib/config.cc b/src/lib/config.cc index 5496c0b3c..abf0eb42b 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -204,6 +204,7 @@ Config::create_certificate_chain () { return make_shared ( openssl_path(), + CERTIFICATE_VALIDITY_PERIOD, "dcpomatic.com", "dcpomatic.com", ".dcpomatic.smpte-430-2.ROOT", @@ -227,7 +228,8 @@ Config::backup () while (n < 100 && exists(add_number(path_to_copy, n))) { ++n; } - copy_file(path_to_copy, add_number(path_to_copy, n)); + boost::system::error_code ec; + copy_file(path_to_copy, add_number(path_to_copy, n), ec); }; /* Make a backup copy of any config.xml, cinemas.xml, dkdm_recipients.xml that we might be about @@ -235,18 +237,17 @@ Config::backup () * and decide to overwrite it with a new one (possibly losing important details in the corrupted * file). But we might as well back up the other files while we're about it. */ - try { - /* This uses the State::write_path stuff so, e.g. for a current version 2.16 we might copy - * ~/.config/dcpomatic2/2.16/config.xml to ~/.config/dcpomatic2/2.16/config.xml.1 - */ - copy_adding_number (config_write_file()); - /* These do not use State::write_path, so whatever path is in the Config we will copy - * adding a number. - */ - copy_adding_number (_cinemas_file); - copy_adding_number (_dkdm_recipients_file); - } catch (...) {} + /* This uses the State::write_path stuff so, e.g. for a current version 2.16 we might copy + * ~/.config/dcpomatic2/2.16/config.xml to ~/.config/dcpomatic2/2.16/config.xml.1 + */ + copy_adding_number (config_write_file()); + + /* These do not use State::write_path, so whatever path is in the Config we will copy + * adding a number. + */ + copy_adding_number (_cinemas_file); + copy_adding_number (_dkdm_recipients_file); } void @@ -591,7 +592,7 @@ try } } catch (...) { - if (have_existing ("config.xml")) { + if (have_existing("config.xml") || have_existing("cinemas.xml") || have_existing("dkdm_recipients.xml")) { backup (); /* We have a config file but it didn't load */ FailedToLoad ();