samba-cvs.cvs
[Top] [All Lists]

[SCM] Samba Shared Repository - branch master updated

Subject: [SCM] Samba Shared Repository - branch master updated
From: Matthias Dieter Wallnöfer
Date: Thu, 4 Mar 2010 03:50:01 -0600 CST
The branch, master has been updated
       via  af6f594... s4:provision - use the new "interface_ips" python call 
to detect the right host IPv4 address
       via  8a8c2de... s4:ldif_handlers - Use "unsigned int" for counting 
purposes
      from  a319eb9... testprogs: add test_PrinterDataW.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit af6f59468ab157d125e14a649ee1d55bd17e8d1a
Author: Matthias Dieter Wallnöfer <mwallnoefer@xxxxxxxx>
Date:   Thu Mar 4 10:29:33 2010 +0100

    s4:provision - use the new "interface_ips" python call to detect the right 
host IPv4 address
    
    Inform the user when there are more possibilities (so he can check for the
    right address and otherwise he is able to do an immediate reprovision) and 
no
    possibility at all (then we fall back to the loopback address "127.0.0.1" - 
this
    is thought for testing purposes).
    
    I think this should be enough for closing bug #5484.

commit 8a8c2de29f95ac81e9899264cf86ebea22053782
Author: Matthias Dieter Wallnöfer <mwallnoefer@xxxxxxxx>
Date:   Fri Nov 6 20:14:41 2009 +0100

    s4:ldif_handlers - Use "unsigned int" for counting purposes
    
    I changed "uint32_t" to "unsigned int" since the LDB specification 
prescrives
    "unsigned (int)" for counter variables (number of attributes,
    number of values...).

-----------------------------------------------------------------------

Summary of changes:
 source4/lib/ldb-samba/ldif_handlers.c       |    8 ++++----
 source4/scripting/python/samba/provision.py |   16 ++++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb-samba/ldif_handlers.c 
b/source4/lib/ldb-samba/ldif_handlers.c
index effec46..b5a6630 100644
--- a/source4/lib/ldb-samba/ldif_handlers.c
+++ b/source4/lib/ldb-samba/ldif_handlers.c
@@ -594,7 +594,7 @@ static int ldif_write_prefixMap(struct ldb_context *ldb, 
void *mem_ctx,
        struct prefixMapBlob *blob;
        enum ndr_err_code ndr_err;
        char *string;
-       uint32_t i;
+       unsigned int i;
 
        if (ldb_get_flags(ldb) & LDB_FLG_SHOW_BINARY) {
                int err;
@@ -1075,7 +1075,7 @@ static const struct {
 
 const struct ldb_schema_syntax *ldb_samba_syntax_by_name(struct ldb_context 
*ldb, const char *name)
 {
-       uint32_t j;
+       unsigned int j;
        const struct ldb_schema_syntax *s = NULL;
        
        for (j=0; j < ARRAY_SIZE(samba_syntaxes); j++) {
@@ -1089,7 +1089,7 @@ const struct ldb_schema_syntax 
*ldb_samba_syntax_by_name(struct ldb_context *ldb
 
 const struct ldb_schema_syntax *ldb_samba_syntax_by_lDAPDisplayName(struct 
ldb_context *ldb, const char *name)
 {
-       uint32_t j;
+       unsigned int j;
        const struct ldb_schema_syntax *s = NULL;
 
        for (j=0; j < ARRAY_SIZE(samba_attributes); j++) {
@@ -1107,7 +1107,7 @@ const struct ldb_schema_syntax 
*ldb_samba_syntax_by_lDAPDisplayName(struct ldb_c
 */
 int ldb_register_samba_handlers(struct ldb_context *ldb)
 {
-       uint32_t i;
+       unsigned int i;
 
        for (i=0; i < ARRAY_SIZE(samba_attributes); i++) {
                int ret;
diff --git a/source4/scripting/python/samba/provision.py 
b/source4/scripting/python/samba/provision.py
index 450881c..cb90141 100644
--- a/source4/scripting/python/samba/provision.py
+++ b/source4/scripting/python/samba/provision.py
@@ -1182,14 +1182,14 @@ def provision(setup_dir, message, session_info,
     paths.bind_gid = bind_gid
 
     if hostip is None:
-        try:
-            for ip in socket.getaddrinfo(names.hostname, None, socket.AF_INET, 
socket.AI_CANONNAME, socket.IPPROTO_IP):
-                if hostip is None:
-                    hostip = ip[-1][0]
-                if hostip.startswith('127.0.0.') and (not 
ip[-1][0].startswith('127.0.0.')):
-                    hostip = ip[-1][0]
-        except socket.gaierror, (socket.EAI_NODATA, msg):
-            hostip = None
+        hostips = glue.interface_ips(lp)
+        if len(hostips) == 0:
+            message("No external IPv4 address has been found: I use the 
loopback.")
+            hostip = '127.0.0.1'
+        else:
+            hostip = hostips[0]
+            if len(hostips) > 1:
+                message("More than one IPv4 address found: I use " + hostip + 
".")
 
     if hostip6 is None:
         try:


-- 
Samba Shared Repository

<Prev in Thread] Current Thread [Next in Thread>