summaryrefslogtreecommitdiffstats
path: root/server/util/util.h
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-06-02 15:26:13 -0400
committerSimo Sorce <ssorce@redhat.com>2009-06-10 14:55:20 -0400
commit1a9957cf23b3635f60dd22485988fe47d7154f6c (patch)
tree3515e84d82392f6f12123787f08aadb201a5c46b /server/util/util.h
parent1bbaf1a7cfde76bd81cab964c2eb9c91c6d8feba (diff)
downloadsssd-1a9957cf23b3635f60dd22485988fe47d7154f6c.tar.gz
sssd-1a9957cf23b3635f60dd22485988fe47d7154f6c.tar.xz
sssd-1a9957cf23b3635f60dd22485988fe47d7154f6c.zip
Turn sssd_mem_takeover into sssd_mem_attach
The old function was not used anywhere, and this function uses better semantics, including not using void ** which gives strict aliasing problems. Also add a generic password destroy function
Diffstat (limited to 'server/util/util.h')
-rw-r--r--server/util/util.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/server/util/util.h b/server/util/util.h
index 61f63feff..7acbfe613 100644
--- a/server/util/util.h
+++ b/server/util/util.h
@@ -52,11 +52,6 @@ void debug_fn(const char *format, ...);
#define talloc_zfree(ptr) do { talloc_free(ptr); ptr = NULL; } while(0)
#endif
-struct main_context {
- struct tevent_context *event_ctx;
- struct confdb_ctx *confdb_ctx;
-};
-
#include "util/dlinklist.h"
/* From debug.c */
@@ -64,6 +59,11 @@ void ldb_debug_messages(void *context, enum ldb_debug_level level,
const char *fmt, va_list ap);
/* from server.c */
+struct main_context {
+ struct tevent_context *event_ctx;
+ struct confdb_ctx *confdb_ctx;
+};
+
int server_setup(const char *name, int flags,
const char *conf_entry,
struct main_context **main_ctx);
@@ -77,9 +77,18 @@ void CatchChild(void);
void CatchChildLeaveStatus(void);
/* from memory.c */
-TALLOC_CTX *sssd_mem_takeover(TALLOC_CTX *mem_ctx,
- void *ptr,
- int (*destructor)(void **));
+typedef int (void_destructor_fn_t)(void *);
+
+struct mem_holder {
+ void *mem;
+ void_destructor_fn_t *fn;
+};
+
+void *sss_mem_attach(TALLOC_CTX *mem_ctx,
+ void *ptr,
+ void_destructor_fn_t *fn);
+
+int password_destructor(void *memctx);
/* from usertools.c */
char *get_username_from_uid(TALLOC_CTX *mem_ctx, uid_t uid);