Author: jelmer
Date: 2007-09-07 11:47:03 +0000 (Fri, 07 Sep 2007)
New Revision: 24992

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

Log:
Remove some uses of lp_*().
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/lib/gencache/gencache.c
   branches/SAMBA_4_0/source/lib/socket/socket.c
   branches/SAMBA_4_0/source/libcli/cldap/cldap.c
   branches/SAMBA_4_0/source/libcli/cliconnect.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/lib/gencache/gencache.c
===================================================================
--- branches/SAMBA_4_0/source/lib/gencache/gencache.c   2007-09-07 09:14:44 UTC 
(rev 24991)
+++ branches/SAMBA_4_0/source/lib/gencache/gencache.c   2007-09-07 11:47:03 UTC 
(rev 24992)
@@ -50,22 +50,23 @@
 BOOL gencache_init(void)
 {
        char* cache_fname = NULL;
+       TALLOC_CTX *mem_ctx = talloc_autofree_context();
        
        /* skip file open if it's already opened */
        if (cache) return True;
 
-       asprintf(&cache_fname, "%s/%s", lp_lockdir(), "gencache.tdb");
-       if (cache_fname)
+       cache_fname = lock_path(mem_ctx, "gencache.tdb");
+       if (cache_fname != NULL) {
                DEBUG(5, ("Opening cache file at %s\n", cache_fname));
-       else {
+       } else {
                DEBUG(0, ("Filename allocation failed.\n"));
-               return False;
+               return false;
        }
 
-       cache = tdb_wrap_open(NULL, cache_fname, 0, TDB_DEFAULT,
+       cache = tdb_wrap_open(mem_ctx, cache_fname, 0, TDB_DEFAULT,
                              O_RDWR|O_CREAT, 0644);
 
-       SAFE_FREE(cache_fname);
+       talloc_free(cache_fname);
        if (!cache) {
                DEBUG(5, ("Attempt to open gencache.tdb has failed.\n"));
                return False;

Modified: branches/SAMBA_4_0/source/lib/socket/socket.c
===================================================================
--- branches/SAMBA_4_0/source/lib/socket/socket.c       2007-09-07 09:14:44 UTC 
(rev 24991)
+++ branches/SAMBA_4_0/source/lib/socket/socket.c       2007-09-07 11:47:03 UTC 
(rev 24992)
@@ -429,10 +429,6 @@
 
 #if HAVE_IPV6
        if (strcmp("ipv6", family) == 0) {
-               if (lp_parm_bool(-1, "socket", "noipv6", False)) {
-                       DEBUG(3, ("IPv6 support was disabled in smb.conf"));
-                       return NULL;
-               }
                return socket_ipv6_ops(type);
        }
 #endif

Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/cldap/cldap.c      2007-09-07 09:14:44 UTC 
(rev 24991)
+++ branches/SAMBA_4_0/source/libcli/cldap/cldap.c      2007-09-07 11:47:03 UTC 
(rev 24992)
@@ -315,7 +315,8 @@
        }
 
        req->dest = socket_address_from_strings(req, cldap->sock->backend_name,
-                                               io->in.dest_address, 
lp_cldap_port());
+                                               io->in.dest_address, 
+                                               lp_cldap_port());
        if (!req->dest) goto failed;
 
        req->message_id = idr_get_new_random(cldap->idr, req, UINT16_MAX);

Modified: branches/SAMBA_4_0/source/libcli/cliconnect.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/cliconnect.c       2007-09-07 09:14:44 UTC 
(rev 24991)
+++ branches/SAMBA_4_0/source/libcli/cliconnect.c       2007-09-07 11:47:03 UTC 
(rev 24992)
@@ -205,7 +205,7 @@
 /*
   parse a //server/share type UNC name
 */
-BOOL smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
+bool smbcli_parse_unc(const char *unc_name, TALLOC_CTX *mem_ctx,
                      char **hostname, char **sharename)
 {
        char *p;
@@ -220,12 +220,9 @@
        *hostname = talloc_strdup(mem_ctx, &unc_name[2]);
        p = terminate_path_at_separator(*hostname);
 
-       if (p && *p) {
+       if (p != NULL && *p) {
                *sharename = talloc_strdup(mem_ctx, p);
                terminate_path_at_separator(*sharename);
-       } else {
-               *sharename = talloc_strdup(mem_ctx, 
-                                          lp_parm_string(-1, "torture", 
"share"));
        }
 
        if (*hostname && *sharename) {

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c       2007-09-07 
09:14:44 UTC (rev 24991)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c       2007-09-07 
11:47:03 UTC (rev 24992)
@@ -111,12 +111,12 @@
        conn->in.dest_host              = s->io.binding->host;
        conn->in.port                   = 0;
        if (s->io.binding->target_hostname == NULL)
-               conn->in.called_name = "*SMBSERVER";
+               conn->in.called_name = "*SMBSERVER"; /* FIXME: This is invalid 
*/
        else
                conn->in.called_name            = 
s->io.binding->target_hostname;
        conn->in.service                = "IPC$";
        conn->in.service_type           = NULL;
-       conn->in.workgroup              = lp_workgroup();
+       conn->in.workgroup              = lp_workgroup();
 
        /*
         * provide proper credentials - user supplied, but allow a

Reply via email to