NTSTATUS status = NT_STATUS_OK;
int ret;
+ /*
+ * The main process thread should never
+ * allow per_thread_cwd_enable() to be
+ * called.
+ */
+ per_thread_cwd_disable();
+
if (reinit_after_fork_pipe[1] != -1) {
close(reinit_after_fork_pipe[1]);
reinit_after_fork_pipe[1] = -1;
}
#if defined(HAVE_OFD_LOCKS)
-int map_process_lock_to_ofd_lock(int op, bool *use_ofd_locks)
+int map_process_lock_to_ofd_lock(int op)
{
switch (op) {
case F_GETLK:
op = F_OFD_SETLKW;
break;
default:
- *use_ofd_locks = false;
return -1;
}
- *use_ofd_locks = true;
return op;
}
#else /* HAVE_OFD_LOCKS */
-int map_process_lock_to_ofd_lock(int op, bool *use_ofd_locks)
+int map_process_lock_to_ofd_lock(int op)
{
- *use_ofd_locks = false;
return op;
}
#endif /* HAVE_OFD_LOCKS */
return cpy;
}
+/****************************************************************************
+ Return a root token
+****************************************************************************/
+
+struct security_unix_token *root_unix_token(TALLOC_CTX *mem_ctx)
+{
+ struct security_unix_token *t = NULL;
+
+ t = talloc_zero(mem_ctx, struct security_unix_token);
+ if (t == NULL) {
+ return NULL;
+ }
+
+ /*
+ * This is not needed, but lets make it explicit, not implicit.
+ */
+ *t = (struct security_unix_token) {
+ .uid = 0,
+ .gid = 0,
+ .ngroups = 0,
+ .groups = NULL
+ };
+
+ return t;
+}
+
/****************************************************************************
Check that a file matches a particular file type.
****************************************************************************/