#include "lib/util/sys_rw_data.h"
#include "lib/util/util_process.h"
#include "lib/dbwrap/dbwrap_ctdb.h"
+#include "lib/gencache.h"
#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
* we have reached EOF on stdin, which means the
* parent has exited. Shutdown the server
*/
+ TALLOC_FREE(fde);
(void)kill(getpid(), SIGTERM);
}
}
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 */
enum remote_arch_types ra;
};
-static void ra_parser(time_t timeout, DATA_BLOB blob, void *priv_data)
+static void ra_parser(const struct gencache_timeout *t,
+ DATA_BLOB blob,
+ void *priv_data)
{
struct ra_parser_state *state = (struct ra_parser_state *)priv_data;
const char *ra_str = NULL;
- if (timeout <= time(NULL)) {
+ if (gencache_timeout_expired(t)) {
return;
}
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.
****************************************************************************/