using std::cerr;
using std::cout;
using std::runtime_error;
-using boost::shared_ptr;
+using std::shared_ptr;
using boost::optional;
using boost::function;
}
}
+
+bool PrivilegeEscalator::test = false;
+
PrivilegeEscalator::~PrivilegeEscalator ()
{
- unprivileged ();
+ if (!test) {
+ unprivileged ();
+ }
}
PrivilegeEscalator::PrivilegeEscalator ()
{
- int const r = seteuid(0);
- if (r < 0) {
- throw PrivilegeError (String::compose("seteuid() call failed with %1", errno));
+ if (!test) {
+ int const r = seteuid(0);
+ if (r < 0) {
+ throw PrivilegeError (String::compose("seteuid() call failed with %1", errno));
+ }
}
}
}
+string
+dcpomatic::get_process_id ()
+{
+ return dcp::raw_convert<string>(getpid());
+}