[Samba] File Locking and Deleting Problem

2006-04-15 Thread Michael Stearne
I have a new share setup that I would like to do some pretty simple
things with.  I would like to have multiple people connect to it. 
Everyone can read and write to it but the only creator of a given file
can delete that file.  Also, when a given file (say Word, Quark or
Photoshop docs) is open by user1 it should be considered read-only by
the other users. If user1 creates a file user2 (in the same group)
should be able to edit the file as long as no one else is editing it.

This seems very straight forward to me but I can't seem to have the
share follow these rules.  When testing I have either 2 or 3 different
users connected to the share from at least 1 Windows client and 1 OS X
client.  OS X is going to be the main connector to this share but
Windows users will be in there also.

Here's the smb.conf I have:

[global]
idmap gid = 16777216-33554431
idmap uid = 16777216-33554431
path = /var/www/
unix password sync = yes
workgroup = cmny
os level = 20
auto services = advertising editorial
null passwords = yes
encrypt passwords = yes
winbind use default domain = no
security = user
template shell = /bin/false
lock directory = /var/lock/smb
share modes = yes
locking = yes

[advertising]
writeable = yes
wide links = no
path = /var/www/advertising
strict locking = yes
force create mode = 755
valid users = @advertising
oplocks = False
level2 oplocks = False

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


[Samba] Join Active Directory, Share: Only allow an AD group read/write?

2006-04-15 Thread Göran Törnqvist
I've seen a couple of howtos on how to join a a samba server to windows active 
directory, so I don't think that will be a problem. But I want to set up a 
samba share that only allows read/write access to a group located in active 
directory, is that possible? 

 

The AD is windows server 2003 by the way...

 

Thanks...

 

/Goran

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


[Samba] Is printcap information required if no [printers] share?

2006-04-15 Thread Neil Hoggarth

Hi folks,

I have a print server, running SPARC Solaris 9. I've just upgraded from 
Samba 3.0.10 to 3.0.22 and immediately hit system load issues which 
appear to be related to the use of lpstat -v to determine the 
available print queues.


There are about 70 Unix print queues on this system. Running lpstat -v 
can take something like 20s of wall-clock time. lpstat itself doesn't 
use much in the way of CPU cycles during this delay, though it is 
possible that busy work is going on elsewhere (lpsched daemon?).


I got the load on the server back under control by creating an 
/etc/printcap file that just listed all the queue names, one per line, 
and pointing the global printcap name parameter at the file. System 
load fell back to normal levels very rapidly following this change, 
and the system became much more responsive.


I then started experimenting to see if I could get away without 
maintaining a separate printcap file. It happens that I don't use a 
[printers] share - each of my print shares is explicitly listed in its 
own smb.conf section, so it occured to me that Samba possibly didn't 
need to be able to enumerate the available queues at all.


I tried setting printcap name = /dev/null.

This seems to work, based on initial testing: all the print shares still 
show up when I browse my server; I still see all the queues in my 
servers Printers and Faxes folder; I can still print to the queues 
successfully. However, I thought I'd post this query to double check 
that there aren't any pitfalls that I haven't discovered yet.


Does Samba make any use of the list of queues that it automatically 
determines at startup, other than for expanding the [printers] magical 
share?


Regards,
--
Neil Hoggarth  ---  Computing Manager, Sherrington Building
Department of Physiology, Anatomy and Genetics  -  University of Oxford, UK
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Set setuid bit on a Solaris server from a Windows client

2006-04-15 Thread Bolz, Karsten
Dear all,

I'm running Samba version 3.0.4 (this is what comes with Solaris 10) on a 
Solaris machine. For WORM file system support, a new Snaplock-mechanism has 
been implemented into SAM-FS. This mechanism uses the setting of the setuid 
bit (e. g.: chmod 4000 filename) to trigger a file to become a WORM file 
(i. e. it cannot be modified / deleted before a retention period is over).
Is there a way to trigger this bit from a Windows client? (As to my knowledge 
Windows is not aware of the existence of this setuid bit, thus it can't 
trigger it. Right?)

Other implementations of a CIFS protocol stack work as follows: In order to 
trigger the setuid bit, the Windows client sends an attrib +s-r filename 
(set system attribute and set file to read only). The server intercepts this 
command and flips the S-bit (-rw-r--r-- becomes -r-Sr--r--).
As to my understanding, for Samba this would require a slight modification in 
smbd/dismode.c (at least this is what I read from the debug log).

Anybody else ever came across this problem? Any solution, comments, thoughts...

Kind regards

Karsten


Karsten Bolz
Storage Architect
Sun Microsystems GmbH
Data Management Group
Phone: +49 6196 9568-264
Fax: +49 6196 9568-293

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


[Samba] remote subnet browsing

2006-04-15 Thread Lukasz Stelmach
Greetings.

I try to set up cross subnet browsing but I've encountered some
difficulties. Let me introduce my situation

10.1.2.0  10.1.1.0
A_N1 -+   +- A_N1
  |   |
B_N1 -+--[R1]===[R2]--+- B_N2
. |   VPN accross |.
. |   the Internet|.
Z_N1 -+   +- Z_N

A_N1 is 10.1.2.4, PDC
A_N2 is 10.1.1.1, BDC

the vpn makes everything look as if there was only one router
between two networks (except of course of ping times). Please
also note that I am aware of the difference between browsing
and name resolution.

In both networks there is the same DOMAIN. A_N[12] act as PDC and
BDC, respectively. There is however a detail that makes the situation
a little bit different than the one in the Samba3-HOWTO (ch.9).
Both A_N1 and A_N2 run wins server, that's because I don't full
trust the vpn. This forses using remote announce and remote
browse sync 

There is something wierd, however, I can't find (smbclient -L A_N2 -N)
any machines from N1 on the BDC. Instead i get messages like these on A_N2

process_host_announce: from A_N100 IP 10.1.2.4 to DOMAIN1d for server A_N1.
write_browse_list: Wrote browse list into file /var/cache/samba/browse.dat
process_master_browser_announce: Local master announce from A_N1 IP 10.1.2.4.
process_master_browser_announce: Not configured as domain master - ignoring 
master announce.

which seem to be triggered by these packets

11:55:36.244688 IP (tos 0x0, ttl  64, id 68, offset 0, flags [DF], proto: UDP 
(17), length: 242) 10.1.2.4.138  10.1.1.1.138: [bad udp cksum 7635!] 
 NBT UDP PACKET(138) Res=0x110A ID=0x7F01 IP=10 (0xa).1 (0x1).2 (0x2).4 
 (0x4) Port=138 (0x8a) Length=200 (0xc8) Res2=0x0
SourceName=A_N1   NameType=0x00 (Workstation)
DestName=DOMAIN NameType=0x1D (Master Browser)

SMB PACKET: SMBtrans (REQUEST)
SMB Command   =  0x25
Error class   =  0x0
Error code=  0 (0x0)
Flags1=  0x0
Flags2=  0x0
Tree ID   =  0 (0x0)
Proc ID   =  0 (0x0)
UID   =  0 (0x0)
MID   =  0 (0x0)
Word Count=  17 (0x11)
TotParamCnt=0 (0x0) 
TotDataCnt=46 (0x2e) 
MaxParmCnt=0 (0x0) 
MaxDataCnt=0 (0x0)
MaxSCnt=0 (0x0) 
TransFlags=0x0 
Res1=0x0 
Res2=0x0 
Res3=0x0
ParamCnt=0 (0x0) 
ParamOff=0 (0x0) 
DataCnt=46 (0x2e) 
DataOff=86 (0x56) 
SUCnt=3 (0x3)
Data: (6 bytes)
[000] 01 00 01 00 02 00 
\001\000\001\000\002\000 
smb_bcc=63
Name=\MAILSLOT\BROWSE
BROWSE PACKET
BROWSE PACKET:
Type=0x1 (HostAnnouncement)
UpdateCount=0x2056
Res1=0xBF
AnnounceInterval=2 (0x2)
Name=A_N1   NameType=0x00 (Workstation)
MajorVersion=0x4
MinorVersion=0x9
ServerType=0x9A2B
ElectionVersion=0x10F
BrowserConstant=0xAA55
Data: (14 bytes)
[000] 53 65 72 77 65 72 20 70  6C 69 6B A2 77 00Serwer p lik\242w\000



11:55:36.246539 IP (tos 0x0, ttl  64, id 69, offset 0, flags [DF], proto: UDP 
(17), length: 203) 10.1.2.4.138  10.1.1.1.138: [bad udp cksum a4ee!] 
 NBT UDP PACKET(138) Res=0x100A ID=0x7F02 IP=10 (0xa).1 (0x1).2 (0x2).4 
 (0x4) Port=138 (0x8a) Length=161 (0xa1) Res2=0x0
SourceName=A_N1   NameType=0x00 (Workstation)
DestName=*   NameType=0x00 (Workstation)

SMB PACKET: SMBtrans (REQUEST)
SMB Command   =  0x25
Error class   =  0x0
Error code=  0 (0x0)
Flags1=  0x0
Flags2=  0x0
Tree ID   =  0 (0x0)
Proc ID   =  0 (0x0)
UID   =  0 (0x0)
MID   =  0 (0x0)
Word Count=  17 (0x11)
TotParamCnt=0 (0x0) 
TotDataCnt=7 (0x7) 
MaxParmCnt=0 (0x0) 
MaxDataCnt=0 (0x0)
MaxSCnt=0 (0x0) 
TransFlags=0x0 
Res1=0x0 
Res2=0x0 
Res3=0x0
ParamCnt=0 (0x0) 
ParamOff=0 (0x0) 
DataCnt=7 (0x7) 
DataOff=86 (0x56) 
SUCnt=3 (0x3)
Data: (6 bytes)
[000] 01 00 01 00 02 00 
\001\000\001\000\002\000 
smb_bcc=24
Name=\MAILSLOT\BROWSE
BROWSE PACKET
BROWSE PACKET:
Type=0xD (MasterAnnouncement)
MasterName=A_N1

From time to time I also get:

find_domain_master_name_query_fail:
Unable to find the Domain Master Browser name DOMAIN1b for the workgroup 
DOMAIN.
Unable to sync browse lists in this workgroup.

I am quite confused with all this because that is not what I'd expect
when I use remote browse sync.

Best regards.
PS. please CC answers
-- 
Miłego dnia
Łukasz
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] 3.0.22 Cups shares naming mixed up

2006-04-15 Thread Paul Vlenterie

Best Samba-list,

This message is about a reproducable problem regarding Samba printing 
using cups.

Expected results: Print shares should match the CUPS defined configuration.
Results  : 1st Print shares get mixed up: the sharename 
becomes the Comment

  2nd Print shares are missing

We pin-pointed one possible source of the problem down to the 
Description field of lpadmin.

(FYI: adding a printer
 # lpadmin -p $printername -E -v socket://$printername -m raw -D 
$description -L $location )
So far we found one workaround by using the same description for all 64 
printers.


Best regards,
Paul and Leroy @ WL - The Netherlands
( Please CC PauldotVlenterieatwldelft.nl since we're not enlisted )
---
System details:
OS - RedHat Enterprise 4U2 32-bit running on Intel
Samba 3.0.22 compiled from source with cups support
Vendor supplied CUPS ( cups-1.1.22-0.rc1.9.8 )

Example one mixing the shares up:
hk0oce1|Printer abc:rm=lphost2.wldelft.nl:rp=hk0oce1:
hk1cls1|Another label:rm=lphost2.wldelft.nl:rp=hk1cls1:
hk1oce1|Something 123:rm=lphost2.wldelft.nl:rp=hk1oce1:
hk2oce2|Hmm:rm=lphost2.wldelft.nl:rp=hk2oce2:
hk3las1|Just another printer:rm=lphost2.wldelft.nl:rp=hk3las1:
hk3occ1|OCE-3145:rm=lphost2.wldelft.nl:rp=hk3occ1:
hk3oce1|OCE_OPE180:rm=lphost2.wldelft.nl:rp=hk3oce1:
hk4las1|Whatever:rm=lphost2.wldelft.nl:rp=hk4las1:
etc etc. till 64 printers...

Example two Now it works
hk0oce1|Printer at:rm=lphost2.wldelft.nl:rp=hk0oce1:
hk1cls1|Printer at WL:rm=lphost2.wldelft.nl:rp=hk1cls1:
hk1oce1|Printer at WL:rm=lphost2.wldelft.nl:rp=hk1oce1:
hk2oce2|Printer at WL:rm=lphost2.wldelft.nl:rp=hk2oce2:
hk3las1|Printer at WL:rm=lphost2.wldelft.nl:rp=hk3las1:
hk3occ1|Printer at WL:rm=lphost2.wldelft.nl:rp=hk3occ1:
hk3oce1|Printer at WL:rm=lphost2.wldelft.nl:rp=hk3oce1:
hk4las1|Printer at WL:rm=lphost2.wldelft.nl:rp=hk4las1:
etc etc. till 64 printers...

Partial smb.conf:
[printers]
comment = All Printers
path= /drbd/lphost/spool
browseable  = yes
guest ok= yes
writable= no
printable   = yes

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


[Samba] problem for the user with numbered password

2006-04-15 Thread Gilles Lauwers

Hello

first, I'm sorry for my english but I'm a newbie in this language !

I installed the authenfication through winbind

so the user does not have to retape password when they are accesing to a 
share but the people with numbered password can't access to the share


what's the problem ?

thx


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


Re: [Samba] read only - write list

2006-04-15 Thread Thomas Dorsch


Sorry, typo error in write List. I meant user1 has write access

Hi Eric,

maybe this is what you ' re looking for:

[share]
comment = whatever
path = /mnt/share_1
valid users = @group1  # both users have to be members of
that group
write list = user1
public = no
writable = no
create mask = 0750
force create mode = 0650
directory mask = 0750
force directory mode = 0750


Another important thing is that you set the right filesystem permissions
for the share.

Hope this helps !



Eric Velluet schrieb:

Hello,

I want to share à directory in read/write access for user1 and in read 
access for an user2.

Y try this syntaxe without succes :

[sharerep]
valid users = user1, user2
public = no
browseable = yes
read only = yes
write list = user1

Y try also read only = no but in this case the two users can read/write

samba version 3.0.10

I have not understand something but what  ?

Best wishes.



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

Re: [Samba] read only - write list

2006-04-15 Thread Thomas Dorsch

Hi Eric,

maybe this is what you ' re looking for:

[share]
   comment = whatever
   path = /mnt/share_1
   valid users = @group1  # both users have to be members of 
that group

   write list = user2
   public = no
   writable = no
   create mask = 0750
   force create mode = 0650
   directory mask = 0750
   force directory mode = 0750


Another important thing is that you set the right filesystem permissions 
for the share.


Hope this helps !



Eric Velluet schrieb:

Hello,

I want to share à directory in read/write access for user1 and in read 
access for an user2.

Y try this syntaxe without succes :

[sharerep]
valid users = user1, user2
public = no
browseable = yes
read only = yes
write list = user1

Y try also read only = no but in this case the two users can read/write

samba version 3.0.10

I have not understand something but what  ?

Best wishes.

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

[Samba] Max number of users

2006-04-15 Thread Mark Peterson
Is there a limitation on the number of accounts one
can create in Samba 2 and 3?

Thanks, -Mark

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] ACL Support in Samba 3.0.20b

2006-04-15 Thread jim_mosbey
My agency is migrating from Solaris PCnetlink to Samba 3.0.20b for file 
and print sharing. Samba is installed on Solaris 9 (which I just recently 
inherited). Is there any way to tell if Samba was compiled with ACL 
support? I am having some trouble matching permissions from windows to 
Unix.



Jim Mosbey
NYS Dept. of  Public Service
(518) 474-2722

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


[Samba] samba daemons

2006-04-15 Thread Anna Barnes

Hi there
Our server crashed this morning and now SAMBA is acting funky.
I can connect to the fileserver via samba from an apple box and I can  
mount my home directory and access my files, I can also mount the  
other folder with data in it but I can't access, in fact I can't see  
any files inside this folder.


On the server if I do ps -ef | grep smbd I get
 amandel  1744   648  0 12:40:03 ?0:00 /opt/samba/sbin/smbd -D
root   648 1  0 11:47:47 ?0:00 /opt/samba/sbin/smbd -D
jgrinban  1700   648  0 12:29:01 ?0:04 /opt/samba/sbin/smbd -D

and ps -ef | grep nmbd gives
 root   651   650  0 11:47:47 ?0:00 /opt/samba/sbin/nmbd -D
root   650 1  0 11:47:47 ?0:02 /opt/samba/sbin/nmbd -D

I've tried stopping and starting these with smbd stop and smbd start  
etc but it actually makes no difference to the behaviour I am seeing.  
e.g If I stop the daemons I can still mount my home directory. I've  
also run smbclient -U and -L localhost and it all comes up fine.


What should I do next ?

Thank you
Anna


Anna Barnes (PhD)
fMRI Research Laboratory
Department of Radiology
Columbia University College of Physicians and Surgeons
710 W168th St
New York, NY10032
USA
+1212 342 0293

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


[Samba] Debian package including --with-acl-support?

2006-04-15 Thread Sean Wingert
Hi Samba Experts,

Does anyone know where I could download a Debian Sarge package that
has the --with-acl-support configure option set?

I've read that the Debian packages on Sarge don't have it, and I've tried
modifying /etc/apt/sources.list to include 
deb http://us4.samba.org/samba/ftp/Binary_Packages/Debian sarge samba

But everytime I try to modify ACLS via Windows XP security tab, I get the
PERMISSION DENIED despite my smb.conf with nt acl support = yes

This is a vanilla install from the debian packages on that site, but let me
know if you need my smb.conf

Sean


==


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


[Samba] Failed to initialise SAM_ACCOUNT for user

2006-04-15 Thread Girish
I'm trying to create samba user accounts for users that don't have 
accounts on the machine.  I get the following error when using 
'smbpasswd -a username'. Failed to initialise SAM_ACCOUNT for user 
username.  Does this user 
exist in the UNIX password database?m I doing something wrong?  Or can you not 
have samba accounts if they 
don't have user accounts.I am using samba Version 3.0.14a-2thanks
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Re: Debian package including --with-acl-support?

2006-04-15 Thread Blaž Primc

Hi,

you should check: http://www.enterprisesamba.org/index.php?id=56
And be sure to mount your disk with acl support!

Best regards, Blaž.

Sean Wingert wrote:

Hi Samba Experts,

Does anyone know where I could download a Debian Sarge package that
has the --with-acl-support configure option set?

I've read that the Debian packages on Sarge don't have it, and I've tried
modifying /etc/apt/sources.list to include 
deb http://us4.samba.org/samba/ftp/Binary_Packages/Debian sarge samba


But everytime I try to modify ACLS via Windows XP security tab, I get the
PERMISSION DENIED despite my smb.conf with nt acl support = yes

This is a vanilla install from the debian packages on that site, but let me
know if you need my smb.conf

Sean


==




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


Re: [Samba] ACL Support in Samba 3.0.20b

2006-04-15 Thread Doug VanLeuven

[EMAIL PROTECTED] wrote:
My agency is migrating from Solaris PCnetlink to Samba 3.0.20b for file 
and print sharing. Samba is installed on Solaris 9 (which I just recently 
inherited). Is there any way to tell if Samba was compiled with ACL 
support? I am having some trouble matching permissions from windows to 
Unix.




Hi,

smbd -b

will print the build environment

I was curious myself, so I compiled an otherwise identical
non-acl version and diffed the smbd -b outputs.

3c3
Built on:Mon Jan  9 23:00:58 PST 2006
---
Built on:Sat Apr 15 11:04:25 PDT 2006
258a259
HAVE_NO_ACLS
264d264
HAVE_POSIX_ACLS

Good luck, Doug


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


[Samba] Why Can I Delete?

2006-04-15 Thread Michael Stearne
If user1 creates a file on the share, why with this configuration can
user2 delete that file created by user1?

Thanks,
Michael

[global]
idmap gid = 16777216-33554431
idmap uid = 16777216-33554431
path = /var/www/
unix password sync = yes
workgroup = cmny
os level = 20
auto services = advertising editorial
null passwords = yes
encrypt passwords = yes
winbind use default domain = no
security = user
template shell = /bin/false
lock directory = /var/lock/smb
share modes = yes
locking = yes

[advertising]
wide links = no
path = /var/www/advertising
strict locking = yes
valid users = @advertising
oplocks = False
level2 oplocks = False
public = no
writable = yes
create mask = 0700
force create mode = 0700
directory mask = 0700
force directory mode = 0700
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Why Can I Delete?

2006-04-15 Thread Eric Warnke
Please supply a `ls -ald /var/www/advertising`

Cheers,
Eric

On 4/15/06, Michael Stearne [EMAIL PROTECTED] wrote:

 If user1 creates a file on the share, why with this configuration can
 user2 delete that file created by user1?

 Thanks,
 Michael

 [global]
 idmap gid = 16777216-33554431
 idmap uid = 16777216-33554431
 path = /var/www/
 unix password sync = yes
 workgroup = cmny
 os level = 20
 auto services = advertising editorial
 null passwords = yes
 encrypt passwords = yes
 winbind use default domain = no
 security = user
 template shell = /bin/false
 lock directory = /var/lock/smb
 share modes = yes
 locking = yes

 [advertising]
 wide links = no
 path = /var/www/advertising
 strict locking = yes
 valid users = @advertising
 oplocks = False
 level2 oplocks = False
 public = no
 writable = yes
 create mask = 0700
 force create mode = 0700
 directory mask = 0700
 force directory mode = 0700
 --
 To unsubscribe from this list go to the following URL and read the
 instructions:  https://lists.samba.org/mailman/listinfo/samba

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


[Samba] Samba Restart -- Re-caching dependency info (mtimes differ)

2006-04-15 Thread Will Strickland
try /sbin/depscan.sh --update
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Samba PDC LDAP: Got too many (2) info entries for domain

2006-04-15 Thread Alberto Picón Couselo
Hello there. I'm currently configuring a Samba PDC LDAP Master Server and
two Samba BDC LDAP Slave Servers with slurpd replication service over Debian
3.1 Sarge and Samba 3.0.22. I'm trying to fix a problem related with the
info domain entry. When I execute the net getlocalsid [Domain] in the PDC
server, I receive the following response:

# net getlocalsid [domain]
[2006/04/16 03:26:51, 0] lib/smbldap_util.c:smbldap_search_domain_info(276)
  Got too many (2) domain info entries for domain [domain]
SID for domain [DOMAIN] is: S-1-5-21-xxx-xxx-x

In addition, when I execute, for example, pdbedit -L, I receive the
following output:

# pdbedit -L
Searching for:[((objectClass=sambaDomain)(sambaDomainName=[DOMAIN]))]
smbldap_open_connection: connection opened
ldap_connect_system: succesful connection to the LDAP server
Got too many (2) domain info entries for domain [DOMAIN]
pdb_init_ldapsam: WARNING: Could not get domain info, nor add one to the
domain
pdb_init_ldapsam: Continuing on regardless, will be unable to allocate new
users/groups, and will risk BDCs having inconsistant SIDs
Searching for:[((objectClass=sambaDomain)(sambaDomainName=[DOMAIN]))]
smbldap_open_connection: connection opened
ldap_connect_system: succesful connection to the LDAP server
Got too many (2) domain info entries for domain [DOMAIN]
pdb_init_ldapsam: WARNING: Could not get domain info, nor add one to the
domain
pdb_init_ldapsam: Continuing on regardless, will be unable to allocate new
users/groups, and will risk BDCs having inconsistant SIDs
ldapsam_setsampwent: 5 entries in the base dc=mydomain,dc=com
init_sam_from_ldap: Entry found for user: user1
user1:10001:User 1
init_sam_from_ldap: Entry found for user: machine-01$
machine-01$:25001:machine-01$
init_sam_from_ldap: Entry found for user: machine-02$
machine-02$:25000:machine-02$
init_sam_from_ldap: Entry found for user: user2
user2:10002:User 2
init_sam_from_ldap: Entry found for user: admin
admin:0:admin admin

Following several fixes I've found, I've tryed to reindex the LDAP master
database and rebuild the domain entry. I've made sure that there is only one
entry for the domain too without results. I think that the problem is
related with the domain entry stored in secrets.tdb. When I delete the LDAP
domain entry and execute net getlocalsid [domain], the response is correct.
However, when I rebuild the LDAP entry, the error comes back again.

Can you please give me any advice or workaround I could apply to fix it?

Thank you very much in advance,
Alberto



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


svn commit: samba r15090 - in branches/SAMBA_4_0/source/lib/tdb/swig: .

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-15 07:44:06 + (Sat, 15 Apr 2006)
New Revision: 15090

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15090

Log:
Since we wrap the swig wrapper in another layer of Python, there isn't 
much point in doing lots of %rename calls in tdb.i so get rid of them.

Modified:
   branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py
   branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py   2006-04-15 04:07:14 UTC 
(rev 15089)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/Tdb.py   2006-04-15 07:44:06 UTC 
(rev 15090)
@@ -20,15 +20,16 @@
 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 #
 
-import tdb, os
+import os
+from tdb import *
 
 # Open flags
 
-DEFAULT= tdb.TDB_DEFAULT
-CLEAR_IF_FIRST = tdb.TDB_CLEAR_IF_FIRST
-INTERNAL   = tdb.TDB_INTERNAL
-NOLOCK = tdb.TDB_NOLOCK
-NOMMAP = tdb.TDB_NOMMAP
+DEFAULT= TDB_DEFAULT
+CLEAR_IF_FIRST = TDB_CLEAR_IF_FIRST
+INTERNAL   = TDB_INTERNAL
+NOLOCK = TDB_NOLOCK
+NOMMAP = TDB_NOMMAP
 
 # Class representing a TDB file
 
@@ -36,40 +37,40 @@
 
 # Create and destroy Tdb objects
 
-def __init__(self, name, hash_size = 0, flags = tdb.TDB_DEFAULT,
+def __init__(self, name, hash_size = 0, flags = TDB_DEFAULT,
  open_flags = os.O_RDWR | os.O_CREAT, mode = 0600):
-self.tdb = tdb.open(name, hash_size, flags, open_flags, mode)
+self.tdb = tdb_open(name, hash_size, flags, open_flags, mode)
 if self.tdb is None:
-raise IOError, tdb.errorstr(self.tdb)
+raise IOError, tdb_errorstr(self.tdb)
 
 def __del__(self):
 self.close()
 
 def close(self):
 if hasattr(self, 'tdb') and self.tdb is not None:
-if tdb.close(self.tdb) == -1:
-raise IOError, tdb.errorstr(self.tdb)
+if tdb_close(self.tdb) == -1:
+raise IOError, tdb_errorstr(self.tdb)
 self.tdb = None
 
 # Random access to keys, values
 
 def __getitem__(self, key):
-result = tdb.fetch(self.tdb, key)
+result = tdb_fetch(self.tdb, key)
 if result is None:
-raise KeyError, '%s: %s' % (key, tdb.errorstr(self.tdb))
+raise KeyError, '%s: %s' % (key, tdb_errorstr(self.tdb))
 return result
 
 def __setitem__(self, key, item):
-if tdb.store(self.tdb, key, item) == -1:
-raise IOError, tdb.errorstr(self.tdb)
+if tdb_store(self.tdb, key, item) == -1:
+raise IOError, tdb_errorstr(self.tdb)
 
 def __delitem__(self, key):
-if not tdb.exists(self.tdb, key):
-raise KeyError, '%s: %s' % (key, tdb.errorstr(self.tdb))
-tdb.delete(self.tdb, key)
+if not tdb_exists(self.tdb, key):
+raise KeyError, '%s: %s' % (key, tdb_errorstr(self.tdb))
+tdb_delete(self.tdb, key)
 
 def has_key(self, key):
-return tdb.exists(self.tdb, key)
+return tdb_exists(self.tdb, key)
 
 # Tdb iterator
 
@@ -83,12 +84,12 @@
 
 def next(self):
 if self.key is None:
-self.key = tdb.firstkey(self.tdb)
+self.key = tdb_firstkey(self.tdb)
 if self.key is None:
 raise StopIteration
 return self.key
 else:
-self.key = tdb.nextkey(self.tdb, self.key)
+self.key = tdb_nextkey(self.tdb, self.key)
 if self.key is None:
 raise StopIteration
 return self.key

Modified: branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i
===
--- branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2006-04-15 04:07:14 UTC 
(rev 15089)
+++ branches/SAMBA_4_0/source/lib/tdb/swig/tdb.i2006-04-15 07:44:06 UTC 
(rev 15090)
@@ -113,11 +113,9 @@
}
 }
 
-%rename tdb_open open;
 TDB_CONTEXT *tdb_open(const char *name, int hash_size, int tdb_flags,
  int open_flags, mode_t mode);
 
-%rename tdb_open_ex open_ex;
 TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
 int open_flags, mode_t mode,
 tdb_log_func log_fn,
@@ -125,66 +123,46 @@
 
 %exception;
 
-%rename tdb_reopen reopen;
 int tdb_reopen(TDB_CONTEXT *tdb);
 
-%rename tdb_reopen_all reopen_all;
 int tdb_reopen_all(void);
 
-%rename tdb_logging_function logging_function;
 void tdb_logging_function(TDB_CONTEXT *tdb, tdb_log_func);
 
-%rename tdb_error error;
 enum TDB_ERROR tdb_error(TDB_CONTEXT *tdb);
 
-%rename tdb_errorstr errorstr;
 const char *tdb_errorstr(TDB_CONTEXT *tdb);
 
-%rename tdb_fetch fetch;
 TDB_DATA tdb_fetch(TDB_CONTEXT *tdb, TDB_DATA 

svn commit: samba r15091 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-15 10:10:23 + (Sat, 15 Apr 2006)
New Revision: 15091

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15091

Log:
Raise LdbError instead of IOError when ldb function calls return an 
error.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-15 07:44:06 UTC 
(rev 15090)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/Ldb.py   2006-04-15 10:10:23 UTC 
(rev 15091)
@@ -22,6 +22,10 @@
 
 import ldb
 
+class LdbError(Exception):
+An exception raised when a ldb error occurs.
+pass
+
 class LdbElement:
 A class representing a ldb element as an array of values.
 
@@ -84,19 +88,22 @@
 
 def search(self, expression):
 
-result = ldb.search(self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
-expression, None);
+self._ldb_call(ldb.search, self.ldb_ctx, None, ldb.LDB_SCOPE_DEFAULT,
+   expression, None);
 
 return [LdbMessage(ldb.ldb_message_ptr_array_getitem(result.msgs, ndx))
 for ndx in range(result.count)]
 
+def _ldb_call(self, fn, *args):
+result = fn(*args)
+if result != ldb.LDB_SUCCESS:
+raise LdbError, (result, ldb.strerror(result))
+
 def delete(self, dn):
-if ldb.delete(self.ldb_ctx, dn) != 0:
-raise IOError, ldb.errstring(self.ldb_ctx)
+self._ldb_call(ldb.delete, self.ldb_ctx, dn)
 
 def rename(self, olddn, newdn):
-if ldb.rename(self.ldb_ctx, olddn, newdn) != 0:
-raise IOError, ldb.errstring(self.ldb_ctx)
+self._ldb_call(ldb.rename, self.ldb_ctx, olddn, newdn)
 
 def add(self, msg):
-ldb.add(self.ldb_ctx, msg)
+self._ldb_call(ldb.add, self.ldb_ctx, msg)



svn commit: samba r15092 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-15 10:13:09 + (Sat, 15 Apr 2006)
New Revision: 15092

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15092

Log:
Remove some swig stuff that didn't work out and the %rename call.

Add wrappers for some of the ldb_msg_* functions.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-15 10:10:23 UTC 
(rev 15091)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-15 10:13:09 UTC 
(rev 15092)
@@ -72,20 +72,22 @@
  * Wrap struct ldb_val
  */
 
-%typemap(in) struct ldb_val {
+%typemap(in) struct ldb_val * (struct ldb_val temp) {
+   $1 = temp;
if (!PyString_Check($input)) {
PyErr_SetString(PyExc_TypeError, string arg expected);
return NULL;
}
-   $1.length = PyString_Size($input);
-   $1.data = PyString_AsString($input);
+   $1-length = PyString_Size($input);
+   $1-data = PyString_AsString($input);
 }
 
-%typemap(out) struct ldb_val {
-   if ($1.data == NULL  $1.length == 0) {
+%typemap(out) struct ldb_val * {
+   if ($1-data == NULL  $1-length == 0) {
+   Py_INCREF(Py_None);
$result = Py_None;
} else {
-   $result = PyString_FromStringAndSize($1.data, $1.length);
+   $result = PyString_FromStringAndSize($1-data, $1-length);
}
 }
 
@@ -103,34 +105,12 @@
 }
 
 %typemap(argout) struct ldb_result ** {
-
-   /* XXX: Check result for error and throw exception if necessary */
-
resultobj = SWIG_NewPointerObj(*$1, SWIGTYPE_p_ldb_result, 0);
 }  
 
 %types(struct ldb_result *);
 
 /*
- * Wrap struct ldb_dn
- */
-
-%typemap(in) struct ldb_dn * {
-   if ($input == Py_None) {
-   $1 = NULL;
-   } else if (!PyString_Check($input)) {
-   PyErr_SetString(PyExc_TypeError, string arg expected);
-   return NULL;
-   } else {
-   $1 = ldb_dn_explode(NULL, PyString_AsString($input));
-   }
-}
-
-%typemap(out) struct ldb_dn * {
-   $result = PyString_FromString(ldb_dn_linearize($1, $1));
-}
-
-/*
  * Wrap struct ldb_message_element
  */
 
@@ -153,33 +133,9 @@
struct ldb_dn *dn;
unsigned int num_elements;
struct ldb_message_element *elements;
-   void *private_data; /* private to the backend */
+   void *private_data;
 };
 
-%typemap(in) struct ldb_message * {
-   PyObject *obj, *key, *value;
-   int pos;
-
-   $1 = ldb_msg_new(NULL);
-
-   obj = PyObject_GetAttrString($input, dn);
-   $1-dn = ldb_dn_explode(NULL, PyString_AsString(obj));
-
-   obj = PyObject_GetAttrString($input, private_data);
-   $1-private_data = PyString_AsString(obj);
-
-   obj = PyObject_GetAttrString($input, elements);
-
-   pos = 0;
-   while (PyDict_Next(obj, pos, key, value)) {
-   struct ldb_val v;
-
-   v.data = PyString_AsString(value);
-   v.length = PyString_Size(value);
-   ldb_msg_add_value($1, PyString_AsString(key), v);
-   }
-}
-
 /*
  * Wrap struct ldb_result
  */
@@ -197,23 +153,20 @@
  * Wrap ldb functions 
  */
 
-%rename ldb_init init;
 struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx);
 
-%rename ldb_errstring errstring;
 const char *ldb_errstring(struct ldb_context *ldb);
 
-%rename ldb_connect connect;
 int ldb_connect(struct ldb_context *ldb, const char *url, unsigned int flags, 
const char *options[]);
 
-%rename ldb_search search;
 int ldb_search(struct ldb_context *ldb, const struct ldb_dn *base, enum 
ldb_scope scope, const char *expression, const char * const *attrs, struct 
ldb_result **OUT);
 
-%rename ldb_delete delete;
 int ldb_delete(struct ldb_context *ldb, const struct ldb_dn *dn);
 
-%rename ldb_rename rename;
 int ldb_rename(struct ldb_context *ldb, const struct ldb_dn *olddn, const 
struct ldb_dn *newdn);
 
-%rename ldb_add add;
 int ldb_add(struct ldb_context *ldb, const struct ldb_message *message);
+
+struct ldb_message *ldb_msg_new(void *mem_ctx);
+struct ldb_message_element *ldb_msg_find_element(const struct ldb_message 
*msg, const char *attr_name);
+int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *val);



svn commit: samba r15093 - branches/SAMBA_3_0/source/python trunk/source/python

2006-04-15 Thread lmuelle
Author: lmuelle
Date: 2006-04-15 13:45:27 + (Sat, 15 Apr 2006)
New Revision: 15093

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15093

Log:
Align to the last winbind changes.

Modified:
   branches/SAMBA_3_0/source/python/py_winbind.c
   trunk/source/python/py_winbind.c


Changeset:
Modified: branches/SAMBA_3_0/source/python/py_winbind.c
===
--- branches/SAMBA_3_0/source/python/py_winbind.c   2006-04-15 10:13:09 UTC 
(rev 15092)
+++ branches/SAMBA_3_0/source/python/py_winbind.c   2006-04-15 13:45:27 UTC 
(rev 15093)
@@ -134,8 +134,8 @@
 
result = PyList_New(0);
 
-   if (response.extra_data) {
-   const char *extra_data = response.extra_data;
+   if (response.extra_data.data) {
+   const char *extra_data = response.extra_data.data;
fstring name;
 
while (next_token(extra_data, name, ,, sizeof(fstring)))
@@ -165,8 +165,8 @@
 
result = PyList_New(0);
 
-   if (response.extra_data) {
-   const char *extra_data = response.extra_data;
+   if (response.extra_data.data) {
+   const char *extra_data = response.extra_data.data;
fstring name;
 
while (next_token(extra_data, name, ,, sizeof(fstring)))
@@ -200,8 +200,8 @@
 
result = PyList_New(0);
 
-   if (response.extra_data) {
-   const char *extra_data = response.extra_data;
+   if (response.extra_data.data) {
+   const char *extra_data = response.extra_data.data;
fstring name;
 
while (next_token(extra_data, name, ,, sizeof(fstring)))

Modified: trunk/source/python/py_winbind.c
===
--- trunk/source/python/py_winbind.c2006-04-15 10:13:09 UTC (rev 15092)
+++ trunk/source/python/py_winbind.c2006-04-15 13:45:27 UTC (rev 15093)
@@ -134,8 +134,8 @@
 
result = PyList_New(0);
 
-   if (response.extra_data) {
-   const char *extra_data = response.extra_data;
+   if (response.extra_data.data) {
+   const char *extra_data = response.extra_data.data;
fstring name;
 
while (next_token(extra_data, name, ,, sizeof(fstring)))
@@ -165,8 +165,8 @@
 
result = PyList_New(0);
 
-   if (response.extra_data) {
-   const char *extra_data = response.extra_data;
+   if (response.extra_data.data) {
+   const char *extra_data = response.extra_data.data;
fstring name;
 
while (next_token(extra_data, name, ,, sizeof(fstring)))
@@ -200,8 +200,8 @@
 
result = PyList_New(0);
 
-   if (response.extra_data) {
-   const char *extra_data = response.extra_data;
+   if (response.extra_data.data) {
+   const char *extra_data = response.extra_data.data;
fstring name;
 
while (next_token(extra_data, name, ,, sizeof(fstring)))



svn commit: samba r15094 - branches/SAMBA_3_0/examples/pam_winbind trunk/examples/pam_winbind

2006-04-15 Thread lmuelle
Author: lmuelle
Date: 2006-04-15 21:24:32 + (Sat, 15 Apr 2006)
New Revision: 15094

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15094

Log:
Replace ; by # where we have a comment and remove superfluous spaces at
the end of lines.

Modified:
   branches/SAMBA_3_0/examples/pam_winbind/pam_winbind.conf
   trunk/examples/pam_winbind/pam_winbind.conf


Changeset:
Modified: branches/SAMBA_3_0/examples/pam_winbind/pam_winbind.conf
===
--- branches/SAMBA_3_0/examples/pam_winbind/pam_winbind.conf2006-04-15 
13:45:27 UTC (rev 15093)
+++ branches/SAMBA_3_0/examples/pam_winbind/pam_winbind.conf2006-04-15 
21:24:32 UTC (rev 15094)
@@ -1,26 +1,26 @@
-;
-; pam_winbind configuration file
-;
-; /etc/security/pam_winbind.conf
-;
+#
+# pam_winbind configuration file
+#
+# /etc/security/pam_winbind.conf
+#
 
 [global]
 
-; turn on debugging 
+# turn on debugging
 ;debug = no
 
-; request a cached login if possible 
-; (needs winbind offline logon = yes in smb.conf)
+# request a cached login if possible
+# (needs winbind offline logon = yes in smb.conf)
 ;cached_login = no
 
-; authenticate using kerberos
+# authenticate using kerberos
 ;krb5_auth = no
 
-; when using kerberos, request a FILE krb5 credential cache type 
-; (leave empty to just do krb5 authentication but not have a ticket
-; afterwards)
-;krb5_ccache_type = 
+# when using kerberos, request a FILE krb5 credential cache type
+# (leave empty to just do krb5 authentication but not have a ticket
+# afterwards)
+;krb5_ccache_type =
 
-; make successful authentication dependend on membership of one SID
-; (can also take a name)
+# make successful authentication dependend on membership of one SID
+# (can also take a name)
 ;require_membership_of =

Modified: trunk/examples/pam_winbind/pam_winbind.conf
===
--- trunk/examples/pam_winbind/pam_winbind.conf 2006-04-15 13:45:27 UTC (rev 
15093)
+++ trunk/examples/pam_winbind/pam_winbind.conf 2006-04-15 21:24:32 UTC (rev 
15094)
@@ -1,26 +1,26 @@
-;
-; pam_winbind configuration file
-;
-; /etc/security/pam_winbind.conf
-;
+#
+# pam_winbind configuration file
+#
+# /etc/security/pam_winbind.conf
+#
 
 [global]
 
-; turn on debugging 
+# turn on debugging
 ;debug = no
 
-; request a cached login if possible 
-; (needs winbind offline logon = yes in smb.conf)
+# request a cached login if possible
+# (needs winbind offline logon = yes in smb.conf)
 ;cached_login = no
 
-; authenticate using kerberos
+# authenticate using kerberos
 ;krb5_auth = no
 
-; when using kerberos, request a FILE krb5 credential cache type 
-; (leave empty to just do krb5 authentication but not have a ticket
-; afterwards)
-;krb5_ccache_type = 
+# when using kerberos, request a FILE krb5 credential cache type
+# (leave empty to just do krb5 authentication but not have a ticket
+# afterwards)
+;krb5_ccache_type =
 
-; make successful authentication dependend on membership of one SID
-; (can also take a name)
+# make successful authentication dependend on membership of one SID
+# (can also take a name)
 ;require_membership_of =



Build status as of Sun Apr 16 00:00:07 2006

2006-04-15 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-04-15 
00:00:38.0 +
+++ /home/build/master/cache/broken_results.txt 2006-04-16 00:00:09.0 
+
@@ -1,15 +1,15 @@
-Build status as of Sat Apr 15 00:00:02 2006
+Build status as of Sun Apr 16 00:00:07 2006
 
 Build counts:
 Tree Total  Broken Panic 
 ccache   35 5  0 
 distcc   34 4  0 
-lorikeet-heimdal 32 32 0 
+lorikeet-heimdal 31 31 0 
 ppp  19 0  0 
 rsync35 2  0 
 samba2  0  0 
 samba-docs   0  0  0 
-samba4   40 28 2 
+samba4   40 29 2 
 samba_3_037 8  0 
 smb-build28 0  0 
 talloc   33 18 0 


svn commit: samba r15095 - in branches/SAMBA_4_0/source/lib/ldb/swig: .

2006-04-15 Thread tpot
Author: tpot
Date: 2006-04-16 03:46:05 + (Sun, 16 Apr 2006)
New Revision: 15095

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=15095

Log:
Fix up typemap for struct ldb_val so that ldb_msg_add_value() wrapper 
works properly.

Modified:
   branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i
===
--- branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-15 21:24:32 UTC 
(rev 15094)
+++ branches/SAMBA_4_0/source/lib/ldb/swig/ldb.i2006-04-16 03:46:05 UTC 
(rev 15095)
@@ -45,6 +45,15 @@
 %include carrays.i
 %include exception.i
 
+/*
+ * Constants
+ */
+
+enum ldb_scope {LDB_SCOPE_DEFAULT=-1, 
+   LDB_SCOPE_BASE=0, 
+   LDB_SCOPE_ONELEVEL=1,
+   LDB_SCOPE_SUBTREE=2};
+
 /* 
  * Wrap struct ldb_context
  */
@@ -72,7 +81,7 @@
  * Wrap struct ldb_val
  */
 
-%typemap(in) struct ldb_val * (struct ldb_val temp) {
+%typemap(in) struct ldb_val *INPUT (struct ldb_val temp) {
$1 = temp;
if (!PyString_Check($input)) {
PyErr_SetString(PyExc_TypeError, string arg expected);
@@ -82,20 +91,10 @@
$1-data = PyString_AsString($input);
 }
 
-%typemap(out) struct ldb_val * {
-   if ($1-data == NULL  $1-length == 0) {
-   Py_INCREF(Py_None);
-   $result = Py_None;
-   } else {
-   $result = PyString_FromStringAndSize($1-data, $1-length);
-   }
+%typemap(out) struct ldb_val {
+   $result = PyString_FromStringAndSize($1.data, $1.length);
 }
 
-enum ldb_scope {LDB_SCOPE_DEFAULT=-1, 
-   LDB_SCOPE_BASE=0, 
-   LDB_SCOPE_ONELEVEL=1,
-   LDB_SCOPE_SUBTREE=2};
-
 /*
  * Wrap struct ldb_result
  */
@@ -169,4 +168,4 @@
 
 struct ldb_message *ldb_msg_new(void *mem_ctx);
 struct ldb_message_element *ldb_msg_find_element(const struct ldb_message 
*msg, const char *attr_name);
-int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *val);
+int ldb_msg_add_value(struct ldb_message *msg, const char *attr_name, const 
struct ldb_val *INPUT);