Revert "Re-allow audio channel 15 to be mapped so that users can add"
[dcpomatic.git] / src / lib / cross_linux.cc
index 28b8a4b416d343824fddf94a28505d760d38e6d8..2d43d38019c7d2697af5fb498b3894be60d7724d 100644 (file)
@@ -99,15 +99,26 @@ cpu_info ()
 }
 
 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)
 {
@@ -379,11 +390,9 @@ unprivileged ()
        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);
        }
 }
 
@@ -394,7 +403,10 @@ PrivilegeEscalator::~PrivilegeEscalator ()
 
 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