r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
[tprouty/samba.git] / source / include / passdb.h
index 74063d0fff1aa648fc9a441034c83662613265bd..60e8a63f9084169a74f838aec45999bc0fa05318 100644 (file)
@@ -8,7 +8,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -17,8 +17,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef _PASSDB_H
@@ -34,8 +33,8 @@
 #define ACCT_FULL_NAME         0x00000002
 #define ACCT_RID               0x00000004
 #define ACCT_PRIMARY_GID       0x00000008
-#define ACCT_ADMIN_DESC                0x00000010
-#define ACCT_DESCRIPTION       0x00000020
+#define ACCT_DESCRIPTION       0x00000010
+#define ACCT_COMMENT           0x00000020
 #define ACCT_HOME_DIR          0x00000040
 #define ACCT_HOME_DRIVE                0x00000080
 #define ACCT_LOGON_SCRIPT      0x00000100
@@ -90,7 +89,7 @@ enum pdb_elements {
        PDB_UNIXHOMEDIR,
        PDB_ACCTDESC,
        PDB_WORKSTATIONS,
-       PDB_UNKNOWNSTR,
+       PDB_COMMENT,
        PDB_MUNGEDDIAL,
        PDB_HOURS,
        PDB_FIELDS_PRESENT,
@@ -160,7 +159,7 @@ struct samu {
        const char *profile_path; /* profile path string */
        const char *acct_desc;    /* user description string */
        const char *workstations; /* login from workstations string */
-       const char *unknown_str;  /* don't know what this is, yet. */
+       const char *comment;
        const char *munged_dial;  /* munged path name and dial-back tel number */
                
        DOM_SID user_sid;  
@@ -241,10 +240,11 @@ struct pdb_search {
  * samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in
  * the pdb module. Remove the latter, this might happen more often. VL.
  * changed to version 14 to move lookup_rids and lookup_names to return
- * enum SID_NAME_USE rather than uint32.
+ * enum lsa_SidType rather than uint32.
+ * Changed to 16 for access to the trusted domain passwords (obnox).
  */
 
-#define PASSDB_INTERFACE_VERSION 14
+#define PASSDB_INTERFACE_VERSION 16
 
 struct pdb_methods 
 {
@@ -300,7 +300,7 @@ struct pdb_methods
                                               DOM_SID sid);
 
        NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods,
-                                      const DOM_SID *sid, enum SID_NAME_USE sid_name_use,
+                                      const DOM_SID *sid, enum lsa_SidType sid_name_use,
                                       GROUP_MAP **pp_rmap, size_t *p_num_entries,
                                       BOOL unix_only);
 
@@ -328,9 +328,6 @@ struct pdb_methods
                                 TALLOC_CTX *mem_ctx,
                                 uint32 group_rid, uint32 member_rid);
 
-       NTSTATUS (*find_alias)(struct pdb_methods *methods,
-                              const char *name, DOM_SID *sid);
-
        NTSTATUS (*create_alias)(struct pdb_methods *methods,
                                 const char *name, uint32 *rid);
 
@@ -365,14 +362,14 @@ struct pdb_methods
                                int num_rids,
                                uint32 *rids,
                                const char **pp_names,
-                               enum SID_NAME_USE *attrs);
+                               enum lsa_SidType *attrs);
 
        NTSTATUS (*lookup_names)(struct pdb_methods *methods,
                                 const DOM_SID *domain_sid,
                                 int num_names,
                                 const char **pp_names,
                                 uint32 *rids,
-                                enum SID_NAME_USE *attrs);
+                                enum lsa_SidType *attrs);
 
        NTSTATUS (*get_account_policy)(struct pdb_methods *methods,
                                       int policy_index, uint32 *value);
@@ -393,14 +390,29 @@ struct pdb_methods
 
        BOOL (*uid_to_rid)(struct pdb_methods *methods, uid_t uid,
                           uint32 *rid);
+       BOOL (*uid_to_sid)(struct pdb_methods *methods, uid_t uid,
+                          DOM_SID *sid);
        BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid,
                           DOM_SID *sid);
        BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid,
-                         union unid_t *id, enum SID_NAME_USE *type);
+                         union unid_t *id, enum lsa_SidType *type);
 
        BOOL (*rid_algorithm)(struct pdb_methods *methods);
        BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid);
 
+
+       BOOL (*get_trusteddom_pw)(struct pdb_methods *methods,
+                                 const char *domain, char** pwd, 
+                                 DOM_SID *sid, time_t *pass_last_set_time);
+       BOOL (*set_trusteddom_pw)(struct pdb_methods *methods, 
+                                 const char* domain, const char* pwd,
+                                 const DOM_SID *sid);
+       BOOL (*del_trusteddom_pw)(struct pdb_methods *methods, 
+                                 const char *domain);
+       NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods,
+                                    TALLOC_CTX *mem_ctx, uint32 *num_domains,
+                                    struct trustdom_info ***domains);
+
        void *private_data;  /* Private data of some kind */
        
        void (*free_private_data)(void **);