Re: [Samba] Usershare parameters

2006-09-04 Thread Jeremy Allison
On Mon, Sep 04, 2006 at 12:35:12AM -0400, Cybionet wrote:
 Greating all,
 
 I have try the usershare parameter, and two of them seem not to work.
 
 /  usershare max shares = 1
 //  usershare template share = /etc/samba/template/
 
 - In the first one, users can create a infinit number of usershare file.
 - In the second one, the template are not use at all.

This isn't what the template syntax is for. Look at the
man page for smb.conf for details. For usershare
max shares try setting 10 and see if this limits
it correctly. I'll test this out in the 3.0.23c code
and fix it if there's a bug.

Thanks,

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


[Samba] Bad substitution for %a variable

2006-09-04 Thread Walter . Laub
Hi,

The %a variable is not well substituted for XP64.

For separation of profiles of different OS we use the %a variable:
logon path = \\%L\Profiles\%U\%a

With samba3021b the variable points to Win2K for XP64! This result in 
trouble with the user profiles!

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


[Samba] fam error

2006-09-04 Thread Willy Offermans
Dear Samba Friends,

I got the following error again and again:

snip
.
Sep  4 10:58:18 sun smbd[94479]: [2006/09/04 10:58:18, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:18 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:23 sun smbd[94479]: [2006/09/04 10:58:23, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:23 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:24 sun smbd[94479]: [2006/09/04 10:58:24, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:24 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:25 sun smbd[94479]: [2006/09/04 10:58:25, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:25 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:25 sun smbd[94479]: [2006/09/04 10:58:25, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:25 sun smbd[94479]:   failed to connect to FAM service
Sep  4 11:23:22 sun smbd[94479]: [2006/09/04 11:23:22, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 11:23:22 sun smbd[94479]:   failed to connect to FAM service
.
/snip

I'm using samba-3.0.23b,1 on FreeBSD 6.1

I did not specify anything with respect to fam in my
/usr/local/etc/smb.conf file.

I have only noticed that a new directory has been created in /tmp/

drwx--  2 root  wheel  512 Sep  4 08:45 /tmp/fam-root/

This directory is empty and updated once and a while. I mean the
directory is recreated at a later time. Attributes and owner do not
change.

In the clients log files I find the following:

snip

[2006/09/04 11:36:41, 0] smbd/notify_fam.c:fam_check_reconnect(136)
  failed to connect to FAM service
  Socket directory /tmp/fam-root has different owner
  Failed to remove unsafe path /tmp/fam-root
...
/snip

It seems that the client tries to access /tmp/fam-root but has not the
right user priviliges.

Can someone help me out and explain what is going on? How can I solve
the problem?


-- 
Met vriendelijke groeten,
With kind regards,
Mit freundlichen Gruessen,
De jrus wah,

Willy

*
W.K. Offermans
Eindhoven University of Technology
Department of Chemical Engineering
Laboratory of Catalysis (SKA)
building ST-W 4.27, PO Box 513
5600 MB  Eindhoven, Netherlands
Tel:+31 40 247 37 81
Fax:+31 40 245 50 54
Home:   +31 45 544 49 44
Mobile: +31 650 697 837
e-mail: [EMAIL PROTECTED]
http://www.catalysis.nl

   Powered by 

(__)
 \\\'',)
   \/  \ ^
   .\._/_)

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


[Samba] question about wiki.samba.org

2006-09-04 Thread Franz Pfoertsch
Hi people,

who maintain the samba wiki at http://wiki.samba.org?

do we need this wiki or should we use the normal documentation?

I made some additons to the wiki, but it seems nobody needs the
information ..

I hope somebody could me explain who should use this documentation
plattform ...

regards
Franz

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


Re: [Samba] question about wiki.samba.org

2006-09-04 Thread Felipe Augusto van de Wiel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/04/2006 07:12 AM, Franz Pfoertsch escreveu:
 Hi people,

Hey! :)


 who maintain the samba wiki at http://wiki.samba.org?

The Samba Community? :)
Including users and developers.


 do we need this wiki or should we use the normal documentation?

Both. The wiki has the great advantage that we could add
bits and info that are not available on the public documentation,
it also allow us to keep track of important notes and allow
doc maintainers to check the wiki and add relevant information to
the official docs.


 I made some additons to the wiki, but it seems nobody needs the
 information ..

Sorry, but how do you know nobody needs it?


 I hope somebody could me explain who should use this documentation
 plattform ...

As I understand, the wiki is a little bit under used,
perhaps it needs more attention from us, we should think about
adding the bits that we solve around this list to the wiki, and
try to reference the official docs. (I have to confess that until
your message I did not think about that).


 regards
 Franz

Kind regards,

- --
Felipe Augusto van de Wiel [EMAIL PROTECTED]
Coordenadoria de Tecnologia da Informação (CTI) - SEDU/PARANACIDADE
http://www.paranacidade.org.br/   Phone: (+55 41 3350 3300)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFE/BG8Cj65ZxU4gPQRAtO6AJ94QmcljRmxofZn6sWZ8j8DKPP0pQCfa3Md
Re0yYPOrzEM3+VFsHeXUUBU=
=3tuv
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Linux client have problem with Samba share

2006-09-04 Thread Felipe Augusto van de Wiel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/04/2006 01:35 AM, Cybionet escreveu:
 Greating all,
 I want to use Acomba (Fortune 1000) with a database on a samba share.
 All work perfectly with Windows client, but the Linux client can't open
 the database file. Any idea?

Different versions of Samba in server and client? Wrong
arguments when mounting the samba share?


 Similar thing with Openoffice 2.x. The Windows client can save properly
 file on samba share, but Linux client have a error message when they try
 to save. Linux client need to press save two time to successfully save
 they modifications.
 
 Any idea to help?

Try to increase the log verbosity and see if you can
discover what's going on, you can change the important part of the
logs to the samba list, so we can try to help you find out.


Kind regards,

- --
Felipe Augusto van de Wiel [EMAIL PROTECTED]
Coordenadoria de Tecnologia da Informação (CTI) - SEDU/PARANACIDADE
http://www.paranacidade.org.br/   Phone: (+55 41 3350 3300)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFE/BJQCj65ZxU4gPQRAmASAJ9w9q657/Je5X8pvjzernhPE7eTyACfdCPX
am9AbSU9OSodo2w0cNKRGFE=
=5eVv
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] samba + ldap query filter

2006-09-04 Thread Felipe Augusto van de Wiel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/03/2006 11:13 AM, Andreas Calvo escreveu:
 Hi!
 I've been using samba as PDC with a LDAP backend, and everything seems to
 work fine but, whenever a user has to auth to samba, it seems that the
 query
 that it performs is against the mail attribute, instead of the uid as I
 desired.
 Is there any way to manually specify the query filter to use agains the
 LDAP
 tree?

I remeber that there is an 'ldap filter' parameter.

I couldn't find it on the smb.conf manpage (I'm cc:ing
John Terpstra), but in the [1]docs I could find a reference.

1.http://us4.samba.org/samba/docs/man/Samba-HOWTO-Collection/passdb.html#id2559680


I hope this helps.


 Thanks!

You are welcome, kind regards!

- --
Felipe Augusto van de Wiel [EMAIL PROTECTED]
Coordenadoria de Tecnologia da Informação (CTI) - SEDU/PARANACIDADE
http://www.paranacidade.org.br/   Phone: (+55 41 3350 3300)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFE/BPuCj65ZxU4gPQRAvNPAJwPxwxry41C1fEFpHoXwRaMDJj0DACgvaew
HvBTSLBDy++hkhaKyuBxDkk=
=PBfd
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Bad substitution for %a variable

2006-09-04 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, 4 Sep 2006, [EMAIL PROTECTED] wrote:

 Hi,
 
 The %a variable is not well substituted for XP64.
 
 For separation of profiles of different OS we use the %a variable:
 logon path = \\%L\Profiles\%U\%a
 
 With samba3021b the variable points to Win2K for XP64! This result in 
 trouble with the user profiles!

OK.  I'll take a look tomorrow.  Please file a bug report for me.
I noticed similar behavior with the latest Vista beta last week.





cheers, jerry
=
Samba--- http://www.samba.org
Centeris ---  http://www.centeris.com
What man is a man who does not make the world better?  --Balian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFE/BSYIR7qMdg1EfYRAuMaAJ4juDrWdVnHNUxKgP0syA5cFI4NZwCgrpZa
QjP6lx8qO1s7qHOWe78MY3A=
=uGih
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Roaming profiles errors and shares not disconnecting

2006-09-04 Thread Felipe Augusto van de Wiel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/02/2006 03:00 PM, Philippe LAUGET escreveu:
 Hi,
 
 We are using Samba 3.0.22 on FreeBSD 5.5 PDC with ldap backend and
 roaming profiles.
 
 We meet some difficulties when users logout from some Windows 2000 SP4
 clients, and storing their profiles back to the Samba server.
 
 The file NTUSER.DAT seems to be uploaded and stored in lowercase, as
 ntuser.dat.
 Then, when users try to reopen a win session, they get a corrupted new
 profile. This new profile is fully broken, since it's not possible to
 modify any options that affect NTUSER.DAT.

I couldn't find any references for case changes in your
smb.conf, but I would recommend the [1]Name Mangling section of the
smb.conf manpage. You could activate the 'preserv case' parameter
for the profiles share.

1.http://us4.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#NAMEMANGLINGSECT


 When they disconnect, smbstatus shows the user as connected on the
 machine for a long time ( from 15 minutes to hours ) after he has logged
 out. The shares that has been mounted on the client do not seem to be
 disconnected.

If you shut down the machine, this behaviour changes?


 Here is the output of smbstatus for user test 15 minutes afters he has
 logged out :
 
 Samba version 3.0.22
 PID Username  Group Machine
 ---

[... smbstatus output ...]


 Here is some relevant part of smb.conf :
 [global]
[... smb.conf ...]


 Is there a way to force these shares to close really when users logout ?

Hmmm, you can add commands to the postexec, but I'm not
quite sure that it will solve the problem. In our network, we
have problems with CD servers, sometimes, Win98 does not tell
the server that the share is not in use (the user needs to
logoff). We solve that with mount timeouts, it is a separeted
problem, but has relation to the fact that the MS Windows clients
forgets to //release// the share. :)


 Thank for your help.

Kind regards,

- --
Felipe Augusto van de Wiel [EMAIL PROTECTED]
Coordenadoria de Tecnologia da Informação (CTI) - SEDU/PARANACIDADE
http://www.paranacidade.org.br/   Phone: (+55 41 3350 3300)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFE/BaYCj65ZxU4gPQRAtqgAJ9xDTyecGY9PUhygmXAg742UoSQHQCgy2nU
jy248D+TtpTn8MQ4B5qGcLE=
=OlQc
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] fam error

2006-09-04 Thread James Peach

On 04/09/06, Willy Offermans [EMAIL PROTECTED] wrote:

Dear Samba Friends,

I got the following error again and again:

snip
.
Sep  4 10:58:18 sun smbd[94479]: [2006/09/04 10:58:18, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:18 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:23 sun smbd[94479]: [2006/09/04 10:58:23, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:23 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:24 sun smbd[94479]: [2006/09/04 10:58:24, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:24 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:25 sun smbd[94479]: [2006/09/04 10:58:25, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:25 sun smbd[94479]:   failed to connect to FAM service
Sep  4 10:58:25 sun smbd[94479]: [2006/09/04 10:58:25, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 10:58:25 sun smbd[94479]:   failed to connect to FAM service
Sep  4 11:23:22 sun smbd[94479]: [2006/09/04 11:23:22, 0] 
smbd/notify_fam.c:fam_check_reconnect(136)
Sep  4 11:23:22 sun smbd[94479]:   failed to connect to FAM service
.
/snip

I'm using samba-3.0.23b,1 on FreeBSD 6.1


I've only ever tested the FAM support on IRIX. smbd will automatically
attempt to use FAM if it appears to be available, but it shouldn't


I did not specify anything with respect to fam in my
/usr/local/etc/smb.conf file.

I have only noticed that a new directory has been created in /tmp/

drwx--  2 root  wheel  512 Sep  4 08:45 /tmp/fam-root/

This directory is empty and updated once and a while. I mean the
directory is recreated at a later time. Attributes and owner do not
change.

In the clients log files I find the following:

snip

[2006/09/04 11:36:41, 0] smbd/notify_fam.c:fam_check_reconnect(136)
  failed to connect to FAM service
  Socket directory /tmp/fam-root has different owner
  Failed to remove unsafe path /tmp/fam-root
...
/snip

It seems that the client tries to access /tmp/fam-root but has not the
right user priviliges.

Can someone help me out and explain what is going on? How can I solve
the problem?


You can disable FAM support by setting fam change notify = no in
smb.conf. This
will get rid of the messages, but obviously you won't get FAM support.
I'd have to dig
into the FAM implementation on FreeBSD to be more helpful, and I won't
be able to
do that for a couple of weeks.

--
James Peach | [EMAIL PROTECTED]
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Roaming profiles errors and shares not disconnecting

2006-09-04 Thread Miguel Da Silva - Servicio de Informát ica

Philippe LAUGET wrote:

Hi,

We are using Samba 3.0.22 on FreeBSD 5.5 PDC with ldap backend and 
roaming profiles.


We meet some difficulties when users logout from some Windows 2000 SP4 
clients, and storing their profiles back to the Samba server.


The file NTUSER.DAT seems to be uploaded and stored in lowercase, as 
ntuser.dat.
Then, when users try to reopen a win session, they get a corrupted new 
profile. This new profile is fully broken, since it's not possible to 
modify any options that affect NTUSER.DAT.




I have a similar problem... same Windows version, same Samba version. 
According to smb.conf man page, the default option to preserve case is 
yes.


Some times the problem is even more anoying, an user logs in in an 
Windows station, do whatever he/she wants and logs off. Everything seems 
go fine, but then when the user logs in again he/she can't, for example, 
print anymore.


I think the biggest problem is that people look at me and say Why I can 
not print? I've just printed 2 minutes ago. The solution? Erase the 
old profile and create a new one, but... I have to configure everything 
again (mail client, browser, back-up the files, etc, etc).


I thought once it could be an Ethernet problem (I mean, a physical 
network problem), but it's not :(


Any hints?

--
Miguel Da Silva.
Servicio de Informatica.
Facultad de Ciencias.
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] extending files slow on FAT filesystems

2006-09-04 Thread Mattias Rönnblom
Jeremy Allison [EMAIL PROTECTED] writes:

 On Thu, Aug 24, 2006 at 05:51:45PM +0200, Mattias Rönnblom wrote:
  Hi,
  
  I'm running Samba 3.0.23a on Linux. One of my share is a USB disk with
  a FAT32 filesystem.
  
  When copying large files from my Windows XP machine to this share,
  smbd seem to reserve (by using ftruncate()) the space needed on the
  USB disk before actually doing any copying. This ftruncate() operation
  takes quite a while when the file is large. It may even cause the
  client to time out.
  
  If I reformat the disk with ext2, ftruncate() runs fast.
  
  Is there some way of turning off this pre-allocation behaviour? I've
  consulted smb.conf(5), but I've been unable to find anything of use.
  
  Would you consider this a problem in Samba or in the VFAT filesystem
  driver?
 
 VFAT system driver. Samba is just calling ftruncate in this 
 case. You can control this behaviour by setting strict allocate = no.
 

Both strict and not strict allocation policy are painfully slow on
VFAT.

Does anyone know if it's possible to turn off this truncate-
before-write behavior in the Windows SMB client?

Thanks,
Mattias

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


[Samba] Samba PDC + Windows 2003 Std Server Trust Relationship

2006-09-04 Thread prashant n
Hi,

Is it possible to configure Windows 2003 Standard Server to have a domain trust 
relationship with a Samba PDC enabled with LDAP ?

If so how ?

regards
shann

---
Sign up and get your 30GB webmail at www.30gigs.com now!
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Linux client have problem with Samba share

2006-09-04 Thread simo
On Mon, 2006-09-04 at 00:35 -0400, Cybionet wrote:
 Greating all,
 
 I want to use Acomba (Fortune 1000) with a database on a samba share. 
 All work perfectly with Windows client, but the Linux client can't open 
 the database file. Any idea?
 
 Similar thing with Openoffice 2.x. The Windows client can save properly 
 file on samba share, but Linux client have a error message when they try 
 to save. Linux client need to press save two time to successfully save 
 they modifications.
 
 Any idea to help?

smbfs? or cifs vfs?

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: [EMAIL PROTECTED]
http://samba.org

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


[Samba] error winbind ?

2006-09-04 Thread Noc Phibee

Hi


I have this in my logs of winbond:


[2006/09/04 15:25:05, 0] nsswitch/winbindd.c:process_loop(863)
 winbindd: Exceeding 200 client connections, no idle connection found


and

[2006/09/04 15:23:10, 0] 
rpc_client/cli_pipe.c:cli_rpc_pipe_open_noauth(2229)
 cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe \NETLOGON failed with 
error NT_STATUS_BUFFER_TOO_SMALL



Anyone know this problems ?

thanks bye


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


Re: [Samba] Linux client have problem with Samba share

2006-09-04 Thread Cybionet

I use cifs.

On Mon, 2006-09-04 at 00:35 -0400, Cybionet wrote:
  

Greating all,

I want to use Acomba (Fortune 1000) with a database on a samba share. 
All work perfectly with Windows client, but the Linux client can't open 
the database file. Any idea?


Similar thing with Openoffice 2.x. The Windows client can save properly 
file on samba share, but Linux client have a error message when they try 
to save. Linux client need to press save two time to successfully save 
they modifications.


Any idea to help?



smbfs? or cifs vfs?

  


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


[Samba] Re: question about wiki.samba.org

2006-09-04 Thread Franz Pfoertsch
You are right!

but there is no link from www.samba.org to the wiki, so it is only a hidden
side.

The developers didn't use the wiki.

the article about clustering is great, we need some more of stuff like this.

I think about a page about the smb.conf, but it makes no sence when the
developer did not write into the wiki.
(http://wiki.samba.org/index.php/Samba_Features_added/changed_%28by_release%29#Changes_in_smb.conf)

I hope everybody is using the wiki

regards
Franz





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


[Samba] Re: samba + ldap query filter

2006-09-04 Thread Andreas Calvo
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Felipe Augusto van de Wiel escribió:
 On 09/03/2006 11:13 AM, Andreas Calvo escreveu:
 Hi!
 I've been using samba as PDC with a LDAP backend, and everything seems to
 work fine but, whenever a user has to auth to samba, it seems that the
 query
 that it performs is against the mail attribute, instead of the uid as I
 desired.
 Is there any way to manually specify the query filter to use agains the
 LDAP
 tree?
 
   I remeber that there is an 'ldap filter' parameter.
 
   I couldn't find it on the smb.conf manpage (I'm cc:ing
 John Terpstra), but in the [1]docs I could find a reference.
 
 1.http://us4.samba.org/samba/docs/man/Samba-HOWTO-Collection/passdb.html#id2559680

it seems that is not used in new versions of samba :(

 
 
   I hope this helps.
 
 
 Thanks!
 
   You are welcome, kind regards!
 
 --
 Felipe Augusto van de Wiel [EMAIL PROTECTED]
 Coordenadoria de Tecnologia da Informação (CTI) - SEDU/PARANACIDADE
 http://www.paranacidade.org.br/   Phone: (+55 41 3350 3300)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/EfFybtJO4snRH0RAvAwAJ0Y3tmadrjhcaLDDR2D/hgB/vu6FACfTA7G
MybM4vAk960+8OZlIU1d7DE=
=CONe
-END PGP SIGNATURE-

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


Re: [Samba] Re: question about wiki.samba.org

2006-09-04 Thread simo
On Mon, 2006-09-04 at 17:29 +0200, Franz Pfoertsch wrote:
 You are right!
 
 but there is no link from www.samba.org to the wiki, so it is only a hidden
 side.
 
 The developers didn't use the wiki.

This is not true, but we can probably use it more, I agree on this.

 the article about clustering is great, we need some more of stuff like this.
 
 I think about a page about the smb.conf, but it makes no sence when the
 developer did not write into the wiki.
 (http://wiki.samba.org/index.php/Samba_Features_added/changed_%28by_release%29#Changes_in_smb.conf)
 
 I hope everybody is using the wiki

I think that many looks at it, maybe we should make it more visible.

Deryck,
what do you think?

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: [EMAIL PROTECTED]
http://samba.org

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


Re: [Samba] Linux client have problem with Samba share

2006-09-04 Thread simo
Is there any error in the samba logs, what error does CFIS get back?
And what kernel/version of CIFS vfs are you using?

Simo.

On Mon, 2006-09-04 at 10:39 -0400, Cybionet wrote:
 I use cifs.
  On Mon, 2006-09-04 at 00:35 -0400, Cybionet wrote:

  Greating all,
 
  I want to use Acomba (Fortune 1000) with a database on a samba share. 
  All work perfectly with Windows client, but the Linux client can't open 
  the database file. Any idea?
 
  Similar thing with Openoffice 2.x. The Windows client can save properly 
  file on samba share, but Linux client have a error message when they try 
  to save. Linux client need to press save two time to successfully save 
  they modifications.
 
  Any idea to help?
  
 
  smbfs? or cifs vfs?
 

 
-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: [EMAIL PROTECTED]
http://samba.org

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


Re: [Samba] Roaming profiles errors and shares not disconnecting

2006-09-04 Thread Freitas Freitas

Hi,


2006/9/4, Felipe Augusto van de Wiel [EMAIL PROTECTED]:


On 09/02/2006 03:00 PM, Philippe LAUGET escreveu:

 Then, when users try to reopen a win session, they get a corrupted new
 profile. This new profile is fully broken, since it's not possible to
 modify any options that affect NTUSER.DAT.

 When they disconnect, smbstatus shows the user as connected on the
 machine for a long time ( from 15 minutes to hours ) after he has logged
 out. The shares that has been mounted on the client do not seem to be
 disconnected.

If you shut down the machine, this behaviour changes?



This problem is similar to my message [Samba] W2K workstation not
disconnecting without a reset, and I am still suffering with this
problem ( Samba 3.0.23b, Slackware 10.2)

I don't have problems with corrupted profiles, but I have the
same problem with users that do not disconnect, even if they logoff.
Actually, we user mandatory profiles.

And, yes, in my situation, if W2K machine makes a reset or a
shutdown, the connection to the server is closed. But, it is not a
'good' solution reset all W2K,  every time some user logs off.

As I explained in that message, I have already verified a lot of
parameters, emails, logs and Samba manual and didn't find an
explanation. Even using deadtime = 1, the connection is not closed.

I would appreciatte some help too and I really thank your attention.

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


Re: [Samba] Is this list active?

2006-09-04 Thread simo
On Mon, 2006-09-04 at 18:55 +0200, Nanni X wrote:
 Hi people,
 I don't receive any post from this lis since Aug 15th. Is this list alive?

What about checking your subscription and the list archives? :)

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: [EMAIL PROTECTED]
http://samba.org

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


Re: [Samba] extending files slow on FAT filesystems

2006-09-04 Thread Jeremy Allison
On Mon, Sep 04, 2006 at 02:55:58PM +0200, Mattias Rönnblom wrote:
 Both strict and not strict allocation policy are painfully slow on
 VFAT.
 
 Does anyone know if it's possible to turn off this truncate-
 before-write behavior in the Windows SMB client?

If strict allocate = no is slow, then it's a function of
the VFAT driver code, not Samba or the client. You'll have
to fix it there.

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


Re: [Samba] extending files slow on FAT filesystems

2006-09-04 Thread Mattias Rönnblom
Jeremy Allison [EMAIL PROTECTED] writes:

 On Mon, Sep 04, 2006 at 02:55:58PM +0200, Mattias Rönnblom wrote:
  Both strict and not strict allocation policy are painfully slow on
  VFAT.
  
  Does anyone know if it's possible to turn off this truncate-
  before-write behavior in the Windows SMB client?
 
 If strict allocate = no is slow, then it's a function of
 the VFAT driver code, not Samba or the client. You'll have
 to fix it there.
 

Is that a no? :-)

I agree the VFAT solution is the right way of fixing it, but I could
live with workarounds as well. Pre-allocating space before writing is
not strictly necessary, as far as I can tell.

I do not know enough about FAT to know if it's even possible to
implement an efficient truncate operation.

Regards,
Mattias

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


Re: [Samba] extending files slow on FAT filesystems

2006-09-04 Thread Mattias Rönnblom
Jeremy Allison [EMAIL PROTECTED] writes:

  I agree the VFAT solution is the right way of fixing it, but I could
  live with workarounds as well. Pre-allocating space before writing is
  not strictly necessary, as far as I can tell.
 
 There is no workaround possible from Samba. We're *NOT*
 pre-allocating, the driver is. That's where the fix must
 be.
 

I know. But it is possible (conceptually, at least) to work around
this issue in the clients. Whence my (slightly off-topic) question
about changing Windows XP SMB client behavior.

Regards,
Mattias

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


Re: [Samba] extending files slow on FAT filesystems

2006-09-04 Thread Jeremy Allison
On Mon, Sep 04, 2006 at 09:18:31PM +0200, Mattias Rönnblom wrote:
 
 I know. But it is possible (conceptually, at least) to work around
 this issue in the clients. Whence my (slightly off-topic) question
 about changing Windows XP SMB client behavior.

It's almost impossible to get clients to change their behaviour.
That's one of our major challenges :-).

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


[Samba] 'username = @group' not working correctly

2006-09-04 Thread Rene Fleschenberg
Hello

I am running a Samba file server (Version 3.0.22) with 'security =
share'. Here is one of my share definitions:

[archive]
path = /var/smb/archive
writeable = Yes
username = @staff
valid users = @staff

First question: In the manpage for smb.conf, it is mentioned that
'+group' expands to the Unix group named 'group'. But that does not work
for me. Using the '@group' syntax works. Is this an error in the
documentation?

However, my actual problem is this:

I need the 'username = @group' mechanism because some of my clients do
not supply a correct username. The problem is that it does not seem to
work for most user accounts. It does work for exactly two users.

After experimenting and looking at the debug logs, I concluded that
Samba only checks the supplied password against the first two users who
are listed as members of the group 'staff' in /etc/group. After checking
the second user, it aborts. These first two users can connect to the
service fine, but all others can not.

If the relevant line in /etc/group looks like this:

staff:x:1034:foo,bar,baz

Then foo and bar can connect, baz can not. If I swap bar and baz in
/etc/group, then baz can connect and bar can not.

Is this a known problem? How do I fix this?

-- 
René
OpenPGP key id: 0x63B1F5DB
JID: [EMAIL PROTECTED]



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

Re: [Samba] ftp 8x faster than samba

2006-09-04 Thread Dragan Krnic

Rober Adkins wrote:

Blaine Armsterd wrote:

Robert Adkins wrote:

Again, I suggest that you test like things with like things, test
a Windows server's file sharing and then Samba file sharing. Test FTP
on a Windows server and then FTP on a Linux server and do this on a
controlled network where only the workstation and the server are
connected via one hub that has no other network connected to it. That
way you can more clearly determine which is faster.


I tested the samve server and the same file over the same connection.
There's 2 boxes on the switch here at my house. There's no more
testing necessary. I can transfer the 723Mb file in 24 seconds using
FTP. There's no reason for Samba to take over 2 minutes.

Samba and FTP both have vastly differing overheads that affect the
transfer of files. Samba (and Windows Server's Filesharing) will never
equal FTP in performance. Neither will even come close. FTP is an
entirely different protocol that is extremely loose and insecure.


As a matter of fact, In a properly set up network there should be
no significant difference in speed between FTP and Samba WHEN
transfering large files. For tests I usually open a DOS window,
change to a share and just time the copy command in both
directions with timethis.exe, like this:

  C:\ W:
  W:\ dir  aBigFile
  31.08.2006 00:11 184.751.471 aBigFile

  W:\ timethis  copy  aBigFile  C:\Temp
  1 File(s) copied. Elapsed Time : 00:00:16.877

  W:\ timethis  copy  C:\Temp\aBigFile
  1 File(s) copied. Elapsed Time : 00:00:16.573

which means about 11 megabytes in either direction. FTP won't give
you any better speed over a 100 Mbps link from PC to switch. Even If
you connect to a gigabit switch through a proper gigabit NIC and a
good cable the limit will be the speed of client's disks. A single
disk can't give you more than about 50-60 meggabytes per second
with either FTP or Samba.

Robert Adkins wrote:

For example, if you are using ReiserFS, then you would see a marked
increase in reading/writing and subsequently file sharing for
relatively small files in, I believe, the sub-32kb range as ReiserFS
is tuned for sharing many small files very quickly. However, ReiserFS
(At least the last version I was using) wasn't great for serving large
files, like the 700MB test file you are using.


Reiserfs 3.6 serves big files via Samba just as fine as small files.
In all my tests the bounds are the throughput rate of the network
and the ability of the client's mass storage to absorb and emit data,
not the Samba software or the file system used.

So to come to the point, if someone says his FTP transfers run 8x
faster than Samba, then he/she actually means to say that his/her Samba
server provides only 1/8th of the available power. This usually means
that that person's network is not configured properly. Unfortunately,
saying ftp 8x faster than samba is insufficient diagnostic to be able
to pinpoint the problem. Even the addition in quoted mail that there
are a server a client and a switch between them just scratches the
surface. There's a lot more details we don't know about the setup.

My guess is that there is a problem in name resolution. Blaine, do you
get same transfer times when using IP-adress and unqualified name?
I mean if your server's name is samba and its IP-address is let's say
192.168.1.1, do you get the same speed/slowness when you use

  \\192.168.1.1\yourShare

as when you use

  \\samba\yourShare

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


[Samba] Failed to setup guest info

2006-09-04 Thread Dean Crawford
I've been trying for the past week to get Samba and LDAP to work 
together as a PDC on my Gentoo box and allow some XP boxes to get in.


I've read and followed the how-to's (emerged and unmergred more then a 
few times)


My LDAP accounts all seem to work when I do the ssh test into them.

Changing the domain in XP fails with the network path not found error 
even after all the registry tweaks. While tring to work through this 
issue I discoved that smbd is not starting correctly.


Code:
thebird # tail /var/log/samba/log.smbd
[2006/08/24 20:28:01, 3] smbd/uid.c:push_conn_ctx(345)
 push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2006/08/24 20:28:01, 3] smbd/sec_ctx.c:set_sec_ctx(241)
 setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2006/08/24 20:28:01, 3] smbd/sec_ctx.c:pop_sec_ctx(339)
 pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2006/08/24 20:28:01, 3] passdb/lookup_sid.c:fetch_sid_from_gid_cache(979)
 fetch sid from gid cache 65534 - S-1-22-2-65534
[2006/08/24 20:28:01, 0] smbd/server.c:main(960)
 ERROR: failed to setup guest info.


I'm thinking that the failed to setup guest info needs to be the first 
thing fixed. I thought I had disabled guest accounts in my smb.conf so 
don't understand why it fails.


I have samba-3.0.23a installed. Here is my smb.conf. I don't have 
networked printers so I commented out all the printer calls.


Code:
#=== Global Settings 
=

[global]

# 1. Server Naming Options:
  workgroup = CRAWFORD_HOUSE
  netbios name = TheBird
  server string = LDAP PDC on Samba Server %v

# 2. Printing Options:
;   printcap name = cups
;   load printers = yes
;   printing = cups
;   printer admin = @adm
;   printer admin = @Domain Admins

# 3. Logging Options:
  time server = yes
  log file = /var/log/samba/log.%m
  max log size = 50
  log level = 3

# 4. Security and Domain Membership Options:
  hosts allow = 192.168.1. 192.168.6. 127.0.0.1
#  guest account = smbguest
#  map to guest = bad user
  security = user
;  password level = 8
;  username level = 8
 encrypt passwords = yes
;  unix password sync = Yes
 pam password change = yes
;  username map = /etc/samba/smbusers

# 5. Browser Control and Networking Options:
  socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
  interfaces = lo eth0
  bind interfaces only = yes
;  interfaces = 192.168.12.2/24 192.168.13.2/24
  local master = yes
  os level = 65
  domain master = yes
;  preferred master = yes

# 6. Domain Control Options:
  domain logons = yes
;  logon script = %m.bat
;  logon script = %U.bat
  logon path = \\%L\profiles\%U
  logon drive = Z:
  logon home = \\%L\%U
  add user script = /usr/sbin/smbldap-useradd -m %u

# Scripts for LDAP backend (assumes nss_ldap is in use on the domain 
controller.

  add user script = /usr/sbin/smbldap-useradd -m %u
  delete user script = /usr/sbin/userdel -r %u
  add machine script = /usr/sbin/smbldap-useradd -w %u
  add group script = /usr/sbin/smbldap-groupadd -p %g
  delete group script = /usr/sbin/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 groups:
# Domain groups are now configured by using the 'net groupmap' tool

# Samba Password Database configuration:
# Enable SSL by using an ldaps url, or enable tls with 'ldap ssl' below.
  passdb backend = ldapsam:ldap://127.0.0.1
  ldap delete dn = Yes
;  idmap uid = 1-2
;  idmap gid = 1-2

# LDAP configuration for Domain Controlling:
  ldap admin dn = cn=Manager,dc=CRAWFORD_HOUSE,dc=NET
  ldap ssl = no

# start_tls should run on 389, but samba defaults incorrectly to 636
;  ldap port = 389
  ldap suffix = dc=CRAWFORD_HOUSE,dc=NET
;  ldap server = ldap.mydomain.com

# Seperate suffixes are available for machines, users, groups, and idmap, if
  ldap machine suffix = ou=Hosts
  ldap user suffix = ou=People
  ldap group suffix = ou=Group
  ldap idmap suffix = ou=Idmap

# 7. Name Resolution Options:
# Windows Internet Name Serving Support Section:
  wins support = yes
  name resolve order = wins lmhosts host bcast

# WINS Proxy - Tells Samba to answer name resolution queries on
;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
  dns proxy = no

# 8. File Naming Options:
;   preserve case = no
;   short preserve case = no
# Default case is normally upper case for all DOS files
;   default case = lower
# Be very careful with case sensitivity - it can break things!
;   case sensitive = no

# Share Definitions 
==

[homes]
  comment = Home Directories
  path = /home/%U
  browseable = no
  valid users = %S
  read only = no
  create mask = 0664
  directory mask = 0775

# Un-comment the following and create the netlogon directory for Domain 
Logons

[netlogon]
  comment = Network Logon Service
  path = 

Re: [Samba] 'username = @group' not working correctly

2006-09-04 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rene,

 I am running a Samba file server (Version 3.0.22) with 'security =
 share'. Here is one of my share definitions:
 
 [archive]
 path = /var/smb/archive
 writeable = Yes
 username = @staff
 valid users = @staff
 
 First question: In the manpage for smb.conf, it is mentioned that
 '+group' expands to the Unix group named 'group'. But that does not work
 for me. Using the '@group' syntax works. Is this an error in the
 documentation?

That makes no sense unless you are using NIS netgroups.

 However, my actual problem is this:
 
 I need the 'username = @group' mechanism because some of 
 my clients do not supply a correct username. The
 problem is that it does not seem to work for most
 user accounts. It does work for exactly two users.

I'd suggest moving to security = user unless you can
explain exactly why you need security = share.  Security = share
is just not well suited for cases where you want to
provide authorization based on username/password pairs.






jerry
=
Samba--- http://www.samba.org
Centeris ---  http://www.centeris.com
What man is a man who does not make the world better?  --Balian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/MOkIR7qMdg1EfYRAm5WAJ9mljhK1uS8sqUkBZ6E+B10wgUaqACff2tn
j6yNGi+IMnf4hQObUX8S83U=
=U1lc
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Usershare parameters

2006-09-04 Thread Cybionet

Greeting,

 I set usershare max shares to 10, and then with an user (and with 
different user)  I add 15 shares definition . When I use the net 
usershare list -l , I see all the 15 usershares and can access to these 
shares with a Windows client. A difference with your example in the 
documentation, I use ACL(EA) to authorize a group of user to add share 
definitions.


 I have read the majority of documentation about usershare, and in the 
one in the smb.conf, I can read 'All other share parameters not 
specified in the user defined share definition are copied from this 
named share.' Then how it is work?


usershare template share
 Names a pre-existing share used as a template for  
creating  new
 usershares. All other share parameters not specified in 
the user

 defined share definition are copied from this named share.

Thank you for your help. The usershare is a great parameter and like to 
understand how to use it perfectly.


Robert


This isn't what the template syntax is for. Look at the
man page for smb.conf for details. For usershare
max shares try setting 10 and see if this limits
it correctly. I'll test this out in the 3.0.23c code
and fix it if there's a bug.

Thanks,

Jeremy.

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


Re: [Samba] Usershare parameters

2006-09-04 Thread Jeremy Allison
On Mon, Sep 04, 2006 at 10:53:25PM -0400, Cybionet wrote:
 Greeting,
 
  I set usershare max shares to 10, and then with an user (and with 
 different user)  I add 15 shares definition . When I use the net 
 usershare list -l , I see all the 15 usershares and can access to these 
 shares with a Windows client. A difference with your example in the 
 documentation, I use ACL(EA) to authorize a group of user to add share 
 definitions.

Ok, please log a bug at bugzilla.samba.org and I'll investiate
(and fix) this.

  I have read the majority of documentation about usershare, and in the 
 one in the smb.conf, I can read 'All other share parameters not 
 specified in the user defined share definition are copied from this 
 named share.' Then how it is work?

Bit busy right now, I'll follow up on this later this week.

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


Re: svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-04 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] schrieb:
 Author: derrell
 Date: 2006-09-03 01:37:26 + (Sun, 03 Sep 2006)
 New Revision: 18012
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=18012
 
 Log:
 Should fix bug 4018.
 
 NetApp filers expect paths in Open AndX Request to have a leading slash.
 Windows clients send the leading slash, so we should too.

Hi Derrell,

a torture test for this would be nice:-)

metze

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFE++ekm70gjA5TCD8RAiD2AJwPcEWMVJEPFkkmuTuKQGSgHOwl7wCeLtT9
szqSLRWwI5Xo457ww6VuNO4=
=2pD0
-END PGP SIGNATURE-


svn commit: samba r18027 - in branches: SAMBA_3_0/source/lib SAMBA_4_0/source/lib/talloc

2006-09-04 Thread vlendec
Author: vlendec
Date: 2006-09-04 08:55:58 + (Mon, 04 Sep 2006)
New Revision: 18027

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

Log:
Fix some 64-bit warnings
Modified:
   branches/SAMBA_3_0/source/lib/talloc.c
   branches/SAMBA_3_0/source/lib/talloctort.c
   branches/SAMBA_4_0/source/lib/talloc/talloc.c
   branches/SAMBA_4_0/source/lib/talloc/testsuite.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/talloc.c
===
--- branches/SAMBA_3_0/source/lib/talloc.c  2006-09-04 04:54:20 UTC (rev 
18026)
+++ branches/SAMBA_3_0/source/lib/talloc.c  2006-09-04 08:55:58 UTC (rev 
18027)
@@ -890,7 +890,7 @@
name,
(unsigned long)talloc_total_size(ptr),
(unsigned long)talloc_total_blocks(ptr),
-   talloc_reference_count(ptr));
+   (int)talloc_reference_count(ptr));
 }
 
 /*

Modified: branches/SAMBA_3_0/source/lib/talloctort.c
===
--- branches/SAMBA_3_0/source/lib/talloctort.c  2006-09-04 04:54:20 UTC (rev 
18026)
+++ branches/SAMBA_3_0/source/lib/talloctort.c  2006-09-04 08:55:58 UTC (rev 
18027)
@@ -960,8 +960,10 @@
s1 = talloc_ptrtype(top, s1);location1 = __location__;
 
if (talloc_get_size(s1) != sizeof(struct struct1)) {
-   printf(%s: talloc_ptrtype() allocated the wrong size %u 
(should be %u)\n,
-   __location__, talloc_get_size(s1), sizeof(struct 
struct1));
+   printf(%s: talloc_ptrtype() allocated the wrong size %lu 
+  (should be %lu)\n,
+   __location__, (unsigned long)talloc_get_size(s1),
+  (unsigned long)sizeof(struct struct1));
ret = False;
}
 
@@ -974,22 +976,27 @@
s2 = talloc_array_ptrtype(top, s2, 10);location2 = __location__;
 
if (talloc_get_size(s2) != (sizeof(struct struct1) * 10)) {
-   printf(%s: talloc_array_ptrtype() allocated the wrong size %u 
(should be %u)\n,
-   __location__, talloc_get_size(s2), (sizeof(struct 
struct1)*10));
+   printf(%s: talloc_array_ptrtype() allocated the wrong size 
+  %lu (should be %lu)\n,
+   __location__, (unsigned long)talloc_get_size(s2),
+  (unsigned long)(sizeof(struct struct1)*10));
ret = False;
}
 
if (strcmp(location2, talloc_get_name(s2)) != 0) {
printf(%s: talloc_array_ptrtype() sets the wrong name '%s' 
(should be '%s')\n,
-   __location__, talloc_get_name(s2), location2);
+   __location__, talloc_get_name(s2),
+  location2);
ret = False;
}
 
s3 = talloc_array_ptrtype(top, s3, 10);location3 = __location__;
 
if (talloc_get_size(s3) != (sizeof(struct struct1 *) * 10)) {
-   printf(%s: talloc_array_ptrtype() allocated the wrong size %u 
(should be %u)\n,
-   __location__, talloc_get_size(s3), (sizeof(struct 
struct1 *)*10));
+   printf(%s: talloc_array_ptrtype() allocated the wrong size 
+  %lu (should be %lu)\n,
+   __location__, (unsigned long)talloc_get_size(s3),
+  (unsigned long)(sizeof(struct struct1 *)*10));
ret = False;
}
 
@@ -1002,8 +1009,10 @@
s4 = talloc_array_ptrtype(top, s4, 10);location4 = __location__;
 
if (talloc_get_size(s4) != (sizeof(struct struct1 **) * 10)) {
-   printf(%s: talloc_array_ptrtype() allocated the wrong size %u 
(should be %u)\n,
-   __location__, talloc_get_size(s4), (sizeof(struct 
struct1 **)*10));
+   printf(%s: talloc_array_ptrtype() allocated the wrong size 
+  %lu (should be %lu)\n,
+   __location__, (unsigned long)talloc_get_size(s4),
+  (unsigned long)(sizeof(struct struct1 **)*10));
ret = False;
}
 

Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c   2006-09-04 04:54:20 UTC 
(rev 18026)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c   2006-09-04 08:55:58 UTC 
(rev 18027)
@@ -890,7 +890,7 @@
name,
(unsigned long)talloc_total_size(ptr),
(unsigned long)talloc_total_blocks(ptr),
-   talloc_reference_count(ptr));
+   (int)talloc_reference_count(ptr));
 }
 
 /*

Modified: branches/SAMBA_4_0/source/lib/talloc/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/talloc/testsuite.c2006-09-04 04:54:20 UTC 
(rev 18026)
+++ 

svn commit: samba r18028 - in branches/SAMBA_3_0/source/nsswitch: .

2006-09-04 Thread vlendec
Author: vlendec
Date: 2006-09-04 09:29:50 + (Mon, 04 Sep 2006)
New Revision: 18028

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

Log:
Fix warnings on non-krb5 systems
Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c2006-09-04 
08:55:58 UTC (rev 18027)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c2006-09-04 
09:29:50 UTC (rev 18028)
@@ -72,10 +72,12 @@
 {
struct WINBINDD_CCACHE_ENTRY *entry =
talloc_get_type_abort(private_data, struct 
WINBINDD_CCACHE_ENTRY);
+#ifdef HAVE_KRB5
int ret;
time_t new_start;
struct timeval t;
struct WINBINDD_MEMORY_CREDS *cred_ptr = entry-cred_ptr;
+#endif
 
DEBUG(10,(krb5_ticket_refresh_handler called\n));
DEBUGADD(10,(event called for: %s, %s\n, entry-ccname, 
entry-username));

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2006-09-04 08:55:58 UTC 
(rev 18027)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2006-09-04 09:29:50 UTC 
(rev 18028)
@@ -321,6 +321,8 @@
return NT_STATUS_OK;
 }
 
+#ifdef HAVE_KRB5
+
 static const char *generate_krb5_ccache(TALLOC_CTX *mem_ctx, 
const char *type,
uid_t uid,
@@ -368,19 +370,6 @@
return gen_cc;
 }
 
-static uid_t get_uid_from_state(struct winbindd_cli_state *state)
-{
-   uid_t uid = -1;
-
-   uid = state-request.data.auth.uid;
-
-   if (uid  0) {
-   DEBUG(1,(invalid uid: '%d'\n, uid));
-   return -1;
-   }
-   return uid;
-}
-
 static void setup_return_cc_name(struct winbindd_cli_state *state, const char 
*cc)
 {
const char *type = state-request.data.auth.krb5_cc_type;
@@ -401,6 +390,21 @@
fstrcpy(state-response.data.auth.krb5ccname, cc);
 }
 
+#endif
+
+static uid_t get_uid_from_state(struct winbindd_cli_state *state)
+{
+   uid_t uid = -1;
+
+   uid = state-request.data.auth.uid;
+
+   if (uid  0) {
+   DEBUG(1,(invalid uid: '%d'\n, uid));
+   return -1;
+   }
+   return uid;
+}
+
 /**
  Authenticate a user with a clear text password using Kerberos and fill up
  ccache if required
@@ -1852,7 +1856,9 @@
  struct winbindd_cli_state *state) 
 {
NTSTATUS result = NT_STATUS_NOT_SUPPORTED;
+#ifdef HAVE_KRB5
int ret;
+#endif
 
DEBUG(3, ([%5lu]: pam dual logoff %s\n, (unsigned long)state-pid,
state-request.data.logoff.user));



svn commit: samba r18029 - in branches/SAMBA_3_0/source: auth lib libsmb rpc_parse utils

2006-09-04 Thread vlendec
Author: vlendec
Date: 2006-09-04 09:51:47 + (Mon, 04 Sep 2006)
New Revision: 18029

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

Log:
More C++ stuff
Modified:
   branches/SAMBA_3_0/source/auth/auth_util.c
   branches/SAMBA_3_0/source/lib/snprintf.c
   branches/SAMBA_3_0/source/libsmb/ntlm_check.c
   branches/SAMBA_3_0/source/libsmb/ntlmssp.c
   branches/SAMBA_3_0/source/rpc_parse/parse_prs.c
   branches/SAMBA_3_0/source/utils/ntlm_auth.c
   branches/SAMBA_3_0/source/utils/ntlm_auth_diagnostics.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===
--- branches/SAMBA_3_0/source/auth/auth_util.c  2006-09-04 09:29:50 UTC (rev 
18028)
+++ branches/SAMBA_3_0/source/auth/auth_util.c  2006-09-04 09:51:47 UTC (rev 
18029)
@@ -1374,7 +1374,7 @@
struct samu *sampass = NULL;
DOM_SID guest_sid;
BOOL ret;
-   static const char zeros[16];
+   static const char zeros[16] = { 0, };
 
if ( !(sampass = samu_new( NULL )) ) {
return NT_STATUS_NO_MEMORY;
@@ -1691,7 +1691,7 @@
auth_serversupplied_info **server_info, 
NET_USER_INFO_3 *info3) 
 {
-   static const char zeros[16];
+   static const char zeros[16] = { 0, };
 
NTSTATUS nt_status = NT_STATUS_OK;
char *found_username;

Modified: branches/SAMBA_3_0/source/lib/snprintf.c
===
--- branches/SAMBA_3_0/source/lib/snprintf.c2006-09-04 09:29:50 UTC (rev 
18028)
+++ branches/SAMBA_3_0/source/lib/snprintf.c2006-09-04 09:51:47 UTC (rev 
18029)
@@ -629,7 +629,7 @@
break;
 
case CNK_PTR:
-   cnk-strvalue = va_arg (args, void *);
+   cnk-strvalue = (char *)va_arg (args, void *);
for (i = 1; i  clist[pnum].num; i++) {
clist[pnum].chunks[i]-strvalue = cnk-strvalue;
}

Modified: branches/SAMBA_3_0/source/libsmb/ntlm_check.c
===
--- branches/SAMBA_3_0/source/libsmb/ntlm_check.c   2006-09-04 09:29:50 UTC 
(rev 18028)
+++ branches/SAMBA_3_0/source/libsmb/ntlm_check.c   2006-09-04 09:51:47 UTC 
(rev 18029)
@@ -183,7 +183,7 @@
 DATA_BLOB *user_sess_key, 
 DATA_BLOB *lm_sess_key)
 {
-   static const unsigned char zeros[8];
+   static const unsigned char zeros[8] = { 0, };
if (nt_pw == NULL) {
DEBUG(3,(ntlm_password_check: NO NT password stored for user 
%s.\n, 
 username));

Modified: branches/SAMBA_3_0/source/libsmb/ntlmssp.c
===
--- branches/SAMBA_3_0/source/libsmb/ntlmssp.c  2006-09-04 09:29:50 UTC (rev 
18028)
+++ branches/SAMBA_3_0/source/libsmb/ntlmssp.c  2006-09-04 09:51:47 UTC (rev 
18029)
@@ -1062,7 +1062,7 @@
}
 
if (!ntlmssp_state-nt_hash || !ntlmssp_state-lm_hash) {
-   static const uchar zeros[16];
+   static const uchar zeros[16] = { 0, };
/* do nothing - blobs are zero length */
 
/* session key is all zeros */

Modified: branches/SAMBA_3_0/source/rpc_parse/parse_prs.c
===
--- branches/SAMBA_3_0/source/rpc_parse/parse_prs.c 2006-09-04 09:29:50 UTC 
(rev 18028)
+++ branches/SAMBA_3_0/source/rpc_parse/parse_prs.c 2006-09-04 09:51:47 UTC 
(rev 18029)
@@ -1626,7 +1626,7 @@
uchar digest_final[16];
uchar confounder[8];
uchar seq_num[8];
-   static const uchar nullbytes[8];
+   static const uchar nullbytes[8] = { 0, };
 
static const uchar schannel_seal_sig[8] = SCHANNEL_SEAL_SIGNATURE;
static const uchar schannel_sign_sig[8] = SCHANNEL_SIGN_SIGNATURE;

Modified: branches/SAMBA_3_0/source/utils/ntlm_auth.c
===
--- branches/SAMBA_3_0/source/utils/ntlm_auth.c 2006-09-04 09:29:50 UTC (rev 
18028)
+++ branches/SAMBA_3_0/source/utils/ntlm_auth.c 2006-09-04 09:51:47 UTC (rev 
18029)
@@ -479,7 +479,7 @@
 
 static NTSTATUS winbind_pw_check(struct ntlmssp_state *ntlmssp_state, 
DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key) 
 {
-   static const char zeros[16];
+   static const char zeros[16] = { 0, };
NTSTATUS nt_status;
char *error_string;
uint8 lm_key[8]; 

Modified: branches/SAMBA_3_0/source/utils/ntlm_auth_diagnostics.c
===
--- branches/SAMBA_3_0/source/utils/ntlm_auth_diagnostics.c 2006-09-04 
09:29:50 UTC (rev 18028)
+++ branches/SAMBA_3_0/source/utils/ntlm_auth_diagnostics.c 2006-09-04 

svn commit: samba r18030 - in branches/SAMBA_3_0/source/tdb/common: .

2006-09-04 Thread vlendec
Author: vlendec
Date: 2006-09-04 10:12:04 + (Mon, 04 Sep 2006)
New Revision: 18030

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

Log:
When compiling with C++, nested structs lead to nested class definitions which
are not compatible. I am aware that this would be a huge change in Samba4, but
I would like to see it in the code that is shared.

Stefan, when you do merge work, can you get this across to Samba4?

Thanks,

Volker


Modified:
   branches/SAMBA_3_0/source/tdb/common/transaction.c


Changeset:
Modified: branches/SAMBA_3_0/source/tdb/common/transaction.c
===
--- branches/SAMBA_3_0/source/tdb/common/transaction.c  2006-09-04 09:51:47 UTC 
(rev 18029)
+++ branches/SAMBA_3_0/source/tdb/common/transaction.c  2006-09-04 10:12:04 UTC 
(rev 18030)
@@ -88,6 +88,12 @@
 
 */
 
+struct tdb_transaction_el {
+   struct tdb_transaction_el *next, *prev;
+   tdb_off_t offset;
+   tdb_len_t length;
+   unsigned char *data;
+};
 
 /*
   hold the context of any current transaction
@@ -105,12 +111,7 @@
   ordered, with first element at the front of the list. It
   needs to be doubly linked as the read/write traversals need
   to be backwards, while the commit needs to be forwards */
-   struct tdb_transaction_el {
-   struct tdb_transaction_el *next, *prev;
-   tdb_off_t offset;
-   tdb_len_t length;
-   unsigned char *data;
-   } *elements, *elements_last;
+   struct tdb_transaction_el *elements, *elements_last;
 
/* non-zero when an internal transaction error has
   occurred. All write operations will then fail until the



Re: svn commit: samba r18030 - in branches/SAMBA_3_0/source/tdb/common: .

2006-09-04 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] schrieb:
 Author: vlendec
 Date: 2006-09-04 10:12:04 + (Mon, 04 Sep 2006)
 New Revision: 18030
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=18030
 
 Log:
 When compiling with C++, nested structs lead to nested class definitions which
 are not compatible. I am aware that this would be a huge change in Samba4, but
 I would like to see it in the code that is shared.
Hi Volker,

Does this also apply to unnamed substructures?

like this:

struct foo {
int bla;
struct {
int val1;
int val1;
} vals;
};

and what's with unions with unnamed substructs?

like this:

union foo {
struct {
struct {
int val1;
} in;
struct {
int val2;
} out;
} level1;
};

metze
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFE+/30m70gjA5TCD8RAjXzAJ9m/wOTXDvDp726ScPn2fKNaP0Q/wCeNBNh
1iuMAbLtGaq9Y7AdNb2k9RE=
=V1I+
-END PGP SIGNATURE-


Rev 9127: Add some macros to make using the ui API easier. in file:///home/jelmer/bzr.samba/4.0-unittest/

2006-09-04 Thread Jelmer Vernooij

revno: 9127
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: unittest
timestamp: Mon 2006-09-04 12:43:45 +0200
message:
  Add some macros to make using the ui API easier.
added:
  source/torture/torture-dummy.h 
torturedummy.h-20060904015825-q6pfqeb8jgju5exd-1
modified:
  source/torture/local/irpc.csvn-v1:[EMAIL PROTECTED]
  source/torture/ui.csvn-v1:[EMAIL PROTECTED]
  source/torture/ui.hsvn-v1:[EMAIL PROTECTED]


svn commit: smb-build r67 - in trunk: . build/m4 build/smb_build

2006-09-04 Thread jelmer
Author: jelmer
Date: 2006-09-04 11:28:24 + (Mon, 04 Sep 2006)
New Revision: 67

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=smb-buildrev=67

Log:
Test availability of __VA_ARGS__
Added:
   trunk/foo.c
Modified:
   trunk/Makefile.in
   trunk/build/m4/rewrite.m4
   trunk/build/smb_build/makefile.pm


Changeset:
Sorry, the patch is too large (367 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=smb-buildrev=67


Rev 9496: Add test for __VA_ARGS__ in file:///home/jelmer/bzr.samba/4.0-replace/

2006-09-04 Thread Jelmer Vernooij

revno: 9496
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: replace
timestamp: Mon 2006-09-04 13:53:05 +0200
message:
  Add test for __VA_ARGS__
modified:
  source/lib/replace/config.m4


Re: svn commit: samba r18030 - in branches/SAMBA_3_0/source/tdb/common: .

2006-09-04 Thread tridge
Volker,

  When compiling with C++, nested structs lead to nested class definitions 
  which
  are not compatible. I am aware that this would be a huge change in Samba4, 
  but
  I would like to see it in the code that is shared.

this may be a step too far. C and C++ are different languages, and
while it is useful to be able to get warnings from g++ is nice, I
don't think it should lead us to worse coding practices. Nesting
structure definitions keeps structure definitions cleaner, and keeps
related structures closer together.

Do you actually have plans to use real C++ somewhere with the Samba
code, or is this purely for the warnings?

Perhaps it might gain more to put some effort into adapting sparse for
warnings that are applicable to Samba code? It is a much more powerful
static analyser than g++ ever will be, and doesn't require a change of
language :-)

Cheers, Tridge


svn commit: samba r18031 - in branches/SAMBA_4_0: . source/dsdb/samdb/ldb_modules source/heimdal/lib/com_err source/heimdal/lib/hdb source/heimdal_build source/lib/ldb source/lib/ldb/include source/li

2006-09-04 Thread jelmer
Author: jelmer
Date: 2006-09-04 12:21:42 + (Mon, 04 Sep 2006)
New Revision: 18031

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

Log:
Merge my replace fixes:
 * libreplace can now build stand-alone
 * add stub testsuite for libreplace
 * make talloc/tdb/ldb use libreplace

Added:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in
   branches/SAMBA_4_0/source/lib/replace/autogen.sh
   branches/SAMBA_4_0/source/lib/replace/configure.ac
   branches/SAMBA_4_0/source/lib/replace/replace.m4
   branches/SAMBA_4_0/source/lib/replace/test/
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
   branches/SAMBA_4_0/source/lib/replace/timegm.c
   branches/SAMBA_4_0/source/lib/talloc/configure.ac
   branches/SAMBA_4_0/source/lib/tdb/configure.ac
Removed:
   branches/SAMBA_4_0/source/lib/ldb/replace/
   branches/SAMBA_4_0/source/lib/talloc/configure.in
   branches/SAMBA_4_0/source/lib/tdb/configure.in
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/.bzrignore
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/config.mk
   branches/SAMBA_4_0/source/heimdal/lib/com_err/lex.c
   branches/SAMBA_4_0/source/heimdal/lib/hdb/hdb.c
   branches/SAMBA_4_0/source/heimdal_build/config.h
   branches/SAMBA_4_0/source/lib/ldb/Makefile.in
   branches/SAMBA_4_0/source/lib/ldb/autogen.sh
   branches/SAMBA_4_0/source/lib/ldb/config.mk
   branches/SAMBA_4_0/source/lib/ldb/configure.in
   branches/SAMBA_4_0/source/lib/ldb/include/includes.h
   branches/SAMBA_4_0/source/lib/replace/README
   branches/SAMBA_4_0/source/lib/replace/config.m4
   branches/SAMBA_4_0/source/lib/replace/config.mk
   branches/SAMBA_4_0/source/lib/replace/dlfcn.c
   branches/SAMBA_4_0/source/lib/replace/getpass.c
   branches/SAMBA_4_0/source/lib/replace/repdir/repdir.c
   branches/SAMBA_4_0/source/lib/replace/replace.c
   branches/SAMBA_4_0/source/lib/replace/replace.h
   branches/SAMBA_4_0/source/lib/replace/snprintf.c
   branches/SAMBA_4_0/source/lib/talloc/config.mk
   branches/SAMBA_4_0/source/lib/tdb/Makefile.in


Changeset:
Sorry, the patch is too large (4165 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=18031


svn commit: samba r18032 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 12:31:23 + (Mon, 04 Sep 2006)
New Revision: 18032

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

Log:

added a 'make distclean'

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 12:21:42 UTC 
(rev 18031)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 12:31:23 UTC 
(rev 18032)
@@ -34,4 +34,12 @@
$(CC) $(CFLAGS) -c $ -o $@
 
 clean:
-   rm -f *.o
+   rm -f *.o *.a testsuite
+
+distclean: clean
+   rm -f *~ */*~
+   rm -rf autom4te.cache
+   rm -f configure \
+   config.log config.status \
+   replace_config.h
+   rm -f Makefile



svn commit: samba r18033 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 12:31:40 + (Mon, 04 Sep 2006)
New Revision: 18033

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

Log:

added install-sh, needed for standalone libreplace build

Added:
   branches/SAMBA_4_0/source/lib/replace/install-sh


Changeset:
Added: branches/SAMBA_4_0/source/lib/replace/install-sh
===
--- branches/SAMBA_4_0/source/lib/replace/install-sh2006-09-04 12:31:23 UTC 
(rev 18032)
+++ branches/SAMBA_4_0/source/lib/replace/install-sh2006-09-04 12:31:40 UTC 
(rev 18033)
@@ -0,0 +1,238 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog=${MVPROG-mv}
+cpprog=${CPPROG-cp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+chgrpprog=${CHGRPPROG-chgrp}
+stripprog=${STRIPPROG-strip}
+rmprog=${RMPROG-rm}
+mkdirprog=${MKDIRPROG-mkdir}
+
+transformbasename=
+transform_arg=
+instcmd=$mvprog
+chmodcmd=$chmodprog 0755
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd=$rmprog -f
+mvcmd=$mvprog
+src=
+dst=
+dir_arg=
+
+while [ x$1 != x ]; do
+case $1 in
+   -c) instcmd=$cpprog
+   shift
+   continue;;
+
+   -d) dir_arg=true
+   shift
+   continue;;
+
+   -m) chmodcmd=$chmodprog $2
+   shift
+   shift
+   continue;;
+
+   -o) chowncmd=$chownprog $2
+   shift
+   shift
+   continue;;
+
+   -g) chgrpcmd=$chgrpprog $2
+   shift
+   shift
+   continue;;
+
+   -s) stripcmd=$stripprog
+   shift
+   continue;;
+
+   -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+   shift
+   continue;;
+
+   -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+   shift
+   continue;;
+
+   *)  if [ x$src = x ]
+   then
+   src=$1
+   else
+   # this colon is to work around a 386BSD /bin/sh bug
+   :
+   dst=$1
+   fi
+   shift
+   continue;;
+esac
+done
+
+if [ x$src = x ]
+then
+   echo install:  no input file specified
+   exit 1
+else
+   true
+fi
+
+if [ x$dir_arg != x ]; then
+   dst=$src
+   src=
+   
+   if [ -d $dst ]; then
+   instcmd=:
+   else
+   instcmd=mkdir
+   fi
+else
+
+# Waiting for this to be detected by the $instcmd $src $dsttmp command
+# might cause directories to be created, which would be especially bad 
+# if $src (and thus $dsttmp) contains '*'.
+
+   if [ -f $src -o -d $src ]
+   then
+   true
+   else
+   echo install:  $src does not exist
+   exit 1
+   fi
+   
+   if [ x$dst = x ]
+   then
+   echo install:  no destination specified
+   exit 1
+   else
+   true
+   fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+   if [ -d $dst ]
+   then
+   dst=$dst/`basename $src`
+   else
+   true
+   fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d $dstdir ]; then
+defaultIFS='   
+'
+IFS=${IFS-${defaultIFS}}
+
+oIFS=${IFS}
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@[EMAIL PROTECTED]' -e '[EMAIL 
PROTECTED]@/@'`
+IFS=${oIFS}
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+   pathcomp=${pathcomp}${1}
+   shift
+
+   if [ ! -d ${pathcomp} ] ;
+then
+   $mkdirprog ${pathcomp}
+   else
+   true
+   fi
+
+   pathcomp=${pathcomp}/
+done
+fi
+
+if [ x$dir_arg != x ]
+then
+   $doit $instcmd $dst 
+
+   if [ x$chowncmd != x ]; then $doit $chowncmd $dst; else true ; fi 
+   if [ x$chgrpcmd != x ]; then $doit $chgrpcmd $dst; else true ; fi 
+   if [ x$stripcmd != x ]; then $doit $stripcmd $dst; else true ; fi 
+   if [ x$chmodcmd != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+   if [ x$transformarg = x ] 
+   then
+

svn commit: samba r18034 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 12:36:06 + (Mon, 04 Sep 2006)
New Revision: 18034

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

Log:

fixed build of libreplace outside of source directory

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 12:31:40 UTC 
(rev 18033)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 12:36:06 UTC 
(rev 18034)
@@ -9,6 +9,8 @@
 builddir = @builddir@
 INSTALL = @INSTALL@
 
+CFLAGS=-I. -I$(srcdir) @CFLAGS@
+
 OBJS = dlfcn.o getpass.o replace.o snprintf.o
 
 all: libreplace.a
@@ -31,7 +33,7 @@
 .c.o:
@echo Compiling $*.c
@mkdir -p `dirname [EMAIL PROTECTED]
-   $(CC) $(CFLAGS) -c $ -o $@
+   @$(CC) $(CFLAGS) -c $ -o $@
 
 clean:
rm -f *.o *.a testsuite



Rev 9569: Add missing file in file:///home/jelmer/bzr.samba/4.0-replace/

2006-09-04 Thread Jelmer Vernooij

revno: 9569
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: replace
timestamp: Mon 2006-09-04 14:47:21 +0200
message:
  Add missing file
added:
  source/lib/ldb/replace.m4
renamed:
  source/lib/ldb/configure.in = source/lib/ldb/configure.ac


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

2006-09-04 Thread jelmer
Author: jelmer
Date: 2006-09-04 12:49:17 + (Mon, 04 Sep 2006)
New Revision: 18036

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

Log:
Add missing file
Added:
   branches/SAMBA_4_0/source/lib/ldb/configure.ac
   branches/SAMBA_4_0/source/lib/ldb/replace.m4
Removed:
   branches/SAMBA_4_0/source/lib/ldb/configure.in
Modified:
   branches/SAMBA_4_0/


Changeset:

Property changes on: branches/SAMBA_4_0
___
Name: bzr:merge
   - [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

   + [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Copied: branches/SAMBA_4_0/source/lib/ldb/configure.ac (from rev 18035, 
branches/SAMBA_4_0/source/lib/ldb/configure.in)
===
--- branches/SAMBA_4_0/source/lib/ldb/configure.in  2006-09-04 12:39:41 UTC 
(rev 18035)
+++ branches/SAMBA_4_0/source/lib/ldb/configure.ac  2006-09-04 12:49:17 UTC 
(rev 18036)
@@ -0,0 +1,79 @@
+AC_PREREQ(2.50)
+AC_DEFUN([AC_CHECK_LIB_EXT], [
+   AC_CHECK_LIB([$1],[$3],[$4],[$5],[$7])
+   ac_cv_lib_ext_$1_$3=$ac_cv_lib_$1_$3
+])
+AC_DEFUN([AC_CHECK_FUNC_EXT], [
+   AC_CHECK_FUNC([$1],[$3],[$4])
+   ac_cv_func_ext_$1=$ac_cv_func_$1
+])
+AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ])
+AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ])
+AC_DEFUN([SMB_EXT_LIB], [echo -n ])
+AC_DEFUN([SMB_ENABLE], [echo -n ])
+AC_INIT(include/ldb.h)
+AC_CONFIG_SRCDIR([common/ldb.c])
+AC_PROG_CC
+
+if test $ac_cv_prog_gcc = yes; then
+   CFLAGS=$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith 
-Wcast-qual -Wcast-align -Wwrite-strings
+fi
+
+WITH_GCOV=0
+AC_ARG_ENABLE(gcov,
+   AS_HELP_STRING([--enable-gcov],[enable GCOV code coverage tests]),
+   [ WITH_GCOV=1])
+AC_SUBST(WITH_GCOV)
+if test x$with_gcov_support = xyes; then
+   CFLAGS=$CFLAGS -ftest-coverage -fprofile-arcs
+   LIBS=$LIBS -lgcov
+fi
+
+AC_SYS_LARGEFILE
+AC_FUNC_MMAP
+AC_PATH_PROG(XSLTPROC,xsltproc)
+AC_PATH_PROG(DOXYGEN,doxygen)
+AC_PATH_PROG(GCOV,gcov)
+AC_PATH_PROG(SLAPD,slapd)
+AC_CHECK_HEADERS(stdint.h dlfcn.h)
+AC_CONFIG_HEADER(include/config.h)
+AC_SEARCH_LIBS(dlopen, dl, AC_DEFINE(HAVE_DLOPEN, [1], [have dlopen]))
+
+SHLIBEXT=so # Should be set based on OS later on
+AC_SUBST(SHLIBEXT)
+
+AC_DEFINE_UNQUOTED(MODULESDIR, LIBDIR /ldb , [Modules directory] )
+AC_SUBST(MODULESDIR)
+
+TESTS=
+EXTRA_OBJ=
+
+sinclude(popt.m4)
+sinclude(replace/config.m4)
+
+sinclude(ldap.m4)
+if test x$with_ldap_support = xyes; then
+   LIBS=$LIBS -llber -lldap
+   CFLAGS=$CFLAGS -DHAVE_LDAP=1
+   EXTRA_OBJ=$EXTRA_OBJ ldb_ldap/ldb_ldap.o
+   TESTS=$TESTS test-ldap.sh
+fi
+
+sinclude(sqlite3.m4)
+if test x$with_sqlite3_support = xyes; then
+   LIBS=$LIBS -lsqlite3
+   CFLAGS=$CFLAGS -DHAVE_SQLITE3=1
+   EXTRA_OBJ=$EXTRA_OBJ ldb_sqlite3/ldb_sqlite3.o
+   TESTS=$TESTS test-sqlite3.sh
+fi
+
+AC_SUBST(TESTS)
+AC_SUBST(EXTRA_OBJ)
+
+sinclude(replace.m4)
+SMB_REPLACE_FUNCS(strtoll)
+
+sinclude(config.m4)
+sinclude(../talloc/config.m4)
+sinclude(../tdb/config.m4)
+AC_OUTPUT(Makefile ldb.pc)

Deleted: branches/SAMBA_4_0/source/lib/ldb/configure.in
===
--- branches/SAMBA_4_0/source/lib/ldb/configure.in  2006-09-04 12:39:41 UTC 
(rev 18035)
+++ branches/SAMBA_4_0/source/lib/ldb/configure.in  2006-09-04 12:49:17 UTC 
(rev 18036)
@@ -1,79 +0,0 @@
-AC_PREREQ(2.50)
-AC_DEFUN([AC_CHECK_LIB_EXT], [
-   AC_CHECK_LIB([$1],[$3],[$4],[$5],[$7])
-   ac_cv_lib_ext_$1_$3=$ac_cv_lib_$1_$3
-])
-AC_DEFUN([AC_CHECK_FUNC_EXT], [
-   AC_CHECK_FUNC([$1],[$3],[$4])
-   ac_cv_func_ext_$1=$ac_cv_func_$1
-])
-AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ])
-AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ])
-AC_DEFUN([SMB_EXT_LIB], [echo -n ])
-AC_DEFUN([SMB_ENABLE], [echo -n ])
-AC_INIT(include/ldb.h)
-AC_CONFIG_SRCDIR([common/ldb.c])
-AC_PROG_CC
-
-if test $ac_cv_prog_gcc = yes; then
-   CFLAGS=$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith 
-Wcast-qual -Wcast-align -Wwrite-strings
-fi
-
-WITH_GCOV=0
-AC_ARG_ENABLE(gcov,
-   AS_HELP_STRING([--enable-gcov],[enable GCOV code coverage tests]),
-   [ WITH_GCOV=1])
-AC_SUBST(WITH_GCOV)
-if test x$with_gcov_support = xyes; then
-   CFLAGS=$CFLAGS -ftest-coverage -fprofile-arcs
-   LIBS=$LIBS -lgcov
-fi
-
-AC_SYS_LARGEFILE
-AC_FUNC_MMAP
-AC_PATH_PROG(XSLTPROC,xsltproc)
-AC_PATH_PROG(DOXYGEN,doxygen)
-AC_PATH_PROG(GCOV,gcov)
-AC_PATH_PROG(SLAPD,slapd)
-AC_CHECK_HEADERS(stdint.h dlfcn.h)
-AC_CONFIG_HEADER(include/config.h)
-AC_SEARCH_LIBS(dlopen, dl, AC_DEFINE(HAVE_DLOPEN, [1], [have dlopen]))
-
-SHLIBEXT=so # Should be set based on OS later on
-AC_SUBST(SHLIBEXT)
-
-AC_DEFINE_UNQUOTED(MODULESDIR, LIBDIR /ldb , [Modules directory] )
-AC_SUBST(MODULESDIR)
-
-TESTS=
-EXTRA_OBJ=
-
-sinclude(popt.m4)
-sinclude(replace/config.m4)
-
-sinclude(ldap.m4)
-if test x$with_ldap_support = xyes; then
-   LIBS=$LIBS -llber 

Rev 9570: Include header with time_t if needed. in file:///home/jelmer/bzr.samba/4.0-replace/

2006-09-04 Thread Jelmer Vernooij

revno: 9570
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: replace
timestamp: Mon 2006-09-04 14:55:20 +0200
message:
  Include header with time_t if needed.
modified:
  source/lib/replace/replace.h


svn commit: samba r18037 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 12:56:14 + (Mon, 04 Sep 2006)
New Revision: 18037

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

Log:

added 'make installcheck' target

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 12:49:17 UTC 
(rev 18036)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 12:56:14 UTC 
(rev 18037)
@@ -26,6 +26,8 @@
 test: testsuite
./testsuite
 
+installcheck: install test
+
 TEST_OBJS = test/testsuite.o
 
 testsuite: libreplace.a $(TEST_OBJS)



svn commit: samba r18038 - in branches/SAMBA_4_0/source/lib/replace/test: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 12:57:40 + (Mon, 04 Sep 2006)
New Revision: 18038

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

Log:

make test fns static

Modified:
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
12:56:14 UTC (rev 18037)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
12:57:40 UTC (rev 18038)
@@ -27,236 +27,236 @@
 #include ../replace.h
 #include stdio.h
 
-int test_ftruncate()
+static int test_ftruncate()
 {
/* FIXME */
return true;
 }
 
-int test_strlcpy()
+static int test_strlcpy()
 {
/* FIXME */
return true;
 }
 
-int test_strlcat()
+static int test_strlcat()
 {
/* FIXME */
return true;
 }
 
-int test_mktime()
+static int test_mktime()
 {
/* FIXME */
return true;
 }
 
-int test_rename()
+static int test_rename()
 {
/* FIXME */
return true;
 }
 
-int test_innetgr()
+static int test_innetgr()
 {
/* FIXME */
return true;
 }
 
-int test_initgroups()
+static int test_initgroups()
 {
/* FIXME */
return true;
 }
 
-int test_memmove()
+static int test_memmove()
 {
/* FIXME */
return true;
 }
 
-int test_strdup()
+static int test_strdup()
 {
/* FIXME */
return true;
 }  
 
-int test_setlinebuf()
+static int test_setlinebuf()
 {
/* FIXME */
return true;
 }
 
-int test_vsyslog()
+static int test_vsyslog()
 {
/* FIXME */
return true;
 }
 
-int test_timegm()
+static int test_timegm()
 {
/* FIXME */
return true;
 }
 
-int test_setenv()
+static int test_setenv()
 {
/* FIXME */
return true;
 }
 
-int test_strndup()
+static int test_strndup()
 {
/* FIXME */
return true;
 }
 
-int test_strnlen()
+static int test_strnlen()
 {
/* FIXME */
return true;
 }
 
-int test_waitpid()
+static int test_waitpid()
 {
/* FIXME */
return true;
 }
 
-int test_seteuid()
+static int test_seteuid()
 {
/* FIXME */
return true;
 }
 
-int test_setegid()
+static int test_setegid()
 {
/* FIXME */
return true;
 }
 
-int test_asprintf()
+static int test_asprintf()
 {
/* FIXME */
return true;
 }
 
-int test_snprintf()
+static int test_snprintf()
 {
/* FIXME */
return true;
 }
 
-int test_vasprintf()
+static int test_vasprintf()
 {
/* FIXME */
return true;
 }
 
-int test_vsnprintf()
+static int test_vsnprintf()
 {
/* FIXME */
return true;
 }
 
-int test_opendir()
+static int test_opendir()
 {
/* FIXME */
return true;
 }
 
-int test_readdir()
+static int test_readdir()
 {
/* FIXME */
return true;
 }
 
-int test_telldir()
+static int test_telldir()
 {
/* FIXME */
return true;
 }
 
-int test_seekdir()
+static int test_seekdir()
 {
/* FIXME */
return true;
 }
 
-int test_dlopen()
+static int test_dlopen()
 {
/* FIXME: test dlopen, dlsym, dlclose, dlerror */
return true;
 }
 
 
-int test_chroot()
+static int test_chroot()
 {
/* FIXME: chroot() */
return true;
 }
 
-int test_bzero()
+static int test_bzero()
 {
/* FIXME: bzero */
return true;
 }
 
-int test_strerror()
+static int test_strerror()
 {
/* FIXME */
return true;
 }
 
-int test_errno()
+static int test_errno()
 {
/* FIXME */
return true;
 }
 
-int test_mkdtemp()
+static int test_mkdtemp()
 {
/* FIXME */
return true;
 }
 
-int test_mkstemp()
+static int test_mkstemp()
 {
/* FIXME */
return true;
 }
 
-int test_pread()
+static int test_pread()
 {
/* FIXME */
return true;
 }
 
-int test_pwrite()
+static int test_pwrite()
 {
/* FIXME */
return true;
 }
 
-int test_getpass()
+static int test_getpass()
 {
/* FIXME */
return true;
 }
 
-int test_inet_ntoa()
+static int test_inet_ntoa()
 {
/* FIXME */
return true;
 }
 
-int test_strtoll()
+static int test_strtoll()
 {
/* FIXME */
return true;
 }
 
-int test_strtoull()
+static int test_strtoull()
 {
/* FIXME */
return true;
@@ -278,25 +278,25 @@
 INT32_MAX
 */
 
-int test_va_copy()
+static int test_va_copy()
 {
/* FIXME */
return true;
 }
 
-int test_FUNCTION()
+static int test_FUNCTION()
 {
/* FIXME: test __FUNCTION__ macro */
return true;
 }
 
-int test_MIN()
+static int test_MIN()
 {
/* FIXME */
return true;
 }
 
-int test_MAX()
+static int test_MAX()
 {
/* FIXME */
return true;



Rev 9571: Merge upstream changes in file:///home/jelmer/bzr.samba/4.0-replace/

2006-09-04 Thread Jelmer Vernooij

revno: 9571
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: replace
timestamp: Mon 2006-09-04 14:59:30 +0200
message:
  Merge upstream changes
removed:
  source/lib/ldb/configure.ac
  source/lib/ldb/replace.m4
added:
  source/lib/ldb/configure.ac
  source/lib/ldb/replace.m4
modified:
  source/lib/replace/Makefile.in

merged: svn-v1:[EMAIL PROTECTED]
committer: tridge
timestamp: Mon 2006-09-04 12:56:14 +
message:
  
  added 'make installcheck' target

merged: svn-v1:[EMAIL PROTECTED]
committer: jelmer
timestamp: Mon 2006-09-04 12:49:17 +
message:
  Add missing file


Rev 9572: Merge upstream changes in file:///home/jelmer/bzr.samba/4.0-replace/

2006-09-04 Thread Jelmer Vernooij

revno: 9572
committer: Jelmer Vernooij [EMAIL PROTECTED]
branch nick: replace
timestamp: Mon 2006-09-04 15:01:26 +0200
message:
  Merge upstream changes
modified:
  source/lib/replace/test/testsuite.c

merged: svn-v1:[EMAIL PROTECTED]
committer: tridge
timestamp: Mon 2006-09-04 12:57:40 +
message:
  
  make test fns static


svn commit: samba r18039 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread jelmer
Author: jelmer
Date: 2006-09-04 13:07:29 + (Mon, 04 Sep 2006)
New Revision: 18039

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

Log:
Include header with time_t if needed.

Modified:
   branches/SAMBA_4_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===
--- branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-04 12:57:40 UTC 
(rev 18038)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-04 13:07:29 UTC 
(rev 18039)
@@ -76,11 +76,21 @@
 void *rep_memmove(void *dest,const void *src,int size);
 #endif
 
+#if !defined(HAVE_MKTIME) || !defined(HAVE_TIMEGM)
+#include sys/time.h
+#endif
+
 #ifndef HAVE_MKTIME
 #define mktime rep_mktime
 time_t rep_mktime(struct tm *t);
 #endif
 
+#ifndef HAVE_TIMEGM
+struct tm;
+#define timegm rep_timegm
+time_t rep_timegm(struct tm *tm);
+#endif
+
 #ifndef HAVE_STRLCPY
 #define strlcpy rep_strlcpy
 size_t rep_strlcpy(char *d, const char *s, size_t bufsize);
@@ -145,11 +155,6 @@
 #define bzero(a,b) memset((a),'\0',(b))
 #endif
 
-#ifndef HAVE_TIMEGM
-struct tm;
-#define timegm rep_timegm
-time_t rep_timegm(struct tm *tm);
-#endif
 
 #ifndef PRINTF_ATTRIBUTE
 #if __GNUC__ = 3



svn commit: samba r18040 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread jelmer
Author: jelmer
Date: 2006-09-04 13:10:14 + (Mon, 04 Sep 2006)
New Revision: 18040

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

Log:
Use only one strnlen implementation
Modified:
   branches/SAMBA_4_0/source/lib/replace/replace.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-04 13:07:29 UTC 
(rev 18039)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-04 13:10:14 UTC 
(rev 18040)
@@ -375,7 +375,7 @@
 /**
  Some platforms don't have strnlen
 **/
- size_t strnlen(const char *s, size_t max)
+ size_t rep_strnlen(const char *s, size_t max)
 {
 size_t len;
   
@@ -540,19 +540,6 @@
 }
 #endif
 
-#ifndef HAVE_STRNLEN
-/**
- Some platforms don't have strnlen
-**/
-size_t rep_strnlen(const char *s, size_t n)
-{
-   int i;
-   for (i=0; s[i]  in; i++)
-   /* noop */ ;
-   return i;
-}
-#endif
-
 #ifndef HAVE_STRTOLL
 long long int rep_strtoll(const char *str, char **endptr, int base)
 {



svn commit: samba r18041 - in branches/SAMBA_4_0/source/lib/replace: . test

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 13:10:49 + (Mon, 04 Sep 2006)
New Revision: 18041

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

Log:

started on the bodies of the testsuite functions for libreplace

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:10:14 UTC 
(rev 18040)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:10:49 UTC 
(rev 18041)
@@ -13,7 +13,7 @@
 
 OBJS = dlfcn.o getpass.o replace.o snprintf.o
 
-all: libreplace.a
+all: libreplace.a testsuite
 
 install: all
mkdir -p $(libdir)

Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
13:10:14 UTC (rev 18040)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
13:10:49 UTC (rev 18041)
@@ -27,9 +27,51 @@
 #include ../replace.h
 #include stdio.h
 
+#if HAVE_STDLIB_H
+#include stdlib.h
+#endif
+
+#if HAVE_TYPES_H
+#include sys/types.h
+#endif
+
+#if HAVE_SYS_STAT_H
+#include sys/stat.h
+#endif
+
+#include fcntl.h
+#include errno.h
+
+#define TESTFILE testfile.dat
+
+/*
+  test ftruncate() function
+ */
 static int test_ftruncate()
 {
-   /* FIXME */
+   struct stat st;
+   int fd, i;
+   const int size;
+   printf(testing ftruncate\n);
+   unlink(TESTFILE);
+   fd = open(TESTFILE, O_RDWR|O_CREAT, 0600);
+   if (fd == -1) {
+   printf(creating '%s' failed - %s\n, TESTFILE, 
strerror(errno));
+   return false;
+   }
+   if (ftruncate(fd, size) != 0) {
+   printf(ftruncate failed - %s\n, strerror(errno));
+   return false;
+   }
+   if (fstat(fd, st) != 0) {
+   printf(fstat failed - %s\n, strerror(errno));
+   return false;
+   }
+   if (st.st_size != size) {
+   printf(ftruncate gave wrong size %d - expected %d\n,
+  (int)st.st_size, size);
+   return false;
+   }
return true;
 }
 



Re: svn commit: samba r18025 - in branches/SAMBA_4_0/source/libcli/ldap: .

2006-09-04 Thread simo
On Mon, 2006-09-04 at 03:59 +, [EMAIL PROTECTED] wrote:
 Author: abartlet
 Date: 2006-09-04 03:59:04 + (Mon, 04 Sep 2006)
 New Revision: 18025
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=18025
 
 Log:
 Don't try to set a target host if there isn't one (such as with ldapi://).

Shouldn't we try use localhost or (hostname -f) here?

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: [EMAIL PROTECTED]
http://samba.org



svn commit: samba r18042 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 13:27:16 + (Mon, 04 Sep 2006)
New Revision: 18042

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

Log:

testsuite needs to link to libreplace.a :-)

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:10:49 UTC 
(rev 18041)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:27:16 UTC 
(rev 18042)
@@ -31,7 +31,7 @@
 TEST_OBJS = test/testsuite.o
 
 testsuite: libreplace.a $(TEST_OBJS)
-   $(CC) -o testsuite $(TEST_OBJS)
+   $(CC) -o testsuite $(TEST_OBJS) -L. -lreplace
 
 .c.o:
@echo Compiling $*.c



svn commit: samba r18043 - in branches/SAMBA_4_0/source/lib/replace/test: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 13:28:54 + (Mon, 04 Sep 2006)
New Revision: 18043

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

Log:


added strlcpy() test

Modified:
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
13:27:16 UTC (rev 18042)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
13:28:54 UTC (rev 18043)
@@ -75,9 +75,31 @@
return true;
 }
 
+/*
+  test strlcpy() function.
+  see http://www.gratisoft.us/todd/papers/strlcpy.html
+ */
 static int test_strlcpy()
 {
-   /* FIXME */
+   char buf[4];
+   const struct {
+   const char *src;
+   int result;
+   } tests[] = {
+   { abc, 3 },
+   { abcdef, 6 },
+   { abcd, 4 },
+   { , 0 },
+   { NULL, 0 }
+   };
+   int i;
+   printf(testing strlcpy\n);
+   for (i=0;tests[i].src;i++) {
+   if (strlcpy(buf, tests[i].src, sizeof(buf)) != tests[i].result) 
{
+   printf(strlcpy test %d failed\n);
+   return false;
+   }
+   }
return true;
 }
 
@@ -347,7 +369,6 @@
 int torture_local_replace()
 {
int ret = true;
-;
ret = test_ftruncate();
ret = test_strlcpy();
ret = test_strlcat();



svn commit: samba r18044 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 13:35:03 + (Mon, 04 Sep 2006)
New Revision: 18044

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

Log:

timegm.c needs to be in a separate file

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in
   branches/SAMBA_4_0/source/lib/replace/replace.c
   branches/SAMBA_4_0/source/lib/replace/timegm.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:28:54 UTC 
(rev 18043)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:35:03 UTC 
(rev 18044)
@@ -11,7 +11,7 @@
 
 CFLAGS=-I. -I$(srcdir) @CFLAGS@
 
-OBJS = dlfcn.o getpass.o replace.o snprintf.o
+OBJS = dlfcn.o getpass.o replace.o snprintf.o timegm.o
 
 all: libreplace.a testsuite
 

Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-04 13:28:54 UTC 
(rev 18043)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-04 13:35:03 UTC 
(rev 18044)
@@ -468,7 +468,7 @@
 {
char *dname;

-   if (dname = mktemp(template)) {
+   if ((dname = mktemp(template))) {
if (mkdir(dname, 0700) = 0) {
return dname;
}
@@ -603,34 +603,3 @@
 }
 #endif
 
-#if !defined(HAVE_TIMEGM)
-
-static int is_leap(unsigned y)
-{
-   y += 1900;
-   return (y % 4) == 0  ((y % 100) != 0 || (y % 400) == 0);
-}
-
-time_t timegm(struct tm *tm)
-{
-   static const unsigned ndays[2][12] ={
-   {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
-   {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}};
-   time_t res = 0;
-   unsigned i;
-   
-   for (i = 70; i  tm-tm_year; ++i)
-   res += is_leap(i) ? 366 : 365;
-   
-   for (i = 0; i  tm-tm_mon; ++i)
-   res += ndays[is_leap(tm-tm_year)][i];
-   res += tm-tm_mday - 1;
-   res *= 24;
-   res += tm-tm_hour;
-   res *= 60;
-   res += tm-tm_min;
-   res *= 60;
-   res += tm-tm_sec;
-   return res;
-}
-#endif

Modified: branches/SAMBA_4_0/source/lib/replace/timegm.c
===
--- branches/SAMBA_4_0/source/lib/replace/timegm.c  2006-09-04 13:28:54 UTC 
(rev 18043)
+++ branches/SAMBA_4_0/source/lib/replace/timegm.c  2006-09-04 13:35:03 UTC 
(rev 18044)
@@ -35,8 +35,8 @@
   adapted for Samba4 by Andrew Tridgell
 */
 
-#include includes.h
-#include ldb/include/includes.h
+#include replace.h
+#include stdlib.h
 
 #ifndef HAVE_TIMEGM
 



svn commit: samba r18045 - in branches/SAMBA_4_0/source/lib/replace: . test

2006-09-04 Thread jelmer
Author: jelmer
Date: 2006-09-04 13:47:57 + (Mon, 04 Sep 2006)
New Revision: 18045

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

Log:
Update format, list test target as phony.

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:35:03 UTC 
(rev 18044)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-04 13:47:57 UTC 
(rev 18045)
@@ -9,6 +9,8 @@
 builddir = @builddir@
 INSTALL = @INSTALL@
 
+.PHONY: test
+
 CFLAGS=-I. -I$(srcdir) @CFLAGS@
 
 OBJS = dlfcn.o getpass.o replace.o snprintf.o timegm.o

Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
13:35:03 UTC (rev 18044)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
13:47:57 UTC (rev 18045)
@@ -96,7 +96,7 @@
printf(testing strlcpy\n);
for (i=0;tests[i].src;i++) {
if (strlcpy(buf, tests[i].src, sizeof(buf)) != tests[i].result) 
{
-   printf(strlcpy test %d failed\n);
+   printf(strlcpy test %d failed\n, i);
return false;
}
}



Re: svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-04 Thread derrell
Stefan (metze) Metzmacher [EMAIL PROTECTED] writes:

 [EMAIL PROTECTED] schrieb:
 Author: derrell
 Date: 2006-09-03 01:37:26 + (Sun, 03 Sep 2006)
 New Revision: 18012
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=18012
 
 Log:
 Should fix bug 4018.
 
 NetApp filers expect paths in Open AndX Request to have a leading slash.
 Windows clients send the leading slash, so we should too.

 Hi Derrell,

 a torture test for this would be nice:-)

I've never written a torture test before, and I don't know how to run the
torture tests.  (Maybe that's something for me to learn while at the
conference.)  Does this (untested) patch do something close to what it's
supposed to?

Index: torture/raw/open.c
===
--- torture/raw/open.c  (revision 17937)
+++ torture/raw/open.c  (working copy)
@@ -351,6 +351,21 @@
CHECK_VAL(io.openx.out.size, 1024*1024);
CHECK_ALL_INFO(io.openx.in.size, size);
smbcli_close(cli-tree, fnum);
+
+   /*
+ * Ensure that opening the file without the leading slash works.
+ * NetApp filers are known to fail on this.
+ */
+   io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN;
+   io.openx.in.fname = fname + 1;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   fnum = io.openx.out.file.fnum;
+   smbcli_close(cli-tree, fnum);
+
+/* Reset io.openx.in.fname back to its proper value */
+io.openx.in.fname = fname;
+
smbcli_unlink(cli-tree, fname);
 
/* check the fields when the file already existed */


svn commit: samba r18046 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread idra
Author: idra
Date: 2006-09-04 16:30:40 + (Mon, 04 Sep 2006)
New Revision: 18046

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

Log:

Add 'z' specifier support and a configure test.

Jeremy should I backport this to samba3 too?


Modified:
   branches/SAMBA_4_0/source/lib/replace/config.m4
   branches/SAMBA_4_0/source/lib/replace/snprintf.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/config.m4
===
--- branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-04 13:47:57 UTC 
(rev 18045)
+++ branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-04 16:30:40 UTC 
(rev 18046)
@@ -91,7 +91,9 @@
 AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
 AC_TRY_RUN([
 #include sys/types.h
+#include stdio.h
 #include stdarg.h
+#include stdlib.h
 void foo(const char *format, ...) { 
va_list ap;
int len;
@@ -107,12 +109,14 @@
va_start(ap, format);
len = vsnprintf(0, 0, format, ap);
va_end(ap);
-   if (len != 5) exit(1);
+   if (len != 5) exit(2);
 
-   if (snprintf(buf, 3, hello) != 5 || strcmp(buf, he) != 0) exit(1);
+   if (snprintf(buf, 3, hello) != 5 || strcmp(buf, he) != 0) exit(3);
 
-   if (snprintf(buf, 20, %lld, l) != 12 || strcmp(buf, 123456789000) 
!= 0) exit(1);
-   if (snprintf(buf, 20, %s, 0)  3) exit(1);
+   if (snprintf(buf, 20, %lld, l) != 12 || strcmp(buf, 123456789000) 
!= 0) exit(4);
+   if (snprintf(buf, 20, %zu, 123456789) != 9 || strcmp(buf, 
123456789) != 0) exit(5);
+   if (snprintf(buf, 20, %2\$d %1\$d, 3, 4) != 3 || strcmp(buf, 4 3) 
!= 0) exit(6);
+   if (snprintf(buf, 20, %s, 0)  3) exit(7);
 
exit(0);
 }

Modified: branches/SAMBA_4_0/source/lib/replace/snprintf.c
===
--- branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-04 13:47:57 UTC 
(rev 18045)
+++ branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-04 16:30:40 UTC 
(rev 18046)
@@ -200,6 +200,7 @@
 #define DP_C_LONG3
 #define DP_C_LDOUBLE 4
 #define DP_C_LLONG   5
+#define DP_C_SIZET   6
 
 /* Chunk types */
 #define CNK_FMT_STR 0
@@ -467,6 +468,10 @@
cnk-cflags = DP_C_LDOUBLE;
ch = *format++;
break;
+   case 'z':
+   cnk-cflags = DP_C_SIZET;
+   ch = *format++;
+   break;
default:
break;
}
@@ -575,6 +580,8 @@
cnk-value = va_arg (args, long int);
else if (cnk-cflags == DP_C_LLONG)
cnk-value = va_arg (args, LLONG);
+   else if (cnk-cflags == DP_C_SIZET)
+   cnk-value = va_arg (args, ssize_t);
else
cnk-value = va_arg (args, int);
 
@@ -592,6 +599,8 @@
cnk-value = (unsigned long int)va_arg (args, 
unsigned long int);
else if (cnk-cflags == DP_C_LLONG)
cnk-value = (LLONG)va_arg (args, unsigned 
LLONG);
+   else if (cnk-cflags == DP_C_SIZET)
+   cnk-value = (size_t)va_arg (args, size_t);
else
cnk-value = (unsigned int)va_arg (args, 
unsigned int);
 
@@ -644,6 +653,8 @@
cnk-pnum = va_arg (args, long int *);
else if (cnk-cflags == DP_C_LLONG)
cnk-pnum = va_arg (args, LLONG *);
+   else if (cnk-cflags == DP_C_SIZET)
+   cnk-pnum = va_arg (args, ssize_t *);
else
cnk-pnum = va_arg (args, int *);
 
@@ -725,6 +736,8 @@
*((long int *)(cnk-pnum)) = (long int)currlen;
else if (cnk-cflags == DP_C_LLONG)
*((LLONG *)(cnk-pnum)) = (LLONG)currlen;
+   else if (cnk-cflags == DP_C_SIZET)
+   *((ssize_t *)(cnk-pnum)) = (ssize_t)currlen;
else
*((int *)(cnk-pnum)) = (int)currlen;
break;
@@ -1258,6 +1271,7 @@
 #ifdef TEST_SNPRINTF
 
  int sprintf(char *str,const char *fmt,...);
+ int printf(const char *fmt,...);
 
  int main (void)
 {
@@ -1327,15 +1341,20 @@
int fail = 0;
int num = 0;
int l1, l2;
+   char *ss_fmt[] = {
+   %zd,
+   %zu,
+   NULL
+   };
+   size_t ss_nums[] = {134, 91340, 123456789, 0203, 1234567890, 0};
 

svn commit: samba r18047 - in branches/SAMBA_3_0/source: client libads libsmb nsswitch printing rpc_parse utils

2006-09-04 Thread vlendec
Author: vlendec
Date: 2006-09-04 19:47:48 + (Mon, 04 Sep 2006)
New Revision: 18047

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

Log:
More C++ stuff
Modified:
   branches/SAMBA_3_0/source/client/clitar.c
   branches/SAMBA_3_0/source/libads/kerberos_verify.c
   branches/SAMBA_3_0/source/libads/sasl.c
   branches/SAMBA_3_0/source/libsmb/smbdes.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_async.c
   branches/SAMBA_3_0/source/printing/print_iprint.c
   branches/SAMBA_3_0/source/rpc_parse/parse_dfs.c
   branches/SAMBA_3_0/source/utils/net_lookup.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/clitar.c
===
--- branches/SAMBA_3_0/source/client/clitar.c   2006-09-04 16:30:40 UTC (rev 
18046)
+++ branches/SAMBA_3_0/source/client/clitar.c   2006-09-04 19:47:48 UTC (rev 
18047)
@@ -1075,7 +1075,7 @@
/* finfo.size here is the length of the filename as written by the 
/./@LongLink name
 * header call. */
int namesize = finfo.size + strlen(cur_dir) + 2;
-   char *longname = SMB_MALLOC(namesize);
+   char *longname = (char *)SMB_MALLOC(namesize);
int offset = 0, left = finfo.size;
BOOL first = True;
 
@@ -1523,7 +1523,7 @@
while ((! error)  (x_fgets(buf, sizeof(buf)-1, inclusion))) {
if (inclusion_buffer == NULL) {
inclusion_buffer_size = 1024;
-   if ((inclusion_buffer = 
SMB_MALLOC(inclusion_buffer_size)) == NULL) {
+   if ((inclusion_buffer = (char 
*)SMB_MALLOC(inclusion_buffer_size)) == NULL) {
DEBUG(0,(failure allocating buffer to read 
inclusion file\n));
error = 1;
break;
@@ -1536,7 +1536,7 @@
 
if ((strlen(buf) + 1 + inclusion_buffer_sofar) = 
inclusion_buffer_size) {
inclusion_buffer_size *= 2;
-   inclusion_buffer = 
SMB_REALLOC(inclusion_buffer,inclusion_buffer_size);
+   inclusion_buffer = (char 
*)SMB_REALLOC(inclusion_buffer,inclusion_buffer_size);
if (!inclusion_buffer) {
DEBUG(0,(failure enlarging inclusion buffer to 
%d bytes\n,
inclusion_buffer_size));

Modified: branches/SAMBA_3_0/source/libads/kerberos_verify.c
===
--- branches/SAMBA_3_0/source/libads/kerberos_verify.c  2006-09-04 16:30:40 UTC 
(rev 18046)
+++ branches/SAMBA_3_0/source/libads/kerberos_verify.c  2006-09-04 19:47:48 UTC 
(rev 18047)
@@ -101,7 +101,7 @@
if (strequal(entry_princ_s, 
valid_princ_formats[i])) {
number_matched_principals++;
p_packet-length = ticket-length;
-   p_packet-data = 
(krb5_pointer)ticket-data;
+   p_packet-data = (char *)ticket-data;
*pp_tkt = NULL;
 
ret = 
krb5_rd_req_return_keyblock_from_keytab(context, auth_context, p_packet,
@@ -228,7 +228,7 @@
/* CIFS doesn't use addresses in tickets. This would break NAT. JRA */
 
p_packet-length = ticket-length;
-   p_packet-data = (krb5_pointer)ticket-data;
+   p_packet-data = (char *)ticket-data;
 
/* We need to setup a auth context with each possible encoding type in 
turn. */
for (i=0;enctypes[i];i++) {

Modified: branches/SAMBA_3_0/source/libads/sasl.c
===
--- branches/SAMBA_3_0/source/libads/sasl.c 2006-09-04 16:30:40 UTC (rev 
18046)
+++ branches/SAMBA_3_0/source/libads/sasl.c 2006-09-04 19:47:48 UTC (rev 
18047)
@@ -348,7 +348,7 @@
goto failed;
}
 
-   cred.bv_val = output_token.value;
+   cred.bv_val = (char *)output_token.value;
cred.bv_len = output_token.length;
 
rc = ldap_sasl_bind_s(ads-ld, NULL, GSSAPI, cred, NULL, 
NULL, 
@@ -397,7 +397,7 @@
gss_release_buffer(minor_status, output_token);
 
output_token.value = SMB_MALLOC(strlen(ads-config.bind_path) + 8);
-   p = output_token.value;
+   p = (uint8 *)output_token.value;
 
*p++ = 1; /* no sign  seal selection */
/* choose the same size as the server gave us */
@@ -419,7 +419,7 @@
 
free(output_token.value);
 
-   cred.bv_val = input_token.value;
+   cred.bv_val = (char *)input_token.value;
cred.bv_len = input_token.length;
 
rc = ldap_sasl_bind_s(ads-ld, NULL, GSSAPI, cred, NULL, NULL, 

Modified: branches/SAMBA_3_0/source/libsmb/smbdes.c

svn commit: samba r18048 - in branches/SAMBA_3_0/source/lib: .

2006-09-04 Thread vlendec
Author: vlendec
Date: 2006-09-04 19:50:30 + (Mon, 04 Sep 2006)
New Revision: 18048

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

Log:
More nested structures
Modified:
   branches/SAMBA_3_0/source/lib/talloctort.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/talloctort.c
===
--- branches/SAMBA_3_0/source/lib/talloctort.c  2006-09-04 19:47:48 UTC (rev 
18047)
+++ branches/SAMBA_3_0/source/lib/talloctort.c  2006-09-04 19:50:30 UTC (rev 
18048)
@@ -609,19 +609,22 @@
return True;
 }
 
+struct el2 {
+   const char *name;
+};
 
+struct el1 {
+   int count;
+   struct el2 **list, **list2, **list3;
+};
+
 /*
   test realloc with a child
 */
 static BOOL test_realloc_child(void)
 {
void *root;
-   struct el1 {
-   int count;
-   struct el2 {
-   const char *name;
-   } **list, **list2, **list3;
-   } *el1;
+   struct el1 *el1;
struct el2 *el2;
 
printf(TESTING REALLOC WITH CHILD\n);



svn commit: samba r18049 - in branches/SAMBA_3_0/source/lib: .

2006-09-04 Thread idra
Author: idra
Date: 2006-09-04 19:53:30 + (Mon, 04 Sep 2006)
New Revision: 18049

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

Log:

Backport SAMBA_4_0 snprintf changes


Modified:
   branches/SAMBA_3_0/source/lib/snprintf.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/snprintf.c
===
--- branches/SAMBA_3_0/source/lib/snprintf.c2006-09-04 19:50:30 UTC (rev 
18048)
+++ branches/SAMBA_3_0/source/lib/snprintf.c2006-09-04 19:53:30 UTC (rev 
18049)
@@ -197,6 +197,7 @@
 #define DP_C_LONG3
 #define DP_C_LDOUBLE 4
 #define DP_C_LLONG   5
+#define DP_C_SIZET   6
 
 /* Chunk types */
 #define CNK_FMT_STR 0
@@ -467,6 +468,10 @@
cnk-cflags = DP_C_LDOUBLE;
ch = *format++;
break;
+   case 'z':
+   cnk-cflags = DP_C_SIZET;
+   ch = *format++;
+   break;
default:
break;
}
@@ -575,6 +580,8 @@
cnk-value = va_arg (args, long int);
else if (cnk-cflags == DP_C_LLONG)
cnk-value = va_arg (args, LLONG);
+   else if (cnk-cflags == DP_C_SIZET)
+   cnk-value = va_arg (args, ssize_t);
else
cnk-value = va_arg (args, int);
 
@@ -592,6 +599,8 @@
cnk-value = (unsigned long int)va_arg (args, 
unsigned long int);
else if (cnk-cflags == DP_C_LLONG)
cnk-value = (LLONG)va_arg (args, unsigned 
LLONG);
+   else if (cnk-cflags == DP_C_SIZET)
+   cnk-value = (size_t)va_arg (args, size_t);
else
cnk-value = (unsigned int)va_arg (args, 
unsigned int);
 
@@ -644,6 +653,8 @@
cnk-pnum = va_arg (args, long int *);
else if (cnk-cflags == DP_C_LLONG)
cnk-pnum = va_arg (args, LLONG *);
+   else if (cnk-cflags == DP_C_SIZET)
+   cnk-pnum = va_arg (args, ssize_t *);
else
cnk-pnum = va_arg (args, int *);
 
@@ -725,6 +736,8 @@
*((long int *)(cnk-pnum)) = (long int)currlen;
else if (cnk-cflags == DP_C_LLONG)
*((LLONG *)(cnk-pnum)) = (LLONG)currlen;
+   else if (cnk-cflags == DP_C_SIZET)
+   *((ssize_t *)(cnk-pnum)) = (ssize_t)currlen;
else
*((int *)(cnk-pnum)) = (int)currlen;
break;
@@ -1260,6 +1273,7 @@
 #ifdef TEST_SNPRINTF
 
  int sprintf(char *str,const char *fmt,...);
+ int printf(const char *fmt,...);
 
  int main (void)
 {
@@ -1329,15 +1343,20 @@
int fail = 0;
int num = 0;
int l1, l2;
+   char *ss_fmt[] = {
+   %zd,
+   %zu,
+   NULL
+   };
+   size_t ss_nums[] = {134, 91340, 123456789, 0203, 1234567890, 0};
 
printf (Testing snprintf format codes against system sprintf...\n);
 
for (x = 0; fp_fmt[x] ; x++) {
for (y = 0; fp_nums[y] != 0 ; y++) {
buf1[0] = buf2[0] = '\0';
-   l1 = snprintf(NULL, 0, fp_fmt[x], fp_nums[y]);
-   l2 = sprintf(buf1, fp_fmt[x], fp_nums[y]);
-   sprintf (buf2, fp_fmt[x], fp_nums[y]);
+   l1 = snprintf(buf1, sizeof(buf1), fp_fmt[x], 
fp_nums[y]);
+   l2 = sprintf (buf2, fp_fmt[x], fp_nums[y]);
buf1[1023] = buf2[1023] = '\0';
if (strcmp (buf1, buf2) || (l1 != l2)) {
printf(snprintf doesn't match Format: 
%s\n\tsnprintf(%d) = [%s]\n\t sprintf(%d) = [%s]\n, 
@@ -1351,9 +1370,8 @@
for (x = 0; int_fmt[x] ; x++) {
for (y = 0; int_nums[y] != 0 ; y++) {
buf1[0] = buf2[0] = '\0';
-   l1 = snprintf(NULL, 0, int_fmt[x], int_nums[y]);
-   l2 = sprintf(buf1, int_fmt[x], int_nums[y]);
-   sprintf (buf2, int_fmt[x], int_nums[y]);
+   l1 = snprintf(buf1, sizeof(buf1), int_fmt[x], 
int_nums[y]);
+   l2 = sprintf (buf2, int_fmt[x], int_nums[y]);
buf1[1023] = buf2[1023] = '\0';
if (strcmp (buf1, buf2) || (l1 != l2)) {
printf(snprintf doesn't match 

svn commit: samba r18050 - in branches/SAMBA_4_0/source/script/tests: .

2006-09-04 Thread mimir
Author: mimir
Date: 2006-09-04 20:48:29 + (Mon, 04 Sep 2006)
New Revision: 18050

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

Log:
Run more NET tests on the build farm.


rafal


Modified:
   branches/SAMBA_4_0/source/script/tests/test_net.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_net.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_net.sh  2006-09-04 19:53:30 UTC 
(rev 18049)
+++ branches/SAMBA_4_0/source/script/tests/test_net.sh  2006-09-04 20:48:29 UTC 
(rev 18050)
@@ -2,9 +2,9 @@
 
 # add tests to this list as they start passing, so we test
 # that they stay passing
-ncacn_np_tests=NET-API-RPCCONN-BIND NET-API-LISTSHARES NET-API-CREATEUSER 
NET-API-DELETEUSER
-ncalrpc_tests=NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER
-ncacn_ip_tcp_tests=NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER
+ncacn_np_tests=NET-API-RPCCONN-BIND NET-API-RPCCONN-SRV NET-API-RPCCONN-DC 
NET-API-RPCCONN-DCINFO NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER
+ncalrpc_tests=NET-API-RPCCONN-SRV NET-API-RPCCONN-DC NET-API-RPCCONN-DCINFO 
NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER
+ncacn_ip_tcp_tests=NET-API-RPCCONN-SRV NET-API-RPCCONN-DC 
NET-API-RPCCONN-DCINFO NET-API-LISTSHARES NET-API-CREATEUSER NET-API-DELETEUSER
 
 if [ $# -lt 4 ]; then
 cat EOF



svn commit: samba r18051 - in branches/SAMBA_4_0/source/lib/replace: . test

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 22:49:30 + (Mon, 04 Sep 2006)
New Revision: 18051

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

Log:

- add gcc warning flags

- fix piles of warnings and ftruncate bug in libreplace testsuite

Modified:
   branches/SAMBA_4_0/source/lib/replace/configure.ac
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/configure.ac
===
--- branches/SAMBA_4_0/source/lib/replace/configure.ac  2006-09-04 20:48:29 UTC 
(rev 18050)
+++ branches/SAMBA_4_0/source/lib/replace/configure.ac  2006-09-04 22:49:30 UTC 
(rev 18051)
@@ -46,6 +46,12 @@
 AC_CONFIG_SRCDIR([dlfcn.c])
 AC_CONFIG_HEADER(replace_config.h)
 AC_PROG_INSTALL
+AC_PROG_CC
+
+if test $ac_cv_prog_gcc = yes; then
+   CFLAGS=$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith 
-Wcast-qual -Wcast-align -Wwrite-strings
+fi
+
 sinclude(config.m4)
 sinclude(win32/config.m4)
 sinclude(repdir/config.m4)

Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
20:48:29 UTC (rev 18050)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-04 
22:49:30 UTC (rev 18051)
@@ -39,6 +39,14 @@
 #include sys/stat.h
 #endif
 
+#if HAVE_UNISTD_H
+#include unistd.h
+#endif
+
+#if HAVE_STRING_H
+#include string.h
+#endif
+
 #include fcntl.h
 #include errno.h
 
@@ -47,11 +55,11 @@
 /*
   test ftruncate() function
  */
-static int test_ftruncate()
+static int test_ftruncate(void)
 {
struct stat st;
-   int fd, i;
-   const int size;
+   int fd;
+   const int size = 1234;
printf(testing ftruncate\n);
unlink(TESTFILE);
fd = open(TESTFILE, O_RDWR|O_CREAT, 0600);
@@ -79,7 +87,7 @@
   test strlcpy() function.
   see http://www.gratisoft.us/todd/papers/strlcpy.html
  */
-static int test_strlcpy()
+static int test_strlcpy(void)
 {
char buf[4];
const struct {
@@ -103,224 +111,224 @@
return true;
 }
 
-static int test_strlcat()
+static int test_strlcat(void)
 {
/* FIXME */
return true;
 }
 
-static int test_mktime()
+static int test_mktime(void)
 {
/* FIXME */
return true;
 }
 
-static int test_rename()
+static int test_rename(void)
 {
/* FIXME */
return true;
 }
 
-static int test_innetgr()
+static int test_innetgr(void)
 {
/* FIXME */
return true;
 }
 
-static int test_initgroups()
+static int test_initgroups(void)
 {
/* FIXME */
return true;
 }
 
-static int test_memmove()
+static int test_memmove(void)
 {
/* FIXME */
return true;
 }
 
-static int test_strdup()
+static int test_strdup(void)
 {
/* FIXME */
return true;
 }  
 
-static int test_setlinebuf()
+static int test_setlinebuf(void)
 {
/* FIXME */
return true;
 }
 
-static int test_vsyslog()
+static int test_vsyslog(void)
 {
/* FIXME */
return true;
 }
 
-static int test_timegm()
+static int test_timegm(void)
 {
/* FIXME */
return true;
 }
 
-static int test_setenv()
+static int test_setenv(void)
 {
/* FIXME */
return true;
 }
 
-static int test_strndup()
+static int test_strndup(void)
 {
/* FIXME */
return true;
 }
 
-static int test_strnlen()
+static int test_strnlen(void)
 {
/* FIXME */
return true;
 }
 
-static int test_waitpid()
+static int test_waitpid(void)
 {
/* FIXME */
return true;
 }
 
-static int test_seteuid()
+static int test_seteuid(void)
 {
/* FIXME */
return true;
 }
 
-static int test_setegid()
+static int test_setegid(void)
 {
/* FIXME */
return true;
 }
 
-static int test_asprintf()
+static int test_asprintf(void)
 {
/* FIXME */
return true;
 }
 
-static int test_snprintf()
+static int test_snprintf(void)
 {
/* FIXME */
return true;
 }
 
-static int test_vasprintf()
+static int test_vasprintf(void)
 {
/* FIXME */
return true;
 }
 
-static int test_vsnprintf()
+static int test_vsnprintf(void)
 {
/* FIXME */
return true;
 }
 
-static int test_opendir()
+static int test_opendir(void)
 {
/* FIXME */
return true;
 }
 
-static int test_readdir()
+static int test_readdir(void)
 {
/* FIXME */
return true;
 }
 
-static int test_telldir()
+static int test_telldir(void)
 {
/* FIXME */
return true;
 }
 
-static int test_seekdir()
+static int test_seekdir(void)
 {
/* FIXME */
return true;
 }
 
-static int test_dlopen()
+static int test_dlopen(void)
 {
/* FIXME: test dlopen, dlsym, dlclose, dlerror */
return true;
 }
 
 
-static int test_chroot()
+static int test_chroot(void)
 {
/* 

svn commit: samba r18052 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-04 22:58:55 + (Mon, 04 Sep 2006)
New Revision: 18052

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

Log:

discard_const_p() isn't part of the libreplace API, so we can't use it
inside libreplace.

Modified:
   branches/SAMBA_4_0/source/lib/replace/replace.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-04 22:49:30 UTC 
(rev 18051)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-04 22:58:55 UTC 
(rev 18052)
@@ -506,7 +506,7 @@
for (s=haystack;*s;s++) {
if (toupper(*needle) == toupper(*s) 
strncasecmp(s, needle, nlen) == 0) {
-   return discard_const_p(char, s);
+   return (char *)((intptr_t)s);
}
}
return NULL;



Build status as of Tue Sep 5 00:00:02 2006

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

--- /home/build/master/cache/broken_results.txt.old 2006-09-04 
00:00:16.0 +
+++ /home/build/master/cache/broken_results.txt 2006-09-05 00:00:23.0 
+
@@ -1,19 +1,20 @@
-Build status as of Mon Sep  4 00:00:01 2006
+Build status as of Tue Sep  5 00:00:02 2006
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
-ccache   27 4  0 
-distcc   29 2  0 
-ldb  30 5  0 
+ccache   36 9  0 
+distcc   36 3  0 
+ldb  33 31 0 
+libreplace   30 9  0 
 lorikeet-heimdal 0  0  0 
-ppp  17 0  0 
-rsync32 3  0 
+ppp  18 0  0 
+rsync35 4  0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   39 22 2 
-samba_3_037 5  0 
-smb-build26 1  0 
-talloc   34 4  0 
-tdb  32 4  0 
+samba4   40 22 1 
+samba_3_037 7  0 
+smb-build27 2  0 
+talloc   36 6  0 
+tdb  34 6  0 
 


Nested structures in C [was Re: svn commit: samba r18030 - in branches/SAMBA_3_0/source/tdb/common]

2006-09-04 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] wrote:
 Author: vlendec
 Date: 2006-09-04 10:12:04 + (Mon, 04 Sep 2006)
 New Revision: 18030
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=18030
 
 Log:
 When compiling with C++, nested structs lead to 
 nested class definitions which are not compatible. I am
 aware that this would be a huge change in Samba4, but
 I would like to see it in the code that is shared.
 
 Stefan, when you do merge work, can you get this 
 across to Samba4?

Hey Volker,

I've got to agree with tridge here.  These kind of things
are just not going to go away.  The entire autogenerated
code from pidl uses the nested structure convention.
And we're about to get a lot more of that in Samba 3.





cheers, jerry
=
Samba--- http://www.samba.org
Centeris ---  http://www.centeris.com
What man is a man who does not make the world better?  --Balian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/Ma4IR7qMdg1EfYRAudaAJ9u0KBvlzzG+qklV2N7QDxytuQXBgCfYg/j
A3D4hkVYIEPwZ25cbObeozA=
=Z4wf
-END PGP SIGNATURE-


Re: Nested structures in C [was Re: svn commit: samba r18030 - in branches/SAMBA_3_0/source/tdb/common]

2006-09-04 Thread Jeremy Allison
On Mon, Sep 04, 2006 at 07:37:12PM -0500, Gerald (Jerry) Carter wrote:
 
 I've got to agree with tridge here.  These kind of things
 are just not going to go away.  The entire autogenerated
 code from pidl uses the nested structure convention.
 And we're about to get a lot more of that in Samba 3.

You C++-hating luddite :-) :-). I can see I've lost this one...


svn commit: samba r18053 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 01:50:52 + (Tue, 05 Sep 2006)
New Revision: 18053

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

Log:

the sig_atomic_t test needs to be in libreplace for getpass.c to
compile on hpux

Modified:
   branches/SAMBA_4_0/source/lib/replace/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/config.m4
===
--- branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-04 22:58:55 UTC 
(rev 18052)
+++ branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-05 01:50:52 UTC 
(rev 18053)
@@ -192,3 +192,16 @@
 # Check prerequisites
 AC_CHECK_FUNCS([memset printf syslog], [], 
   [ AC_MSG_ERROR([Required function not found])])
+
+AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
+AC_TRY_COMPILE([
+#include sys/types.h
+#if STDC_HEADERS
+#include stdlib.h
+#include stddef.h
+#endif
+#include signal.h],[sig_atomic_t i = 0],
+   samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
+if test x$samba_cv_sig_atomic_t = xyes; then
+   AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable 
type])
+fi



svn commit: samba r18054 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 01:54:49 + (Tue, 05 Sep 2006)
New Revision: 18054

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

Log:

snprintf.c needs to use replace.h to get the rep_vasprintf and related
macros

Modified:
   branches/SAMBA_4_0/source/lib/replace/snprintf.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/snprintf.c
===
--- branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-05 01:50:52 UTC 
(rev 18053)
+++ branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-05 01:54:49 UTC 
(rev 18054)
@@ -103,11 +103,7 @@
  *
  **/
 
-#ifdef _SAMBA_BUILD_
-#include config.h
-#else
-#include replace_config.h
-#endif
+#include replace.h
 
 #ifdef TEST_SNPRINTF /* need math library headers for testing */
 



svn commit: samba r18055 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 02:03:22 + (Tue, 05 Sep 2006)
New Revision: 18055

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

Log:

aix needs time.h for timegm.c to compile

Modified:
   branches/SAMBA_4_0/source/lib/replace/config.m4
   branches/SAMBA_4_0/source/lib/replace/timegm.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/config.m4
===
--- branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-05 01:54:49 UTC 
(rev 18054)
+++ branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-05 02:03:22 UTC 
(rev 18055)
@@ -50,6 +50,7 @@
 [AC_DEFINE(socklen_t, int,[Socket length type])])
 
 AC_CHECK_HEADERS(sys/syslog.h syslog.h)
+AC_CHECK_HEADERS(sys/time.h time.h)
 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
 AC_CHECK_FUNCS(waitpid strlcpy strlcat innetgr initgroups memmove strdup)

Modified: branches/SAMBA_4_0/source/lib/replace/timegm.c
===
--- branches/SAMBA_4_0/source/lib/replace/timegm.c  2006-09-05 01:54:49 UTC 
(rev 18054)
+++ branches/SAMBA_4_0/source/lib/replace/timegm.c  2006-09-05 02:03:22 UTC 
(rev 18055)
@@ -40,6 +40,14 @@
 
 #ifndef HAVE_TIMEGM
 
+#ifdef HAVE_SYS_TIME_H
+#include sys/time.h
+#endif
+
+#ifdef TIME_H
+#include time.h
+#endif
+
 static int is_leap(unsigned y)
 {
y += 1900;



svn commit: samba r18056 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 02:05:36 + (Tue, 05 Sep 2006)
New Revision: 18056

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

Log:

includes needed for O_CREAT

Modified:
   branches/SAMBA_4_0/source/lib/replace/replace.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-05 02:03:22 UTC 
(rev 18055)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-05 02:05:36 UTC 
(rev 18056)
@@ -26,8 +26,10 @@
 
 #include stdlib.h
 #include unistd.h
+#include string.h
 #include sys/stat.h
-#include string.h
+#include sys/types.h
+#include fcntl.h
 
 void replace_dummy(void);
 void replace_dummy(void) {}



svn commit: samba r18057 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 04:19:16 + (Tue, 05 Sep 2006)
New Revision: 18057

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

Log:

fixed an #ifdef

Modified:
   branches/SAMBA_4_0/source/lib/replace/timegm.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/timegm.c
===
--- branches/SAMBA_4_0/source/lib/replace/timegm.c  2006-09-05 02:05:36 UTC 
(rev 18056)
+++ branches/SAMBA_4_0/source/lib/replace/timegm.c  2006-09-05 04:19:16 UTC 
(rev 18057)
@@ -44,7 +44,7 @@
 #include sys/time.h
 #endif
 
-#ifdef TIME_H
+#ifdef HAVE_TIME_H
 #include time.h
 #endif
 



svn commit: samba r18058 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 04:23:11 + (Tue, 05 Sep 2006)
New Revision: 18058

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

Log:

we don't actually need __VA_ARGS__ yet (its another C99 feature which
I don't think we use anywhere)

Modified:
   branches/SAMBA_4_0/source/lib/replace/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/config.m4
===
--- branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-05 04:19:16 UTC 
(rev 18057)
+++ branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-05 04:23:11 UTC 
(rev 18058)
@@ -185,10 +185,11 @@
 AC_CHECK_FUNCS(timegm strnlen setenv)
 AC_CHECK_FUNCS(strtoull __strtoull strtouq strtoll __strtoll strtoq)
 
-AC_TRY_CPP([
-#define eprintf(...) fprintf(stderr, __VA_ARGS__)
-eprintf(bla, bar);
-], [], [AC_MSG_ERROR([__VA_ARGS__ is required])])
+# this test disabled as we don't actually need __VA_ARGS__ yet
+# AC_TRY_CPP([
+# #define eprintf(...) fprintf(stderr, __VA_ARGS__)
+# eprintf(bla, bar);
+# ], [], [AC_MSG_ERROR([__VA_ARGS__ is required])])
 
 # Check prerequisites
 AC_CHECK_FUNCS([memset printf syslog], [], 



svn commit: samba r18059 - in branches/SAMBA_4_0/source/lib/replace/test: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 04:48:01 + (Tue, 05 Sep 2006)
New Revision: 18059

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

Log:

another cpp error

Modified:
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-05 
04:23:11 UTC (rev 18058)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-05 
04:48:01 UTC (rev 18059)
@@ -31,7 +31,7 @@
 #include stdlib.h
 #endif
 
-#if HAVE_TYPES_H
+#if HAVE_SYS_TYPES_H
 #include sys/types.h
 #endif
 



svn commit: samba r18060 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-04 Thread tridge
Author: tridge
Date: 2006-09-05 04:53:46 + (Tue, 05 Sep 2006)
New Revision: 18060

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

Log:

use gmake for libreplace if available

Modified:
   branches/SAMBA_4_0/source/lib/replace/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-05 04:48:01 UTC 
(rev 18059)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in   2006-09-05 04:53:46 UTC 
(rev 18060)
@@ -1,3 +1,5 @@
+#!gmake
+#
 CC = @CC@
 prefix = @prefix@
 exec_prefix = @exec_prefix@



svn commit: samba r18062 - in branches/SAMBA_3_0/source/nsswitch: .

2006-09-04 Thread jra
Author: jra
Date: 2006-09-05 05:28:31 + (Tue, 05 Sep 2006)
New Revision: 18062

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

Log:
Fix to ensure the name used by pam matches the
name that will be returned by winbindd. This
(should) fix the bug where the user logs in
with DOMAIN\user but winbindd returns only
user for the username due to 'winbind use
default domain' being set.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2006-09-05 04:58:23 UTC 
(rev 18061)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2006-09-05 05:28:31 UTC 
(rev 18062)
@@ -344,7 +344,8 @@
const char *member, 
const char *cctype,
int process_result,
-   time_t *pwd_last_set)
+   time_t *pwd_last_set,
+   char **user_ret)
 {
struct winbindd_request request;
struct winbindd_response response;
@@ -388,6 +389,11 @@
request.flags |= WBFLAG_PAM_CACHED_LOGIN;
}
 
+   if (user_ret) {
+   *user_ret = NULL;
+   request.flags |= WBFLAG_PAM_UNIX_NAME;
+   }
+
if (cctype != NULL) {
strncpy(request.data.auth.krb5_cc_type, cctype, 
sizeof(request.data.auth.krb5_cc_type) - 1);
@@ -526,6 +532,12 @@
}
}
 
+   /* If winbindd returned a username, return the pointer to it here. */
+   if (user_ret  response.extra_data.data) {
+   /* We have to trust it's a null terminated string. */
+   *user_ret = response.extra_data.data;
+   }
+
return ret;
 }
 
@@ -906,6 +918,7 @@
const char *cctype = NULL;
int retval = PAM_AUTH_ERR;
dictionary *d;
+   char *username_ret = NULL;
 
/* parse arguments */
int ctrl = _pam_parse(argc, argv, d);
@@ -948,7 +961,8 @@
cctype = get_krb5_cc_type_from_config(argc, argv, ctrl, d);
 
/* Now use the username to look up password */
-   retval = winbind_auth_request(pamh, ctrl, username, password, member, 
cctype, True, NULL);
+   retval = winbind_auth_request(pamh, ctrl, username, password, member,
+   cctype, True, NULL, username_ret);
 
if (retval == PAM_NEW_AUTHTOK_REQD ||
retval == PAM_AUTHTOK_EXPIRED) {
@@ -967,6 +981,11 @@
}
 
 out:
+   if (username_ret) {
+   pam_set_item (pamh, PAM_USER, username_ret);
+   free(username_ret);
+   }
+
if (d) {
iniparser_freedict(d);
}
@@ -1259,7 +1278,8 @@
}
/* verify that this is the password for this user */

-   retval = winbind_auth_request(pamh, ctrl, user, pass_old, NULL, 
NULL, False, pwdlastset_prelim);
+   retval = winbind_auth_request(pamh, ctrl, user, pass_old,
+   NULL, NULL, False, pwdlastset_prelim, 
NULL);
 
if (retval != PAM_ACCT_EXPIRED  
retval != PAM_AUTHTOK_EXPIRED 
@@ -1354,7 +1374,8 @@
const char *member = get_member_from_config(argc, argv, 
ctrl, d);
const char *cctype = get_krb5_cc_type_from_config(argc, 
argv, ctrl, d);
 
-   retval = winbind_auth_request(pamh, ctrl, user, 
pass_new, member, cctype, False, NULL);
+   retval = winbind_auth_request(pamh, ctrl, user, 
pass_new,
+   member, cctype, False, 
NULL, NULL);
_pam_overwrite(pass_new);
_pam_overwrite(pass_old);
pass_old = pass_new = NULL;

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2006-09-05 04:58:23 UTC 
(rev 18061)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c   2006-09-05 05:28:31 UTC 
(rev 18062)
@@ -1306,9 +1306,40 @@
DEBUG(10,(Failed to get password policies: %s\n, 
nt_errstr(result)));
goto done;
}
-   
-   } 
 
+   if (state-request.flags  WBFLAG_PAM_UNIX_NAME) {
+   /* We've been asked to return the unix username, per 
+  'winbind use default domain' settings and the like */
+
+   fstring username_out;
+   const char *nt_username, *nt_domain;
+
+   if