s3: Add winbindd_lookupsids
[ira/wip.git] / nsswitch / winbind_struct_protocol.h
index fe3da817910eb107c6dd8b5d686c4d3801b6e3bc..e5ed8e1b3a148de71bc5fb770536973a2e9bb0ab 100644 (file)
 #define SAFE_FREE(x) do { if(x) {free(x); x=NULL;} } while(0)
 #endif
 
+#ifndef FSTRING_LEN
+#define FSTRING_LEN 256
+typedef char fstring[FSTRING_LEN];
+#endif
+
 #ifndef _WINBINDD_NTDOM_H
 #define _WINBINDD_NTDOM_H
 
 #define WINBINDD_DONT_ENV    "_NO_WINBINDD"
 #define WINBINDD_LOCATOR_KDC_ADDRESS "WINBINDD_LOCATOR_KDC_ADDRESS"
 
-/* Update this when you change the interface.  */
-
-#define WINBIND_INTERFACE_VERSION 20
+/* Update this when you change the interface.
+ * 21: added WINBINDD_GETPWSID
+ *     added WINBINDD_GETSIDALIASES
+ * 22: added WINBINDD_PING_DC
+ * 23: added session_key to ccache_ntlm_auth response
+ *     added WINBINDD_CCACHE_SAVE
+ * 24: Fill in num_entries WINBINDD_LIST_USERS and WINBINDD_LIST_GROUPS
+ * 25: removed WINBINDD_SET_HWM
+ *     removed WINBINDD_SET_MAPPING
+ *     removed WINBINDD_REMOVE_MAPPING
+ * 26: added WINBINDD_DC_INFO
+ * 27: added WINBINDD_LOOKUPSIDS
+ */
+#define WINBIND_INTERFACE_VERSION 27
 
 /* Have to deal with time_t being 4 or 8 bytes due to structure alignment.
    On a 64bit Linux box, we have to support a constant structure size
-   between /lib/libnss_winbind.so.2 and /li64/libnss_winbind.so.2.
+   between /lib/libnss_winbind.so.2 and /lib64/libnss_winbind.so.2.
    The easiest way to do this is to always use 8byte values for time_t. */
 
 #define SMB_TIME_T int64_t
@@ -60,6 +76,7 @@ enum winbindd_cmd {
 
        WINBINDD_GETPWNAM,
        WINBINDD_GETPWUID,
+       WINBINDD_GETPWSID,
        WINBINDD_GETGRNAM,
        WINBINDD_GETGRGID,
        WINBINDD_GETGROUPS,
@@ -92,6 +109,7 @@ enum winbindd_cmd {
        WINBINDD_LOOKUPSID,
        WINBINDD_LOOKUPNAME,
        WINBINDD_LOOKUPRIDS,
+       WINBINDD_LOOKUPSIDS,
 
        /* Lookup functions */
 
@@ -103,13 +121,12 @@ enum winbindd_cmd {
 
        WINBINDD_ALLOCATE_UID,
        WINBINDD_ALLOCATE_GID,
-       WINBINDD_SET_MAPPING,
-       WINBINDD_REMOVE_MAPPING,
-       WINBINDD_SET_HWM,
 
        /* Miscellaneous other stuff */
 
        WINBINDD_CHECK_MACHACC,     /* Check machine account pw works */
+       WINBINDD_CHANGE_MACHACC,    /* Change machine account pw */
+       WINBINDD_PING_DC,           /* Ping the DC through NETLOGON */
        WINBINDD_PING,              /* Just tell me winbind is running */
        WINBINDD_INFO,              /* Various bit of info.  Currently just tidbits */
        WINBINDD_DOMAIN_NAME,       /* The domain this winbind server is a member of (lp_workgroup()) */
@@ -118,6 +135,7 @@ enum winbindd_cmd {
                                   struct winbindd_domain */
        WINBINDD_GETDCNAME,     /* Issue a GetDCName Request */
        WINBINDD_DSGETDCNAME,   /* Issue a DsGetDCName Request */
+       WINBINDD_DC_INFO,       /* Which DC are we connected to? */
 
        WINBINDD_SHOW_SEQUENCE, /* display sequence numbers of domains */
 
@@ -140,6 +158,9 @@ enum winbindd_cmd {
        /* Various group queries */
        WINBINDD_GETUSERDOMGROUPS,
 
+       /* lookup local groups */
+       WINBINDD_GETSIDALIASES,
+
        /* Initialize connection in a child */
        WINBINDD_INIT_CONNECTION,
 
@@ -150,17 +171,17 @@ enum winbindd_cmd {
        WINBINDD_DUAL_SIDS2XIDS,
        WINBINDD_DUAL_UID2SID,
        WINBINDD_DUAL_GID2SID,
-       WINBINDD_DUAL_SET_MAPPING,
-       WINBINDD_DUAL_REMOVE_MAPPING,
-       WINBINDD_DUAL_SET_HWM,
 
        /* Wrapper around possibly blocking unix nss calls */
        WINBINDD_DUAL_USERINFO,
        WINBINDD_DUAL_GETSIDALIASES,
 
+       WINBINDD_DUAL_NDRCMD,
+
        /* Complete the challenge phase of the NTLM authentication
           protocol using cached password. */
        WINBINDD_CCACHE_NTLMAUTH,
+       WINBINDD_CCACHE_SAVE,
 
        WINBINDD_NUM_CMDS
 };
@@ -236,6 +257,7 @@ struct winbindd_request {
                fstring groupname;   /* getgrnam */
                uid_t uid;           /* getpwuid, uid_to_sid */
                gid_t gid;           /* getgrgid, gid_to_sid */
+               uint32_t ndrcmd;
                struct {
                        /* We deliberatedly don't split into domain/user to
                            avoid having the client know what the separator
@@ -317,6 +339,11 @@ struct winbindd_request {
                        uint32_t initial_blob_len; /* blobs in extra_data */
                        uint32_t challenge_blob_len;
                } ccache_ntlm_auth;
+               struct {
+                       uid_t uid;
+                       fstring user;
+                       fstring pass;
+               } ccache_save;
                struct {
                        fstring domain_name;
                        fstring domain_guid;
@@ -461,6 +488,7 @@ struct winbindd_response {
                        uint32_t group_rid;
                } user_info;
                struct {
+                       uint8_t session_key[16];
                        uint32_t auth_blob_len; /* blob in extra_data */
                } ccache_ntlm_auth;
                struct {
@@ -484,31 +512,4 @@ struct winbindd_response {
        } extra_data;
 };
 
-struct WINBINDD_MEMORY_CREDS {
-       struct WINBINDD_MEMORY_CREDS *next, *prev;
-       const char *username; /* lookup key. */
-       uid_t uid;
-       int ref_count;
-       size_t len;
-       uint8_t *nt_hash; /* Base pointer for the following 2 */
-       uint8_t *lm_hash;
-       char *pass;
-};
-
-struct WINBINDD_CCACHE_ENTRY {
-       struct WINBINDD_CCACHE_ENTRY *next, *prev;
-       const char *principal_name;
-       const char *ccname;
-       const char *service;
-       const char *username;
-       const char *realm;
-       struct WINBINDD_MEMORY_CREDS *cred_ptr;
-       int ref_count;
-       uid_t uid;
-       time_t create_time;
-       time_t renew_until;
-       time_t refresh_time;
-       struct timed_event *event;
-};
-
 #endif