[Samba] login.bat has error?

2009-07-05 Thread Mohsen Pahlevanzadeh
Dear all,
I ran PDC on smbpasswd auth.
When i use following the command, i receive :
//
debian:/usr/local/etc/samba_3# ./bin/net rpc join mylove -U root 
Enter root's password:
Creation of workstation account failed
Unable to join domain MYLOVE.
debian:/usr/local/etc/samba_3# 
///


my smb.conf is :




[global]
netbios name = mylove
server string = Axjooon 
workgroup = mylove
os level = 65
prefered master = yes
domain master = yes
local master = yes
domain logons = yes
;misc options
#socket options = TCP NODELAY IPTOS LOWDELAY SO SNDBUF=8192 SO
RCVBUF=8192
time server = yes
hide dot files = yes
#client code page = 852
#character set = ISO8859-2
smb passwd file = /usr/local/etc/samba_3/lib/smbpasswd

security = user
guest ok = no
invalid users = bin sys ftp man mail
admin users = @admin
wins support = yes
# passdb backend = ldapsam:ldap://ldap1.company.com
ldap://ldap2.company.com;
 #   passdb backend = ldapsam:ldap://127.0.0.1/
  # ldap admin dn = cn=Manager,dc=mylove,dc=com
#ldap admin dn = cn=samba,ou=DSA,dc=company,dc=com
   # ldap suffix = dc=mylove,dc=com
#ldap group suffix = ou=Groups
#ldap user suffix = ou=Users
#ldap machine suffix = ou=Computers
#ldap idmap suffix = ou=Idmap
#add user script = /usr/sbin/smbldap-useradd -m %u
#ldap delete dn = Yes
#delete user script = /usr/sbin/smbldap-userdel %u
  #  add machine script = /usr/sbin/smbldap-useradd -t 0 -w %u
   # add group script = /usr/sbin/smbldap-groupadd -p %g
#delete group script = /usr/sbin/smbldap-groupdel %g
 #   add user to group script = /usr/sbin/smbldap-groupmod -m %u
%g
 #   delete user from group script = /usr/sbin/smbldap-groupmod -x
%u %g
  #  set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%
u'



#domain admin group = @admin
#domain admin users = root

#encrypt password = yes


;logging
log level = 2
log file = /usr/local/etc/samba_3/var/log.%L
max log size = 1
debug timestamp = yes
syslog = 1

;user roaming profiles path
logon path = \\%N\profiles\%u
;general logon script 
logon script = logon.bat

[netlogon]
path = /home/samba/netlogon
public = no
writeable = no
browseable = no
valid users = r...@debian

[profiles]
path = /home/samba/profiles
writeable = yes
create mask = 0700
directory mask = 0700
browseable = no
valid users = r...@debian
//  

my login.bat is :


///
@echo off
rem by robowarp.deletet...@gmx.de leave to public as it is , dont think
of asking me
rem created for samba 3 login, the bat files were creted on the fly by
genlogin.pl
rem this script is only valid for win2000/NT/XP
rem exec bat for logged in machine ( maybe software status or machine
data )
echo %COMPUTERNAME%
call %COMPUTERNAME%.bat
rem exec bat for login user
echo %USERNAME%
call %USERNAME%.bat
rem exec bat for different groups
rem ifmember.exe must be in the netlogon share download it at
microschrott
ifmember Administrators
if errorlevel 1 call Administrators.bat
ifmember users
if errorlevel 1 call users.bat
//


Please help me

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] I need to be able to retrieve windows user info on a windows server.

2009-07-05 Thread touchring



Kai Blin-4 wrote:
 
 I think at this point your best bet is to use the Samba-based libnetapi 
 library. I'm not sure if that is packaged for your system or if you need
 to 
 build samba yourself to get it. I'm also not sure on how to create pascal 
 bindings for a C library, but I assume there is a way to do so.
 


Thanks Kai , I'll check out that.  Meanwhile, I read there's also a NET
command - https://features.opensuse.org/303535
-- 
View this message in context: 
http://www.nabble.com/I-need-to-be-able-to-retrieve-windows-user-info-on-a-windows-server.-tp24241182p24344662.html
Sent from the Samba - General mailing list archive at Nabble.com.

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


[Samba] max. length of a username

2009-07-05 Thread Helmut Hullen
Hallo,

how long may a valid samba username be?

Viele Gruesse!
Helmut
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] max. length of a username

2009-07-05 Thread John H Terpstra - Samba Team
Helmut Hullen wrote:
 Hallo,
 
 how long may a valid samba username be?
 
 Viele Gruesse!
 Helmut

Usually the length of a username is limited by the host operating system.

Many older UNIX systems limit usernames to 8 characters.

Under OpenSUSE 11.2 (not yet released) it is possible to use the
useradd utility to add a username up to 29 characters in length.  It
is possible to add that user to the tdbsam password backend using
smbpasswd -a.  That account is valid within Samba (at least using
smbclient).

So the answer is: What is the limit of the operating system that is
hosting your Samba?

- John T.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Re: [Samba] max. length of a username

2009-07-05 Thread OPC oota
On Sun, Jul 05, 2009 at 05:52:18PM -0500, John H Terpstra - Samba Team wrote:
 
 Many older UNIX systems limit usernames to 8 characters.
 
 Under OpenSUSE 11.2 (not yet released) it is possible to use the
 useradd utility to add a username up to 29 characters in length.  It

FYI. FreeBSD can handle max 16 characters.

--
--- Oota Toshiya ---  t-oota at dh.jp.nec.com
NEC Computers Software Operations Unit  Shiba,Minato,Tokyo
Open Source Software Platform Development Division  Japan,Earth,Solar system
(samba-jp/ldap-jp Staff,mutt-j/samba-jp postmaster)
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba


Is Erotic Poweer Exchange AA Culture?

2009-07-05 Thread abode
Iss Erotic Power xEchange A Culture? www. via65. com. See Dick. Rumun!
PLEASE READ THIS IMPORTANT ETIQUETTE MESSAGE BEFORE POSTING:

http://www.catb.org/~esr/faqs/smart-questions.html


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-229-g2540710

2009-07-05 Thread Björn Jacke
The branch, master has been updated
   via  2540710b5eeb4a4ea2e0c0c7ba8ab7382f4236af (commit)
  from  a5cd278f6fa8f9d79d727b978ab8b6b78956dc4c (commit)

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


- Log -
commit 2540710b5eeb4a4ea2e0c0c7ba8ab7382f4236af
Author: Björn Jacke b...@sernet.de
Date:   Sun Jul 5 11:28:05 2009 +0200

s3:configure: honor CFLAGS in compile tests

When compilation is done for the architecture that's not the compiler's
default, for example by setting CFLAGS to -m64, then compile tests might 
fail
when they are done with the comiler's default arch. This should fix
bugzilla #6162.

---

Summary of changes:
 source3/configure.in |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index 3a95b6a..7cfd3fb 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -137,7 +137,7 @@ if test x$ac_cv_prog_gcc = xyes ; then
int main(void)
{
return 0;
-   }],[-Wdeclaration-after-statement],[$CPPFLAGS],[$LDFLAGS],
+   }],[$CFLAGS -Wdeclaration-after-statement],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_Wdeclaration_after_statement=yes,
samba_cv_HAVE_Wdeclaration_after_statement=no,
samba_cv_HAVE_Wdeclaration_after_statement=cross)
@@ -155,7 +155,7 @@ if test x$ac_cv_prog_gcc = xyes ; then
int main(void)
{
return 0;
-   }],[-Werror-implicit-function-declaration],[$CPPFLAGS],[$LDFLAGS],
+   }],[$CFLAGS 
-Werror-implicit-function-declaration],[$CPPFLAGS],[$LDFLAGS],
samba_cv_HAVE_Werror_implicit_function_declaration=yes,
samba_cv_HAVE_Werror_implicit_function_declaration=no,
samba_cv_HAVE_Werror_implicit_function_declaration=cross)
@@ -269,7 +269,7 @@ AC_CACHE_CHECK([that the C compiler understands 
-Werror],samba_cv_HAVE_Werror, [
   int main(void)
   {
return 0;
-  }],[-Werror],[$CPPFLAGS],[$LDFLAGS],
+  }],[$CFLAGS -Werror],[$CPPFLAGS],[$LDFLAGS],
   
samba_cv_HAVE_Werror=yes,samba_cv_HAVE_Werror=no,samba_cv_HAVE_Werror=cross)])
 if test x$samba_cv_HAVE_Werror = xyes; then
Werror_FLAGS=-Werror
@@ -280,7 +280,7 @@ AC_CACHE_CHECK([that the C compiler understands 
-w2],samba_cv_HAVE_w2, [
   int main(void)
   {
return 0;
-  }],[-w2],[$CPPFLAGS],[$LDFLAGS],
+  }],[$CFLAGS -w2],[$CPPFLAGS],[$LDFLAGS],
   samba_cv_HAVE_w2=yes,samba_cv_HAVE_w2=no,samba_cv_HAVE_w2=cross)])
 if test x$samba_cv_HAVE_w2 = xyes; then
Werror_FLAGS=-w2
@@ -291,7 +291,7 @@ AC_CACHE_CHECK([that the C compiler understands 
-errwarn],samba_cv_HAVE_errwarn,
int main(void)
{
return 0;
-   }],[-errwarn=%all],[$CPPFLAGS],[$LDFLAGS],
+   }],[$CFLAGS -errwarn=%all],[$CPPFLAGS],[$LDFLAGS],

samba_cv_HAVE_errwarn=yes,samba_cv_HAVE_errwarn=no,samba_cv_HAVE_errwarn=cross)])
 if test x$samba_cv_HAVE_errwarn = xyes; then
Werror_FLAGS=-errwarn=%all
@@ -3757,7 +3757,7 @@ if test x$with_ads_support != xno; then
if (str) free (str); 
return 0;
}
-   ],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+   ],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
smb_krb5_cv_enctype_to_string_takes_krb5_context_arg=yes,
smb_krb5_cv_enctype_to_string_takes_krb5_context_arg=no)])
 
@@ -3775,7 +3775,7 @@ if test x$with_ads_support != xno; then
krb5_enctype_to_string(1, buf, 256);
return 0;
}
-   ],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+   ],[$CFLAGS $Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
smb_krb5_cv_enctype_to_string_takes_size_t_arg=yes,
smb_krb5_cv_enctype_to_string_takes_size_t_arg=no)])
 
@@ -4467,7 +4467,7 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4A 1
 #define AUTOCONF_TEST 1
 #include confdefs.h
-#include 
${srcdir-.}/../tests/sysquotas.c],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include ${srcdir-.}/../tests/sysquotas.c],[$CFLAGS 
$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],

samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)])
 if test x$samba_cv_HAVE_QUOTACTL_4A = xyes; then
 samba_cv_SYSQUOTA_FOUND=yes;
@@ -4482,7 +4482,7 @@ AC_TRY_RUN_STRICT([
 #define HAVE_QUOTACTL_4B 1
 #define AUTOCONF_TEST 1
 #include confdefs.h
-#include 
${srcdir-.}/../tests/sysquotas.c],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
+#include ${srcdir-.}/../tests/sysquotas.c],[$CFLAGS 
$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],

samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)])
 if test x$samba_cv_HAVE_QUOTACTL_4B = xyes; then

[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-230-g43887c8

2009-07-05 Thread Björn Jacke
The branch, master has been updated
   via  43887c8d718087beb5a963a7962608b141e132fe (commit)
  from  2540710b5eeb4a4ea2e0c0c7ba8ab7382f4236af (commit)

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


- Log -
commit 43887c8d718087beb5a963a7962608b141e132fe
Author: Björn Jacke b...@sernet.de
Date:   Sun Jul 5 22:42:29 2009 +0200

libreplace: update library search path variables

---

Summary of changes:
 lib/replace/libreplace_ld.m4 |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/libreplace_ld.m4 b/lib/replace/libreplace_ld.m4
index 90c5be6..3982bba 100644
--- a/lib/replace/libreplace_ld.m4
+++ b/lib/replace/libreplace_ld.m4
@@ -320,7 +320,7 @@ AC_DEFUN([AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR],
LIB_PATH_VAR=LD_LIBRARY_PATH
;;
*aix*)
-   LIB_PATH_VAR=LIB_PATH
+   LIB_PATH_VAR=LIBPATH
;;
*irix*)
LIB_PATH_VAR=LD_LIBRARY_PATH
@@ -328,6 +328,9 @@ AC_DEFUN([AC_LIBREPLACE_RUNTIME_LIB_PATH_VAR],
*darwin*)
LIB_PATH_VAR=DYLD_LIBRARY_PATH
;;
+   *)
+   LIB_PATH_VAR=LD_LIBRARY_PATH
+   ;;
esac
 
AC_SUBST(LIB_PATH_VAR)


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-237-g880c286

2009-07-05 Thread Volker Lendecke
The branch, master has been updated
   via  880c286bc92db809553c5af2c4a26fe34d6a58dc (commit)
   via  e77e21e0f14acf670b1fdc2411425223f03ed645 (commit)
   via  58fbf7420c184c95f8b9761a32392227848794cd (commit)
   via  f8cfe19d85534d30f97a4992179633ca68bc838b (commit)
   via  30dd96e8193254f05c1aa05a70a68b65c4d036b6 (commit)
   via  f2998feb8e6444a93b9efab5c9dc1b29f62a4baa (commit)
   via  ee5236e2d2dbae185be63abdc19009104c8fb50d (commit)
  from  43887c8d718087beb5a963a7962608b141e132fe (commit)

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


- Log -
commit 880c286bc92db809553c5af2c4a26fe34d6a58dc
Author: Volker Lendecke v...@samba.org
Date:   Sun Jul 5 10:23:56 2009 +0200

Use null_ndr_syntax_id instead of zeroing null_interface manually

commit e77e21e0f14acf670b1fdc2411425223f03ed645
Author: Volker Lendecke v...@samba.org
Date:   Sun Jul 5 10:21:39 2009 +0200

Add const to init_rpc_hdr_ba

commit 58fbf7420c184c95f8b9761a32392227848794cd
Author: Volker Lendecke v...@samba.org
Date:   Sun Jul 5 10:13:03 2009 +0200

Remove typedef struct ndr_syntax_id RPC_IFACE;

commit f8cfe19d85534d30f97a4992179633ca68bc838b
Author: Volker Lendecke v...@samba.org
Date:   Sun Jul 5 10:21:06 2009 +0200

Introduce null_ndr_syntax_id

commit 30dd96e8193254f05c1aa05a70a68b65c4d036b6
Author: Volker Lendecke v...@samba.org
Date:   Sun Jul 5 09:43:23 2009 +0200

Make check_bind_req static to rpc_server/srv_pipe.c

commit f2998feb8e6444a93b9efab5c9dc1b29f62a4baa
Author: Volker Lendecke v...@samba.org
Date:   Sun Jul 5 16:20:05 2009 +0200

Actually increase PASSDB_INTERFACE_VERSION to 18 :-)

commit ee5236e2d2dbae185be63abdc19009104c8fb50d
Author: Volker Lendecke v...@samba.org
Date:   Sun Jul 5 23:15:34 2009 +0200

Fix some nonempty blank lines

---

Summary of changes:
 source3/include/passdb.h|2 +-
 source3/include/proto.h |8 +-
 source3/include/rpc_dce.h   |9 +--
 source3/librpc/ndr/util.c   |3 +
 source3/rpc_client/cli_pipe.c   |   17 ++--
 source3/rpc_parse/parse_rpc.c   |   14 ++--
 source3/rpc_server/srv_pipe.c   |   14 ++--
 source4/dsdb/samdb/cracknames.c |  154 +++
 8 files changed, 110 insertions(+), 111 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/passdb.h b/source3/include/passdb.h
index c288015..4e53311 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -226,7 +226,7 @@ struct pdb_domain_info {
  * Changed to 18, pdb_rid_algorithm - pdb_capabilities
  */
 
-#define PASSDB_INTERFACE_VERSION 17
+#define PASSDB_INTERFACE_VERSION 18
 
 struct pdb_methods 
 {
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 955a5a0..e4bcdb5 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2126,6 +2126,7 @@ void ndr_print_file_id(struct ndr_print *ndr, const char 
*name, const struct fil
 _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const 
bool b);
 _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char 
*name, const struct sockaddr_storage *ss);
 const char *ndr_errstr(enum ndr_err_code err);
+extern const struct ndr_syntax_id null_ndr_syntax_id;
 
 /* The following definitions come from librpc/ndr/sid.c  */
 
@@ -5692,7 +5693,8 @@ void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE 
pkt_type, uint8 flags,
uint32 call_id, int data_len, int auth_len);
 bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int 
depth);
 void init_rpc_context(RPC_CONTEXT *rpc_ctx, uint16 context_id,
- const RPC_IFACE *abstract, const RPC_IFACE *transfer);
+ const struct ndr_syntax_id *abstract,
+ const struct ndr_syntax_id *transfer);
 void init_rpc_hdr_rb(RPC_HDR_RB *rpc, 
uint16 max_tsize, uint16 max_rsize, uint32 
assoc_gid,
RPC_CONTEXT *context);
@@ -5702,7 +5704,7 @@ void init_rpc_hdr_ba(RPC_HDR_BA *rpc,
uint16 max_tsize, uint16 max_rsize, uint32 
assoc_gid,
const char *pipe_addr,
uint8 num_results, uint16 result, uint16 reason,
-   RPC_IFACE *transfer);
+   const struct ndr_syntax_id *transfer);
 bool smb_io_rpc_hdr_ba(const char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int 
depth);
 void init_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum);
 bool smb_io_rpc_hdr_req(const char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, 
int depth);
@@ -5799,8 +5801,6 @@ bool create_next_pdu(pipes_struct *p);
 bool api_pipe_bind_auth3(pipes_struct *p, prs_struct *rpc_in_p);
 bool setup_fault_pdu(pipes_struct *p, NTSTATUS 

[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-239-gf45a9d6

2009-07-05 Thread Andrew Bartlett
The branch, master has been updated
   via  f45a9d63e5a1697a7e85b123b535d2dc05f9fd8c (commit)
   via  da45d5215d1da2a1ff1b72b9bc3f10ec2192fba9 (commit)
  from  880c286bc92db809553c5af2c4a26fe34d6a58dc (commit)

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


- Log -
commit f45a9d63e5a1697a7e85b123b535d2dc05f9fd8c
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Jul 6 09:31:38 2009 +1000

s4:ldb Rework use of talloc and ldif objects in python wrapper

The talloc hirarchy here was a bit odd - we would both steal the
parsed ldif onto 'NULL', then reference it onto a python talloc
wrapper.

Now we just leave the reference, after we complete building the object.

Andrew Bartlett

commit da45d5215d1da2a1ff1b72b9bc3f10ec2192fba9
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Jul 6 09:24:18 2009 +1000

s4:ldb Fix talloc hirarchy in LDIF parsing code

The problem here was that some parts of the ldb_message were still
attached to the ldb_ldif structure, and when only the message was
taken (and the ldif free'ed to reclaim memory) we refereced free'ed
memory.

Andrew Bartlett

---

Summary of changes:
 source4/lib/ldb/common/ldb_ldif.c |6 +++---
 source4/lib/ldb/pyldb.c   |   21 ++---
 2 files changed, 21 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/common/ldb_ldif.c 
b/source4/lib/ldb/common/ldb_ldif.c
index 400fb35..d64a9f1 100644
--- a/source4/lib/ldb/common/ldb_ldif.c
+++ b/source4/lib/ldb/common/ldb_ldif.c
@@ -632,7 +632,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
if (!el-values) {
goto failed;
}
-   ret = a-syntax-ldif_read_fn(ldb, ldif, value, 
el-values[el-num_values]);
+   ret = a-syntax-ldif_read_fn(ldb, el-values, value, 
el-values[el-num_values]);
if (ret != 0) {
goto failed;
}
@@ -647,7 +647,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
el-num_values++;
} else {
/* its a new attribute */
-   msg-elements = talloc_realloc(ldif, msg-elements, 
+   msg-elements = talloc_realloc(msg, msg-elements, 
 struct 
ldb_message_element, 
 msg-num_elements+1);
if (!msg-elements) {
@@ -661,7 +661,7 @@ struct ldb_ldif *ldb_ldif_read(struct ldb_context *ldb,
goto failed;
}
el-num_values = 1;
-   ret = a-syntax-ldif_read_fn(ldb, ldif, value, 
el-values[0]);
+   ret = a-syntax-ldif_read_fn(ldb, el-values, value, 
el-values[0]);
if (ret != 0) {
goto failed;
}
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c
index 9bdd71d..2e0f4fd 100644
--- a/source4/lib/ldb/pyldb.c
+++ b/source4/lib/ldb/pyldb.c
@@ -790,7 +790,6 @@ static PyObject *ldb_ldif_to_pyobject(struct ldb_ldif *ldif)
Py_RETURN_NONE;
} else {
/* We don't want this attached to the 'ldb' any more */
-   talloc_steal(NULL, ldif);
return Py_BuildValue(discard_const_p(char, (iO)),
 ldif-changetype,
 PyLdbMessage_FromMessage(ldif-msg));
@@ -804,13 +803,29 @@ static PyObject *py_ldb_parse_ldif(PyLdbObject *self, 
PyObject *args)
struct ldb_ldif *ldif;
const char *s;
 
+   TALLOC_CTX *mem_ctx;
+
if (!PyArg_ParseTuple(args, s, s))
return NULL;
 
+   mem_ctx = talloc_new(NULL);
+   if (!mem_ctx) {
+   Py_RETURN_NONE;
+   }
+
list = PyList_New(0);
-   while ((ldif = ldb_ldif_read_string(self-ldb_ctx, s)) != NULL) {
-   PyList_Append(list, ldb_ldif_to_pyobject(ldif));
+   while (s  *s != '\0') {
+   ldif = ldb_ldif_read_string(self-ldb_ctx, s);
+   talloc_steal(mem_ctx, ldif);
+   if (ldif) {
+   PyList_Append(list, ldb_ldif_to_pyobject(ldif));
+   } else {
+   PyErr_SetString(PyExc_ValueError, unable to parse ldif 
string);
+   talloc_free(mem_ctx);
+   return NULL;
+   }
}
+   talloc_free(mem_ctx); /* The pyobject already has a reference to the 
things it needs */
return PyObject_GetIter(list);
 }
 


-- 
Samba 

Build status as of Mon Jul 6 00:00:02 2009

2009-07-05 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2009-07-05 
00:00:42.0 +
+++ /home/build/master/cache/broken_results.txt 2009-07-06 00:00:41.0 
+
@@ -1,4 +1,4 @@
-Build status as of Sun Jul  5 00:00:03 2009
+Build status as of Mon Jul  6 00:00:02 2009
 
 Build counts:
 Tree Total  Broken Panic 
@@ -6,17 +6,17 @@
 ccache   32 7  0 
 distcc   0  0  0 
 ldb  33 33 0 
-libreplace   32 13 0 
+libreplace   32 14 0 
 lorikeet 0  0  0 
-pidl 21 2  0 
+pidl 22 2  0 
 ppp  12 0  0 
-rsync33 12 0 
+rsync32 12 0 
 samba-docs   0  0  0 
 samba-web0  0  0 
 samba_3_current 30 18 0 
-samba_3_master 29 24 2 
+samba_3_master 29 24 3 
 samba_3_next 29 26 1 
-samba_4_0_test 30 27 13
+samba_4_0_test 30 27 12
 talloc   33 32 0 
 tdb  31 28 0 
 


[SCM] CTDB repository - branch master updated - ctdb-1.0.86-18-g49e7584

2009-07-05 Thread Ronnie Sahlberg
The branch, master has been updated
   via  49e7584679c7467a367888c5b14529c8e338f032 (commit)
   via  6e1f60d8d780c1240aaabb78ecc8550d0480cd7e (commit)
  from  6baaf5bec3ba0094c71d83315170acb5dc729711 (commit)

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


- Log -
commit 49e7584679c7467a367888c5b14529c8e338f032
Merge: 6baaf5bec3ba0094c71d83315170acb5dc729711 
6e1f60d8d780c1240aaabb78ecc8550d0480cd7e
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Jul 6 11:28:10 2009 +1000

Merge r...@10.1.1.27:/shared/ctdb/ctdb-git

commit 6e1f60d8d780c1240aaabb78ecc8550d0480cd7e
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Mon Jul 6 11:49:55 2009 +1000

Perform an ipreallocate efter each enable/disable.

This will force a wait until the ip addresses have been reallocated after a 
disable/enable command and will make scripting of enable/disable more 
predictable.

This will cause the command enable/disable to wait until the ip realocation 
that normally follows shortly after a enable/disable to finish before the 
command returns to the prompt.

---

Summary of changes:
 tools/ctdb.c |  121 +++--
 1 files changed, 66 insertions(+), 55 deletions(-)


Changeset truncated at 500 lines:

diff --git a/tools/ctdb.c b/tools/ctdb.c
index 5d00da9..3ba4db9 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1529,6 +1529,62 @@ static int control_getpid(struct ctdb_context *ctdb, int 
argc, const char **argv
 }
 
 /*
+  handler for receiving the response to ipreallocate
+*/
+static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid, 
+TDB_DATA data, void *private_data)
+{
+   printf(IP Reallocation completed\n);
+   exit(0);
+}
+
+/*
+  ask the recovery daemon on the recovery master to perform a ip reallocation
+ */
+static int control_ipreallocate(struct ctdb_context *ctdb, int argc, const 
char **argv)
+{
+   int ret;
+   TDB_DATA data;
+   struct rd_memdump_reply rd;
+   uint32_t recmaster;
+
+   rd.pnn = ctdb_ctrl_getpnn(ctdb, TIMELIMIT(), CTDB_CURRENT_NODE);
+   if (rd.pnn == -1) {
+   DEBUG(DEBUG_ERR, (Failed to get pnn of local node\n));
+   return -1;
+   }
+   rd.srvid = getpid();
+
+   /* register a message port for receiveing the reply so that we
+  can receive the reply
+   */
+   ctdb_set_message_handler(ctdb, rd.srvid, ip_reallocate_handler, NULL);
+
+   data.dptr = (uint8_t *)rd;
+   data.dsize = sizeof(rd);
+
+   ret = ctdb_ctrl_getrecmaster(ctdb, ctdb, TIMELIMIT(), options.pnn, 
recmaster);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR, (Unable to get recmaster from node %u\n, 
options.pnn));
+   return ret;
+   }
+
+   ret = ctdb_send_message(ctdb, recmaster, CTDB_SRVID_TAKEOVER_RUN, data);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR,(Failed to send ip takeover run request 
message to %u\n, options.pnn));
+   return -1;
+   }
+
+   /* this loop will terminate when we have received the reply */
+   while (1) { 
+   event_loop_once(ctdb-ev);
+   }
+
+   return 0;
+}
+
+
+/*
   disable a remote node
  */
 static int control_disable(struct ctdb_context *ctdb, int argc, const char 
**argv)
@@ -1552,6 +1608,11 @@ static int control_disable(struct ctdb_context *ctdb, 
int argc, const char **arg
}
 
} while (!(nodemap-nodes[options.pnn].flags  
NODE_FLAGS_PERMANENTLY_DISABLED));
+   ret = control_ipreallocate(ctdb, argc, argv);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR, (IP Reallocate failed on node %u\n, 
options.pnn));
+   return ret;
+   }
 
return 0;
 }
@@ -1581,6 +1642,11 @@ static int control_enable(struct ctdb_context *ctdb, int 
argc, const char **argv
}
 
} while (nodemap-nodes[options.pnn].flags  
NODE_FLAGS_PERMANENTLY_DISABLED);
+   ret = control_ipreallocate(ctdb, argc, argv);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR, (IP Reallocate failed on node %u\n, 
options.pnn));
+   return ret;
+   }
 
return 0;
 }
@@ -2859,61 +2925,6 @@ static int control_rddumpmemory(struct ctdb_context 
*ctdb, int argc, const char
 }
 
 /*
-  handler for receiving the response to ipreallocate
-*/
-static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid, 
-TDB_DATA data, void *private_data)
-{
-   printf(IP Reallocation completed\n);
-   exit(0);
-}
-
-/*
-  ask the recovery daemon on the recovery master to perform a ip reallocation
- */
-static int control_ipreallocate(struct ctdb_context *ctdb, int argc, const 
char **argv)
-{
-   int ret;
-   TDB_DATA