an initial fix for handling sparse files in smbd
[import/samba-cvsimport.git] / source / include / secrets.h
1 /*
2  * Unix SMB/CIFS implementation. 
3  * secrets.tdb file format info
4  * Copyright (C) Andrew Tridgell              2000
5  * 
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation; either version 2 of the License, or (at your
9  * option) any later version.
10  * 
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14  * more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, write to the Free Software Foundation, Inc., 675
18  * Mass Ave, Cambridge, MA 02139, USA.  
19  */
20
21 #ifndef _SECRETS_H
22 #define _SECRETS_H
23
24 /* the first one is for the hashed password (NT4 style) the latter
25    for plaintext (ADS)
26 */
27 #define SECRETS_MACHINE_ACCT_PASS "SECRETS/$MACHINE.ACC"
28 #define SECRETS_MACHINE_PASSWORD "SECRETS/MACHINE_PASSWORD"
29
30 /* this one is for storing trusted domain account password */
31 #define SECRETS_DOMTRUST_ACCT_PASS "SECRETS/$DOMTRUST.ACC"
32
33 /* The domain sid and our sid are stored here even though they aren't
34    really secret. */
35 #define SECRETS_DOMAIN_SID    "SECRETS/SID"
36 #define SECRETS_SAM_SID       "SAM/SID"
37
38 #define SECRETS_LDAP_BIND_PW "SECRETS/LDAP_BIND_PW"
39
40 /* Authenticated user info is stored in secrets.tdb under these keys */
41
42 #define SECRETS_AUTH_USER      "SECRETS/AUTH_USER"
43 #define SECRETS_AUTH_DOMAIN      "SECRETS/AUTH_DOMAIN"
44 #define SECRETS_AUTH_PASSWORD  "SECRETS/AUTH_PASSWORD"
45
46 /* structure for storing machine account password
47    (ie. when samba server is member of a domain */
48 struct machine_acct_pass {
49         uint8 hash[16];
50         time_t mod_time;
51 };
52
53 /*
54  * storage structure for trusted domain
55  */
56 struct trusted_dom_pass {
57         size_t uni_name_len;
58         smb_ucs2_t uni_name[32]; /* unicode domain name */
59         size_t pass_len;
60         fstring pass;           /* trust relationship's password */
61         time_t mod_time;
62         DOM_SID domain_sid;     /* remote domain's sid */
63 };
64
65 /*
66  * trusted domain entry/entries returned by secrets_get_trusted_domains
67  * (used in _lsa_enum_trust_dom call)
68  */
69 typedef struct trustdom {
70         smb_ucs2_t *name;
71         DOM_SID sid;
72 } TRUSTDOM;
73
74
75 #endif /* _SECRETS_H */