summaryrefslogtreecommitdiff
path: root/src/responder/pac/pacsrv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder/pac/pacsrv.h')
-rw-r--r--src/responder/pac/pacsrv.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/responder/pac/pacsrv.h b/src/responder/pac/pacsrv.h
index 0dfe7f9e..f0ffea29 100644
--- a/src/responder/pac/pacsrv.h
+++ b/src/responder/pac/pacsrv.h
@@ -21,6 +21,11 @@
#ifndef __PACSRV_H__
#define __PACSRV_H__
+#include <stdbool.h>
+#include <util/data_blob.h>
+#include <ndr.h>
+#include <gen_ndr/krb5pac.h>
+#include <gen_ndr/ndr_krb5pac.h>
#include <stdint.h>
#include <sys/un.h>
@@ -33,6 +38,8 @@
#include "responder/common/responder_packet.h"
#include "responder/common/responder.h"
#include "lib/idmap/sss_idmap.h"
+#include "util/sss_nss.h"
+#include "db/sysdb.h"
#define PAC_SBUS_SERVICE_VERSION 0x0001
#define PAC_SBUS_SERVICE_NAME "pac"
@@ -40,13 +47,61 @@
#define PAC_PACKET_MAX_RECV_SIZE 1024
struct getent_ctx;
+struct dom_sid;
struct pac_ctx {
struct resp_ctx *rctx;
+ struct sss_idmap_ctx *idmap_ctx;
+ struct dom_sid *my_dom_sid;
+ struct local_mapping_ranges *range_map;
+};
+
+struct range {
+ uint32_t min;
+ uint32_t max;
+};
+
+struct local_mapping_ranges {
+ struct range local_ids;
+ struct range primary_rids;
+ struct range secondary_rids;
};
int pac_cmd_execute(struct cli_ctx *cctx);
struct sss_cmd_table *get_pac_cmds(void);
+errno_t local_sid_to_id(struct local_mapping_ranges *map, struct dom_sid *sid,
+ uint32_t *id);
+
+errno_t add_idmap_domain(struct sss_idmap_ctx *idmap_ctx,
+ struct sysdb_ctx *sysdb,
+ const char *domain_name,
+ const char *dom_sid_str);
+
+errno_t domsid_rid_to_uid(struct pac_ctx *pac_ctx,
+ struct sysdb_ctx *sysdb,
+ const char *domain_name,
+ struct dom_sid2 *domsid, uint32_t rid,
+ uid_t *uid);
+
+errno_t get_my_domain_sid(struct pac_ctx *pac_ctx,
+ struct sss_domain_info *dom,
+ struct dom_sid **_sid);
+
+errno_t get_gids_from_pac(TALLOC_CTX *mem_ctx,
+ struct local_mapping_ranges *range_map,
+ struct dom_sid *domain_sid,
+ struct PAC_LOGON_INFO *logon_info,
+ size_t *_gid_count, gid_t **_gids);
+
+errno_t get_data_from_pac(TALLOC_CTX *mem_ctx,
+ uint8_t *pac_blob, size_t pac_len,
+ struct PAC_LOGON_INFO **_logon_info);
+
+errno_t get_pwd_from_pac(TALLOC_CTX *mem_ctx,
+ struct pac_ctx *pac_ctx,
+ struct sss_domain_info *dom,
+ struct PAC_LOGON_INFO *logon_info,
+ struct passwd **_pwd);
#endif /* __PACSRV_H__ */