}
boost::filesystem::path
-shared_path ()
+resources_path ()
{
- char const * p = getenv ("DCPOMATIC_LINUX_SHARE_PREFIX");
- if (p) {
- return p;
- }
- return boost::filesystem::canonical (LINUX_SHARE_PREFIX);
+ return directory_containing_executable().parent_path() / "share" / "dcpomatic2";
+}
+
+
+boost::filesystem::path
+xsd_path ()
+{
+ return boost::filesystem::canonical(LINUX_SHARE_PREFIX) / "libdcp" / "xsd";
}
+
+boost::filesystem::path
+tags_path ()
+{
+ return boost::filesystem::canonical(LINUX_SHARE_PREFIX) / "libdcp" / "tags";
+}
+
+
void
run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
{
uid_t ruid, euid, suid;
if (getresuid(&ruid, &euid, &suid) == -1) {
cerr << "getresuid() failed.\n";
- exit (EXIT_FAILURE);
}
if (seteuid(ruid) == -1) {
cerr << "seteuid() failed.\n";
- exit (EXIT_FAILURE);
}
}
PrivilegeEscalator::PrivilegeEscalator ()
{
- seteuid (0);
+ int const r = seteuid(0);
+ if (r < 0) {
+ throw PrivilegeError (String::compose("seteuid() call failed with %1", errno));
+ }
}
boost::filesystem::path