Re: [Samba] Many STATUS_INVALID_HANDLE

2007-08-02 Thread Carwyn Edwards

Jeremy Allison wrote:

What Samba version please ?


Currently we have 3.0.25b on Solaris 10 on a Sun T2000 (one of those 4 
way threaded 8 core things). The problem has been around in 3.0.25, 
3.0.22 and some earlier versions too.


Oplocks are off. I'm trimming down our smb.conf at the moment to make 
sure it's not related to any legacy settings in there.


Carwyn

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


[Samba] Printer publishing

2007-08-02 Thread Stephane ARMANET

Hello list

I use a samba (version  3.0.14) PDC and Cups (1.2.7)  for sharing 
printers with windows clients.


When I create a new printer in Cups i have to wait a long time (abour 20 
minutes) to see the printer in Samba's sharing


Here is my Print sectin of the smb.conf

[printers]
path = /tmp
print ok = yes
browseable = yes
printable = yes
printer admin = @users, root


[print$]
path = /drivers/
public = yes
writeable = yes
write list = @users, root


Does anyone can help me ??

Thanks

--

ARMANET Stephane
Service Informatique
Hopital Intercommunal Sud Leman Valserine
BP 110
74164 St Julien en Genevois Cedex
tel: 04 50 49 65 04
fax: 04 50 49 66 88
[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] Printer publishing

2007-08-02 Thread Martin Zielinski

Hello,

Please make sure, you have

printing = cups
printcap name = cups

also in your smb.conf.

When you have added a printer with cups, you could either restart your 
samba processes (/etc/init.d/samba restart - or something like that) or 
send them a signal to re-read the configuration.


killall -1 smbd

should do that.

Bye,

Martin

Stephane ARMANET schrieb:

Hello list

I use a samba (version  3.0.14) PDC and Cups (1.2.7)  for sharing 
printers with windows clients.


When I create a new printer in Cups i have to wait a long time (abour 20 
minutes) to see the printer in Samba's sharing


Here is my Print sectin of the smb.conf

[printers]
path = /tmp
print ok = yes
browseable = yes
printable = yes
printer admin = @users, root


[print$]
path = /drivers/
public = yes
writeable = yes
write list = @users, root


Does anyone can help me ??

Thanks



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


Re: [Samba] Printer publishing

2007-08-02 Thread Alex Crow
Stephane,

killall -HUP smbd

Your printers should then show up immediately.

Cheers

Alex

On Thu, 2007-08-02 at 11:14 +0200, Stephane ARMANET wrote:
 Hello list
 
 I use a samba (version  3.0.14) PDC and Cups (1.2.7)  for sharing 
 printers with windows clients.
 
 When I create a new printer in Cups i have to wait a long time (abour 20 
 minutes) to see the printer in Samba's sharing
 
 Here is my Print sectin of the smb.conf
 
 [printers]
 path = /tmp
 print ok = yes
 browseable = yes
 printable = yes
 printer admin = @users, root
 
 
 [print$]
 path = /drivers/
 public = yes
 writeable = yes
 write list = @users, root
 
 
 Does anyone can help me ??
 
 Thanks
 
 -- 
 
 ARMANET Stephane
 Service Informatique
 Hopital Intercommunal Sud Leman Valserine
 BP 110
 74164 St Julien en Genevois Cedex
 tel: 04 50 49 65 04
 fax: 04 50 49 66 88
 [EMAIL PROTECTED]
 
 
-- 
This message is intended only for the addressee and may contain 
confidential information.  Unless you are that person, you may not 
disclose its contents or use it in any way and are requested to delete 
the message along with any attachments and notify us immediately. 

Transact is operated by Integrated Financial Arrangements plc 
Domain House, 5-7 Singer Street, London  EC2A 4BQ 
Tel: (020) 7608 4900 Fax: (020) 7608 1200
(Registered office: as above; Registered in England and Wales under
number: 3727592) 
Authorised and regulated by the Financial Services Authority (entered on
the FSA Register; number: 190856)


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


Re: [Samba] Printer publishing

2007-08-02 Thread Stephane ARMANET

Martin Zielinski a écrit :

Hello,

Please make sure, you have

printing = cups
printcap name = cups

also in your smb.conf.

When you have added a printer with cups, you could either restart your 
samba processes (/etc/init.d/samba restart - or something like that) 
or send them a signal to re-read the configuration.


killall -1 smbd

should do that.

Bye,

Martin






Well I make a /etc/init.d/samba reload  wich only restart the smbd 
deamon  with the HUP signal and it doesn't change anything.


In my smb.conf i've got:

printing = cups
printcap name = cups



--

ARMANET Stephane
Service Informatique
Hopital Intercommunal Sud Leman Valserine
BP 110
74164 St Julien en Genevois Cedex
tel: 04 50 49 65 04
fax: 04 50 49 66 88
[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] nsupdate-gss

2007-08-02 Thread Dag Wieers
On Wed, 1 Aug 2007, Dag Wieers wrote:

 PS I also noticed that the nsupdate-gss fails even when it by accident 
 takes a local DC because it does not use the same server for $nameserver 
 and $server_name, which causes the TKEY negotiation to fail.
 
 This could explain tridge his 'only one out of two attempts work'. In 
 fact, only 1 out of X attempts will work when X number of nameservers are 
 available. Only if you have a single DC it will work consistently.

When I fixed the above, it suddenly worked for all DCs ! So the extra 
argument patch is no longer really useful unless you want to target a 
specific DC for test purposes.

Here is a new patch that fixes all problems we had with the 
original nsupdate-gss. The only real fix is this bit:

 print Using DNS server name $server_name\n;
 
+$nameserver-nameservers($server_name);
+
 # use a long random key name

Which enforces the same nameserver to be used during TKEY negotiation for 
constructing the principal name in the GSS query as the one used to send 
the GSS query to.

This is required if you have more than one DC acting as a nameserver, 
without it your luck depends on the order of the nameserver (which is 
round-robin).

Is the nsupdate-gss still maintained ? I'd like to add some additional 
features (like automatically filling in the hostname, domain and IP if 
none are provided). I also want to fix the 'Uninitialized value in 
Net/DNS/RR/TKEY.pm' problem.

I'm interested to hear from people how to best integrate this with DHCP 
and non-interactive DNS updates (those are my next tasks in this quest).


PS nsupdate-gss is pretty much still required:

 - because every Enterprise Linux ships Samba = 2.0.23
 - Samba 2.0.25b does not work (and may suffer from the above problem)
 - it does not require Samba to work

Kind regards,
--   dag wieers,  [EMAIL PROTECTED],  http://dag.wieers.com/   --
[Any errors in spelling, tact or fact are transmission errors]--- /usr/src/redhat/SOURCES/nsupdate-gss2006-01-23 06:35:10.0 
+0100
+++ /usr/bin/nsupdate-gss   2007-08-01 17:30:35.0 +0200
@@ -5,6 +5,9 @@
 # [EMAIL PROTECTED]
 # updated, 2004-Enero
 
+# [EMAIL PROTECTED]
+# updated, 2007-EMC
+
 
 # See draft-ietf-dnsext-gss-tsig-02, RFC2845 and RFC2930
 
@@ -20,21 +23,22 @@
 
 # Integrity of the arguments
 
-if ($#ARGV != 3) {
+if ($#ARGV  3) {
 print 
-Usage: nsupdate-gss.pl HOST DOMAIN IP TTL
+Usage: nsupdate-gss.pl HOST DOMAIN IP TTL [NS]
 ;
 exit 1;
 }
 
 
 
-
-my $host = $ARGV[0];
-my $domain = $ARGV[1];
-my $ip = $ARGV[2];
+### FIXME: Fill in all information automatically
+my $host = $ARGV[0]; # hostname -s
+my $domain = $ARGV[1]; # domainname
+my $ip = $ARGV[2]; # ifconfig
 my $ttl = $ARGV[3];
 my $alg = gss.microsoft.com;
+my $ns = $ARGV[4] if ($#ARGV = 4);
 
 
 
@@ -229,7 +233,11 @@
 # find the nameservers
 my $nameserver = find_nameservers($domain.);
 
-print Found nameserver $nameserver\n;
+$nameserver-nameservers($ns) if (defined($ns));
+#print $nameserver-print;
+
+#print Found nameserver $nameserver\n;
+print Found .$nameserver-nameservers. nameserver(s)\n;
 
 if (!defined($nameserver) || $nameserver-{'errorstring'} ne 'NOERROR') {
 print Failed to find a nameserver for domain $domain\n;
@@ -238,12 +246,16 @@
 
 # find the name of the DNS server
 my $server_name = find_server_name($domain);
+$server_name = $ns if (defined($ns));
+
 if (!defined($server_name)) {
 print Failed to find a DNS server name for $domain\n;
 exit 1;
 }
 print Using DNS server name $server_name\n;
 
+$nameserver-nameservers($server_name);
+
 # use a long random key name
 my $key_name = int(rand 10);
 
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

Re: [Samba] Failed to create Users problem. PLUS further evidence

2007-08-02 Thread Felipe Augusto van de Wiel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Daryl wrote, On 01-08-2007 18:05:
 Hi Felipe (and others),
Thanks very much for your help so far.

You are welcome. :-)


 Felipe Augusto van de Wiel wrote:
Assuming that's true, how would I change things 
 to get this problem to go away? Add some kind of group
 mapping or something? How does one go about doing that?
 
  Did you checked the Release Notes? And the Samba
 Official HOWTO about Group Mapping?
 
 I did check out the Release Notes, but I'm no samba 
 expert so I didn't fully understand them. I will
 check out the HOWTO on Group Mapping later.

Before 3.0.23, Samba automagically create some
groupmaps when you use tdbsam, after that, you need to
create them by yourself.

The HOWTO has the specific commands, it is not
a big chapter and it is really relevant to read and
understand.


 I was hoping you (or anybody, really) had a quick way 
 to get this done that didn't require me to do lots of
 research beforehand. Maybe somebody has come across
 and solved this problem before, and knew exactly what
 to do with say 1 simple command or something. Anyway,
 I'll look into it myself later.

Unfortunately, Samba requires some understanding
of what's going on, in this specific case it is not one
line that will solve your problem, but a few of them and
there is not much point in repeating the docs here, this
part of the HOWTO is good and clear on what to do.

You will use 'net groupmap'. And of course, you
need to have *nix accounts on the server that are mapped
by Samba to convert users from Windows world in real
users and permissions.


 Probably because you are not login anonymously from 
 Windows. Anonymous logins are different from WinXP
 logins, AFAICT.
 
 Okay, I didn't know that. When I try as a 
 specific user, I get the following:
 
 $ smbclient -L //www -U daryl
 Password:
 session setup failed: NT_STATUS_LOGON_FAILURE

Ok, this is a user/password error.

So, you are really missing the user or something
else related to permissions on the server.


When I check the log for that machine on the 
 samba server, the log is filled with the same sorts
 of messages as the generic log.smbd (but what you see
 below is from log.[worstation-name]):
 
 [2007/08/01 15:03:06, 0] auth/auth_util.c:create_builtin_administrators(792)
   create_builtin_administrators: Failed to create Administrators
 [2007/08/01 15:03:06, 0] auth/auth_util.c:create_builtin_users(758)
   create_builtin_users: Failed to create Users
 [2007/08/01 15:03:06, 0] auth/auth_util.c:create_builtin_administrators(792)
   create_builtin_administrators: Failed to create Administrators
 [2007/08/01 15:03:06, 0] auth/auth_util.c:create_builtin_users(758)
   create_builtin_users: Failed to create Users
 
I also saw this at the top of that log file, which seems strange 
 to me since I'm using tdbsam:
 
 [2007/08/01 10:06:10, 0] passdb/pdb_smbpasswd.c:startsmbfilepwent(241)
   startsmbfilepwent_internal: file /var/lib/samba/private/smbpasswd did 
 not exist. File successfully created.

I will keep my hint, try to create the groups,
users and groupmaps and make sure that everything is
consistent (SIDs, permissions, shares, usernames, uids,
gids).


 I tried increasing the log level to 10 before, and didn't see 
 anything unusual beyond the errors reported already. I will try that 
 again though, and get back to you.

It is not just the error, but also when the error happens
and what happened before it.


 Thanks again for the help.
 Sincerely,
Daryl.


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.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsdEICj65ZxU4gPQRCIwgAKCa4AFEmHT4nCa6m0qJwNVB4AJA1ACdGUGm
ava9r1ZQTQL2kZse1W9b61s=
=l0Yo
-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: samba pdc/bdc and trust relationship

2007-08-02 Thread Josh Kelley
On 8/2/07, Mohammad Zohny [EMAIL PROTECTED] wrote:
 kindly try to help me in this problem, I need the solution urgently!

 On 7/31/07, Mohammad Zohny [EMAIL PROTECTED] wrote:
 
  Hi all,
  My environment consists of 2 locations. the first has a windows NT4 PDC
  (for domain EGVLE) and another SLES10 PDC server (for VLE domain).with a
  bi-directional trust relationship between them.
  the second location will have SLES10 server that will work as a BDC for
  the samba VLE domain.
  I want to know how the bdc server will take the trust relationship from
  the PDC server?
  and what is the optimum solution to do that?

Domain trusts are explained in the Samba HOWTO Collection
(http://samba.org/samba/docs/man/Samba-HOWTO-Collection/) and may also
be covered in Samba By Example
(http://samba.org/samba/docs/man/Samba-Guide/).  Do you have specific
questions not addressed in the docs?

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


Re: [Samba] Permission denied when opening certain files - NT_STATUS_NOT_A_REPARSE_POINT

2007-08-02 Thread Josh Kelley
On 8/1/07, Daniel Bramkamp [EMAIL PROTECTED] wrote:
 I am experiencing a strange issue on our Samba PDC (3.0.24). Today I
 got called up by a user who was unable to open certain files from a
 samba share. He can open .doc, .xls, .pdf, etc. just fine, however, if
 he tries to open a .mdb file or an executable program from that share,
 he gets a permission denied message. Opening the same files from
 another user account logged into the same terminalserver works just
 fine.

 I have looked through the logs on the server and found a weird message:

 error packet at smbd/nttrans.c(90) cmd=160 (SMBnttrans)
 NT_STATUS_NOT_A_REPARSE_POINT

As a wild guess, have you tried rebooting the client and then
disconnecting and re-mapping the network drive?  Samba 3.0.23-3.0.25
contain some changes to DFS settings that have caused some users
problems, and although that doesn't sound like your problem, it might
be worth a try.

As a second wild guess...  I wonder if some client software specific
to that user is trying to interpret the file as a reparse point...  A
client-side tool like Sysinternals' Process Monitor
(http://www.microsoft.com/technet/sysinternals/Utilities/ProcessMonitor.mspx)
could show you the file operations that the client is attempting and
might help show what's going on.

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


[Samba] Problem compliling samba 3.0.25b with openldap-2.3.32(stable)

2007-08-02 Thread Angela Gavazzi
Hallo!

When compiling samba 3.0.25b with openldap-2.3.32 make failes with the 
following error:
Compiling passdb/pdb_ldap.c
./source/passdb/pdb_ldap.c: In function ‘ldapsam_get_new_rid’:
./source/passdb/pdb_ldap.c:4459: error: incompatible types in assignment
./source/passdb/pdb_ldap.c: In function ‘pdb_init_ldapsam’:
./source/passdb/pdb_ldap.c:5654: error: incompatible types in assignment
The following command failed:
gcc -I. -I/usr/src/samba/samba-070802/samba-3.0.25b/./source  
-I/usr/local/ldap/include -D_SAMBA_BUILD_=3  
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/iniparser/src -Iinclude 
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/include -I. 
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source 
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/lib/replace 
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/lib/talloc 
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/tdb/include 
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/libaddns 
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/librpc -DHAVE_CONFIG_H  
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLDAP_DEPRECATED
-I/usr/src/samba/samba-070802/samba-3.0.25b/./source/lib -D_SAMBA_BUILD_=3 
-fPIC -c ./source/passdb/pdb_ldap.c -o 
passdb/pdb_ldap.o
make: *** [passdb/pdb_ldap.o] Fehler 1


This is my install script which works with samba 3.0.25 on the same machine.

CFLAGS=-I/usr/local/ldap/include
LDFLAGS=-L/usr/local/ldap/lib

export CFLAGS
export LDFLAGS

configure \
'--prefix=/usr/local/samba' \
'--sysconfdir=/etc' \
'--localstatedir=/usr/local/samba/var' \
'--with-configdir=/etc/samba' \
'--with-ldap=/usr/local/ldap' \
'--with-privatedir=/etc/samba' \
'--with-lockdir=/usr/local/samba/var/lock' \
'--with-piddir=/usr/local/samba/var/run' \
'--with-swatdir=/usr/local/samba/swat' \
'--with-smbmount' \
'--with-quotas' \
'--with-acl-support'

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


Re: [Samba] Receiving SMB: Server stopped responding

2007-08-02 Thread Josh Kelley
On 8/1/07, Turbo Fredriksson [EMAIL PROTECTED] wrote:
 I've upgraded to 3.0.25b, and I can't seem to get it
 running for more than a few minutes before it starts
 failing to find users...

Since system-level username resolution is failing, could you provide a
bit more information on your system?  What OS?  I'm assuming from your
smb.conf file that you're using nss_ldap (or something equivalent)?
Is nscd running?  (And is it stable?)  Is winbind running?

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


Re: [Samba] Help cleaning up domain SID mess...

2007-08-02 Thread Bjørn Tore Sund

Phil Burrow wrote:

Bjoern Tore Sund wrote:

 No Windows here, this is the cifs disk server for 800 Linux clients.
 None of which are members of the domain in any meaningful way.  I just
 want all the servers to authenticate against the same LDAP server, the
 domain is irrelevant for functionality.  Hmmm.  Which means that I 
might
 just get away with setting the same SID on all four domains and 
leave it

 at that... ?

 -BT

Makes sense if thats all you need and theres no Windows stuff to 
break, yep :) Sorry for being presumptuous about your setup!


You would need to remove three of the sambaDomainName entries if you 
only want a single domain though, and ensure that the only one present 
is sambaDomainName=UNIX.


When you do net getlocalsid, it should be looking up the details for 
the domain you specified in smb.conf (UNIX) in your LDAP directory. 
Check your logs, see if it's happening and see what questions it's 
asking your LDAP server, that way you can see where it's getting its 
unusual SID information from and why it may not be setting the SID 
like it should.


i.e. on one of my broken systems that I use for playing about with 
stuff, I just booted to test it and I can see that if I do net 
getlocalsid its looking for:


smbldap_search_domain_info: Query was: dc=mydomain,dc=co,dc=uk, 
((objectClass=sambaDomain)(sambaDomainName=MYDOMAINFROMSMB-CONF))

Just feedback, since things are working ok now.

The domain question isn't relevant, so I really don't care whether I 
have one or four.  Which is just as well, because the servers all ignore 
the domainName=UNIX entry.  If I delete their LDAP entry, they'll simply 
create a new one.  Which is consistent with documentation, with 
security=user, any workgroup- or realm-setting is ignored, and with 
security=anything-but-user, ldapsam doesn't work.  I've checked and 
confirmed that 'net lookup sid' in all cases return the local domain and 
as long as I have no need to connect the domains I'm fine.


Thanks for your help!

Bjørn

--
Bj¯rn Tore Sund   Phone: 555-84894   Email:   [EMAIL PROTECTED]
IT department VIP:   81724   Support: http://bs.uib.no 
Univ. of Bergen


When in fear and when in doubt, run in circles, scream and shout.

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


[Samba] Samba Quotas using LDAP?

2007-08-02 Thread Steve Scanavarro
Hello everyone.
I would like to create a file share samba, that uses a LDAP base to
authenticate my users.
What I would like to do is to create a quota per user. Is that a way for
doing that using LDAP to store the quota limit, AND samba understand this?

If not, what would be the better way for quota in Samba?

Thanks in advance for any help.

Best,

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


Re: [Samba] Samba Quotas using LDAP?

2007-08-02 Thread Cleber P. de Souza
If your users can be retrieved by 'getent passwd' you could use quota
in the filesystem.


On 8/2/07, Steve Scanavarro [EMAIL PROTECTED] wrote:
 Hello everyone.
 I would like to create a file share samba, that uses a LDAP base to
 authenticate my users.
 What I would like to do is to create a quota per user. Is that a way for
 doing that using LDAP to store the quota limit, AND samba understand this?

 If not, what would be the better way for quota in Samba?

 Thanks in advance for any help.

 Best,

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



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


Re: [Samba] Receiving SMB: Server stopped responding

2007-08-02 Thread Turbo Fredriksson
 Josh == Josh Kelley [EMAIL PROTECTED] writes:

Josh On 8/1/07, Turbo Fredriksson [EMAIL PROTECTED] wrote:
 I've upgraded to 3.0.25b, and I can't seem to get it running
 for more than a few minutes before it starts failing to find
 users...

And what makes things strange is that it doesn't seem to matter if I
disable the LDAP 'driver', and use a tdbsam instead. Same broken
behaviour (there it complains about 'Failed to find Unix account for
xxx')...

And no matter what configuration I try, it still locks up.

Josh Since system-level username resolution is failing, could you
Josh provide a bit more information on your system?  What OS?

Debian GNU/Linux Sarge (with some bits and pieces from unstable and
homemade OpenLDAP packages etc).


I tried removing all my samba packages, and install the Sarge
originals (version '3.0.14a-3sarge6') and there everything works just
fine. The weird part is that I've actually made my own version of that
package after trying a lot of version not working. That homemade (just
a recompile) didn't work either!


If I run my own package, I get about half a minute 'blackout' (or
'hang') before it starts responding and then it responds correctly
for a couple of minutes before it starts failing again.

So it's something in my build environment that's fucked it seems.

Josh I'm assuming from your smb.conf file that you're using
Josh nss_ldap (or something equivalent)? 

Yes togheter with pam_ldap and pam_krb5. Works great.

Josh Is nscd running? 

No, not even installed! I _HATE_ that thing! Every single time I've
tried using it over the years, login etc really fucks up! But I'll
give it a try any way while I wait for the 3.0.25b to build again
(this time I'm saving a full log of the build process which I will
have a look at after it's done)...


UPDATE: Dang, that actually seemed to work! Then the semi-question
is why pre 2.0.24 worked without without NSCD (and if
I should care - time will tell if NSCD is usable now).

Josh Is winbind running?

Yes. But I have to recreate the /var/run/samba/winbindd_cache.tdb
file before i start winbindd, othervise it won't start (and no
error or warning why not - not even with '-d9'!). But once that's
done, winbindd runs perfectly.
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Receiving SMB: Server stopped responding

2007-08-02 Thread Turbo Fredriksson
 Turbo == Turbo Fredriksson [EMAIL PROTECTED] writes:

Josh Is nscd running?

Turbo UPDATE: Dang, that actually seemed to work!

After running this almost all day now, I still get the
'Receiving SMB: Server stopped responding' message, but
other than that, everything now seems to be working as
it's supposed (with my homemade 3.0.25b packages).
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Samba Domain member server also with local user

2007-08-02 Thread Leigh Wedding
Say I have a Samba PDC with LDAP SAM backend (say called PDC1).  Then I
have a domain member server (security = domain, say called SERV1, also
Samba); domain users can connect fine to access shares on SERV1.  Is it
also possible to create local users on SERV1 which can be stored in the
tdbsam backend and /etc/passwd, such that if login fails as a domain user,
then login can be attempted as a local user?  Then on successful login
as a local user, the connection proceeds based on the local permissions
for that user.  Is this possible?

Perhaps it is needed to change SERV1 to security = user, and then set
passdb backend = tdbsam:... ldapsam:  Would this do the job?  Would
this cause any problems since now SERV1 is now a standalone server?

Thanks,
Leigh.



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


[Samba] Problem with name resolution (I think)

2007-08-02 Thread Joakim Lagerqvist
Dear all,

I believe I have a problem with name resolution and I wonder if anyone
here might have a cure for it or can point me to the right direction?

It is a fairly small network (about 30 client computers) but it seems to
be only one client computer (XP service pack 2) that has the problem.
This is what happens:
The client brows the network and find the samba server and start
browsing the folders and files. However, after a while (perhaps a minut
or two) the client gets an error message that the server is not
available or he has not permission. The client has to find the server
again and login. However if he uses the IP address of the samba server
instead, this do not happen.

I strongly believe it is a problem with name resolution and that the XP
computer forgets the server name after a while.

The samba server has also a proxy DNS installed to handle DNS lookups
and the server has an entry there. It is also no problem to do DNS
lookups of the samba server or using other protocols (such as pinging to
the server name). Below is a dump of smb.conf:

[global]
workgroup = VOLVO
server string = File sharing server
interfaces = eth1
log file = /var/log/samba/%m.log
max log size = 50
smb ports = 139
load printers = No
os level = 255
preferred master = Yes

[homes]
comment = Home Directories
read only = No
create mask = 0770
force create mode = 0770
directory mask = 0770
force directory mode = 0770
browseable = No


Thanks in advance!

best regards,
Joakim

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


Re: [Samba] Samba Quotas using LDAP?

2007-08-02 Thread Andrew Bartlett
On Thu, 2007-08-02 at 14:48 -0300, Cleber P. de Souza wrote:
 If your users can be retrieved by 'getent passwd' you could use quota
 in the filesystem.
 
 
 On 8/2/07, Steve Scanavarro [EMAIL PROTECTED] wrote:
  Hello everyone.
  I would like to create a file share samba, that uses a LDAP base to
  authenticate my users.
  What I would like to do is to create a quota per user. Is that a way for
  doing that using LDAP to store the quota limit, AND samba understand this?
 
  If not, what would be the better way for quota in Samba?
 
  Thanks in advance for any help.
 

I did this once, with a nasty script I found to sync the quotas between
LDAP and the disk.  It was *really* ugly (running edquota, with EDITOR
set to a command that filled the file in as expected!), but it did keep
the students in line...

Andrew Bartlett

-- 
Andrew Bartletthttp://samba.org/~abartlet/
Authentication Developer, Samba Team   http://samba.org
Samba Developer, Red Hat Inc.  http://redhat.com


signature.asc
Description: This is a digitally signed message part
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba

svn commit: samba r24120 - in branches/SAMBA_3_2/source: include lib modules printing smbd

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 08:53:24 + (Thu, 02 Aug 2007)
New Revision: 24120

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

Log:
add a file_id_create() hook into the VFS layer

it's needed for some cluster filesystems to
overload this function.

metze
Modified:
   branches/SAMBA_3_2/source/include/vfs.h
   branches/SAMBA_3_2/source/include/vfs_macros.h
   branches/SAMBA_3_2/source/lib/file_id.c
   branches/SAMBA_3_2/source/modules/vfs_default.c
   branches/SAMBA_3_2/source/printing/printfsp.c
   branches/SAMBA_3_2/source/smbd/close.c
   branches/SAMBA_3_2/source/smbd/filename.c
   branches/SAMBA_3_2/source/smbd/open.c
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/include/vfs.h
===
--- branches/SAMBA_3_2/source/include/vfs.h 2007-08-02 05:50:40 UTC (rev 
24119)
+++ branches/SAMBA_3_2/source/include/vfs.h 2007-08-02 08:53:24 UTC (rev 
24120)
@@ -71,6 +71,7 @@
 /* Changed to version21 to add chflags operation -- jpeach */
 /* Changed to version22 to add lchown operation -- jra */
 /* Leave at 22 - not yet released. But change set_nt_acl to return an 
NTSTATUS. jra. */
+/* Leave at 22 - not yet released. Add file_id_create operation. --metze */
 #define SMB_VFS_INTERFACE_VERSION 22
 
 
@@ -162,6 +163,7 @@
SMB_VFS_OP_REALPATH,
SMB_VFS_OP_NOTIFY_WATCH,
SMB_VFS_OP_CHFLAGS,
+   SMB_VFS_OP_FILE_ID_CREATE,
 
/* NT ACL operations. */
 
@@ -295,7 +297,8 @@
  struct notify_event 
*ev),
 void *private_data, void *handle_p);
int (*chflags)(struct vfs_handle_struct *handle, const char 
*path, uint flags);
-   
+   struct file_id (*file_id_create)(struct vfs_handle_struct 
*handle, SMB_DEV_T dev, SMB_INO_T inode);
+
/* NT ACL operations. */

size_t (*fget_nt_acl)(struct vfs_handle_struct *handle, struct 
files_struct *fsp, int fd,  uint32 security_info, struct security_descriptor 
**ppdesc);
@@ -414,6 +417,7 @@
struct vfs_handle_struct *realpath;
struct vfs_handle_struct *notify_watch;
struct vfs_handle_struct *chflags;
+   struct vfs_handle_struct *file_id_create;
 
/* NT ACL operations. */
 

Modified: branches/SAMBA_3_2/source/include/vfs_macros.h
===
--- branches/SAMBA_3_2/source/include/vfs_macros.h  2007-08-02 05:50:40 UTC 
(rev 24119)
+++ branches/SAMBA_3_2/source/include/vfs_macros.h  2007-08-02 08:53:24 UTC 
(rev 24120)
@@ -80,6 +80,7 @@
 #define SMB_VFS_REALPATH(conn, path, resolved_path) 
((conn)-vfs.ops.realpath((conn)-vfs.handles.realpath, (path), 
(resolved_path)))
 #define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) 
((conn)-vfs.ops.notify_watch((conn)-vfs.handles.notify_watch, (ctx), (e), 
(callback), (private_data), (handle_p)))
 #define SMB_VFS_CHFLAGS(conn, path, flags) 
((conn)-vfs.ops.chflags((conn)-vfs.handles.chflags, (path), (flags)))
+#define SMB_VFS_FILE_ID_CREATE(conn, dev, inode) 
((conn)-vfs.ops.file_id_create((conn)-vfs.handles.file_id_create, (dev), 
(inode)))
 
 /* NT ACL operations. */
 #define SMB_VFS_FGET_NT_ACL(fsp, fd, security_info, ppdesc) 
((fsp)-conn-vfs.ops.fget_nt_acl((fsp)-conn-vfs.handles.fget_nt_acl, (fsp), 
(fd), (security_info), (ppdesc)))
@@ -197,6 +198,7 @@
 #define SMB_VFS_OPAQUE_REALPATH(conn, path, resolved_path) 
((conn)-vfs_opaque.ops.realpath((conn)-vfs_opaque.handles.realpath, (path), 
(resolved_path)))
 #define SMB_VFS_OPAQUE_NOTIFY_WATCH(conn, ctx, e, callback, private_data, 
handle_p) 
((conn)-vfs_opaque.ops.notify_watch((conn)-vfs_opaque.handles.notify_watch, 
(ctx), (e), (callback), (private_data), (handle_p)))
 #define SMB_VFS_OPAQUE_CHFLAGS(conn, path, flags) 
((conn)-vfs_opaque.ops.chflags((conn)-vfs_opaque.handles.chflags, (path), 
(flags)))
+#define SMB_VFS_OPAQUE_FILE_ID_CREATE(conn, dev, inode) 
((conn)-vfs.ops_opaque.file_id_create((conn)-vfs_opaque.handles.file_id_create,
 (dev), (inode)))
 
 /* NT ACL operations. */
 #define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, fd, security_info, ppdesc) 
((fsp)-conn-vfs_opaque.ops.fget_nt_acl((fsp)-conn-vfs_opaque.handles.fget_nt_acl,
 (fsp), (fd), (security_info), (ppdesc)))
@@ -315,6 +317,7 @@
 #define SMB_VFS_NEXT_REALPATH(handle, path, resolved_path) 
((handle)-vfs_next.ops.realpath((handle)-vfs_next.handles.realpath, (path), 
(resolved_path)))
 #define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, 
handle_p) 
((conn)-vfs_next.ops.notify_watch((conn)-vfs_next.handles.notify_watch, 
(ctx), (e), (callback), (private_data), (handle_p)))
 #define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) 

svn commit: samba r24121 - in branches/SAMBA_3_2_0/source/locking: .

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 08:56:10 + (Thu, 02 Aug 2007)
New Revision: 24121

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

Log:
merge from SAMBA_3_2:
use locking_key() instead of forming the TDB_DATA key
by hand

metze
Modified:
   branches/SAMBA_3_2_0/source/locking/locking.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/locking/locking.c
===
--- branches/SAMBA_3_2_0/source/locking/locking.c   2007-08-02 08:53:24 UTC 
(rev 24120)
+++ branches/SAMBA_3_2_0/source/locking/locking.c   2007-08-02 08:56:10 UTC 
(rev 24121)
@@ -782,11 +782,8 @@
const char *fname)
 {
struct share_mode_lock *lck;
-   TDB_DATA key;
+   TDB_DATA key = locking_key(id);
 
-   key.dptr = (unsigned char *)id;
-   key.dsize = sizeof(id);
-
if (!(lck = TALLOC_P(mem_ctx, struct share_mode_lock))) {
DEBUG(0, (talloc failed\n));
return NULL;



svn commit: samba r24126 - in branches/SAMBA_3_2_0/source/utils: .

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 09:23:16 + (Thu, 02 Aug 2007)
New Revision: 24126

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

Log:
merge from SAMBA_3_2:
use TALLOC_FREE()

metze
Modified:
   branches/SAMBA_3_2_0/source/utils/status.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/utils/status.c
===
--- branches/SAMBA_3_2_0/source/utils/status.c  2007-08-02 09:22:47 UTC (rev 
24125)
+++ branches/SAMBA_3_2_0/source/utils/status.c  2007-08-02 09:23:16 UTC (rev 
24126)
@@ -219,7 +219,7 @@
 (double)start, (double)size,
 sharepath, fname);
 
-   talloc_free(share_mode);
+   TALLOC_FREE(share_mode);
 }
 
 static int traverse_fn1(struct db_record *rec,
@@ -369,7 +369,7 @@

d_printf(---\n);
 
db-traverse_read(db, traverse_sessionid, NULL);
-   talloc_free(db);
+   TALLOC_FREE(db);
}
 
if (processes_only) 



svn commit: samba r24123 - in branches/SAMBA_3_2: examples/VFS source/modules

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 09:19:04 + (Thu, 02 Aug 2007)
New Revision: 24123

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

Log:
add file_id_create() to some vfs modules

metze
Modified:
   branches/SAMBA_3_2/examples/VFS/skel_opaque.c
   branches/SAMBA_3_2/examples/VFS/skel_transparent.c
   branches/SAMBA_3_2/source/modules/vfs_full_audit.c


Changeset:
Modified: branches/SAMBA_3_2/examples/VFS/skel_opaque.c
===
--- branches/SAMBA_3_2/examples/VFS/skel_opaque.c   2007-08-02 08:59:17 UTC 
(rev 24122)
+++ branches/SAMBA_3_2/examples/VFS/skel_opaque.c   2007-08-02 09:19:04 UTC 
(rev 24123)
@@ -280,6 +280,15 @@
return -1;
 }
 
+static struct file_id skel_file_id_create(vfs_handle_struct *handle,
+ SMB_DEV_T dev, SMB_INO_T inode)
+{
+   struct file_id id_zero;
+   ZERO_STRUCT(id_zero);
+   errno = ENOSYS;
+   return id_zero;
+}
+
 static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
int fd, uint32 security_info, SEC_DESC **ppdesc)
 {
@@ -618,9 +627,8 @@
{SMB_VFS_OP(skel_realpath), SMB_VFS_OP_REALPATH,
SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_notify_watch), 
SMB_VFS_OP_NOTIFY_WATCH,SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_chflags),  SMB_VFS_OP_CHFLAGS, 
SMB_VFS_LAYER_OPAQUE},
+   {SMB_VFS_OP(skel_file_id_create),   
SMB_VFS_OP_FILE_ID_CREATE,  SMB_VFS_LAYER_OPAQUE},
 
-
-
/* NT File ACL operations */
 
{SMB_VFS_OP(skel_fget_nt_acl),  SMB_VFS_OP_FGET_NT_ACL, 
SMB_VFS_LAYER_OPAQUE},

Modified: branches/SAMBA_3_2/examples/VFS/skel_transparent.c
===
--- branches/SAMBA_3_2/examples/VFS/skel_transparent.c  2007-08-02 08:59:17 UTC 
(rev 24122)
+++ branches/SAMBA_3_2/examples/VFS/skel_transparent.c  2007-08-02 09:19:04 UTC 
(rev 24123)
@@ -273,6 +273,12 @@
return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
 }
 
+static struct file_id skel_file_id_create(vfs_handle_struct *handle,
+ SMB_DEV_T dev, SMB_INO_T inode)
+{
+   return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
+}
+
 static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
int fd, uint32 security_info, SEC_DESC **ppdesc)
 {
@@ -579,6 +585,7 @@
{SMB_VFS_OP(skel_realpath), SMB_VFS_OP_REALPATH,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(skel_notify_watch), 
SMB_VFS_OP_NOTIFY_WATCH,SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(skel_chflags),  SMB_VFS_OP_CHFLAGS, 
SMB_VFS_LAYER_TRANSPARENT},
+   {SMB_VFS_OP(skel_file_id_create),   
SMB_VFS_OP_FILE_ID_CREATE,  SMB_VFS_LAYER_TRANSPARENT},
 
/* NT File ACL operations */
 

Modified: branches/SAMBA_3_2/source/modules/vfs_full_audit.c
===
--- branches/SAMBA_3_2/source/modules/vfs_full_audit.c  2007-08-02 08:59:17 UTC 
(rev 24122)
+++ branches/SAMBA_3_2/source/modules/vfs_full_audit.c  2007-08-02 09:19:04 UTC 
(rev 24123)
@@ -184,6 +184,8 @@
void *private_data, void *handle_p);
 static int smb_full_audit_chflags(vfs_handle_struct *handle,
const char *path, uint flags);
+static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct 
*handle,
+   SMB_DEV_T dev, SMB_INO_T 
inode);
 static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, 
files_struct *fsp,
int fd, uint32 security_info,
SEC_DESC **ppdesc);
@@ -413,6 +415,8 @@
 SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_chflags),SMB_VFS_OP_CHFLAGS,
 SMB_VFS_LAYER_LOGGER},
+   {SMB_VFS_OP(smb_full_audit_file_id_create), 
SMB_VFS_OP_FILE_ID_CREATE,
+SMB_VFS_LAYER_LOGGER},
 
/* NT ACL operations. */
 
@@ -579,6 +583,7 @@
{ SMB_VFS_OP_REALPATH,  realpath },
{ SMB_VFS_OP_NOTIFY_WATCH, notify_watch },
{ SMB_VFS_OP_CHFLAGS,   chflags },
+   { SMB_VFS_OP_FILE_ID_CREATE,file_id_create },
{ SMB_VFS_OP_FGET_NT_ACL,   fget_nt_acl },
{ SMB_VFS_OP_GET_NT_ACL,get_nt_acl },
{ SMB_VFS_OP_FSET_NT_ACL,   fset_nt_acl },
@@ -1466,6 +1471,23 @@
return result;
 }
 
+static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct 
*handle,
+   SMB_DEV_T dev, SMB_INO_T 
inode)
+{
+   struct file_id id_zero;
+   struct file_id result;
+
+   ZERO_STRUCT(id_zero);
+
+   result = 

svn commit: samba r24124 - in branches/SAMBA_3_2_0: examples/VFS source/modules

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 09:19:52 + (Thu, 02 Aug 2007)
New Revision: 24124

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

Log:
merge from SAMBA_3_2:
add file_id_create() to some vfs modules

metze
Modified:
   branches/SAMBA_3_2_0/examples/VFS/skel_opaque.c
   branches/SAMBA_3_2_0/examples/VFS/skel_transparent.c
   branches/SAMBA_3_2_0/source/modules/vfs_full_audit.c


Changeset:
Modified: branches/SAMBA_3_2_0/examples/VFS/skel_opaque.c
===
--- branches/SAMBA_3_2_0/examples/VFS/skel_opaque.c 2007-08-02 09:19:04 UTC 
(rev 24123)
+++ branches/SAMBA_3_2_0/examples/VFS/skel_opaque.c 2007-08-02 09:19:52 UTC 
(rev 24124)
@@ -280,6 +280,15 @@
return -1;
 }
 
+static struct file_id skel_file_id_create(vfs_handle_struct *handle,
+ SMB_DEV_T dev, SMB_INO_T inode)
+{
+   struct file_id id_zero;
+   ZERO_STRUCT(id_zero);
+   errno = ENOSYS;
+   return id_zero;
+}
+
 static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
int fd, uint32 security_info, SEC_DESC **ppdesc)
 {
@@ -618,9 +627,8 @@
{SMB_VFS_OP(skel_realpath), SMB_VFS_OP_REALPATH,
SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_notify_watch), 
SMB_VFS_OP_NOTIFY_WATCH,SMB_VFS_LAYER_OPAQUE},
{SMB_VFS_OP(skel_chflags),  SMB_VFS_OP_CHFLAGS, 
SMB_VFS_LAYER_OPAQUE},
+   {SMB_VFS_OP(skel_file_id_create),   
SMB_VFS_OP_FILE_ID_CREATE,  SMB_VFS_LAYER_OPAQUE},
 
-
-
/* NT File ACL operations */
 
{SMB_VFS_OP(skel_fget_nt_acl),  SMB_VFS_OP_FGET_NT_ACL, 
SMB_VFS_LAYER_OPAQUE},

Modified: branches/SAMBA_3_2_0/examples/VFS/skel_transparent.c
===
--- branches/SAMBA_3_2_0/examples/VFS/skel_transparent.c2007-08-02 
09:19:04 UTC (rev 24123)
+++ branches/SAMBA_3_2_0/examples/VFS/skel_transparent.c2007-08-02 
09:19:52 UTC (rev 24124)
@@ -273,6 +273,12 @@
return SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
 }
 
+static struct file_id skel_file_id_create(vfs_handle_struct *handle,
+ SMB_DEV_T dev, SMB_INO_T inode)
+{
+   return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
+}
+
 static size_t skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
int fd, uint32 security_info, SEC_DESC **ppdesc)
 {
@@ -579,6 +585,7 @@
{SMB_VFS_OP(skel_realpath), SMB_VFS_OP_REALPATH,
SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(skel_notify_watch), 
SMB_VFS_OP_NOTIFY_WATCH,SMB_VFS_LAYER_TRANSPARENT},
{SMB_VFS_OP(skel_chflags),  SMB_VFS_OP_CHFLAGS, 
SMB_VFS_LAYER_TRANSPARENT},
+   {SMB_VFS_OP(skel_file_id_create),   
SMB_VFS_OP_FILE_ID_CREATE,  SMB_VFS_LAYER_TRANSPARENT},
 
/* NT File ACL operations */
 

Modified: branches/SAMBA_3_2_0/source/modules/vfs_full_audit.c
===
--- branches/SAMBA_3_2_0/source/modules/vfs_full_audit.c2007-08-02 
09:19:04 UTC (rev 24123)
+++ branches/SAMBA_3_2_0/source/modules/vfs_full_audit.c2007-08-02 
09:19:52 UTC (rev 24124)
@@ -184,6 +184,8 @@
void *private_data, void *handle_p);
 static int smb_full_audit_chflags(vfs_handle_struct *handle,
const char *path, uint flags);
+static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct 
*handle,
+   SMB_DEV_T dev, SMB_INO_T 
inode);
 static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, 
files_struct *fsp,
int fd, uint32 security_info,
SEC_DESC **ppdesc);
@@ -413,6 +415,8 @@
 SMB_VFS_LAYER_LOGGER},
{SMB_VFS_OP(smb_full_audit_chflags),SMB_VFS_OP_CHFLAGS,
 SMB_VFS_LAYER_LOGGER},
+   {SMB_VFS_OP(smb_full_audit_file_id_create), 
SMB_VFS_OP_FILE_ID_CREATE,
+SMB_VFS_LAYER_LOGGER},
 
/* NT ACL operations. */
 
@@ -579,6 +583,7 @@
{ SMB_VFS_OP_REALPATH,  realpath },
{ SMB_VFS_OP_NOTIFY_WATCH, notify_watch },
{ SMB_VFS_OP_CHFLAGS,   chflags },
+   { SMB_VFS_OP_FILE_ID_CREATE,file_id_create },
{ SMB_VFS_OP_FGET_NT_ACL,   fget_nt_acl },
{ SMB_VFS_OP_GET_NT_ACL,get_nt_acl },
{ SMB_VFS_OP_FSET_NT_ACL,   fset_nt_acl },
@@ -1466,6 +1471,23 @@
return result;
 }
 
+static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct 
*handle,
+   SMB_DEV_T dev, SMB_INO_T 
inode)
+{
+   struct file_id id_zero;
+   struct file_id 

svn commit: samba r24125 - in branches/SAMBA_3_2/source/utils: .

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 09:22:47 + (Thu, 02 Aug 2007)
New Revision: 24125

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

Log:
use TALLOC_FREE()

metze
Modified:
   branches/SAMBA_3_2/source/utils/status.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/status.c
===
--- branches/SAMBA_3_2/source/utils/status.c2007-08-02 09:19:52 UTC (rev 
24124)
+++ branches/SAMBA_3_2/source/utils/status.c2007-08-02 09:22:47 UTC (rev 
24125)
@@ -219,7 +219,7 @@
 (double)start, (double)size,
 sharepath, fname);
 
-   talloc_free(share_mode);
+   TALLOC_FREE(share_mode);
 }
 
 static int traverse_fn1(struct db_record *rec,
@@ -369,7 +369,7 @@

d_printf(---\n);
 
db-traverse_read(db, traverse_sessionid, NULL);
-   talloc_free(db);
+   TALLOC_FREE(db);
}
 
if (processes_only) 



svn commit: samba r24122 - in branches/SAMBA_3_2_0/source: include lib modules printing smbd

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 08:59:17 + (Thu, 02 Aug 2007)
New Revision: 24122

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

Log:
merge from SAMBA_3_2:
add a file_id_create() hook into the VFS layer

it's needed for some cluster filesystems to
overload this function.

metze
Modified:
   branches/SAMBA_3_2_0/source/include/vfs.h
   branches/SAMBA_3_2_0/source/include/vfs_macros.h
   branches/SAMBA_3_2_0/source/lib/file_id.c
   branches/SAMBA_3_2_0/source/modules/vfs_default.c
   branches/SAMBA_3_2_0/source/printing/printfsp.c
   branches/SAMBA_3_2_0/source/smbd/close.c
   branches/SAMBA_3_2_0/source/smbd/filename.c
   branches/SAMBA_3_2_0/source/smbd/open.c
   branches/SAMBA_3_2_0/source/smbd/reply.c
   branches/SAMBA_3_2_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/include/vfs.h
===
--- branches/SAMBA_3_2_0/source/include/vfs.h   2007-08-02 08:56:10 UTC (rev 
24121)
+++ branches/SAMBA_3_2_0/source/include/vfs.h   2007-08-02 08:59:17 UTC (rev 
24122)
@@ -71,6 +71,7 @@
 /* Changed to version21 to add chflags operation -- jpeach */
 /* Changed to version22 to add lchown operation -- jra */
 /* Leave at 22 - not yet released. But change set_nt_acl to return an 
NTSTATUS. jra. */
+/* Leave at 22 - not yet released. Add file_id_create operation. --metze */
 #define SMB_VFS_INTERFACE_VERSION 22
 
 
@@ -162,6 +163,7 @@
SMB_VFS_OP_REALPATH,
SMB_VFS_OP_NOTIFY_WATCH,
SMB_VFS_OP_CHFLAGS,
+   SMB_VFS_OP_FILE_ID_CREATE,
 
/* NT ACL operations. */
 
@@ -295,7 +297,8 @@
  struct notify_event 
*ev),
 void *private_data, void *handle_p);
int (*chflags)(struct vfs_handle_struct *handle, const char 
*path, uint flags);
-   
+   struct file_id (*file_id_create)(struct vfs_handle_struct 
*handle, SMB_DEV_T dev, SMB_INO_T inode);
+
/* NT ACL operations. */

size_t (*fget_nt_acl)(struct vfs_handle_struct *handle, struct 
files_struct *fsp, int fd,  uint32 security_info, struct security_descriptor 
**ppdesc);
@@ -414,6 +417,7 @@
struct vfs_handle_struct *realpath;
struct vfs_handle_struct *notify_watch;
struct vfs_handle_struct *chflags;
+   struct vfs_handle_struct *file_id_create;
 
/* NT ACL operations. */
 

Modified: branches/SAMBA_3_2_0/source/include/vfs_macros.h
===
--- branches/SAMBA_3_2_0/source/include/vfs_macros.h2007-08-02 08:56:10 UTC 
(rev 24121)
+++ branches/SAMBA_3_2_0/source/include/vfs_macros.h2007-08-02 08:59:17 UTC 
(rev 24122)
@@ -80,6 +80,7 @@
 #define SMB_VFS_REALPATH(conn, path, resolved_path) 
((conn)-vfs.ops.realpath((conn)-vfs.handles.realpath, (path), 
(resolved_path)))
 #define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) 
((conn)-vfs.ops.notify_watch((conn)-vfs.handles.notify_watch, (ctx), (e), 
(callback), (private_data), (handle_p)))
 #define SMB_VFS_CHFLAGS(conn, path, flags) 
((conn)-vfs.ops.chflags((conn)-vfs.handles.chflags, (path), (flags)))
+#define SMB_VFS_FILE_ID_CREATE(conn, dev, inode) 
((conn)-vfs.ops.file_id_create((conn)-vfs.handles.file_id_create, (dev), 
(inode)))
 
 /* NT ACL operations. */
 #define SMB_VFS_FGET_NT_ACL(fsp, fd, security_info, ppdesc) 
((fsp)-conn-vfs.ops.fget_nt_acl((fsp)-conn-vfs.handles.fget_nt_acl, (fsp), 
(fd), (security_info), (ppdesc)))
@@ -197,6 +198,7 @@
 #define SMB_VFS_OPAQUE_REALPATH(conn, path, resolved_path) 
((conn)-vfs_opaque.ops.realpath((conn)-vfs_opaque.handles.realpath, (path), 
(resolved_path)))
 #define SMB_VFS_OPAQUE_NOTIFY_WATCH(conn, ctx, e, callback, private_data, 
handle_p) 
((conn)-vfs_opaque.ops.notify_watch((conn)-vfs_opaque.handles.notify_watch, 
(ctx), (e), (callback), (private_data), (handle_p)))
 #define SMB_VFS_OPAQUE_CHFLAGS(conn, path, flags) 
((conn)-vfs_opaque.ops.chflags((conn)-vfs_opaque.handles.chflags, (path), 
(flags)))
+#define SMB_VFS_OPAQUE_FILE_ID_CREATE(conn, dev, inode) 
((conn)-vfs.ops_opaque.file_id_create((conn)-vfs_opaque.handles.file_id_create,
 (dev), (inode)))
 
 /* NT ACL operations. */
 #define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, fd, security_info, ppdesc) 
((fsp)-conn-vfs_opaque.ops.fget_nt_acl((fsp)-conn-vfs_opaque.handles.fget_nt_acl,
 (fsp), (fd), (security_info), (ppdesc)))
@@ -315,6 +317,7 @@
 #define SMB_VFS_NEXT_REALPATH(handle, path, resolved_path) 
((handle)-vfs_next.ops.realpath((handle)-vfs_next.handles.realpath, (path), 
(resolved_path)))
 #define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, 
handle_p) 
((conn)-vfs_next.ops.notify_watch((conn)-vfs_next.handles.notify_watch, 
(ctx), (e), (callback), (private_data), (handle_p)))
 #define 

svn commit: samba r24127 - in branches/SAMBA_4_0/source: libnet torture/libnet winbind

2007-08-02 Thread abartlet
Author: abartlet
Date: 2007-08-02 13:08:39 + (Thu, 02 Aug 2007)
New Revision: 24127

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

Log:
Set the Domain SID into the libnet context, and have libnet_UserInfo
return full SIDs for the user SID and primary group sid.

This should help kai with his getpwnam work in winbind.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/libnet/libnet.h
   branches/SAMBA_4_0/source/libnet/libnet_domain.c
   branches/SAMBA_4_0/source/libnet/libnet_user.c
   branches/SAMBA_4_0/source/libnet/libnet_user.h
   branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c
   branches/SAMBA_4_0/source/winbind/wb_init_domain.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet.h
===
--- branches/SAMBA_4_0/source/libnet/libnet.h   2007-08-02 09:23:16 UTC (rev 
24126)
+++ branches/SAMBA_4_0/source/libnet/libnet.h   2007-08-02 13:08:39 UTC (rev 
24127)
@@ -28,7 +28,8 @@
/* samr connection parameters - opened handles and related properties */
struct {
struct dcerpc_pipe *pipe;
-   const char *name;
+   char *name;
+   struct dom_sid *sid;
uint32_t access_mask;
struct policy_handle handle;
struct policy_handle connect_handle;
@@ -38,7 +39,7 @@
/* lsa connection parameters - opened handles and related properties */
struct {
struct dcerpc_pipe *pipe;
-   const char *name;
+   char *name;
uint32_t access_mask;
struct policy_handle handle;
} lsa;

Modified: branches/SAMBA_4_0/source/libnet/libnet_domain.c
===
--- branches/SAMBA_4_0/source/libnet/libnet_domain.c2007-08-02 09:23:16 UTC 
(rev 24126)
+++ branches/SAMBA_4_0/source/libnet/libnet_domain.c2007-08-02 13:08:39 UTC 
(rev 24127)
@@ -361,6 +361,7 @@
   libnet functions */
ctx-samr.connect_handle = s-connect_handle;
ctx-samr.handle  = s-domain_handle;
+   ctx-samr.sid = talloc_steal(ctx, s-lookup.out.sid);
ctx-samr.name= talloc_steal(ctx, 
s-domain_name.string);
ctx-samr.access_mask = s-access_mask;
}
@@ -844,7 +845,10 @@
/* domain policy handle closed successfully */
 
ZERO_STRUCT(ctx-samr.handle);
+   talloc_free(ctx-samr.name);
+   talloc_free(ctx-samr.sid);
ctx-samr.name = NULL;
+   ctx-samr.sid = NULL;
 
io-out.error_string = talloc_asprintf(mem_ctx, Success);
 

Modified: branches/SAMBA_4_0/source/libnet/libnet_user.c
===
--- branches/SAMBA_4_0/source/libnet/libnet_user.c  2007-08-02 09:23:16 UTC 
(rev 24126)
+++ branches/SAMBA_4_0/source/libnet/libnet_user.c  2007-08-02 13:08:39 UTC 
(rev 24127)
@@ -773,6 +773,9 @@
s = talloc_get_type(c-private_data, struct user_info_state);
info = s-userinfo.out.info.info21;
 
+   r-out.user_sid = dom_sid_add_rid(mem_ctx, s-ctx-samr.sid, 
info-rid);
+   r-out.primary_group_sid = dom_sid_add_rid(mem_ctx, 
s-ctx-samr.sid, info-primary_gid);
+
/* string fields */
r-out.account_name   = talloc_steal(mem_ctx, 
info-account_name.string);
r-out.full_name  = talloc_steal(mem_ctx, 
info-full_name.string);

Modified: branches/SAMBA_4_0/source/libnet/libnet_user.h
===
--- branches/SAMBA_4_0/source/libnet/libnet_user.h  2007-08-02 09:23:16 UTC 
(rev 24126)
+++ branches/SAMBA_4_0/source/libnet/libnet_user.h  2007-08-02 13:08:39 UTC 
(rev 24127)
@@ -92,6 +92,8 @@
const char *domain_name;
} in;
struct {
+   struct dom_sid *user_sid;
+   struct dom_sid *primary_group_sid;
const char *account_name;
const char *full_name;
const char *description;

Modified: branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c
===
--- branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c2007-08-02 
09:23:16 UTC (rev 24126)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c2007-08-02 
13:08:39 UTC (rev 24127)
@@ -34,7 +34,7 @@
 
 static BOOL test_opendomain_samr(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
 struct policy_handle *handle, struct 
lsa_String *domname,
-uint32_t *access_mask)
+uint32_t *access_mask, struct dom_sid **sid)
 {
NTSTATUS status;
struct policy_handle h, 

svn commit: samba r24128 - in branches/SAMBA_3_2/source/libads: .

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 15:11:37 + (Thu, 02 Aug 2007)
New Revision: 24128

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

Log:
fix double free in error path

metze
Modified:
   branches/SAMBA_3_2/source/libads/sasl.c


Changeset:
Modified: branches/SAMBA_3_2/source/libads/sasl.c
===
--- branches/SAMBA_3_2/source/libads/sasl.c 2007-08-02 13:08:39 UTC (rev 
24127)
+++ branches/SAMBA_3_2/source/libads/sasl.c 2007-08-02 15:11:37 UTC (rev 
24128)
@@ -962,11 +962,10 @@
  output_token,
  ret_flags,
  NULL);
-
-   if (input_token.value) {
-   gss_release_buffer(minor_status, input_token);
+   if (scred) {
+   ber_bvfree(scred);
+   scred = NULL;
}
-
if (gss_rc  gss_rc != GSS_S_CONTINUE_NEEDED) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
@@ -999,13 +998,15 @@
 
gss_rc = 
gss_unwrap(minor_status,context_handle,input_token,output_token,
conf_state,NULL);
+   if (scred) {
+   ber_bvfree(scred);
+   scred = NULL;
+   }
if (gss_rc) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
}
 
-   gss_release_buffer(minor_status, input_token);
-
p = (uint8 *)output_token.value;
 
 #if 0



svn commit: samba r24129 - in branches/SAMBA_3_2_0/source/libads: .

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 15:12:32 + (Thu, 02 Aug 2007)
New Revision: 24129

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

Log:
merge from SAMBA_3_2:
fix double free in error path

metze
Modified:
   branches/SAMBA_3_2_0/source/libads/sasl.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/libads/sasl.c
===
--- branches/SAMBA_3_2_0/source/libads/sasl.c   2007-08-02 15:11:37 UTC (rev 
24128)
+++ branches/SAMBA_3_2_0/source/libads/sasl.c   2007-08-02 15:12:32 UTC (rev 
24129)
@@ -962,11 +962,10 @@
  output_token,
  ret_flags,
  NULL);
-
-   if (input_token.value) {
-   gss_release_buffer(minor_status, input_token);
+   if (scred) {
+   ber_bvfree(scred);
+   scred = NULL;
}
-
if (gss_rc  gss_rc != GSS_S_CONTINUE_NEEDED) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
@@ -999,13 +998,15 @@
 
gss_rc = 
gss_unwrap(minor_status,context_handle,input_token,output_token,
conf_state,NULL);
+   if (scred) {
+   ber_bvfree(scred);
+   scred = NULL;
+   }
if (gss_rc) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
}
 
-   gss_release_buffer(minor_status, input_token);
-
p = (uint8 *)output_token.value;
 
 #if 0



svn commit: samba r24132 - in branches/SAMBA_3_2_0/source: include libads

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 17:46:45 + (Thu, 02 Aug 2007)
New Revision: 24132

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

Log:
merge from SAMBA_3_2:
- make it more clear what the different min and max fields mean
- with the GSSAPI sasl mech the plain, sign or seal negotiation
  is independed from the req_flags and ret_flags
- verify the server supports the wrapping type we want
- better handling on negotiated buffer sizes

metze
Modified:
   branches/SAMBA_3_2_0/source/include/ads.h
   branches/SAMBA_3_2_0/source/libads/sasl.c
   branches/SAMBA_3_2_0/source/libads/sasl_wrapping.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/include/ads.h
===
--- branches/SAMBA_3_2_0/source/include/ads.h   2007-08-02 17:41:47 UTC (rev 
24131)
+++ branches/SAMBA_3_2_0/source/include/ads.h   2007-08-02 17:46:45 UTC (rev 
24132)
@@ -103,16 +103,17 @@
uint32 ofs;
uint32 needed;
uint32 left;
-   uint32 max;
-   uint32 min;
+#defineADS_SASL_WRAPPING_IN_MAX_WRAPPED0x0FFF
+   uint32 max_wrapped;
+   uint32 min_wrapped;
uint32 size;
uint8 *buf;
} in;
struct {
uint32 ofs;
uint32 left;
-   uint32 max;
-   uint32 min;
+#defineADS_SASL_WRAPPING_OUT_MAX_WRAPPED   0x00A0
+   uint32 max_unwrapped;
uint32 sig_size;
uint32 size;
uint8 *buf;

Modified: branches/SAMBA_3_2_0/source/libads/sasl.c
===
--- branches/SAMBA_3_2_0/source/libads/sasl.c   2007-08-02 17:41:47 UTC (rev 
24131)
+++ branches/SAMBA_3_2_0/source/libads/sasl.c   2007-08-02 17:46:45 UTC (rev 
24132)
@@ -247,11 +247,10 @@
   then the state will be kept by the signing engine */
 
if (ads-ldap.wrap_type  ADS_SASLWRAP_TYPE_PLAIN) {
-   ads-ldap.out.min = 4;
-   ads-ldap.out.max = 0x0FFF - NTLMSSP_SIG_SIZE;
+   ads-ldap.out.max_unwrapped = ADS_SASL_WRAPPING_OUT_MAX_WRAPPED 
- NTLMSSP_SIG_SIZE;
ads-ldap.out.sig_size = NTLMSSP_SIG_SIZE;
-   ads-ldap.in.min = 4;
-   ads-ldap.in.max = 0x0FFF;
+   ads-ldap.in.min_wrapped = ads-ldap.out.sig_size;
+   ads-ldap.in.max_wrapped = ADS_SASL_WRAPPING_IN_MAX_WRAPPED;
status = ads_setup_sasl_wrapping(ads, ads_sasl_ntlmssp_ops, 
ntlmssp_state);
if (!ADS_ERR_OK(status)) {
DEBUG(0, (ads_setup_sasl_wrapping() failed: %s\n,
@@ -574,21 +573,20 @@
}
 
if (ads-ldap.wrap_type  ADS_SASLWRAP_TYPE_PLAIN) {
-   uint32 max_msg_size = 0x0A00;
+   uint32 max_msg_size = ADS_SASL_WRAPPING_OUT_MAX_WRAPPED;
 
gss_rc = gss_wrap_size_limit(minor_status, context_handle,
 (ads-ldap.wrap_type == 
ADS_SASLWRAP_TYPE_SEAL),
 GSS_C_QOP_DEFAULT,
-max_msg_size, ads-ldap.out.max);
+max_msg_size, 
ads-ldap.out.max_unwrapped);
if (gss_rc) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
}
 
-   ads-ldap.out.min = 4;
-   ads-ldap.out.sig_size = max_msg_size - ads-ldap.out.max;
-   ads-ldap.in.min = 4;
-   ads-ldap.in.max = max_msg_size;
+   ads-ldap.out.sig_size = max_msg_size - 
ads-ldap.out.max_unwrapped;
+   ads-ldap.in.min_wrapped = 0x2C; /* taken from a capture with 
LDAP unbind */
+   ads-ldap.in.max_wrapped = max_msg_size;
status = ads_setup_sasl_wrapping(ads, ads_sasl_gssapi_ops, 
context_handle);
if (!ADS_ERR_OK(status)) {
DEBUG(0, (ads_setup_sasl_wrapping() failed: %s\n,
@@ -930,23 +928,19 @@
int i=0;
int gss_rc, rc;
uint8 *p;
-   uint32 max_msg_size = 0;
+   uint32 max_msg_size = ADS_SASL_WRAPPING_OUT_MAX_WRAPPED;
+   uint8 wrap_type = ADS_SASLWRAP_TYPE_PLAIN;
ADS_STATUS status;
 
input_token.value = NULL;
input_token.length = 0;
 
-   req_flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG;
-   switch (ads-ldap.wrap_type) {
-   case ADS_SASLWRAP_TYPE_SEAL:
-   req_flags |= GSS_C_INTEG_FLAG | GSS_C_CONF_FLAG;
-   break;
-   case ADS_SASLWRAP_TYPE_SIGN:
-   req_flags |= GSS_C_INTEG_FLAG;
-   break;
- 

svn commit: samba r24131 - in branches/SAMBA_3_2/source: include libads

2007-08-02 Thread metze
Author: metze
Date: 2007-08-02 17:41:47 + (Thu, 02 Aug 2007)
New Revision: 24131

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

Log:
- make it more clear what the different min and max fields mean
- with the GSSAPI sasl mech the plain, sign or seal negotiation
  is independed from the req_flags and ret_flags
- verify the server supports the wrapping type we want
- better handling on negotiated buffer sizes

metze
Modified:
   branches/SAMBA_3_2/source/include/ads.h
   branches/SAMBA_3_2/source/libads/sasl.c
   branches/SAMBA_3_2/source/libads/sasl_wrapping.c


Changeset:
Modified: branches/SAMBA_3_2/source/include/ads.h
===
--- branches/SAMBA_3_2/source/include/ads.h 2007-08-02 17:37:38 UTC (rev 
24130)
+++ branches/SAMBA_3_2/source/include/ads.h 2007-08-02 17:41:47 UTC (rev 
24131)
@@ -103,16 +103,17 @@
uint32 ofs;
uint32 needed;
uint32 left;
-   uint32 max;
-   uint32 min;
+#defineADS_SASL_WRAPPING_IN_MAX_WRAPPED0x0FFF
+   uint32 max_wrapped;
+   uint32 min_wrapped;
uint32 size;
uint8 *buf;
} in;
struct {
uint32 ofs;
uint32 left;
-   uint32 max;
-   uint32 min;
+#defineADS_SASL_WRAPPING_OUT_MAX_WRAPPED   0x00A0
+   uint32 max_unwrapped;
uint32 sig_size;
uint32 size;
uint8 *buf;

Modified: branches/SAMBA_3_2/source/libads/sasl.c
===
--- branches/SAMBA_3_2/source/libads/sasl.c 2007-08-02 17:37:38 UTC (rev 
24130)
+++ branches/SAMBA_3_2/source/libads/sasl.c 2007-08-02 17:41:47 UTC (rev 
24131)
@@ -247,11 +247,10 @@
   then the state will be kept by the signing engine */
 
if (ads-ldap.wrap_type  ADS_SASLWRAP_TYPE_PLAIN) {
-   ads-ldap.out.min = 4;
-   ads-ldap.out.max = 0x0FFF - NTLMSSP_SIG_SIZE;
+   ads-ldap.out.max_unwrapped = ADS_SASL_WRAPPING_OUT_MAX_WRAPPED 
- NTLMSSP_SIG_SIZE;
ads-ldap.out.sig_size = NTLMSSP_SIG_SIZE;
-   ads-ldap.in.min = 4;
-   ads-ldap.in.max = 0x0FFF;
+   ads-ldap.in.min_wrapped = ads-ldap.out.sig_size;
+   ads-ldap.in.max_wrapped = ADS_SASL_WRAPPING_IN_MAX_WRAPPED;
status = ads_setup_sasl_wrapping(ads, ads_sasl_ntlmssp_ops, 
ntlmssp_state);
if (!ADS_ERR_OK(status)) {
DEBUG(0, (ads_setup_sasl_wrapping() failed: %s\n,
@@ -574,21 +573,20 @@
}
 
if (ads-ldap.wrap_type  ADS_SASLWRAP_TYPE_PLAIN) {
-   uint32 max_msg_size = 0x0A00;
+   uint32 max_msg_size = ADS_SASL_WRAPPING_OUT_MAX_WRAPPED;
 
gss_rc = gss_wrap_size_limit(minor_status, context_handle,
 (ads-ldap.wrap_type == 
ADS_SASLWRAP_TYPE_SEAL),
 GSS_C_QOP_DEFAULT,
-max_msg_size, ads-ldap.out.max);
+max_msg_size, 
ads-ldap.out.max_unwrapped);
if (gss_rc) {
status = ADS_ERROR_GSS(gss_rc, minor_status);
goto failed;
}
 
-   ads-ldap.out.min = 4;
-   ads-ldap.out.sig_size = max_msg_size - ads-ldap.out.max;
-   ads-ldap.in.min = 4;
-   ads-ldap.in.max = max_msg_size;
+   ads-ldap.out.sig_size = max_msg_size - 
ads-ldap.out.max_unwrapped;
+   ads-ldap.in.min_wrapped = 0x2C; /* taken from a capture with 
LDAP unbind */
+   ads-ldap.in.max_wrapped = max_msg_size;
status = ads_setup_sasl_wrapping(ads, ads_sasl_gssapi_ops, 
context_handle);
if (!ADS_ERR_OK(status)) {
DEBUG(0, (ads_setup_sasl_wrapping() failed: %s\n,
@@ -930,23 +928,19 @@
int i=0;
int gss_rc, rc;
uint8 *p;
-   uint32 max_msg_size = 0;
+   uint32 max_msg_size = ADS_SASL_WRAPPING_OUT_MAX_WRAPPED;
+   uint8 wrap_type = ADS_SASLWRAP_TYPE_PLAIN;
ADS_STATUS status;
 
input_token.value = NULL;
input_token.length = 0;
 
-   req_flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG;
-   switch (ads-ldap.wrap_type) {
-   case ADS_SASLWRAP_TYPE_SEAL:
-   req_flags |= GSS_C_INTEG_FLAG | GSS_C_CONF_FLAG;
-   break;
-   case ADS_SASLWRAP_TYPE_SIGN:
-   req_flags |= GSS_C_INTEG_FLAG;
-   break;
-   case ADS_SASLWRAP_TYPE_PLAIN:

svn commit: samba r24130 - in branches/SAMBA_3_2/source: include smbd

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 17:37:38 + (Thu, 02 Aug 2007)
New Revision: 24130

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

Log:
Explicitly pass flags2 to srvstr_push

This is in preparation of the trans2 conversion: srvstr_push should not
look at inbuf directly.

Modified:
   branches/SAMBA_3_2/source/include/safe_string.h
   branches/SAMBA_3_2/source/smbd/lanman.c
   branches/SAMBA_3_2/source/smbd/nttrans.c
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2/source/smbd/srvstr.c
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/include/safe_string.h
===
--- branches/SAMBA_3_2/source/include/safe_string.h 2007-08-02 15:12:32 UTC 
(rev 24129)
+++ branches/SAMBA_3_2/source/include/safe_string.h 2007-08-02 17:37:38 UTC 
(rev 24130)
@@ -167,7 +167,7 @@
 #define pull_string_talloc(ctx, base_ptr, smb_flags2, dest, src, src_len, 
flags) pull_string_talloc_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, ctx, 
base_ptr, smb_flags2, dest, src, src_len, flags)
 #define clistr_push(cli, dest, src, dest_len, flags) 
clistr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, 
dest_len, flags)
 #define clistr_pull(cli, dest, src, dest_len, src_len, flags) 
clistr_pull_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, 
dest_len, src_len, flags)
-#define srvstr_push(base_ptr, dest, src, dest_len, flags) 
srvstr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, 
src, dest_len, flags)
+#define srvstr_push(base_ptr, smb_flags2, dest, src, dest_len, flags) 
srvstr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, 
smb_flags2, dest, src, dest_len, flags)
 
 #define alpha_strcpy(dest,src,other_safe_chars,maxlength) 
alpha_strcpy_fn(SAFE_STRING_FUNCTION_NAME,SAFE_STRING_LINE,dest,src,other_safe_chars,maxlength)
 #define StrnCpy(dest,src,n)
StrnCpy_fn(SAFE_STRING_FUNCTION_NAME,SAFE_STRING_LINE,dest,src,n)
@@ -211,10 +211,10 @@
 ? __unsafe_string_function_usage_here_size_t__() \
 : clistr_pull_fn(fn_name, fn_line, cli, dest, src, dest_len, srclen, 
flags))
 
-#define srvstr_push_fn2(fn_name, fn_line, base_ptr, dest, src, dest_len, 
flags) \
+#define srvstr_push_fn2(fn_name, fn_line, base_ptr, smb_flags2, dest, src, 
dest_len, flags) \
 (CHECK_STRING_SIZE(dest, dest_len) \
 ? __unsafe_string_function_usage_here_size_t__() \
-: srvstr_push_fn(fn_name, fn_line, base_ptr, dest, src, dest_len, flags))
+: srvstr_push_fn(fn_name, fn_line, base_ptr, smb_flags2, dest, src, 
dest_len, flags))
 
 #else
 

Modified: branches/SAMBA_3_2/source/smbd/lanman.c
===
--- branches/SAMBA_3_2/source/smbd/lanman.c 2007-08-02 15:12:32 UTC (rev 
24129)
+++ branches/SAMBA_3_2/source/smbd/lanman.c 2007-08-02 17:37:38 UTC (rev 
24130)
@@ -2866,7 +2866,7 @@
p = *rdata;
p2 = p + struct_len;
if (uLevel != 20) {
-   srvstr_push(NULL, p,global_myname(),16, 
+   srvstr_push(NULL, 0, p,global_myname(),16,
STR_ASCII|STR_UPPER|STR_TERMINATE);
}
p += 16;

Modified: branches/SAMBA_3_2/source/smbd/nttrans.c
===
--- branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-02 15:12:32 UTC (rev 
24129)
+++ branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-02 17:37:38 UTC (rev 
24130)
@@ -2571,7 +2571,10 @@
shadow_data-num_volumes,fsp-fsp_name));
if (labels  shadow_data-labels) {
for (i=0;ishadow_data-num_volumes;i++) {
-   srvstr_push(outbuf, cur_pdata, 
shadow_data-labels[i], 2*sizeof(SHADOW_COPY_LABEL), STR_UNICODE|STR_TERMINATE);
+   srvstr_push(outbuf, SVAL(outbuf, smb_flg2),
+   cur_pdata, shadow_data-labels[i],
+   2*sizeof(SHADOW_COPY_LABEL),
+   STR_UNICODE|STR_TERMINATE);
cur_pdata+=2*sizeof(SHADOW_COPY_LABEL);
DEBUGADD(10,(Label[%u]: 
'%s'\n,i,shadow_data-labels[i]));
}

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-02 15:12:32 UTC (rev 
24129)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-02 17:37:38 UTC (rev 
24130)
@@ -715,9 +715,13 @@
return(UNIXERROR(ERRDOS,ERRbadfid));
}
SSVAL(p,0,fsp-rap_print_jobid); /* Job 
number */
-   srvstr_push(outbuf, p+2, global_myname(), 15, 
STR_TERMINATE|STR_ASCII);
+

svn commit: samba r24134 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 18:13:57 + (Thu, 02 Aug 2007)
New Revision: 24134

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

Log:
talloc smb_request for handle_trans2

When starting to convert the individual trans2 subcalls, I need the new
API conventions to be present there. This means that those calls fill in
req-outbuf when there's something to ship

Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 18:06:45 UTC (rev 
24133)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 18:13:57 UTC (rev 
24134)
@@ -6882,11 +6882,22 @@
if ((state-received_param == state-total_param) 
(state-received_data == state-total_data)) {
 
-   struct smb_request req;
-   init_smb_request(req, (uint8 *)inbuf);
+   struct smb_request *req;
 
-   outsize = handle_trans2(conn, req, state, inbuf, outbuf,
+   if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
+   END_PROFILE(SMBtrans2);
+   return ERROR_NT(NT_STATUS_NO_MEMORY);
+   }
+
+   init_smb_request(req, (uint8 *)inbuf);
+
+   outsize = handle_trans2(conn, req, state, inbuf, outbuf,
size, bufsize);
+   if (req-outbuf != NULL) {
+   outsize = smb_len(req-outbuf) + 4;
+   memcpy(outbuf, req-outbuf, outsize);
+   }
+   TALLOC_FREE(req);
SAFE_FREE(state-data);
SAFE_FREE(state-param);
TALLOC_FREE(state);
@@ -6924,7 +6935,7 @@
int outsize = 0;
unsigned int pcnt,poff,dcnt,doff,pdisp,ddisp;
struct trans_state *state;
-   struct smb_request req;
+   struct smb_request *req;
 
START_PROFILE(SMBtranss2);
 
@@ -7010,10 +7021,20 @@
 */
SCVAL(outbuf,smb_com,SMBtrans2);
 
-   init_smb_request(req, (uint8 *)inbuf);
+   if (!(req = talloc(tmp_talloc_ctx(), struct smb_request))) {
+   END_PROFILE(SMBtranss2);
+   return ERROR_NT(NT_STATUS_NO_MEMORY);
+   }
 
-   outsize = handle_trans2(conn, req, state, inbuf, outbuf, size,
+   init_smb_request(req, (uint8 *)inbuf);
+
+   outsize = handle_trans2(conn, req, state, inbuf, outbuf, size,
bufsize);
+   if (req-outbuf != NULL) {
+   outsize = smb_len(req-outbuf) + 4;
+   memcpy(outbuf, req-outbuf, outsize);
+   }
+   TALLOC_FREE(req);
 
DLIST_REMOVE(conn-pending_trans, state);
SAFE_FREE(state-data);



svn commit: samba r24135 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 18:28:41 + (Thu, 02 Aug 2007)
New Revision: 24135

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

Log:
Convert call_trans2open to the new API

This itself won't help much, because send_trans2_replies_new still allocates
the big buffers, but stay tuned :-)

Also add/update my copyright on stuff I recently touched.

Volker

Modified:
   branches/SAMBA_3_2/source/smbd/negprot.c
   branches/SAMBA_3_2/source/smbd/process.c
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2/source/smbd/sesssetup.c
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/negprot.c
===
--- branches/SAMBA_3_2/source/smbd/negprot.c2007-08-02 18:13:57 UTC (rev 
24134)
+++ branches/SAMBA_3_2/source/smbd/negprot.c2007-08-02 18:28:41 UTC (rev 
24135)
@@ -2,6 +2,7 @@
Unix SMB/CIFS implementation.
negprot reply code
Copyright (C) Andrew Tridgell 1992-1998
+   Copyright (C) Volker Lendecke 2007

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Modified: branches/SAMBA_3_2/source/smbd/process.c
===
--- branches/SAMBA_3_2/source/smbd/process.c2007-08-02 18:13:57 UTC (rev 
24134)
+++ branches/SAMBA_3_2/source/smbd/process.c2007-08-02 18:28:41 UTC (rev 
24135)
@@ -2,7 +2,7 @@
Unix SMB/CIFS implementation.
process incoming packets - main loop
Copyright (C) Andrew Tridgell 1992-1998
-   Copyright (C) Volker Lendecke 2005
+   Copyright (C) Volker Lendecke 2005-2007

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-02 18:13:57 UTC (rev 
24134)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-02 18:28:41 UTC (rev 
24135)
@@ -4,6 +4,7 @@
Copyright (C) Andrew Tridgell 1992-1998
Copyright (C) Andrew Bartlett  2001
Copyright (C) Jeremy Allison 1992-2007.
+   Copyright (C) Volker Lendecke 2007
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Modified: branches/SAMBA_3_2/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_2/source/smbd/sesssetup.c  2007-08-02 18:13:57 UTC (rev 
24134)
+++ branches/SAMBA_3_2/source/smbd/sesssetup.c  2007-08-02 18:28:41 UTC (rev 
24135)
@@ -5,6 +5,7 @@
Copyright (C) Andrew Bartlett  2001
Copyright (C) Jim McDonough [EMAIL PROTECTED] 2002
Copyright (C) Luke Howard  2003
+   Copyright (C) Volker Lendecke  2007
 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 18:13:57 UTC (rev 
24134)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 18:28:41 UTC (rev 
24135)
@@ -3,7 +3,7 @@
SMB transaction2 handling
Copyright (C) Jeremy Allison1994-2007
Copyright (C) Stefan (metze) Metzmacher 2003
-   Copyright (C) Volker Lendecke   2005
+   Copyright (C) Volker Lendecke   2005-2007
Copyright (C) Steve French  2005
Copyright (C) James Peach   2007
 
@@ -735,16 +735,37 @@
return 0;
 }
 
+static void send_trans2_replies_new(struct smb_request *req,
+   const char *params,
+   int paramsize,
+   const char *pdata,
+   int datasize,
+   int max_data_bytes)
+{
+   char *inbuf, *outbuf;
+   int length, bufsize;
+
+   if (!reply_prep_legacy(req, inbuf, outbuf, length, bufsize)) {
+   reply_nterror(req, NT_STATUS_NO_MEMORY);
+   return;
+   }
+
+   reply_post_legacy(req, send_trans2_replies(
+ inbuf, outbuf, bufsize,
+ params, paramsize,
+ pdata, datasize,
+ max_data_bytes));
+}
+
 /
  Reply to a TRANSACT2_OPEN.
 /
 
-static int call_trans2open(connection_struct *conn,
-  struct smb_request 

svn commit: samba r24133 - in branches/SAMBA_3_2/source: include lib libsmb smbd

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 18:06:45 + (Thu, 02 Aug 2007)
New Revision: 24133

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

Log:
Explicitly pass flags2 down to push_string_fn

This needs a bit closer review, it also touches the client libs

Modified:
   branches/SAMBA_3_2/source/include/safe_string.h
   branches/SAMBA_3_2/source/lib/charcnv.c
   branches/SAMBA_3_2/source/libsmb/clistr.c
   branches/SAMBA_3_2/source/smbd/srvstr.c


Changeset:
Modified: branches/SAMBA_3_2/source/include/safe_string.h
===
--- branches/SAMBA_3_2/source/include/safe_string.h 2007-08-02 17:46:45 UTC 
(rev 24132)
+++ branches/SAMBA_3_2/source/include/safe_string.h 2007-08-02 18:06:45 UTC 
(rev 24133)
@@ -191,7 +191,7 @@
 #define push_string_fn2(fn_name, fn_line, base_ptr, dest, src, dest_len, 
flags) \
 (CHECK_STRING_SIZE(dest, dest_len) \
 ? __unsafe_string_function_usage_here_size_t__() \
-: push_string_fn(fn_name, fn_line, base_ptr, dest, src, dest_len, flags))
+: push_string_fn(fn_name, fn_line, base_ptr, 0, dest, src, dest_len, 
flags))
 
 #define pull_string_fn2(fn_name, fn_line, base_ptr, smb_flags2, dest, src, 
dest_len, src_len, flags) \
 (CHECK_STRING_SIZE(dest, dest_len) \

Modified: branches/SAMBA_3_2/source/lib/charcnv.c
===
--- branches/SAMBA_3_2/source/lib/charcnv.c 2007-08-02 17:46:45 UTC (rev 
24132)
+++ branches/SAMBA_3_2/source/lib/charcnv.c 2007-08-02 18:06:45 UTC (rev 
24133)
@@ -1504,7 +1504,10 @@
  is -1 then no maxiumum is used.
 **/
 
-size_t push_string_fn(const char *function, unsigned int line, const void 
*base_ptr, void *dest, const char *src, size_t dest_len, int flags)
+size_t push_string_fn(const char *function, unsigned int line,
+ const void *base_ptr, uint16 flags2,
+ void *dest, const char *src,
+ size_t dest_len, int flags)
 {
 #ifdef DEVELOPER
/* We really need to zero fill here, not clobber
@@ -1524,7 +1527,7 @@
 
if (!(flags  STR_ASCII)  \
((flags  STR_UNICODE || \
- (SVAL(base_ptr, smb_flg2)  FLAGS2_UNICODE_STRINGS {
+ (flags2  FLAGS2_UNICODE_STRINGS {
return push_ucs2(base_ptr, dest, src, dest_len, flags);
}
return push_ascii(dest, src, dest_len, flags);

Modified: branches/SAMBA_3_2/source/libsmb/clistr.c
===
--- branches/SAMBA_3_2/source/libsmb/clistr.c   2007-08-02 17:46:45 UTC (rev 
24132)
+++ branches/SAMBA_3_2/source/libsmb/clistr.c   2007-08-02 18:06:45 UTC (rev 
24133)
@@ -28,13 +28,21 @@
if (dest_len == -1) {
if (((ptrdiff_t)dest  (ptrdiff_t)cli-outbuf) || (buf_used  
cli-bufsize)) {
DEBUG(0, (Pushing string of 'unlimited' length into 
non-SMB buffer!\n));
-   return push_string_fn(function, line, cli-outbuf, 
dest, src, -1, flags);
+   return push_string_fn(function, line,
+ cli-outbuf,
+ SVAL(cli-outbuf, smb_flg2),
+ dest, src, -1, flags);
}
-   return push_string_fn(function, line, cli-outbuf, dest, src, 
cli-bufsize - buf_used, flags);
+   return push_string_fn(function, line, cli-outbuf,
+ SVAL(cli-outbuf, smb_flg2),
+ dest, src, cli-bufsize - buf_used,
+ flags);
}

/* 'normal' push into size-specified buffer */
-   return push_string_fn(function, line, cli-outbuf, dest, src, dest_len, 
flags);
+   return push_string_fn(function, line, cli-outbuf,
+ SVAL(cli-outbuf, smb_flg2),
+ dest, src, dest_len, flags);
 }
 
 size_t clistr_pull_fn(const char *function, unsigned int line, 

Modified: branches/SAMBA_3_2/source/smbd/srvstr.c
===
--- branches/SAMBA_3_2/source/smbd/srvstr.c 2007-08-02 17:46:45 UTC (rev 
24132)
+++ branches/SAMBA_3_2/source/smbd/srvstr.c 2007-08-02 18:06:45 UTC (rev 
24133)
@@ -33,13 +33,17 @@
 #if 0
DEBUG(0, (Pushing string of 'unlimited' length into 
non-SMB buffer!\n));
 #endif
-   return push_string_fn(function, line, base_ptr, dest, 
src, -1, flags);
+   return push_string_fn(function, line, base_ptr,
+ smb_flags2, dest, src, -1,
+ flags);
}
-   return push_string_fn(function, line, base_ptr, dest, src, 
max_send - buf_used, flags);
+

Re: svn commit: samba r24133 - in branches/SAMBA_3_2/source: include lib libsmb smbd

2007-08-02 Thread Jeremy Allison
On Thu, Aug 02, 2007 at 06:06:48PM +, [EMAIL PROTECTED] wrote:
 Author: vlendec
 Date: 2007-08-02 18:06:45 + (Thu, 02 Aug 2007)
 New Revision: 24133
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=24133
 
 Log:
 Explicitly pass flags2 down to push_string_fn
 
 This needs a bit closer review, it also touches the client libs

Actually this looks very safe, as the change is an identity
to what was already there.

Thanks,

Jeremy.


svn commit: samba r24136 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 18:50:17 + (Thu, 02 Aug 2007)
New Revision: 24136

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

Log:
get_lanman2_dir_entry() does not need access to inbuf/outbuf

It did not use inbuf anyway. Outbuf was used for alignment and to the
flags2. The alignment works ok if we align relative to base_data because this
and outbuf are both malloc'ed, and we put send_trans2_replies aligns out_data
properly relative to the start of the outbuf.

I don't know if the explicit align_string() calls in get_lanman2_dir_entry are
really necessary. I think that srvstr_push also does the same.

Please also note that this changes dst_len in srvstr_push from -1 to the real
length remaining.

Volker

Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 18:28:41 UTC (rev 
24135)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 18:50:17 UTC (rev 
24136)
@@ -1130,12 +1130,12 @@
  Get a level dependent lanman2 dir entry.
 /
 
-static BOOL get_lanman2_dir_entry(connection_struct *conn,
- void *inbuf, char *outbuf,
+static BOOL get_lanman2_dir_entry(connection_struct *conn, uint16 flags2,
 char *path_mask,uint32 dirtype,int info_level,
 int requires_resume_key,
 BOOL dont_descend,char **ppdata, 
-char *base_data, int space_remaining, 
+char *base_data, char *end_data,
+int space_remaining,
 BOOL *out_of_space, BOOL *got_exact_match,
 int *last_entry_off, struct ea_list 
*name_list, TALLOC_CTX *ea_ctx)
 {
@@ -1339,10 +1339,11 @@
SSVAL(p,20,mode);
p += 23;
nameptr = p;
-   p += align_string(outbuf, p, 0);
-   len = srvstr_push(outbuf, SVAL(outbuf, smb_flg2), p,
- fname, -1, STR_TERMINATE);
-   if (SVAL(outbuf, smb_flg2)  FLAGS2_UNICODE_STRINGS) {
+   p += align_string(pdata, p, 0);
+   len = srvstr_push(base_data, flags2, p,
+ fname, PTR_DIFF(end_data, p),
+ STR_TERMINATE);
+   if (flags2  FLAGS2_UNICODE_STRINGS) {
if (len  2) {
SCVAL(nameptr, -1, len - 2);
} else {
@@ -1376,10 +1377,10 @@
}
p += 27;
nameptr = p - 1;
-   len = srvstr_push(outbuf, SVAL(outbuf, smb_flg2),
- p, fname, -1,
+   len = srvstr_push(base_data, flags2,
+ p, fname, PTR_DIFF(end_data, p),
  STR_TERMINATE | STR_NOALIGN);
-   if (SVAL(outbuf, smb_flg2)  FLAGS2_UNICODE_STRINGS) {
+   if (flags2  FLAGS2_UNICODE_STRINGS) {
if (len  2) {
len -= 2;
} else {
@@ -1434,10 +1435,10 @@
/* Push the ea_data followed by the name. */
p += fill_ea_buffer(ea_ctx, p, space_remaining, conn, 
name_list);
nameptr = p;
-   len = srvstr_push(outbuf, SVAL(outbuf, smb_flg2),
- p + 1, fname, -1,
+   len = srvstr_push(base_data, flags2,
+ p + 1, fname, PTR_DIFF(end_data, p),
  STR_TERMINATE | STR_NOALIGN);
-   if (SVAL(outbuf, smb_flg2)  FLAGS2_UNICODE_STRINGS) {
+   if (flags2  FLAGS2_UNICODE_STRINGS) {
if (len  2) {
len -= 2;
} else {
@@ -1484,8 +1485,7 @@
mangle_map(mangled_name,True,True,
   conn-params);
mangled_name[12] = 0;
-   len = srvstr_push(outbuf,
- SVAL(outbuf, smb_flg2),
+   len = srvstr_push(base_data, flags2,
  p+2, mangled_name, 24,
   

svn commit: samba r24137 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 19:08:21 + (Thu, 02 Aug 2007)
New Revision: 24137

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

Log:
Convert call_trans2findfirst to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 18:50:17 UTC (rev 
24136)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:08:21 UTC (rev 
24137)
@@ -1730,9 +1730,11 @@
  Reply to a TRANS2_FINDFIRST.
 /
 
-static int call_trans2findfirst(connection_struct *conn, char *inbuf, char 
*outbuf, int bufsize,  
-   char **pparams, int total_params, char 
**ppdata, int total_data,
-   unsigned int max_data_bytes)
+static void call_trans2findfirst(connection_struct *conn,
+struct smb_request *req,
+char **pparams, int total_params,
+char **ppdata, int total_data,
+unsigned int max_data_bytes)
 {
/* We must be careful here that we don't return more than the
allowed number of data bytes. If this means returning fewer than
@@ -1767,7 +1769,8 @@
NTSTATUS ntstatus = NT_STATUS_OK;
 
if (total_params  13) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
dirtype = SVAL(params,0);
@@ -1804,35 +1807,43 @@
case SMB_FIND_FILE_UNIX:
case SMB_FIND_FILE_UNIX_INFO2:
if (!lp_unix_extensions()) {
-   return ERROR_NT(NT_STATUS_INVALID_LEVEL);
+   reply_nterror(req, NT_STATUS_INVALID_LEVEL);
+   return;
}
break;
default:
-   return ERROR_NT(NT_STATUS_INVALID_LEVEL);
+   reply_nterror(req, NT_STATUS_INVALID_LEVEL);
+   return;
}
 
-   srvstr_get_path_wcard(inbuf, SVAL(inbuf,smb_flg2), directory,
+   srvstr_get_path_wcard(params, req-flags2, directory,
  params+12, sizeof(directory), total_params - 12,
  STR_TERMINATE, ntstatus, mask_contains_wcard);
if (!NT_STATUS_IS_OK(ntstatus)) {
-   return ERROR_NT(ntstatus);
+   reply_nterror(req, ntstatus);
+   return;
}
 
-   ntstatus = resolve_dfspath_wcard(conn, SVAL(inbuf,smb_flg2)  
FLAGS2_DFS_PATHNAMES, directory, mask_contains_wcard);
+   ntstatus = resolve_dfspath_wcard(conn, req-flags2  
FLAGS2_DFS_PATHNAMES, directory, mask_contains_wcard);
if (!NT_STATUS_IS_OK(ntstatus)) {
if (NT_STATUS_EQUAL(ntstatus,NT_STATUS_PATH_NOT_COVERED)) {
-   return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, ERRSRV, 
ERRbadpath);
+   reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,
+   ERRSRV, ERRbadpath);
+   return;
}
-   return ERROR_NT(ntstatus);
+   reply_nterror(req, ntstatus);
+   return;
}
 
ntstatus = unix_convert(conn, directory, True, NULL, sbuf);
if (!NT_STATUS_IS_OK(ntstatus)) {
-   return ERROR_NT(ntstatus);
+   reply_nterror(req, ntstatus);
+   return;
}
ntstatus = check_name(conn, directory);
if (!NT_STATUS_IS_OK(ntstatus)) {
-   return ERROR_NT(ntstatus);
+   reply_nterror(req, ntstatus);
+   return;
}
 
p = strrchr_m(directory,'/');
@@ -1856,29 +1867,34 @@
uint32 ea_size;
 
if (total_data  4) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
ea_size = IVAL(pdata,0);
if (ea_size != total_data) {
DEBUG(4,(call_trans2findfirst: Rejecting EA request 
with incorrect \
 total_data=%u (should be %u)\n, (unsigned int)total_data, (unsigned 
int)IVAL(pdata,0) ));
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
if (!lp_ea_support(SNUM(conn))) {
-   return ERROR_DOS(ERRDOS,ERReasnotsupported);
+   reply_doserror(req, ERRDOS, ERReasnotsupported);
+  

svn commit: samba r24138 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 19:22:14 + (Thu, 02 Aug 2007)
New Revision: 24138

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

Log:
Convert call_trans2findnext to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:08:21 UTC (rev 
24137)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:22:14 UTC (rev 
24138)
@@ -2052,9 +2052,11 @@
  Reply to a TRANS2_FINDNEXT.
 /
 
-static int call_trans2findnext(connection_struct *conn, char *inbuf, char 
*outbuf, int length, int bufsize,
-   char **pparams, int total_params, char 
**ppdata, int total_data,
-   unsigned int max_data_bytes)
+static void call_trans2findnext(connection_struct *conn,
+   struct smb_request *req,
+   char **pparams, int total_params,
+   char **ppdata, int total_data,
+   unsigned int max_data_bytes)
 {
/* We must be careful here that we don't return more than the
allowed number of data bytes. If this means returning fewer than
@@ -2090,7 +2092,8 @@
NTSTATUS ntstatus = NT_STATUS_OK;
 
if (total_params  13) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
dptr_num = SVAL(params,0);
@@ -2105,7 +2108,7 @@
 
*mask = *directory = *resume_name = 0;
 
-   srvstr_get_path_wcard(inbuf, SVAL(inbuf,smb_flg2), resume_name,
+   srvstr_get_path_wcard(params, req-flags2, resume_name,
  params+12, sizeof(resume_name),
  total_params - 12, STR_TERMINATE, ntstatus,
  mask_contains_wcard);
@@ -2114,13 +2117,14 @@
   complain (it thinks we're asking for the directory above the 
shared
   path or an invalid name). Catch this as the resume name is 
only compared, never used in
   a file access. JRA. */
-   srvstr_pull(inbuf, SVAL(inbuf,smb_flg2),
+   srvstr_pull(params, req-flags2,
resume_name, params+12,
sizeof(resume_name), total_params - 12,
STR_TERMINATE);
 
if (!(ISDOT(resume_name) || ISDOTDOT(resume_name))) {
-   return ERROR_NT(ntstatus);
+   reply_nterror(req, ntstatus);
+   return;
}
}
 
@@ -2149,40 +2153,47 @@
case SMB_FIND_FILE_UNIX:
case SMB_FIND_FILE_UNIX_INFO2:
if (!lp_unix_extensions()) {
-   return ERROR_NT(NT_STATUS_INVALID_LEVEL);
+   reply_nterror(req, NT_STATUS_INVALID_LEVEL);
+   return;
}
break;
default:
-   return ERROR_NT(NT_STATUS_INVALID_LEVEL);
+   reply_nterror(req, NT_STATUS_INVALID_LEVEL);
+   return;
}
 
if (info_level == SMB_FIND_EA_LIST) {
uint32 ea_size;
 
if (total_data  4) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
ea_size = IVAL(pdata,0);
if (ea_size != total_data) {
DEBUG(4,(call_trans2findnext: Rejecting EA request 
with incorrect \
 total_data=%u (should be %u)\n, (unsigned int)total_data, (unsigned 
int)IVAL(pdata,0) ));
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}

  
if (!lp_ea_support(SNUM(conn))) {
-   return ERROR_DOS(ERRDOS,ERReasnotsupported);
+   reply_doserror(req, ERRDOS, ERReasnotsupported);
+   return;
}

  
if ((ea_ctx = talloc_init(findnext_ea_list)) == NULL) {
-   return ERROR_NT(NT_STATUS_NO_MEMORY);
+ 

svn commit: samba r24139 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 19:35:27 + (Thu, 02 Aug 2007)
New Revision: 24139

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

Log:
Convert call_trans2mkdir to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:22:14 UTC (rev 
24138)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:35:27 UTC (rev 
24139)
@@ -6365,9 +6365,10 @@
  Reply to a TRANS2_MKDIR (make directory with extended attributes).
 /
 
-static int call_trans2mkdir(connection_struct *conn, char *inbuf, char 
*outbuf, int length, int bufsize,
-   char **pparams, int total_params, char 
**ppdata, int total_data,
-   unsigned int max_data_bytes)
+static void call_trans2mkdir(connection_struct *conn, struct smb_request *req,
+char **pparams, int total_params,
+char **ppdata, int total_data,
+unsigned int max_data_bytes)
 {
char *params = *pparams;
char *pdata = *ppdata;
@@ -6376,36 +6377,43 @@
NTSTATUS status = NT_STATUS_OK;
struct ea_list *ea_list = NULL;
 
-   if (!CAN_WRITE(conn))
-   return ERROR_DOS(ERRSRV,ERRaccess);
+   if (!CAN_WRITE(conn)) {
+   reply_doserror(req, ERRSRV, ERRaccess);
+   return;
+   }
 
if (total_params  5) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
-   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), directory, params[4],
+   srvstr_get_path(params, req-flags2, directory, params[4],
sizeof(directory), total_params - 4, STR_TERMINATE,
status);
if (!NT_STATUS_IS_OK(status)) {
-   return ERROR_NT(status);
+   reply_nterror(req, status);
+   return;
}
 
DEBUG(3,(call_trans2mkdir : name = %s\n, directory));
 
status = unix_convert(conn, directory, False, NULL, sbuf);
if (!NT_STATUS_IS_OK(status)) {
-   return ERROR_NT(status);
+   reply_nterror(req, status);
+   return;
}
 
status = check_name(conn, directory);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(5,(call_trans2mkdir error (%s)\n, nt_errstr(status)));
-   return ERROR_NT(status);
+   reply_nterror(req, status);
+   return;
}
 
/* Any data in this call is an EA list. */
if (total_data  (total_data != 4)  !lp_ea_support(SNUM(conn))) {
-   return ERROR_NT(NT_STATUS_EAS_NOT_SUPPORTED);
+   reply_nterror(req, NT_STATUS_EAS_NOT_SUPPORTED);
+   return;
}
 
/*
@@ -6416,50 +6424,57 @@
 
if (total_data != 4) {
if (total_data  10) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
if (IVAL(pdata,0)  total_data) {
DEBUG(10,(call_trans2mkdir: bad total data size (%u)  
%u\n,
IVAL(pdata,0), (unsigned int)total_data));
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
ea_list = read_ea_list(tmp_talloc_ctx(), pdata + 4,
   total_data - 4);
if (!ea_list) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
} else if (IVAL(pdata,0) != 4) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
status = create_directory(conn, directory);
 
if (!NT_STATUS_IS_OK(status)) {
-   return ERROR_NT(status);
+   reply_nterror(req, status);
+   return;
}
   
/* Try and set any given EA. */
if (ea_list) {
status = set_ea(conn, NULL, directory, ea_list);
if (!NT_STATUS_IS_OK(status)) {
-   return ERROR_NT(status);
+   reply_nterror(req, status);
+   return;
}
}
 
/* Realloc the parameter and data sizes */
  

svn commit: samba r24140 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 19:48:44 + (Thu, 02 Aug 2007)
New Revision: 24140

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

Log:
Convert call_trans2findnotifyfirst/next to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:35:27 UTC (rev 
24139)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:48:44 UTC (rev 
24140)
@@ -6482,16 +6482,19 @@
  We don't actually do this - we just send a null response.
 /
 
-static int call_trans2findnotifyfirst(connection_struct *conn, char *inbuf, 
char *outbuf, int length, int bufsize,
-   char **pparams, int total_params, char 
**ppdata, int total_data,
-   unsigned int max_data_bytes)
+static void call_trans2findnotifyfirst(connection_struct *conn,
+  struct smb_request *req,
+  char **pparams, int total_params,
+  char **ppdata, int total_data,
+  unsigned int max_data_bytes)
 {
static uint16 fnf_handle = 257;
char *params = *pparams;
uint16 info_level;
 
if (total_params  6) {
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
+   return;
}
 
info_level = SVAL(params,4);
@@ -6502,13 +6505,15 @@
case 2:
break;
default:
-   return ERROR_NT(NT_STATUS_INVALID_LEVEL);
+   reply_nterror(req, NT_STATUS_INVALID_LEVEL);
+   return;
}
 
/* Realloc the parameter and data sizes */
*pparams = (char *)SMB_REALLOC(*pparams,6);
if (*pparams == NULL) {
-   return ERROR_NT(NT_STATUS_NO_MEMORY);
+   reply_nterror(req, NT_STATUS_NO_MEMORY);
+   return;
}
params = *pparams;
 
@@ -6521,9 +6526,9 @@
if(fnf_handle == 0)
fnf_handle = 257;
 
-   send_trans2_replies(inbuf, outbuf, bufsize, params, 6, *ppdata, 0, 
max_data_bytes);
+   send_trans2_replies_new(req, params, 6, *ppdata, 0, max_data_bytes);
   
-   return(-1);
+   return;
 }
 
 /
@@ -6531,9 +6536,11 @@
  changes). Currently this does nothing.
 /
 
-static int call_trans2findnotifynext(connection_struct *conn, char *inbuf, 
char *outbuf, int length, int bufsize,
-   char **pparams, int total_params, char 
**ppdata, int total_data,
-   unsigned int max_data_bytes)
+static void call_trans2findnotifynext(connection_struct *conn,
+ struct smb_request *req,
+ char **pparams, int total_params,
+ char **ppdata, int total_data,
+ unsigned int max_data_bytes)
 {
char *params = *pparams;
 
@@ -6542,16 +6549,17 @@
/* Realloc the parameter and data sizes */
*pparams = (char *)SMB_REALLOC(*pparams,4);
if (*pparams == NULL) {
-   return ERROR_NT(NT_STATUS_NO_MEMORY);
+   reply_nterror(req, NT_STATUS_NO_MEMORY);
+   return;
}
params = *pparams;
 
SSVAL(params,0,0); /* No changes */
SSVAL(params,2,0); /* No EA errors */
 
-   send_trans2_replies(inbuf, outbuf, bufsize, params, 4, *ppdata, 0, 
max_data_bytes);
+   send_trans2_replies_new(req, params, 4, *ppdata, 0, max_data_bytes);
   
-   return(-1);
+   return;
 }
 
 /
@@ -6783,11 +6791,10 @@
case TRANSACT2_FINDNOTIFYFIRST:
{
START_PROFILE(Trans2_findnotifyfirst);
-   outsize = call_trans2findnotifyfirst(
-   conn, inbuf, outbuf, size, bufsize, 
-   state-param, state-total_param,
-   state-data, state-total_data,
-   state-max_data_return);
+   call_trans2findnotifyfirst(conn, req,
+  state-param, state-total_param,
+  state-data, state-total_data,
+  state-max_data_return);
END_PROFILE(Trans2_findnotifyfirst);
break;
}
@@ -6795,11 +6802,10 @@
 

svn commit: samba r24141 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 19:50:56 + (Thu, 02 Aug 2007)
New Revision: 24141

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

Log:
Add check_fsp as a replacement for CHECK_FSP
Modified:
   branches/SAMBA_3_2/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-02 19:48:44 UTC (rev 
24140)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-02 19:50:56 UTC (rev 
24141)
@@ -285,6 +285,33 @@
 }
 
 /
+ Check if we have a correct fsp pointing to a file. Replacement for the
+ CHECK_FSP macro.
+/
+BOOL check_fsp(connection_struct *conn, struct smb_request *req,
+  files_struct *fsp, struct current_user *user)
+{
+   if (!(fsp) || !(conn)) {
+   reply_nterror(req, NT_STATUS_INVALID_HANDLE);
+   return False;
+   }
+   if (((conn) != (fsp)-conn) || current_user.vuid != (fsp)-vuid) {
+   reply_nterror(req, NT_STATUS_INVALID_HANDLE);
+   return False;
+   }
+   if ((fsp)-is_directory) {
+   reply_nterror(req, NT_STATUS_INVALID_DEVICE_REQUEST);
+   return False;
+   }
+   if ((fsp)-fh-fd == -1) {
+   reply_nterror(req, NT_STATUS_ACCESS_DENIED);
+   return False;
+   }
+   (fsp)-num_smb_operations++;
+   return True;
+}
+
+/
  Reply to a (netbios-level) special message.
 /
 



svn commit: samba r24142 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 20:06:15 + (Thu, 02 Aug 2007)
New Revision: 24142

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

Log:
Remove some direct inbuf references from call_trans2qfilepathinfo
Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 19:50:56 UTC (rev 
24141)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 20:06:15 UTC (rev 
24142)
@@ -3401,7 +3401,9 @@
  file name or file id).
 /
 
-static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char 
*outbuf, int length, int bufsize,
+static int call_trans2qfilepathinfo(connection_struct *conn,
+   struct smb_request *req,
+   char *inbuf, char *outbuf, int length, int 
bufsize,
unsigned int tran_call,
char **pparams, int total_params, char 
**ppdata, int total_data,
unsigned int max_data_bytes)
@@ -3527,14 +3529,16 @@
return ERROR_NT(NT_STATUS_INVALID_LEVEL);
}
 
-   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), fname, params[6],
+   srvstr_get_path(params, req-flags2, fname, params[6],
sizeof(fname), total_params - 6,
STR_TERMINATE, status);
if (!NT_STATUS_IS_OK(status)) {
return ERROR_NT(status);
}
 
-   status = resolve_dfspath(conn, SVAL(inbuf,smb_flg2)  
FLAGS2_DFS_PATHNAMES, fname);
+   status = resolve_dfspath(conn,
+req-flags2  FLAGS2_DFS_PATHNAMES,
+fname);
if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) 
{
return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, 
ERRSRV, ERRbadpath);
@@ -6767,7 +6771,8 @@
{
START_PROFILE(Trans2_qpathinfo);
outsize = call_trans2qfilepathinfo(
-   conn, inbuf, outbuf, size, bufsize, state-call,
+   conn, req,
+   inbuf, outbuf, size, bufsize, state-call,
state-param, state-total_param,
state-data, state-total_data,
state-max_data_return);



svn commit: samba r24143 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 20:19:27 + (Thu, 02 Aug 2007)
New Revision: 24143

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

Log:
Convert call_trans2qfilepathinfo to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


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


svn commit: samba r24144 - in branches/SAMBA_3_2/source/smbd: .

2007-08-02 Thread vlendec
Author: vlendec
Date: 2007-08-02 20:56:40 + (Thu, 02 Aug 2007)
New Revision: 24144

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

Log:
Fix the build

In a function returning void the return; needs to stand alone on some
compilers

Modified:
   branches/SAMBA_3_2/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 20:19:27 UTC (rev 
24143)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-02 20:56:40 UTC (rev 
24144)
@@ -3458,13 +3458,11 @@
}
 
if (IS_IPC(conn)) {
-   return call_trans2qpipeinfo(conn, req,
-   tran_call,
-   pparams,
-   total_params,
-   ppdata,
-   total_data,
-   max_data_bytes);
+   call_trans2qpipeinfo(conn, req, tran_call,
+pparams, total_params,
+ppdata, total_data,
+max_data_bytes);
+   return;
}
 
fsp = file_fsp(SVAL(params,0));



Build status as of Fri Aug 3 00:00:02 2007

2007-08-02 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-08-02 
00:02:01.0 +
+++ /home/build/master/cache/broken_results.txt 2007-08-03 00:01:56.0 
+
@@ -1,4 +1,4 @@
-Build status as of Thu Aug  2 00:00:02 2007
+Build status as of Fri Aug  3 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 
@@ -7,17 +7,17 @@
 ccache   33 8  0 
 ctdb 0  0  0 
 distcc   2  0  0 
-ldb  32 4  0 
+ldb  33 4  0 
 libreplace   32 10 0 
 lorikeet-heimdal 29 12 0 
 pidl 20 4  0 
 ppp  14 11 0 
 python   0  0  0 
-rsync34 13 0 
+rsync34 12 0 
 samba-docs   0  0  0 
 samba-gtk4  4  0 
 samba4   31 28 6 
-samba_3_235 21 0 
+samba_3_235 24 0 
 smb-build31 31 0 
 talloc   34 1  0 
 tdb  33 3  0 


Rev 586: merge from ronnie in http://samba.org/~tridge/ctdb

2007-08-02 Thread tridge

revno: 586
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Andrew Tridgell [EMAIL PROTECTED]
branch nick: tridge
timestamp: Fri 2007-08-03 13:18:44 +1000
message:
  merge from ronnie
added:
  common/rb_tree.c   rb_tree.c-20070724085023-9r1nhv41taadrjde-1
  common/rb_tree.h   rb_tree.h-20070724085025-nboaewff1rsepopq-1
  tests/rb_perftest.crb_perftest.c-20070730005029-azh0e7q5wzuu40vj-1
  utils/ utils-20070803001844-k0ekeu031hzlt8bg-1
  utils/smnotify/smnotify-20070803001844-k0ekeu031hzlt8bg-2
  utils/smnotify/smnotify.c  smnotify.c-20070803001844-k0ekeu031hzlt8bg-3
  utils/smnotify/smnotify.x  smnotify.x-20070803001844-k0ekeu031hzlt8bg-4
modified:
  Makefile.inmakefile.in-20061117234101-o3qt14umlg9en8z0-1
  client/ctdb_client.c   ctdb_client.c-20070411010216-3kd8v37k61steeya-1
  doc/ctdb.1 ctdb.1-20070609004027-2618fsab2br6vqha-1
  doc/ctdb.1.htmlctdb.1.html-20070609004024-w2r7qblwi5s3iw4a-1
  doc/ctdb.1.xml ctdb.1.xml-20070608070258-bjuf7701h1qc1b05-2
  include/ctdb_private.h 
ctdb_private.h-20061117234101-o3qt14umlg9en8z0-13
  server/ctdb_control.c  
ctdb_control.c-20070426122724-j6gkpiofhbwdin63-1
  server/ctdb_daemon.c   ctdb_daemon.c-20070409200331-3el1kqgdb9m4ib0g-1
  server/ctdb_takeover.c 
ctdb_takeover.c-20070525071636-a5n1ihghjtppy08r-2
  server/ctdb_tunables.c 
ctdb_tunables.c-20070604095258-4m34d7cm1qa7yos9-1
  tools/ctdb.c   
ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1

revno: 432.1.170
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Fri 2007-08-03 10:47:37 +1000
message:
  dont wait for the default rpc timeout when trying to bing to a client.
  abort after 3 seconds
  
  fix makefile so that we generate the header before trying to compile 
  smnotify.o

revno: 432.1.169
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Fri 2007-08-03 10:18:48 +1000
message:
  add a small tool that can send smnotify packets

revno: 432.1.168
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Fri 2007-08-03 07:53:52 +1000
message:
  update the manpage for the -n option to make it clear we are referring 
  to the node number and not the node hostname

revno: 432.1.167
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Mon 2007-07-30 16:10:14 +1000
message:
  after we have checked dest address that it is a public address
  update addr to the source address so the rpintout in the log matches
  the client that attached to samba

revno: 432.1.166
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Mon 2007-07-30 10:50:35 +1000
message:
  add a small tool to compare rb tree with a timeval_compare()+add an 
  entry to the end of the list DLIST (worst case insert)

revno: 432.1.165
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Mon 2007-07-30 09:09:34 +1000
message:
  fix the remaining bugs with tree delete that testing found.
  
  the binary tree should work reasonably well now for delete.
  insert always worked fine.

revno: 432.1.164
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Thu 2007-07-26 07:22:36 +1000
message:
  remove dead code

revno: 432.1.163
merged: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Ronnie Sahlberg [EMAIL PROTECTED]
branch nick: ctdb
timestamp: Thu 2007-07-26 07:21:32 +1000
message:
  fix some remaining bugs with deleting nodes

revno: 432.1.162
merged: [EMAIL