~ubuntu-branches/ubuntu/precise/krb5/precise-updates

« back to all changes in this revision

Viewing changes to src/windows/identity/kconfig/kconfiginternal.h

  • Committer: Package Import Robot
  • Author(s): Sam Hartman
  • Date: 2011-12-01 19:34:41 UTC
  • mfrom: (28.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20111201193441-9tipg3aru1jsidyv
Tags: 1.10+dfsg~alpha1-6
* Fix segfault with unknown hostnames in krb5_sname_to_principal,
  Closes: #650671
* Indicate that this library breaks libsmbclient versions that depend on
  krb5_locate_kdc, Closes: #650603, #650611

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2005 Massachusetts Institute of Technology
3
 
 *
4
 
 * Permission is hereby granted, free of charge, to any person
5
 
 * obtaining a copy of this software and associated documentation
6
 
 * files (the "Software"), to deal in the Software without
7
 
 * restriction, including without limitation the rights to use, copy,
8
 
 * modify, merge, publish, distribute, sublicense, and/or sell copies
9
 
 * of the Software, and to permit persons to whom the Software is
10
 
 * furnished to do so, subject to the following conditions:
11
 
 *
12
 
 * The above copyright notice and this permission notice shall be
13
 
 * included in all copies or substantial portions of the Software.
14
 
 *
15
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
 
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
 
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
 
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19
 
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20
 
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
 
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
 
 * SOFTWARE.
23
 
 */
24
 
 
25
 
/* $Id$ */
26
 
 
27
 
#ifndef __KHIMAIRA_KCONFIGINTERNAL_H
28
 
#define __KHIMAIRA_KCONFIGINTERNAL_H
29
 
 
30
 
#define _NIMLIB_
31
 
 
32
 
#include<windows.h>
33
 
#include<kconfig.h>
34
 
#include<khlist.h>
35
 
#include<kherror.h>
36
 
#include<utils.h>
37
 
#include<strsafe.h>
38
 
 
39
 
/* TODO: Implement configuration provider interfaces
40
 
 
41
 
typedef struct kconf_provider_t {
42
 
 
43
 
} kconf_provider;
44
 
*/
45
 
 
46
 
typedef struct kconf_conf_space_t {
47
 
    wchar_t * name;
48
 
 
49
 
    /* kconf_provider * provider; */
50
 
 
51
 
    /* the regpath is the cumulative path starting from a hive root */
52
 
    wchar_t *   regpath;
53
 
    HKEY        regkey_user;
54
 
    khm_int32   regkey_user_flags;
55
 
    HKEY        regkey_machine;
56
 
    khm_int32   regkey_machine_flags;
57
 
 
58
 
    khm_int32   refcount;
59
 
    khm_int32   flags;
60
 
 
61
 
    const kconf_schema * schema;
62
 
    khm_int32   nSchema;
63
 
 
64
 
    TDCL(struct kconf_conf_space_t);
65
 
} kconf_conf_space;
66
 
 
67
 
#define KCONF_SPACE_FLAG_DELETE_U 0x00000040
68
 
#define KCONF_SPACE_FLAG_DELETE_M 0x00000080
69
 
#define KCONF_SPACE_FLAG_DELETED  0x00000100
70
 
 
71
 
typedef struct kconf_conf_handle_t {
72
 
    khm_int32   magic;
73
 
    khm_int32   flags;
74
 
    kconf_conf_space * space;
75
 
 
76
 
    struct kconf_conf_handle_t * lower;
77
 
 
78
 
    LDCL(struct kconf_conf_handle_t);
79
 
} kconf_handle;
80
 
 
81
 
#define KCONF_HANDLE_MAGIC 0x38eb49d2
82
 
#define khc_is_handle(h) ((h) && ((kconf_handle *)h)->magic == KCONF_HANDLE_MAGIC)
83
 
#define khc_shadow(h) (((kconf_handle *)h)->lower)
84
 
#define khc_is_shadowed(h) (khc_is_handle(h) && khc_shadow(h) != NULL)
85
 
 
86
 
extern kconf_conf_space * conf_root;
87
 
extern kconf_handle * conf_handles;
88
 
extern kconf_handle * conf_free_handles;
89
 
extern CRITICAL_SECTION cs_conf_global;
90
 
extern LONG conf_init;
91
 
extern LONG conf_status;
92
 
 
93
 
#define khc_is_config_running() (conf_init && conf_status)
94
 
 
95
 
#define CONFIG_REGPATHW L"Software\\MIT\\NetIDMgr"
96
 
 
97
 
void init_kconf(void);
98
 
void exit_kconf(void);
99
 
 
100
 
/* handle operations */
101
 
#define khc_space_from_handle(h)    (((kconf_handle *) h)->space)
102
 
#define khc_is_schema_handle(h)     (((kconf_handle *) h)->flags & KCONF_FLAG_SCHEMA)
103
 
#define khc_is_user_handle(h)       (((kconf_handle *) h)->flags & KCONF_FLAG_USER)
104
 
#define khc_is_machine_handle(h)    (((kconf_handle *) h)->flags & KCONF_FLAG_MACHINE)
105
 
#define khc_handle_flags(h)         (((kconf_handle *) h)->flags)
106
 
 
107
 
kconf_handle *
108
 
khcint_handle_from_space(kconf_conf_space * s, khm_int32 flags);
109
 
 
110
 
void
111
 
khcint_handle_free(kconf_handle * h);
112
 
 
113
 
kconf_conf_space *
114
 
khcint_create_empty_space(void);
115
 
 
116
 
void
117
 
khcint_free_space(kconf_conf_space * r);
118
 
 
119
 
void
120
 
khcint_space_hold(kconf_conf_space * s);
121
 
 
122
 
void
123
 
khcint_space_release(kconf_conf_space * s);
124
 
 
125
 
HKEY
126
 
khcint_space_open_key(kconf_conf_space * s, khm_int32 flags);
127
 
 
128
 
khm_int32
129
 
khcint_remove_space(kconf_conf_space * c, khm_int32 flags);
130
 
 
131
 
#endif