Author: gd
Date: 2007-08-28 15:16:42 +0000 (Tue, 28 Aug 2007)
New Revision: 24746

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24746

Log:
As the winbindd pipe is officially broken since a while: split out request
specfic and generic flags in a winbindd_request.

It turns out that the WBFLAG_RECURSE flag is the only non-PAM specific flag we
put into the "flags" field of a winbind request anyway. Now each request
command can use the entire space of the "flags" field.

Guenther

Modified:
   branches/SAMBA_3_2/source/nsswitch/wb_common.c
   branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h
   branches/SAMBA_3_2_0/source/nsswitch/wb_common.c
   branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h


Changeset:
Modified: branches/SAMBA_3_2/source/nsswitch/wb_common.c
===================================================================
--- branches/SAMBA_3_2/source/nsswitch/wb_common.c      2007-08-28 15:12:11 UTC 
(rev 24745)
+++ branches/SAMBA_3_2/source/nsswitch/wb_common.c      2007-08-28 15:16:42 UTC 
(rev 24746)
@@ -320,7 +320,7 @@
 
        /* version-check the socket */
 
-       request.flags = WBFLAG_RECURSE;
+       request.wb_flags = WBFLAG_RECURSE;
        if ((winbindd_request_response(WINBINDD_INTERFACE_VERSION, &request, 
&response) != NSS_STATUS_SUCCESS) || (response.data.interface_version != 
WINBIND_INTERFACE_VERSION)) {
                close_sock();
                return -1;
@@ -328,7 +328,7 @@
 
        /* try and get priv pipe */
 
-       request.flags = WBFLAG_RECURSE;
+       request.wb_flags = WBFLAG_RECURSE;
        if (winbindd_request_response(WINBINDD_PRIV_PIPE_DIR, &request, 
&response) == NSS_STATUS_SUCCESS) {
                int fd;
                if ((fd = winbind_named_pipe_sock((char 
*)response.extra_data.data)) != -1) {
@@ -567,13 +567,13 @@
        init_request(request, req_type);
        
        if (write_sock(request, sizeof(*request),
-                      request->flags & WBFLAG_RECURSE, need_priv) == -1) {
+                      request->wb_flags & WBFLAG_RECURSE, need_priv) == -1) {
                return NSS_STATUS_UNAVAIL;
        }
 
        if ((request->extra_len != 0) &&
            (write_sock(request->extra_data.data, request->extra_len,
-                       request->flags & WBFLAG_RECURSE, need_priv) == -1)) {
+                       request->wb_flags & WBFLAG_RECURSE, need_priv) == -1)) {
                return NSS_STATUS_UNAVAIL;
        }
        

Modified: branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h
===================================================================
--- branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h   2007-08-28 15:12:11 UTC 
(rev 24745)
+++ branches/SAMBA_3_2/source/nsswitch/winbindd_nss.h   2007-08-28 15:16:42 UTC 
(rev 24746)
@@ -42,7 +42,7 @@
 
 /* Update this when you change the interface.  */
 
-#define WINBIND_INTERFACE_VERSION 18
+#define WINBIND_INTERFACE_VERSION 19
 
 /* 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
@@ -194,26 +194,27 @@
        uint32 gr_mem_ofs;   /* offset to group membership */
 } WINBINDD_GR;
 
-
+/* PAM specific request flags */
 #define WBFLAG_PAM_INFO3_NDR           0x00000001
 #define WBFLAG_PAM_INFO3_TEXT          0x00000002
 #define WBFLAG_PAM_USER_SESSION_KEY    0x00000004
 #define WBFLAG_PAM_LMKEY               0x00000008
 #define WBFLAG_PAM_CONTACT_TRUSTDOM    0x00000010
-#define WBFLAG_QUERY_ONLY              0x00000020
 #define WBFLAG_PAM_UNIX_NAME           0x00000080
 #define WBFLAG_PAM_AFS_TOKEN           0x00000100
 #define WBFLAG_PAM_NT_STATUS_SQUASH    0x00000200
+#define WBFLAG_PAM_KRB5                        0x00001000
+#define WBFLAG_PAM_FALLBACK_AFTER_KRB5 0x00002000
+#define WBFLAG_PAM_CACHED_LOGIN                0x00004000
+#define WBFLAG_PAM_GET_PWD_POLICY      0x00008000      /* not used */
 
+/* generic request flags */
+#define WBFLAG_QUERY_ONLY              0x00000020      /* not used */
 /* This is a flag that can only be sent from parent to child */
-#define WBFLAG_IS_PRIVILEGED           0x00000400
+#define WBFLAG_IS_PRIVILEGED           0x00000400      /* not used */
 /* Flag to say this is a winbindd internal send - don't recurse. */
 #define WBFLAG_RECURSE                 0x00000800
 
-#define WBFLAG_PAM_KRB5                        0x00001000
-#define WBFLAG_PAM_FALLBACK_AFTER_KRB5 0x00002000
-#define WBFLAG_PAM_CACHED_LOGIN                0x00004000
-#define WBFLAG_PAM_GET_PWD_POLICY      0x00008000      /* not used */
 
 #define WINBINDD_MAX_EXTRA_DATA (128*1024)
 
@@ -233,7 +234,8 @@
        enum winbindd_cmd original_cmd;   /* Original Winbindd command
                                             issued to parent process */
        pid_t pid;               /* pid of calling process */
-       uint32 flags;            /* flags relavant to a given request */
+       uint32 wb_flags;         /* generic flags */
+       uint32 flags;            /* flags relevant *only* to a given request */
        fstring domain_name;    /* name of domain for which the request applies 
*/
 
        union {

Modified: branches/SAMBA_3_2_0/source/nsswitch/wb_common.c
===================================================================
--- branches/SAMBA_3_2_0/source/nsswitch/wb_common.c    2007-08-28 15:12:11 UTC 
(rev 24745)
+++ branches/SAMBA_3_2_0/source/nsswitch/wb_common.c    2007-08-28 15:16:42 UTC 
(rev 24746)
@@ -320,7 +320,7 @@
 
        /* version-check the socket */
 
-       request.flags = WBFLAG_RECURSE;
+       request.wb_flags = WBFLAG_RECURSE;
        if ((winbindd_request_response(WINBINDD_INTERFACE_VERSION, &request, 
&response) != NSS_STATUS_SUCCESS) || (response.data.interface_version != 
WINBIND_INTERFACE_VERSION)) {
                close_sock();
                return -1;
@@ -328,7 +328,7 @@
 
        /* try and get priv pipe */
 
-       request.flags = WBFLAG_RECURSE;
+       request.wb_flags = WBFLAG_RECURSE;
        if (winbindd_request_response(WINBINDD_PRIV_PIPE_DIR, &request, 
&response) == NSS_STATUS_SUCCESS) {
                int fd;
                if ((fd = winbind_named_pipe_sock((char 
*)response.extra_data.data)) != -1) {
@@ -567,13 +567,13 @@
        init_request(request, req_type);
        
        if (write_sock(request, sizeof(*request),
-                      request->flags & WBFLAG_RECURSE, need_priv) == -1) {
+                      request->wb_flags & WBFLAG_RECURSE, need_priv) == -1) {
                return NSS_STATUS_UNAVAIL;
        }
 
        if ((request->extra_len != 0) &&
            (write_sock(request->extra_data.data, request->extra_len,
-                       request->flags & WBFLAG_RECURSE, need_priv) == -1)) {
+                       request->wb_flags & WBFLAG_RECURSE, need_priv) == -1)) {
                return NSS_STATUS_UNAVAIL;
        }
        

Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h
===================================================================
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h 2007-08-28 15:12:11 UTC 
(rev 24745)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd_nss.h 2007-08-28 15:16:42 UTC 
(rev 24746)
@@ -35,7 +35,7 @@
 
 /* Update this when you change the interface.  */
 
-#define WINBIND_INTERFACE_VERSION 18
+#define WINBIND_INTERFACE_VERSION 19
 
 /* 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
@@ -187,26 +187,27 @@
        uint32 gr_mem_ofs;   /* offset to group membership */
 } WINBINDD_GR;
 
-
+/* PAM specific request flags */
 #define WBFLAG_PAM_INFO3_NDR           0x00000001
 #define WBFLAG_PAM_INFO3_TEXT          0x00000002
 #define WBFLAG_PAM_USER_SESSION_KEY    0x00000004
 #define WBFLAG_PAM_LMKEY               0x00000008
 #define WBFLAG_PAM_CONTACT_TRUSTDOM    0x00000010
-#define WBFLAG_QUERY_ONLY              0x00000020
 #define WBFLAG_PAM_UNIX_NAME           0x00000080
 #define WBFLAG_PAM_AFS_TOKEN           0x00000100
 #define WBFLAG_PAM_NT_STATUS_SQUASH    0x00000200
+#define WBFLAG_PAM_KRB5                        0x00001000
+#define WBFLAG_PAM_FALLBACK_AFTER_KRB5 0x00002000
+#define WBFLAG_PAM_CACHED_LOGIN                0x00004000
+#define WBFLAG_PAM_GET_PWD_POLICY      0x00008000      /* not used */
 
+/* generic request flags */
+#define WBFLAG_QUERY_ONLY              0x00000020      /* not used */
 /* This is a flag that can only be sent from parent to child */
-#define WBFLAG_IS_PRIVILEGED           0x00000400
+#define WBFLAG_IS_PRIVILEGED           0x00000400      /* not used */
 /* Flag to say this is a winbindd internal send - don't recurse. */
 #define WBFLAG_RECURSE                 0x00000800
 
-#define WBFLAG_PAM_KRB5                        0x00001000
-#define WBFLAG_PAM_FALLBACK_AFTER_KRB5 0x00002000
-#define WBFLAG_PAM_CACHED_LOGIN                0x00004000
-#define WBFLAG_PAM_GET_PWD_POLICY      0x00008000      /* not used */
 
 #define WINBINDD_MAX_EXTRA_DATA (128*1024)
 
@@ -226,7 +227,8 @@
        enum winbindd_cmd original_cmd;   /* Original Winbindd command
                                             issued to parent process */
        pid_t pid;               /* pid of calling process */
-       uint32 flags;            /* flags relavant to a given request */
+       uint32 wb_flags;         /* generic flags */
+       uint32 flags;            /* flags relevant *only* to a given request */
        fstring domain_name;    /* name of domain for which the request applies 
*/
 
        union {

Reply via email to