Author: jelmer
Date: 2004-10-25 10:21:41 +0000 (Mon, 25 Oct 2004)
New Revision: 3209

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3209&nolog=1

Log:
- Create directory for ncalrpc with correct mode
- Support binding strings like :

ncacn_np:[sign] 
ncacn_np:myhost[seal,sign,endpoint]

again 

Modified:
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
   branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c  2004-10-25 09:41:24 UTC (rev 
3208)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c  2004-10-25 10:21:41 UTC (rev 
3209)
@@ -403,6 +403,7 @@
        strncpy(sa.sun_path, path, sizeof(sa.sun_path));
 
        if (connect(fd, &sa, sizeof(sa)) < 0) {
+               DEBUG(0, ("Unable to connect to unix socket %s: %s\n", path, 
strerror(errno)));
                return NT_STATUS_BAD_NETWORK_NAME;
        }
 
@@ -487,6 +488,7 @@
        strncpy(sa.sun_path, full_path, sizeof(sa.sun_path));
 
        if (connect(fd, &sa, sizeof(sa)) < 0) {
+               DEBUG(0, ("Unable to connect to unix socket %s (%s): %s\n", full_path, 
identifier, strerror(errno)));
                return NT_STATUS_BAD_NETWORK_NAME;
        }
 

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c  2004-10-25 09:41:24 UTC (rev 
3208)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_util.c  2004-10-25 10:21:41 UTC (rev 
3209)
@@ -220,6 +220,7 @@
                s = talloc_asprintf_append(s, ",%s", b->options[i]);
                if (!s) return NULL;
        }
+
        for (i=0;i<ARRAY_SIZE(ncacn_options);i++) {
                if (b->flags & ncacn_options[i].flag) {
                        s = talloc_asprintf_append(s, ",%s", ncacn_options[i].name);
@@ -325,14 +326,6 @@
        b->options[i] = options;
        b->options[i+1] = NULL;
 
-       /* Endpoint is first option */
-       b->endpoint = b->options[0];
-       if (strlen(b->endpoint) == 0) b->endpoint = NULL;
-
-       for (i=0;b->options[i];i++) {
-               b->options[i] = b->options[i+1];
-       }
-
        /* some options are pre-parsed for convenience */
        for (i=0;b->options[i];i++) {
                for (j=0;j<ARRAY_SIZE(ncacn_options);j++) {
@@ -348,6 +341,16 @@
                }
        }
 
+       if (b->options[0]) {
+               /* Endpoint is first option */
+               b->endpoint = b->options[0];
+               if (strlen(b->endpoint) == 0) b->endpoint = NULL;
+
+               for (i=0;b->options[i];i++) {
+                       b->options[i] = b->options[i+1];
+               }
+       }
+
        if (b->options[0] == NULL)
                b->options = NULL;
        

Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c  2004-10-25 09:41:24 UTC (rev 
3208)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c  2004-10-25 10:21:41 UTC (rev 
3209)
@@ -90,8 +90,10 @@
        char *full_path;
 
        if (!e->ep_description.endpoint) {
-               /* No identifier specified: generate one */
-               e->ep_description.endpoint = generate_random_str(dce_ctx, 10);
+               /* No identifier specified: use DEFAULT. 
+                * DO NOT hardcode this value anywhere else. Rather, specify 
+                * no endpoint and let the epmapper worry about it. */
+               e->ep_description.endpoint = talloc_strdup(dce_ctx, "DEFAULT");
        }
 
        full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(), 
e->ep_description.endpoint);

Reply via email to