[Samba] need help running samba 3.0.11 with security=domain (again)

2006-03-24 Thread Whitaker, Adrian N

My original post didn't seem to work properly - so I am trying again ...

I am having problems getting security=domain to work properly with Samba
3.0.11  (this seems to be the recommended configuration for the
application which I use - ClearCase)

We are running on a Solaris 10 server. 

We created a machine account for the server and then ran the command to
join the domain :
net rpc join -S domain_controller -U user%pass
Joined domain BP1.

The fact that we got the joined domain message looked encouraging.

I thought that this would update /usr/local/samba/private/secrets.tdb -
but the timestamp of this file didn't change. Is this normal ? Maybe it
is because we can now access the samba share from a client PC. However -
it takes too long (around 15 seconds). Occasionally it fails altogether.
If we set password server to * rather than hard coding a domain
controller then it fails every time with access denied errors.

If we switch to security=server it works OK.

The smb.conf file contains the following

[global]
workgroup = BP1
security = DOMAIN
password server = bp1xeudc042.bp1.ad.bp.com
username map = /usr/local/samba/lib/username.map
lm announce = No
preferred master = No
local master = No
domain master = No
kernel oplocks = No
ldap ssl = no
invalid users = root, bin, daemon, adm, sync, shutdown, halt,
mail, news, uucp
create mask = 0775
directory mask = 0775
case sensitive = No
oplocks = No
include = /usr/local/samba/lib/smb.conf.%m
dos filemode = Yes

[export]
comment = ClearCase VOBs
path = /export
read only = No
level2 oplocks = No


The log file contains the following :
  added interface ip=149.184.200.182 bcast=149.184.200.255
nmask=255.255.255.0
[2006/03/23 16:41:53, 2] lib/interface.c:add_interface(79)
  added interface ip=149.184.200.181 bcast=149.184.200.255
nmask=255.255.255.0
[2006/03/23 16:41:53, 2] lib/interface.c:add_interface(79)
  added interface ip=149.184.200.27 bcast=149.184.200.255
nmask=255.255.255.0
[2006/03/23 16:41:53, 2] lib/interface.c:add_interface(79)
  added interface ip=172.28.17.231 bcast=172.28.17.255
nmask=255.255.255.0
[2006/03/23 16:41:57, 3]
libsmb/trusts_util.c:enumerate_domain_trusts(149)
  enumerate_domain_trusts: can't locate a DC for domain BP1
[2006/03/23 16:41:57, 3] auth/auth.c:check_ntlm_password(219)
  check_ntlm_password:  Checking password for unmapped user
[EMAIL PROTECTED]
1LSTL211684] with the new password interface
[2006/03/23 16:41:57, 3] auth/auth.c:check_ntlm_password(222)
  check_ntlm_password:  mapped user is: [EMAIL PROTECTED]
[2006/03/23 16:41:57, 3] smbd/sec_ctx.c:push_sec_ctx(256)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
[2006/03/23 16:41:57, 3] smbd/uid.c:push_conn_ctx(365)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2006/03/23 16:41:57, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2006/03/23 16:41:57, 3] smbd/sec_ctx.c:pop_sec_ctx(386)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2006/03/23 16:42:01, 2] auth/auth.c:check_ntlm_password(312)
  check_ntlm_password:  Authentication for user [WHITAKAN] - [WHITAKAN]
FAILED
with error NT_STATUS_NO_LOGON_SERVERS
[2006/03/23 16:42:01, 3] smbd/process.c:timeout_processing(1334)
  timeout_processing: End of file from client (client has disconnected).
...
...
[2006/03/23 16:42:01, 2] lib/interface.c:add_interface(79)
  added interface ip=172.28.17.231 bcast=172.28.17.255
nmask=255.255.255.0
[2006/03/23 16:42:05, 3]
libsmb/trusts_util.c:enumerate_domain_trusts(149)
  enumerate_domain_trusts: can't locate a DC for domain BP1
[2006/03/23 16:42:05, 3] auth/auth.c:check_ntlm_password(219)
  check_ntlm_password:  Checking password for unmapped user
[EMAIL PROTECTED]
1LSTL211684] with the new password interface
[2006/03/23 16:42:05, 3] auth/auth.c:check_ntlm_password(222)
  check_ntlm_password:  mapped user is: [EMAIL PROTECTED]
[2006/03/23 16:42:05, 3] smbd/sec_ctx.c:push_sec_ctx(256)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
[2006/03/23 16:42:05, 3] smbd/uid.c:push_conn_ctx(365)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2006/03/23 16:42:05, 3] smbd/sec_ctx.c:set_sec_ctx(288)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2006/03/23 16:42:05, 3] smbd/sec_ctx.c:pop_sec_ctx(386)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2006/03/23 16:42:05, 3] libsmb/namequery_dc.c:rpc_dc_name(145)
  rpc_dc_name: Returning DC BP1XEUDC042 (149.184.209.253) for domain BP1
[2006/03/23 16:42:05, 3] libsmb/cliconnect.c:cli_start_connection(1389)
  Connecting to host=BP1XEUDC042
[2006/03/23 16:42:05, 3] lib/util_sock.c:open_socket_out(752)
  Connecting to 149.184.209.253 at port 445
[2006/03/23 16:42:06, 3] smbd/sec_ctx.c:push_sec_ctx(256)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
[2006/03/23 16:42:06, 3] smbd/uid.c:push_conn_ctx(365)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
...
...
[2006/03/23 

Re: [Samba] Understanding Samba 4's features and goals

2006-03-24 Thread Andrew Bartlett
On Wed, 2006-03-22 at 20:05 -0600, Thomas Boutell wrote:
 Hi folks,
 
 I'm the co-author of Windows and Linux Integration, a recent
 Sybex/Wiley title. So I'm very much interested in what's coming
 next in the Samba world. And I've been watching the Samba 4
 'technology releases with interest.
 
 One nifty feature that I like a lot: the old options that specified
 many confusing types of server behavior have been replaced with a
 role option. That makes total sense to me.

Thanks.

 Here's what doesn't make sense to me, though: this option has
 PDC and BDC settings, among others. But my understanding of
 the Active Directory world is that it is a multimastering
 environment, in which updates can be made on *any* DC and will
 be replicated correctly to the other DCs in the domain. There
 is therefore no PDC/BDC distinction.

In the AD world, there is still a PDC/BDC distinction in the idea of a
'PDC emulator' (who holds the #1b name), as well as the global catalog
server.  This option is mainly aimed at the first situation.

 So, the big questions:
 
 1. Will Samba 4 support multimastering, AD-style, with no BDCs?

First I expect we will have master/slave operation, as this is easy to
implement in the ldb backend.  We (I hope) will also be able to back
onto an LDAP server such as Fedora DS, and use that backend's
multi-master capability.  After that is settled in, we may look into
multimaster in our own ldb backends.

 2. Can the other masters run Windows AD, or must they also run Samba 4?

This is going to require more work than supporting just Samba DCs.  We
know some details about how the replications works, but we are far from
being able to participate in the DRSUAPI replication.

 3. If not, what is offered in place of these features?
 
 Thanks for any light you can shed on the matter. And thanks, as
 always, for a fantastic set of tools.
 
 --
 Thomas Boutell
 Boutell.Com, Inc. 
 http://www.boutell.com/
 
-- 
Andrew Bartletthttp://samba.org/~abartlet/
Authentication Developer, Samba Team   http://samba.org
Student Network Administrator, Hawker College  http://hawkerc.net


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

[Samba] Compiling error on HP-UX 11i v1

2006-03-24 Thread paul . barmettler
Dear all

During compilation samba-3.0.21c on a HP-UX 11i v1 system I get an error.

./configure --prefix=/opt/samba-3.0.21c

make

...
Compiling popt/poptconfig.c
Compiling popt/popthelp.c
Compiling popt/poptparse.c
Linking bin/smbd
/usr/ccs/bin/ld: Unsatisfied symbols:
   auth_script_init (first referenced in auth/auth.o) (code)
collect2: ld returned 1 exit status
*** Error exit code 1


Can somebody give me a hint what's going wrong?

With kind regards

Paul

***
br
Notice: The information contained in this message is intended 
only for use of the individual(s) named above and may contain 
confidential, proprietary or legally privileged information. No 
confidentiality or privilege is waived or lost by any 
mistransmission. If you are not the intended recipient of this 
message you are hereby notified that you must not use, 
disseminate, copy it in any form or take any action in 
reliance of it. If you have received this message in error 
please delete it and any copies of it and notify the sender 
immediately.
br
***
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] SFU Permission Denied

2006-03-24 Thread Bradford, Matthew
This appears to be an old problem, but is a complete show stopper for us
at the moment.

We are trying to access an NFS file system, via Samba, from a WinXP
client. Within Windows itself everything is fine, but when accessing the
shares from within an SFU cshell, an error is returned when a file is
created. The file is successfully created, but a Permission Denied
error is returned.

We receive the Unable to validate owner sid message in the log file.

Has any found a solution to this problem yet?

We are using Samba 3.0.21c and SFU 3.5.

Thanks,

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


[Samba] Where can I find explanation for smbstatus locking table values?

2006-03-24 Thread Zoran Ljubisic

Hi all,


In table:

Locked files:
PidDenyMode   Access  R/WOplock   Name
--
28938  DENY_NONE  0x2019f RDWR   EXCLUSIVE+BATCH 
/posao/backup/evident/2006//PODUZECA/PODATCI/P013/Kalkulac/Zaglav.dbf   Fri 
Mar 24 14:09:37 2006


Where can I find what different values of Access (0x2019f) od R/W (RDWR) or 
Oplock (EXCLUSIVE+BATCH) means?


Zoran 


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


[Samba] Searching old posts

2006-03-24 Thread Zoran Ljubisic

Hi all,

Is it possible to search old posts in this list for some keywords?

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


Re: [Samba] Smbd hanging

2006-03-24 Thread Matt Lung

mallapadi niranjan wrote:

Hi

I too have the same problem of smbd processes getting spawned. i gets
sometimes to 200 above process and all the users are unable access my samba
server.  


below is my descript of the problem
#

Hi all

I have a samba 3.0.21c with openldap 2.3.19,  with another linux system
having samba 3.0.21c acting as domain member server. (file server)
all my client access the file server shares extensively. about 100 users
access the file server at time,
this is making things very slow, on the file server about 180 smbd process
are getting created. on the file server i have 1gb of RAM with
2Gb of swap space, it occupies all the 1gb but never access swap space. The
share that they access is of 40gb of data
The access to the file server becomes so slow that all my client systems get
hanged (clients system windows 2k professional)
The server architecture of my file server IBM 226 series xeon server with
1gb ram and 73Gb hard disk.
  


Our hardware setup is a Dell PowerEdge 700, 1GB of RAM, 2GB SWAP, a 
2.4GHz HT P4, and a Raid 5 configuration on four 36GB SCSI disks.  We 
only probably have at most 50 users connecting to this server at a time, 
and not all of them are really opening and closing files all day at the 
same time.  I'd say we probably at most have 10 people really putting a 
hard tax on it (multiple files open w/ read/write, Access frontends 
connecting to the Postgress db), and maybe another 30 users just 
occasionally opening and closing a file or two during the day.  The rest 
just map a drive and do not even access files.  We do have an rsync 
operation that kicks off every hour for replication (could that cause 
some problems with samba?).  Hopefully if others are having this problem 
they will speak up also so we can get this resolved.  Thanks to all that 
are willing to help!




on the file server when we do
smbclient //filesrv/share -U root%redhat
it says server did not respond after 2 milliseconds.
what could be the problem is it that i need to upgrage the RAM, or
plese suggest  or
can we do any changes share defination of smb.conf of my file server so that
access becomes quick.
the following is my smb.conf of domain member server ( file server)
###
[global]

 unix charset = LOCALE
 workgroup = msdpl.com
 netbios name = prjsrv01
 server string = Project Server 1
 printcap name = /etc/printcap
 load printers = yes
 cups options = raw
 log level = 2
 log file = /usr/local/samba-3c/var/%U.%m.log
 syslog = 0
 max log size = 100
 smb ports = 139
 security = domain
 username map = /usr/local/samba-3c/lib/smbusers
 socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
 name resolve order = wins bcasts hosts
 wins server = 192.168.129.20
 dns proxy = no
 ldap server = 192.168.129.20
 ldap suffix = dc=msdpl,dc=com
 ldap machine suffix = ou=Computers
 ldap user suffix = ou=People
 ldap group suffix = ou=Groups
 ldap idmap suffix = ou=Idmap
 ldap admin dn = cn=manager,dc=msdpl,dc=com
 ldap ssl = no
 ldap timeout = 50
 acl check permissions = Yes
 template shell = /bin/false
 winbind use default domain = no
 inherit permissions = yes
 inherit acls = yes
 nt acl support = yes
 hide dot files = yes
###Share
Definations
 [homes]
   comment = Home Directories
   valid users = %S
   browseable = no
   writable = yes
   veto files =
/.bash_history/.bash_logout/.bash_profile/.bashrc/.canna/.emacs/.gtkrc/.kde/.viminfo/.xemacs/.zshrc/
   hide dot files = yes

[printers]
   comment = All Printers
   path = /var/spool/samba
   browseable = no
   guest ok = no
   writable = no
   printable = yes

 [projects]
 comment = All Projects
 path = /projects
 browseable = no
 guest ok = no
 writeable = yes
 printable = no
 veto files = desktop.ini/lost+found/.Trash-root/*.sh/*.scr/.recycle/
 create mode = 2700
 force create mode = 0700
 force directory mode = 0700
 inherit permissions = yes
 inherit acls = yes
 vfs objects = recycle

 [datalib]
 comment = DataLib
 path = /datalib
 browseable = no
 writeable = yes
 vfs objects = recycle
 veto files = lost+found
 inherit permissions = yes
 inherit acls = yes
 veto files = desktop.ini/lost+found/.Trash-root/*.sh/*.scr/.recycle/

[softdumps$]
Comment = Soft Dumps
Path = /dumps/softdumps
browseable = no
writeable = yes
inherit permissions = yes
inherit acls = yes
veto files = lost+found/.Trash-root/*.sh/*.scr/.recycle/
write list = @nns, root, @codesec
vfs objects = recycle
[dumps]
Comment = Dumps
Path = /dumps/dumps
browseable = yes
inherit permissions = yes
inherit acls = yes
vfs objects = recycle
veto files = desktop.ini/lost+found/.Trash-root/*.sh/*.scr/.recycle/

[hdrive$]
   path = /home
   browseable = no
   public = no
   writable = yes
   create mask = 0765
   veto files = desktop.ini
   valid 

Re: [Samba] Searching old posts

2006-03-24 Thread Tomasz Chmielewski

Zoran Ljubisic wrote:

Hi all,

Is it possible to search old posts in this list for some keywords?


Just type:

your key word site:lists.samba.org/archive/samba/

in google.

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


[Samba] Windows not letting me connect to a samba server

2006-03-24 Thread Steve Timpson
I have a Windows XP pro install and I need to create a link to an AIX box as
a drive letter.

 

Every time I try to make the connection it asks for the user name and
password.  When

I enter same widows keeps pre-pending the name of the computer to my
username

Thus:

 

Computername/username

 

And the aix box of coarse rejects the connection.  I am unable to find the
reason for the

Pre-pend.

 

Help

 

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 install on IRIX 6.5

2006-03-24 Thread Jason Mader

On Fri, 24 Mar 2006, James Peach wrote:


Use IRIX 6.5.22 or later. From 6.5.22 onwards, kerberos, openldap and
openssl were bundled with the base OS. I've never attempted to build against
the Freeware versions.


Irix doesn't bundle Kerberos headers, won't that be a problem?

---Jason Mader, FHWA/NHTSA National Crash Analysis Center,
The George Washington University, VA Campus
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] SFU Permission Denied

2006-03-24 Thread Jeremy Allison
On Fri, Mar 24, 2006 at 01:00:18PM -, Bradford, Matthew wrote:
 This appears to be an old problem, but is a complete show stopper for us
 at the moment.
 
 We are trying to access an NFS file system, via Samba, from a WinXP
 client. Within Windows itself everything is fine, but when accessing the
 shares from within an SFU cshell, an error is returned when a file is
 created. The file is successfully created, but a Permission Denied
 error is returned.
 
 We receive the Unable to validate owner sid message in the log file.
 
 Has any found a solution to this problem yet?
 
 We are using Samba 3.0.21c and SFU 3.5.

Debug level 10 log please ? I'm guessing that the problem
might be the uid/gid's on the file can't be looked up in
the LSA. What authentication/domain system are you using ?

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


Re: [Samba] [OT] DeleteRoamingCache=1 doesn't work

2006-03-24 Thread Toni Casueps
On Tue, 14 Mar 2006 16:41:44 + Toni Casueps [EMAIL PROTECTED] 
wrote:


TC
TC I have a Samba server which I set so that Windows clients have roaming
TC profiles. It works but when the user logs off, his personal folder in
TC C:\Documents and Settings remains there, although i created the key
TC DeleteRoamingCache (as a DWORD) in
TC HKEY_LOCAL_MACHINE\Software\Microsoft\Windows 
NT\CurrentVersion\WinLogon

TC and set it to 1.
TC
TC It seems a problem with the Windows client, but I'm not sure so I 
posted it

TC here in case it's a problem with the Samba server.
TC
TC Has this happened to any of you?
TC
TC

Install the User Profile Hive Cleanup Service.

Excerpt from the README file:
UPHClean v1.5e readme.txt Updated March 4, 2004 by Robin Caron
All feedback appreciated to [EMAIL PROTECTED]
WHAT IS UPHCLEAN
UPHClean is a service that once and for all gets rid of problems with user 
profile not unloading.


You can download it from:
http://www.microsoft.com/downloads/details.aspx?FamilyID=1b286e6d-8912-4e18-b570-42470e2f3582displaylang=en




Thanks for your help. Finally the DeleteRoamingCache setting worked, but 
some of the profiles where over quota and that prevented Windows to upload 
them to the server, so it didn't delete them so that they weren't lost.



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


Rich?

2006-03-24 Thread Jim Cheney
Is the infamous RJH reside at this addy?

[If in error, please accept my sincere apology!!]

- Jim Cheney
[EMAIL PROTECTED]
PLEASE READ THIS IMPORTANT ETIQUETTE MESSAGE BEFORE POSTING:

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


svn commit: samba r14688 - in branches/SAMBA_4_0/source/pidl: lib/Parse/Pidl/Samba4/NDR tests

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 11:42:03 + (Fri, 24 Mar 2006)
New Revision: 14688

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

Log:
More work on represent_as(): output the right function calls, fix test.

Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
   branches/SAMBA_4_0/source/pidl/tests/Util.pm
   branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 01:03:02 UTC (rev 14687)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 11:42:03 UTC (rev 14688)
@@ -676,8 +676,12 @@
 
# Representation type is different from transmit_as
if ($e-{REPRESENTATION_TYPE}) {
-   pidl /* FIXME: Convert from $e-{REPRESENTATION_TYPE} to 
$e-{TYPE} */;
-   pidl 
NDR_CHECK(ndr_$e-{REPRESENTATION_TYPE}_to_$e-{TYPE}(FIXME, FIXME));;
+   pidl {;
+   indent;
+   my $transmit_name = _transmit_$e-{NAME};
+   pidl mapType($e-{TYPE}) . $transmit_name;;
+   pidl 
NDR_CHECK(ndr_$e-{REPRESENTATION_TYPE}_to_$e-{TYPE}($var_name, 
$transmit_name));;
+   $var_name = $transmit_name;
}
 
start_flags($e);
@@ -690,6 +694,10 @@
 
end_flags($e);
 
+   if ($e-{REPRESENTATION_TYPE}) {
+   deindent;
+   pidl };
+   }
 }
 
 #
@@ -1064,11 +1072,20 @@
my($e,$ndr,$var_prefix,$env,$primitives,$deferred) = @_;
 
my $var_name = $var_prefix.$e-{NAME};
+   my $represent_name;
 
+   return unless $primitives or ($deferred and ContainsDeferred($e, 
$e-{LEVELS}[0]));
+
+   if ($e-{REPRESENTATION_TYPE}) {
+   pidl {;
+   indent;
+   $represent_name = $var_name;
+   $var_name = _transmit_$e-{NAME};
+   pidl mapType($e-{TYPE}). $var_name;;
+   }
+
$var_name = append_prefix($e, $var_name);
 
-   return unless $primitives or ($deferred and ContainsDeferred($e, 
$e-{LEVELS}[0]));
-
start_flags($e);
 

ParseElementPullLevel($e,$e-{LEVELS}[0],$ndr,$var_name,$env,$primitives,$deferred);
@@ -1077,8 +1094,9 @@
 
# Representation type is different from transmit_as
if ($e-{REPRESENTATION_TYPE}) {
-   pidl /* FIXME: Convert from $e-{TYPE} to 
$e-{REPRESENTATION_TYPE} */;
-   pidl 
NDR_CHECK(ndr_$e-{TYPE}_to_$e-{REPRESENTATION_TYPE}(FIXME, FIXME));;
+   pidl 
NDR_CHECK(ndr_$e-{TYPE}_to_$e-{REPRESENTATION_TYPE}($var_name, 
$represent_name));;
+   deindent;
+   pidl };
}
 }
 

Modified: branches/SAMBA_4_0/source/pidl/tests/Util.pm
===
--- branches/SAMBA_4_0/source/pidl/tests/Util.pm2006-03-24 01:03:02 UTC 
(rev 14687)
+++ branches/SAMBA_4_0/source/pidl/tests/Util.pm2006-03-24 11:42:03 UTC 
(rev 14688)
@@ -57,8 +57,8 @@
print CC #include stdarg.h\n;
print CC $header;
print CC $ndrheader;
+   print CC $extra if ($extra);
print CC $ndrparser;
-   print CC $extra if ($extra);
print CC int main(int argc, const char **argv)
 {
TALLOC_CTX *mem_ctx = talloc_init(NULL);

Modified: branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl
===
--- branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl   2006-03-24 
01:03:02 UTC (rev 14687)
+++ branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl   2006-03-24 
11:42:03 UTC (rev 14688)
@@ -29,11 +29,20 @@
return 2;
 ',
 '
-NTSTATUS ndr_uint8_to_foo(uint8 from, foo *to)
+#include core/nterr.h
+typedef int foo;
+
+NTSTATUS ndr_uint8_to_foo(uint8_t from, foo *to)
 {
*to = from;
return NT_STATUS_OK;
 }
+
+NTSTATUS ndr_foo_to_uint8(foo from, uint8_t *to)
+{
+   *to = from;
+   return NT_STATUS_OK;
+}
 '
 );
 



svn commit: samba r14689 - in branches/SAMBA_4_0/source/pidl/tests: .

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 11:45:40 + (Fri, 24 Mar 2006)
New Revision: 14689

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

Log:
Fix test

Modified:
   branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl
===
--- branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl   2006-03-24 11:42:03 UTC 
(rev 14688)
+++ branches/SAMBA_4_0/source/pidl/tests/ndr_align.pl   2006-03-24 11:45:40 UTC 
(rev 14689)
@@ -113,26 +113,24 @@
return 2;
 ');
 
-SKIP: {
-
-skip align-blob-align2 is known to fail, 8;
-
 test_samba4_ndr('align-blob-align2', 
 '
typedef [public] struct { 
uint8 x;
[flag(LIBNDR_FLAG_ALIGN2)] DATA_BLOB data;
+   uint8 y;
} bla;
 ',
 '
struct ndr_push *ndr = ndr_push_init();
struct bla r;
uint8_t data[] = { 0x01, 0x02 };
-   uint8_t expected[] = { 0x0D, 0x00, 0x01, 0x02 };
-   DATA_BLOB expected_blob = { expected, 4 };
+   uint8_t expected[] = { 0x0D, 0x00, 0x0E };
+   DATA_BLOB expected_blob = { expected, 3 };
DATA_BLOB result_blob;
 
r.x = 13;
+   r.y = 14;
r.data.data = data;
r.data.length = 2;
 
@@ -141,9 +139,6 @@
 
result_blob = ndr_push_blob(ndr);
 
-   printf(%02x%02x%02x%02x\n, result_blob.data[0], result_blob.data[1], 
result_blob.data[2], result_blob.data[3]);
-
if (!data_blob_equal(result_blob, expected_blob)) 
return 2;
 ');
-}



svn commit: samba r14690 - in branches/SAMBA_4_0/source/pidl: lib/Parse/Pidl/Samba4 lib/Parse/Pidl/Samba4/NDR tests

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 12:40:07 + (Fri, 24 Mar 2006)
New Revision: 14690

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

Log:
Support represent_as in headers, enable represent_as() test (which works now)

Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
   branches/SAMBA_4_0/source/pidl/tests/ndr_represent.pl


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm  
2006-03-24 11:45:40 UTC (rev 14689)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/Header.pm  
2006-03-24 12:40:07 UTC (rev 14690)
@@ -55,19 +55,23 @@
my($element) = shift;
 
pidl tabs();
-   HeaderType($element, $element-{TYPE}, );
-   pidl  ;
-   my $numstar = $element-{POINTERS};
-   if ($numstar = 1) {
-   $numstar-- if 
Parse::Pidl::Typelist::scalar_is_reference($element-{TYPE});
+   if (has_property($element, represent_as)) {
+   pidl mapType($element-{PROPERTIES}-{represent_as}). ;
+   } else {
+   HeaderType($element, $element-{TYPE}, );
+   pidl  ;
+   my $numstar = $element-{POINTERS};
+   if ($numstar = 1) {
+   $numstar-- if 
Parse::Pidl::Typelist::scalar_is_reference($element-{TYPE});
+   }
+   foreach (@{$element-{ARRAY_LEN}})
+   {
+   next if is_constant($_) and 
+   not has_property($element, charset);
+   $numstar++;
+   }
+   pidl * foreach (1..$numstar);
}
-   foreach (@{$element-{ARRAY_LEN}})
-   {
-   next if is_constant($_) and 
-   not has_property($element, charset);
-   $numstar++;
-   }
-   pidl * foreach (1..$numstar);
pidl $element-{NAME};
foreach (@{$element-{ARRAY_LEN}}) {
next unless (is_constant($_) and 
@@ -91,8 +95,8 @@
 $tab_depth++;
 my $el_count=0;
 if (defined $struct-{ELEMENTS}) {
-   foreach my $e (@{$struct-{ELEMENTS}}) {
-   HeaderElement($e);
+   foreach (@{$struct-{ELEMENTS}}) {
+   HeaderElement($_);
$el_count++;
}
 }
@@ -237,10 +241,8 @@
 {
 my($fn,$prop) = @_;
 
-foreach my $e (@{$fn-{ELEMENTS}}) {
-   if (has_property($e, $prop)) {
-   HeaderElement($e);
-   }
+foreach (@{$fn-{ELEMENTS}}) {
+   HeaderElement($_) if (has_property($_, $prop));
 }
 }
 

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 11:45:40 UTC (rev 14689)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 12:40:07 UTC (rev 14690)
@@ -670,8 +670,6 @@
 
my $var_name = $var_prefix.$e-{NAME};
 
-   $var_name = append_prefix($e, $var_name);
-
return unless $primitives or ($deferred and ContainsDeferred($e, 
$e-{LEVELS}[0]));
 
# Representation type is different from transmit_as
@@ -680,10 +678,12 @@
indent;
my $transmit_name = _transmit_$e-{NAME};
pidl mapType($e-{TYPE}) . $transmit_name;;
-   pidl 
NDR_CHECK(ndr_$e-{REPRESENTATION_TYPE}_to_$e-{TYPE}($var_name, 
$transmit_name));;
+   pidl 
NDR_CHECK(ndr_$e-{REPRESENTATION_TYPE}_to_$e-{TYPE}($var_name,  . 
get_pointer_to($transmit_name) . ));;
$var_name = $transmit_name;
}
 
+   $var_name = append_prefix($e, $var_name);
+
start_flags($e);
 
if (my $value = has_property($e, value)) {
@@ -1073,6 +1073,7 @@
 
my $var_name = $var_prefix.$e-{NAME};
my $represent_name;
+   my $transmit_name;
 
return unless $primitives or ($deferred and ContainsDeferred($e, 
$e-{LEVELS}[0]));
 
@@ -1080,7 +1081,8 @@
pidl {;
indent;
$represent_name = $var_name;
-   $var_name = _transmit_$e-{NAME};
+   $transmit_name = _transmit_$e-{NAME};
+   $var_name = $transmit_name;
pidl mapType($e-{TYPE}). $var_name;;
}
 
@@ -1094,7 +1096,7 @@
 
# Representation type is different from transmit_as
if ($e-{REPRESENTATION_TYPE}) {
-   pidl 
NDR_CHECK(ndr_$e-{TYPE}_to_$e-{REPRESENTATION_TYPE}($var_name, 
$represent_name));;
+   pidl 
NDR_CHECK(ndr_$e-{TYPE}_to_$e-{REPRESENTATION_TYPE}($transmit_name, 
.get_pointer_to($represent_name).));;

svn commit: samba r14691 - in branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl: . Samba4/NDR

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 14:13:02 + (Fri, 24 Mar 2006)
New Revision: 14691

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

Log:
Fix printing elements with represent_as set

Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm2006-03-24 
12:40:07 UTC (rev 14690)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm2006-03-24 
14:13:02 UTC (rev 14691)
@@ -917,6 +917,10 @@
fatal($e, el_name($e) .  : represent_as() and transmit_as() 
can not be used on the same element);
}
 
+   if (has_property($e, represent_as) and has_property($e, value)) {
+   fatal($e, el_name($e) .  : represent_as() and value() can not 
be used on the same element);
+   }
+
if (defined (has_property($e, subcontext_size)) and not 
defined(has_property($e, subcontext))) {
fatal($e, el_name($e) .  : subcontext_size() on non-subcontext 
element);
}

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 12:40:07 UTC (rev 14690)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 14:13:02 UTC (rev 14691)
@@ -729,9 +729,15 @@
 {
my($e,$var_name,$env) = @_;
 
-   $var_name = append_prefix($e, $var_name);
return if (has_property($e, noprint));
 
+   if ($e-{REPRESENTATION_TYPE}) {
+   pidl ndr_print_$e-{REPRESENTATION_TYPE}(ndr, \$e-{NAME}\, 
$var_name);;
+   return;
+   }
+
+   $var_name = append_prefix($e, $var_name);
+
if (my $value = has_property($e, value)) {
$var_name = (ndr-flags  LIBNDR_PRINT_SET_VALUES)? . 
ParseExpr($value,$env) . :$var_name;
}
@@ -1411,18 +1417,15 @@
 
EnvSubstituteValue($env, $struct);
 
-   foreach my $e (@{$struct-{ELEMENTS}}) {
-   DeclareArrayVariables($e);
-   }
+   DeclareArrayVariables($_) foreach (@{$struct-{ELEMENTS}});
 
pidl ndr_print_struct(ndr, name, \$name\);;
 
start_flags($struct);
 
pidl ndr-depth++;;
-   foreach my $e (@{$struct-{ELEMENTS}}) {
-   ParseElementPrint($e, r-$e-{NAME}, $env);
-   }
+   
+   ParseElementPrint($_, r-$_-{NAME}, $env) foreach 
(@{$struct-{ELEMENTS}});
pidl ndr-depth--;;
 
end_flags($struct);



svn commit: samba r14692 - in branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl: . Samba4/NDR

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 14:22:33 + (Fri, 24 Mar 2006)
New Revision: 14692

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

Log:
Get rid of the obfuscation() attribute

Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Compat.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Compat.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Compat.pm 2006-03-24 
14:13:02 UTC (rev 14691)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Compat.pm 2006-03-24 
14:22:33 UTC (rev 14692)
@@ -124,10 +124,6 @@
warning($e, compression() property not supported);
}
 
-   if (has_property($e, obfuscation)) {
-   warning($e, obfuscation() property not supported);
-   }
-
if (has_property($e, sptr)) {
warning($e, sptr() pointer property not supported);
}

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm2006-03-24 
14:13:02 UTC (rev 14691)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/NDR.pm2006-03-24 
14:22:33 UTC (rev 14692)
@@ -232,7 +232,6 @@
SUBCONTEXT_SIZE = $subsize,
IS_DEFERRED = $is_deferred,
COMPRESSION = has_property($e, compression),
-   OBFUSCATION = has_property($e, obfuscation)
});
}
 
@@ -805,7 +804,6 @@
subcontext= [ELEMENT],
subcontext_size   = [ELEMENT],
compression   = [ELEMENT],
-   obfuscation   = [ELEMENT],
 
# enum
enum8bit  = [TYPEDEF],
@@ -929,10 +927,6 @@
fatal($e, el_name($e) .  : compression() on non-subcontext 
element);
}
 
-   if (defined (has_property($e, obfuscation)) and not 
defined(has_property($e, subcontext))) {
-   fatal($e, el_name($e) .  : obfuscation() on non-subcontext 
element);
-   }
-
if (!$e-{POINTERS}  (
has_property($e, ptr) or
has_property($e, sptr) or

Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 14:13:02 UTC (rev 14691)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm  
2006-03-24 14:22:33 UTC (rev 14692)
@@ -464,42 +464,6 @@
pidl };
 }
 
-sub ParseObfuscationPushStart($$)
-{
-   my ($e,$ndr) = @_;
-   my $obfuscation = has_property($e, obfuscation);
-
-   pidl NDR_CHECK(ndr_push_obfuscation_start($ndr, $obfuscation));;
-
-   return $ndr;
-}
-
-sub ParseObfuscationPushEnd($$)
-{
-   my ($e,$ndr) = @_;
-   my $obfuscation = has_property($e, obfuscation);
-
-   pidl NDR_CHECK(ndr_push_obfuscation_end($ndr, $obfuscation));;
-}
-
-sub ParseObfuscationPullStart($$)
-{
-   my ($e,$ndr) = @_;
-   my $obfuscation = has_property($e, obfuscation);
-
-   pidl NDR_CHECK(ndr_pull_obfuscation_start($ndr, $obfuscation));;
-
-   return $ndr;
-}
-
-sub ParseObfuscationPullEnd($$)
-{
-   my ($e,$ndr) = @_;
-   my $obfuscation = has_property($e, obfuscation);
-
-   pidl NDR_CHECK(ndr_pull_obfuscation_end($ndr, $obfuscation));;
-}
-
 sub ParseSubcontextPushStart()
 {
my ($e,$l,$ndr,$env) = @_;
@@ -515,10 +479,6 @@
$subndr = ParseCompressionPushStart($e, $l, $subndr, $env);
}
 
-   if (defined $l-{OBFUSCATION}) {
-   $subndr = ParseObfuscationPushStart($e, $subndr);
-   }
-
return $subndr;
 }
 
@@ -532,10 +492,6 @@
ParseCompressionPushEnd($e, $l, $subndr, $env);
}
 
-   if (defined $l-{OBFUSCATION}) {
-   ParseObfuscationPushEnd($e, $subndr);
-   }
-
pidl NDR_CHECK(ndr_push_subcontext_end($ndr, $subndr, 
$l-{HEADER_SIZE}, $subcontext_size));;
deindent;
pidl };
@@ -556,10 +512,6 @@
$subndr = ParseCompressionPullStart($e, $l, $subndr, $env);
}
 
-   if (defined $l-{OBFUSCATION}) {
-   $subndr = ParseObfuscationPullStart($e, $subndr);
-   }
-   
return $subndr;
 }
 
@@ -573,10 +525,6 @@
ParseCompressionPullEnd($e, $l, $subndr, $env);
}
 
-   if (defined $l-{OBFUSCATION}) {
-   ParseObfuscationPullEnd($e, $subndr);
-   }
-
pidl NDR_CHECK(ndr_pull_subcontext_end($ndr, $subndr, 
$l-{HEADER_SIZE}, $subcontext_size));;
deindent;
pidl };
@@ -2351,10 +2299,6 @@
pidl 

svn commit: samba r14693 - in branches/SAMBA_4_0/source/build/smb_build: .

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 14:47:50 + (Fri, 24 Mar 2006)
New Revision: 14693

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

Log:
Automatically update dependencies during compilation

Modified:
   branches/SAMBA_4_0/source/build/smb_build/TODO
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/TODO
===
--- branches/SAMBA_4_0/source/build/smb_build/TODO  2006-03-24 14:22:33 UTC 
(rev 14692)
+++ branches/SAMBA_4_0/source/build/smb_build/TODO  2006-03-24 14:47:50 UTC 
(rev 14693)
@@ -1,3 +1,4 @@
+- pregenerate more stuff (IDL, manpages, lex/yacc?)
 - saner names for:
libcli.so.0.0.1 (rename to libsmb?)
libcli_cldap.so.0.0.1 (rename to libcldap?)

Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-24 
14:22:33 UTC (rev 14692)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-24 
14:47:50 UTC (rev 14693)
@@ -41,15 +41,17 @@
$self-output(\n);
$self-output(\n);
 
-   if (!$self-{automatic_deps}) {
-   $self-output(ALL_PREDEP = proto\n);
-   }
-
$self-output(default: all\n\n);
 
$self-_prepare_path_vars();
$self-_prepare_compiler_linker();
 
+   if (!$self-{automatic_deps}) {
+   $self-output(ALL_PREDEP = proto\n);
+   } else {
+   $self-output(CFLAGS += -MD\n);
+   }
+
return $self;
 }
 



svn commit: samba r14694 - in branches/SAMBA_4_0/source/build/smb_build: .

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 17:41:44 + (Fri, 24 Mar 2006)
New Revision: 14694

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

Log:
Remove for now until it does something useful.

Modified:
   branches/SAMBA_4_0/source/build/smb_build/makefile.pm


Changeset:
Modified: branches/SAMBA_4_0/source/build/smb_build/makefile.pm
===
--- branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-24 
14:47:50 UTC (rev 14693)
+++ branches/SAMBA_4_0/source/build/smb_build/makefile.pm   2006-03-24 
17:41:44 UTC (rev 14694)
@@ -48,8 +48,6 @@
 
if (!$self-{automatic_deps}) {
$self-output(ALL_PREDEP = proto\n);
-   } else {
-   $self-output(CFLAGS += -MD\n);
}
 
return $self;



svn commit: samba r14695 - branches/SAMBA_3_0/source branches/SAMBA_3_0/source/smbd trunk/source trunk/source/smbd

2006-03-24 Thread vlendec
Author: vlendec
Date: 2006-03-24 18:40:28 + (Fri, 24 Mar 2006)
New Revision: 14695

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

Log:
Patch from Bj?\195?\182rn Jacke:

- add DMAPI/XDSM support for AIX
- find JFS DMAPI libs on Linux when only they are available

Volker
Modified:
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/smbd/dmapi.c
   trunk/source/configure.in
   trunk/source/smbd/dmapi.c


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2006-03-24 17:41:44 UTC (rev 
14694)
+++ branches/SAMBA_3_0/source/configure.in  2006-03-24 18:40:28 UTC (rev 
14695)
@@ -829,7 +829,7 @@
 AC_CHECK_HEADERS(sys/sysmacros.h security/_pam_macros.h dlfcn.h)
 AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
-AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h)
+AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h)
 
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
@@ -2339,16 +2339,32 @@
 fi
 
 #
-# Check for DMAPI interfaces in libdm.
+# Check for DMAPI interfaces in libdm/libjfsdm/libxsdm
 
 AC_CHECK_LIB(dm, dm_get_eventlist,
[samba_cv_HAVE_LIBDM=yes; samba_dmapi_libs=-ldm],
[samba_cv_HAVE_LIBDM=no])
 
 if test x$samba_cv_HAVE_LIBDM = xyes ; then
-AC_DEFINE(HAVE_LIBDM, 1, [Whether libdm is available])
+   AC_DEFINE(HAVE_LIBDM, 1, [Whether dmapi libdm is available])
 fi
 
+AC_CHECK_LIB(jfsdm, dm_get_eventlist,
+   [samba_cv_HAVE_LIBJFSDM=yes; samba_dmapi_libs=-ljfsdm],
+   [samba_cv_HAVE_LIBJFSDM=no])
+
+if test x$samba_cv_HAVE_LIBJFSDM = xyes ; then
+   AC_DEFINE(HAVE_LIBJFSDM, 1, [Whether dmapi libjfsdm is available])
+fi
+
+AC_CHECK_LIB(xdsm, dm_get_eventlist,
+   [samba_cv_HAVE_LIBXDSM=yes; samba_dmapi_libs=-lxdsm],
+   [samba_cv_HAVE_LIBXDSM=no])
+
+if test x$samba_cv_HAVE_LIBXDSM = xyes ; then
+   AC_DEFINE(HAVE_LIBXDSM, 1, [Whether dmapi libxdsm is available])
+fi
+
 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
 AC_TRY_RUN([
 #include sys/types.h

Modified: branches/SAMBA_3_0/source/smbd/dmapi.c
===
--- branches/SAMBA_3_0/source/smbd/dmapi.c  2006-03-24 17:41:44 UTC (rev 
14694)
+++ branches/SAMBA_3_0/source/smbd/dmapi.c  2006-03-24 18:40:28 UTC (rev 
14695)
@@ -24,8 +24,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_DMAPI
 
-#if defined(HAVE_LIBDM)
-#if (defined(HAVE_XFS_DMAPI_H) || defined(HAVE_SYS_DMI_H))
+#if defined(HAVE_LIBDM) || defined(HAVE_LIBJFSDM) || defined(HAVE_LIBXDSM)
+#if defined(HAVE_XFS_DMAPI_H) || defined(HAVE_SYS_DMI_H) || 
defined(HAVE_SYS_JFSDMAPI_H) || defined(HAVE_SYS_DMAPI_H)
 #define USE_DMAPI 1
 #endif
 #endif
@@ -40,10 +40,12 @@
 
 #ifdef HAVE_XFS_DMAPI_H
 #include xfs/dmapi.h
-#endif
-
-#ifdef HAVE_SYS_DMI_H
+#elif defined(HAVE_SYS_DMI_H)
 #include sys/dmi.h
+#elif defined(HAVE_SYS_JFSDMAPI_H)
+#include sys/jfsdmapi.h
+#elif defined(HAVE_SYS_DMAPI_H)
+#include sys/dmapi.h
 #endif
 
 #define DMAPI_SESSION_NAME samba

Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2006-03-24 17:41:44 UTC (rev 14694)
+++ trunk/source/configure.in   2006-03-24 18:40:28 UTC (rev 14695)
@@ -829,7 +829,7 @@
 AC_CHECK_HEADERS(sys/sysmacros.h security/_pam_macros.h dlfcn.h)
 AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
-AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h)
+AC_CHECK_HEADERS(sys/dmi.h xfs/dmapi.h sys/jfsdmapi.h sys/dmapi.h)
 
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
@@ -2339,16 +2339,32 @@
 fi
 
 #
-# Check for DMAPI interfaces in libdm.
+# Check for DMAPI interfaces in libdm/libjfsdm/libxsdm
 
 AC_CHECK_LIB(dm, dm_get_eventlist,
[samba_cv_HAVE_LIBDM=yes; samba_dmapi_libs=-ldm],
[samba_cv_HAVE_LIBDM=no])
 
 if test x$samba_cv_HAVE_LIBDM = xyes ; then
-AC_DEFINE(HAVE_LIBDM, 1, [Whether libdm is available])
+   AC_DEFINE(HAVE_LIBDM, 1, [Whether dmapi libdm is available])
 fi
 
+AC_CHECK_LIB(jfsdm, dm_get_eventlist,
+   [samba_cv_HAVE_LIBJFSDM=yes; samba_dmapi_libs=-ljfsdm],
+   [samba_cv_HAVE_LIBJFSDM=no])
+
+if test x$samba_cv_HAVE_LIBJFSDM = xyes ; then
+   AC_DEFINE(HAVE_LIBJFSDM, 1, [Whether dmapi libjfsdm is available])
+fi
+
+AC_CHECK_LIB(xdsm, dm_get_eventlist,
+   [samba_cv_HAVE_LIBXDSM=yes; samba_dmapi_libs=-lxdsm],
+   [samba_cv_HAVE_LIBXDSM=no])
+
+if test x$samba_cv_HAVE_LIBXDSM = xyes ; then
+   AC_DEFINE(HAVE_LIBXDSM, 1, [Whether dmapi libxdsm is available])
+fi
+
 AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
 AC_TRY_RUN([
 #include sys/types.h

Modified: trunk/source/smbd/dmapi.c

svn commit: samba r14696 - in branches/SAMBA_3_0/source/passdb: .

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 19:12:04 + (Fri, 24 Mar 2006)
New Revision: 14696

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

Log:
make pdb_find_backend_entry public (for use by an external multi pdb backend)

Modified:
   branches/SAMBA_3_0/source/passdb/pdb_interface.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_interface.c
===
--- branches/SAMBA_3_0/source/passdb/pdb_interface.c2006-03-24 18:40:28 UTC 
(rev 14695)
+++ branches/SAMBA_3_0/source/passdb/pdb_interface.c2006-03-24 19:12:04 UTC 
(rev 14696)
@@ -40,7 +40,6 @@
initialized = True;
 }
 
-static struct pdb_init_function_entry *pdb_find_backend_entry(const char 
*name);
 static BOOL lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid,
  const char **name,
  enum SID_NAME_USE *psid_name_use,
@@ -116,7 +115,7 @@
return NT_STATUS_OK;
 }
 
-static struct pdb_init_function_entry *pdb_find_backend_entry(const char *name)
+struct pdb_init_function_entry *pdb_find_backend_entry(const char *name)
 {
struct pdb_init_function_entry *entry = backends;
 
@@ -1314,7 +1313,6 @@
 
 static NTSTATUS pdb_default_add_sam_account (struct pdb_methods *methods, 
struct samu *newpwd)
 {
-   DEBUG(0,(this backend (%s) should not be listed as the first passdb 
backend! You can't add users to it.\n, methods-name));
return NT_STATUS_NOT_IMPLEMENTED;
 }
 



svn commit: samba r14697 - in trunk/source/passdb: .

2006-03-24 Thread jelmer
Author: jelmer
Date: 2006-03-24 19:13:21 + (Fri, 24 Mar 2006)
New Revision: 14697

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

Log:
make pdb_find_backend_entry public (for use by an external multi pdb backend)

Modified:
   trunk/source/passdb/pdb_interface.c


Changeset:
Modified: trunk/source/passdb/pdb_interface.c
===
--- trunk/source/passdb/pdb_interface.c 2006-03-24 19:12:04 UTC (rev 14696)
+++ trunk/source/passdb/pdb_interface.c 2006-03-24 19:13:21 UTC (rev 14697)
@@ -40,7 +40,6 @@
initialized = True;
 }
 
-static struct pdb_init_function_entry *pdb_find_backend_entry(const char 
*name);
 static BOOL lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32 rid,
  const char **name,
  enum SID_NAME_USE *psid_name_use,
@@ -116,7 +115,7 @@
return NT_STATUS_OK;
 }
 
-static struct pdb_init_function_entry *pdb_find_backend_entry(const char *name)
+struct pdb_init_function_entry *pdb_find_backend_entry(const char *name)
 {
struct pdb_init_function_entry *entry = backends;
 
@@ -1314,7 +1313,6 @@
 
 static NTSTATUS pdb_default_add_sam_account (struct pdb_methods *methods, 
struct samu *newpwd)
 {
-   DEBUG(0,(this backend (%s) should not be listed as the first passdb 
backend! You can't add users to it.\n, methods-name));
return NT_STATUS_NOT_IMPLEMENTED;
 }
 



svn commit: samba r14699 - branches/SAMBA_3_0/source/utils trunk/source/utils

2006-03-24 Thread jerry
Author: jerry
Date: 2006-03-24 23:54:08 + (Fri, 24 Mar 2006)
New Revision: 14699

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

Log:
allow 'net sam addmem' to accept a SID for the member


Modified:
   branches/SAMBA_3_0/source/utils/net_sam.c
   trunk/source/utils/net_sam.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_sam.c
===
--- branches/SAMBA_3_0/source/utils/net_sam.c   2006-03-24 22:04:16 UTC (rev 
14698)
+++ branches/SAMBA_3_0/source/utils/net_sam.c   2006-03-24 23:54:08 UTC (rev 
14699)
@@ -533,10 +533,24 @@
return -1;
}
 
+   /* check to see if the member to be added is a name or a SID */
+
if (!lookup_name(tmp_talloc_ctx(), argv[1], LOOKUP_NAME_ISOLATED,
-memberdomain, membername, member, membertype)) {
-   d_fprintf(stderr, Could not find member %s\n, argv[1]);
-   return -1;
+memberdomain, membername, member, membertype))
+   {
+   /* try it as a SID */
+
+   if ( !string_to_sid( member, argv[1] ) ) {
+   d_fprintf(stderr, Could not find member %s\n, 
argv[1]);
+   return -1;
+   }
+
+   if ( !lookup_sid(tmp_talloc_ctx(), member, memberdomain, 
+   membername, membertype) ) 
+   {
+   d_fprintf(stderr, Could not resolve SID %s\n, 
argv[1]);
+   return -1;
+   }
}
 
if ((grouptype == SID_NAME_ALIAS) || (grouptype == SID_NAME_WKN_GRP)) {
@@ -562,8 +576,8 @@
return -1;
}
 
-   d_printf(Added %s\\%s to %s\\%s\n,
-memberdomain, membername, groupdomain, groupname);
+   d_printf(Added %s\\%s to %s\\%s\n, memberdomain, membername, 
+   groupdomain, groupname);
 
return 0;
 }

Modified: trunk/source/utils/net_sam.c
===
--- trunk/source/utils/net_sam.c2006-03-24 22:04:16 UTC (rev 14698)
+++ trunk/source/utils/net_sam.c2006-03-24 23:54:08 UTC (rev 14699)
@@ -533,10 +533,24 @@
return -1;
}
 
+   /* check to see if the member to be added is a name or a SID */
+
if (!lookup_name(tmp_talloc_ctx(), argv[1], LOOKUP_NAME_ISOLATED,
-memberdomain, membername, member, membertype)) {
-   d_fprintf(stderr, Could not find member %s\n, argv[1]);
-   return -1;
+memberdomain, membername, member, membertype))
+   {
+   /* try it as a SID */
+
+   if ( !string_to_sid( member, argv[1] ) ) {
+   d_fprintf(stderr, Could not find member %s\n, 
argv[1]);
+   return -1;
+   }
+
+   if ( !lookup_sid(tmp_talloc_ctx(), member, memberdomain, 
+   membername, membertype) ) 
+   {
+   d_fprintf(stderr, Could not resolve SID %s\n, 
argv[1]);
+   return -1;
+   }
}
 
if ((grouptype == SID_NAME_ALIAS) || (grouptype == SID_NAME_WKN_GRP)) {
@@ -562,8 +576,8 @@
return -1;
}
 
-   d_printf(Added %s\\%s to %s\\%s\n,
-memberdomain, membername, groupdomain, groupname);
+   d_printf(Added %s\\%s to %s\\%s\n, memberdomain, membername, 
+   groupdomain, groupname);
 
return 0;
 }



Build status as of Sat Mar 25 00:00:02 2006

2006-03-24 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-03-24 
00:00:27.0 +
+++ /home/build/master/cache/broken_results.txt 2006-03-25 00:00:39.0 
+
@@ -1,17 +1,17 @@
-Build status as of Fri Mar 24 00:00:02 2006
+Build status as of Sat Mar 25 00:00:02 2006
 
 Build counts:
 Tree Total  Broken Panic 
 ccache   7  1  0 
-distcc   8  2  0 
+distcc   7  2  0 
 lorikeet-heimdal 31 31 0 
 ppp  16 0  0 
 rsync34 2  0 
 samba2  0  0 
 samba-docs   0  0  0 
-samba4   36 26 0 
+samba4   35 27 0 
 samba_3_036 7  0 
 smb-build21 0  0 
-talloc   32 18 0 
+talloc   11 6  0 
 tdb  32 3  0 
 


svn commit: samba r14700 - in branches/SAMBA_4_0/source/auth/gensec: .

2006-03-24 Thread abartlet
Author: abartlet
Date: 2006-03-25 00:50:26 + (Sat, 25 Mar 2006)
New Revision: 14700

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

Log:
Fix spelling, and change these informational messages to debug level 5.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c
===
--- branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c   2006-03-24 
23:54:08 UTC (rev 14699)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c   2006-03-25 
00:50:26 UTC (rev 14700)
@@ -441,11 +441,11 @@
gensec_gssapi_state-sasl_state = STAGE_DONE;
 
if (gensec_have_feature(gensec_security, 
GENSEC_FEATURE_SEAL)) {
-   DEBUG(3, (GSSAPI Connection will be 
cryptographicly sealed\n));
+   DEBUG(5, (GSSAPI Connection will be 
cryptographicly sealed\n));
} else if (gensec_have_feature(gensec_security, 
GENSEC_FEATURE_SIGN)) {
-   DEBUG(3, (GSSAPI Connection will be 
cryptographicly signed\n));
+   DEBUG(5, (GSSAPI Connection will be 
cryptographicly signed\n));
} else {
-   DEBUG(3, (GSSAPI Connection will have 
no cryptographicly protection\n));
+   DEBUG(5, (GSSAPI Connection will have 
no cryptographic protection\n));
}
 
return NT_STATUS_OK;
@@ -678,11 +678,11 @@
/* quirk:  This changes the value that gensec_have_feature 
returns, to be that after SASL negotiation */
gensec_gssapi_state-sasl_state = STAGE_DONE;
if (gensec_have_feature(gensec_security, GENSEC_FEATURE_SEAL)) {
-   DEBUG(3, (SASL/GSSAPI Connection from client will be 
cryptographicly sealed\n));
+   DEBUG(5, (SASL/GSSAPI Connection from client will be 
cryptographicly sealed\n));
} else if (gensec_have_feature(gensec_security, 
GENSEC_FEATURE_SIGN)) {
-   DEBUG(3, (SASL/GSSAPI Connection from client will be 
cryptographicly signed\n));
+   DEBUG(5, (SASL/GSSAPI Connection from client will be 
cryptographicly signed\n));
} else {
-   DEBUG(3, (SASL/GSSAPI Connection from client will have 
no cryptographicly protection\n));
+   DEBUG(5, (SASL/GSSAPI Connection from client will have 
no cryptographic protection\n));
}
 
*out = data_blob(NULL, 0);



svn commit: samba r14701 - in branches/SAMBA_4_0/source/auth: credentials ntlmssp

2006-03-24 Thread abartlet
Author: abartlet
Date: 2006-03-25 01:00:37 + (Sat, 25 Mar 2006)
New Revision: 14701

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

Log:
Allow, with non-default options, NTLMSSP to access the LM session key,
even when not sending the LM response.  Needed to pass the
test_session_key against Win2k3.

Yes, I think this is a security flaw in the use of Win2k3-compatible NTLM.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/auth/credentials/credentials_ntlm.c
   branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_client.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/credentials/credentials_ntlm.c
===
--- branches/SAMBA_4_0/source/auth/credentials/credentials_ntlm.c   
2006-03-25 00:50:26 UTC (rev 14700)
+++ branches/SAMBA_4_0/source/auth/credentials/credentials_ntlm.c   
2006-03-25 01:00:37 UTC (rev 14701)
@@ -144,6 +144,7 @@
/* LM Key is incompatible... */
*flags = ~CLI_CRED_LANMAN_AUTH;
} else {
+   uint8_t lm_hash[16];
nt_response = data_blob_talloc(mem_ctx, NULL, 24);
SMBOWFencrypt(nt_hash-hash, challenge.data,
  nt_response.data);
@@ -160,7 +161,6 @@
if (!password) {
lm_response = nt_response;
} else {
-   uint8_t lm_hash[16];
lm_response = data_blob_talloc(mem_ctx, NULL, 
24);
if (!SMBencrypt(password,challenge.data,
lm_response.data)) {
@@ -188,6 +188,15 @@
/* LM Key is incompatible... */
lm_response = nt_response;
*flags = ~CLI_CRED_LANMAN_AUTH;
+
+   const char *password;
+   password = cli_credentials_get_password(cred);
+   if (password) {
+   E_deshash(password, lm_hash);
+   lm_session_key = data_blob_talloc(mem_ctx, 
NULL, 16);
+   memcpy(lm_session_key.data, lm_hash, 8);
+   memset(lm_session_key.data[8], '\0', 8);
+   }
}
}
if (_lm_response) {

Modified: branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_client.c
===
--- branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_client.c 2006-03-25 
00:50:26 UTC (rev 14700)
+++ branches/SAMBA_4_0/source/auth/ntlmssp/ntlmssp_client.c 2006-03-25 
01:00:37 UTC (rev 14701)
@@ -194,8 +194,9 @@
}

if (!(flags  CLI_CRED_LANMAN_AUTH)) {
-   /* LM Key is incompatible... */
-   gensec_ntlmssp_state-neg_flags = ~NTLMSSP_NEGOTIATE_LM_KEY;
+   /* LM Key is still possible, just silly.  Fortunetly
+* we require command line options to end up here */
+   /* gensec_ntlmssp_state-neg_flags = 
~NTLMSSP_NEGOTIATE_LM_KEY; */
}
 
if (!(flags  CLI_CRED_NTLM2)) {



svn commit: samba r14702 - in branches/SAMBA_4_0/source/rpc_server/spoolss: .

2006-03-24 Thread abartlet
Author: abartlet
Date: 2006-03-25 01:02:10 + (Sat, 25 Mar 2006)
New Revision: 14702

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

Log:
Accept our netbios aliases as valid names in the SPOOLSS server.  

(Suggested by metze)

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/rpc_server/spoolss/dcesrv_spoolss.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/spoolss/dcesrv_spoolss.c
===
--- branches/SAMBA_4_0/source/rpc_server/spoolss/dcesrv_spoolss.c   
2006-03-25 01:00:37 UTC (rev 14701)
+++ branches/SAMBA_4_0/source/rpc_server/spoolss/dcesrv_spoolss.c   
2006-03-25 01:02:10 UTC (rev 14702)
@@ -145,6 +145,8 @@
 {
BOOL ret;
struct socket_address *myaddr;
+   const char **aliases;
+   int i;
 
/* NULL is ok */
if (!server_name) return WERR_OK;
@@ -169,6 +171,14 @@
ret = strequal(lp_netbios_name(), server_name);
if (ret) return WERR_OK;
 
+   aliases = lp_netbios_aliases();
+
+   for (i=0; aliases  aliases[i]; i++) {
+   if (strequal(aliases[i], server_name)) {
+   return WERR_OK;
+   }
+   }
+
/* DNS NAME is ok
 * TODO: we need to check if aliases are also ok
 */



svn commit: samba r14703 - in branches/SAMBA_3_0/source: lib locking

2006-03-24 Thread jra
Author: jra
Date: 2006-03-25 01:35:43 + (Sat, 25 Mar 2006)
New Revision: 14703

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

Log:
Clarify the return codes for the POSIX locking case. This
was confusing.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/lib/util.c
   branches/SAMBA_3_0/source/locking/posix.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util.c
===
--- branches/SAMBA_3_0/source/lib/util.c2006-03-25 01:02:10 UTC (rev 
14702)
+++ branches/SAMBA_3_0/source/lib/util.c2006-03-25 01:35:43 UTC (rev 
14703)
@@ -1873,7 +1873,7 @@
if (ret == -1  errno != 0)
DEBUG(3,(fcntl_lock: fcntl lock gave errno %d 
(%s)\n,errno,strerror(errno)));
 
-   /* a lock query */
+   /* a lock query - return True if this region is locked, False if not 
locked. */
if (op == SMB_F_GETLK) {
if ((ret != -1) 
(lock.l_type != F_UNLCK)  

Modified: branches/SAMBA_3_0/source/locking/posix.c
===
--- branches/SAMBA_3_0/source/locking/posix.c   2006-03-25 01:02:10 UTC (rev 
14702)
+++ branches/SAMBA_3_0/source/locking/posix.c   2006-03-25 01:35:43 UTC (rev 
14703)
@@ -644,15 +644,19 @@
 
 /
  Actual function that does POSIX locks. Copes with 64 - 32 bit cruft and
- broken NFS implementations.
+ broken NFS implementations. Returns True if we got the lock or the region
+ is unlocked in the F_GETLK case, False otherwise.
 /
 
 static BOOL posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, 
SMB_OFF_T count, int type)
 {
-   int ret;
+   BOOL ret;
 
DEBUG(8,(posix_fcntl_lock %d %d %.0f %.0f 
%d\n,fsp-fh-fd,op,(double)offset,(double)count,type));
 
+   /* In the F_GETLK case this returns True if the region 
+  was locked, False if unlocked. */
+
ret = SMB_VFS_LOCK(fsp,fsp-fh-fd,op,offset,count,type);
 
if (!ret  ((errno == EFBIG) || (errno == ENOLCK) || (errno ==  
EINVAL))) {



svn commit: samba r14704 - in trunk/source/locking: .

2006-03-24 Thread jra
Author: jra
Date: 2006-03-25 01:50:00 + (Sat, 25 Mar 2006)
New Revision: 14704

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

Log:
Fix lock queries with the new VFS semantics.
Jeremy.

Modified:
   trunk/source/locking/posix.c


Changeset:
Modified: trunk/source/locking/posix.c
===
--- trunk/source/locking/posix.c2006-03-25 01:35:43 UTC (rev 14703)
+++ trunk/source/locking/posix.c2006-03-25 01:50:00 UTC (rev 14704)
@@ -649,16 +649,11 @@
 
 static BOOL posix_fcntl_lock(files_struct *fsp, int op, SMB_OFF_T offset, 
SMB_OFF_T count, int type)
 {
-   int ret;
+   BOOL ret;
 
DEBUG(8,(posix_fcntl_lock %d %d %.0f %.0f 
%d\n,fsp-fh-fd,op,(double)offset,(double)count,type));
 
-   if (op != SMB_F_GETLK) {
-   ret = SMB_VFS_LOCK(fsp,fsp-fh-fd,op,offset,count,type);
-   } else {
-   pid_t pid;
-   ret = 
SMB_VFS_GETLOCK(fsp,fsp-fh-fd,offset,count,type,pid);
-   }
+   ret = SMB_VFS_LOCK(fsp,fsp-fh-fd,op,offset,count,type);
 
if (!ret  ((errno == EFBIG) || (errno == ENOLCK) || (errno ==  
EINVAL))) {
 
@@ -682,12 +677,7 @@
DEBUG(0,(Count greater than 31 bits - retrying with 31 
bit truncated length.\n));
errno = 0;
count = 0x7fff;
-   if (op != SMB_F_GETLK) {
-   ret = 
SMB_VFS_LOCK(fsp,fsp-fh-fd,op,offset,count,type);
-   } else {
-   pid_t pid;
-   ret = 
SMB_VFS_GETLOCK(fsp,fsp-fh-fd,offset,count,type,pid);
-   }
+   ret = 
SMB_VFS_LOCK(fsp,fsp-fh-fd,op,offset,count,type);
}
}
 
@@ -696,6 +686,52 @@
 }
 
 /
+ Actual function that gets POSIX locks. Copes with 64 - 32 bit cruft and
+ broken NFS implementations.
+/
+
+static BOOL posix_fcntl_getlock(files_struct *fsp, SMB_OFF_T *poffset, 
SMB_OFF_T *pcount, int *ptype)
+{
+   pid_t pid;
+   BOOL ret;
+
+   DEBUG(8,(posix_fcntl_getlock %d %.0f %.0f %d\n,
+   fsp-fh-fd,(double)*poffset,(double)*pcount,*ptype));
+
+   ret = SMB_VFS_GETLOCK(fsp,fsp-fh-fd,poffset,pcount,ptype,pid);
+
+   if (!ret  ((errno == EFBIG) || (errno == ENOLCK) || (errno ==  
EINVAL))) {
+
+   DEBUG(0,(posix_fcntl_getlock: WARNING: lock request at offset 
%.0f, length %.0f returned\n,
+   (double)*poffset,(double)*pcount));
+   DEBUG(0,(an %s error. This can happen when using 64 bit lock 
offsets\n, strerror(errno)));
+   DEBUG(0,(on 32 bit NFS mounted file systems.\n));
+
+   /*
+* If the offset is  0x7FFF then this will cause problems 
on
+* 32 bit NFS mounted filesystems. Just ignore it.
+*/
+
+   if (*poffset  ~((SMB_OFF_T)0x7fff)) {
+   DEBUG(0,(Offset greater than 31 bits. Returning 
success.\n));
+   return True;
+   }
+
+   if (*pcount  ~((SMB_OFF_T)0x7fff)) {
+   /* 32 bit NFS file system, retry with smaller offset */
+   DEBUG(0,(Count greater than 31 bits - retrying with 31 
bit truncated length.\n));
+   errno = 0;
+   *pcount = 0x7fff;
+   ret = 
SMB_VFS_GETLOCK(fsp,fsp-fh-fd,poffset,pcount,ptype,pid);
+   }
+   }
+
+   DEBUG(8,(posix_fcntl_getlock: Lock query call %s\n, ret ? 
successful : failed));
+   return ret;
+}
+
+
+/
  POSIX function to see if a file region is locked. Returns True if the
  region is locked, False otherwise.
 /
@@ -718,20 +754,15 @@
 * never set it, so presume it is not locked.
 */
 
-   if(!posix_lock_in_range(offset, count, u_offset, u_count))
+   if(!posix_lock_in_range(offset, count, u_offset, u_count)) {
return False;
+   }
 
-   /*
-* Note that most UNIX's can *test* for a write lock on
-* a read-only fd, just not *set* a write lock on a read-only
-* fd. So we don't need to use map_lock_type here.
-*/ 
-
-   if (!posix_fcntl_lock(fsp,SMB_F_GETLK,offset,count,posix_lock_type)) {
+   if (!posix_fcntl_getlock(fsp,offset,count,posix_lock_type)) {
return False;
}
 
-   return (posix_lock_type != F_UNLCK ? True : False);
+   return (posix_lock_type == F_UNLCK ? False : True);
 }
 
 /*



svn commit: samba r14705 - in trunk/source: locking smbd

2006-03-24 Thread jra
Author: jra
Date: 2006-03-25 02:35:40 + (Sat, 25 Mar 2006)
New Revision: 14705

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

Log:
Fill in the lock query part of the POSIX etensions.
Final two pieces to do are :
a). Deal with SETLKW (wait locks).
b). Deal with mapping the POSIX lock requests into
POSIX locks in the underlying filesystem, currently
this doesn't work correctly. Having said that, if
posix locking = no is set on a share and the lock
calls are non-blocking this code should now be able
to be tested by Steve !
Jeremy.

Modified:
   trunk/source/locking/brlock.c
   trunk/source/locking/locking.c
   trunk/source/locking/posix.c
   trunk/source/smbd/trans2.c


Changeset:
Modified: trunk/source/locking/brlock.c
===
--- trunk/source/locking/brlock.c   2006-03-25 01:50:00 UTC (rev 14704)
+++ trunk/source/locking/brlock.c   2006-03-25 02:35:40 UTC (rev 14705)
@@ -1080,7 +1080,7 @@
 */
 
if(lp_posix_locking(fsp-conn-cnum)  (lock_flav == WINDOWS_LOCK)) {
-   ret = is_posix_locked(fsp, start, size, lock_type, 
WINDOWS_LOCK);
+   ret = is_posix_locked(fsp, start, size, lock_type, 
WINDOWS_LOCK);
 
DEBUG(10,(brl_locktest: posix start=%.0f len=%.0f %s for fnum 
%d file %s\n,
(double)start, (double)size, ret ? locked : 
unlocked,
@@ -1092,6 +1092,69 @@
 }
 
 /
+ Query for existing locks.
+/
+
+NTSTATUS brl_lockquery(struct byte_range_lock *br_lck,
+   uint16 *psmbpid,
+   struct process_id pid,
+   br_off *pstart,
+   br_off *psize, 
+   enum brl_type *plock_type,
+   enum brl_flavour lock_flav)
+{
+   unsigned int i;
+   struct lock_struct lock;
+   struct lock_struct *locks = (struct lock_struct *)br_lck-lock_data;
+   files_struct *fsp = br_lck-fsp;
+
+   lock.context.smbpid = *psmbpid;
+   lock.context.pid = pid;
+   lock.context.tid = br_lck-fsp-conn-cnum;
+   lock.start = *pstart;
+   lock.size = *psize;
+   lock.fnum = fsp-fnum;
+   lock.lock_type = *plock_type;
+   lock.lock_flav = lock_flav;
+
+   /* Make sure existing locks don't conflict */
+   for (i=0; i  br_lck-num_locks; i++) {
+   /*
+* Our own locks don't conflict.
+*/
+   if (brl_conflict_other(locks[i], lock)) {
+   *psmbpid = locks[i].context.smbpid;
+   *pstart = locks[i].start;
+   *psize = locks[i].size;
+   *plock_type = locks[i].lock_type = *plock_type;
+   return NT_STATUS_LOCK_NOT_GRANTED;
+   }
+   }
+
+   /*
+* There is no lock held by an SMB daemon, check to
+* see if there is a POSIX lock from a UNIX or NFS process.
+*/
+
+   if(lp_posix_locking(fsp-conn-cnum)) {
+   BOOL ret = is_posix_locked(fsp, pstart, psize, plock_type, 
POSIX_LOCK);
+
+   DEBUG(10,(brl_lockquery: posix start=%.0f len=%.0f %s for fnum 
%d file %s\n,
+   (double)*pstart, (double)*psize, ret ? locked : 
unlocked,
+   fsp-fnum, fsp-fsp_name ));
+
+   if (ret) {
+   /* Hmmm. No clue what to set smbpid to - use -1. */
+   *psmbpid = 0x;
+   return NT_STATUS_LOCK_NOT_GRANTED;
+   }
+}
+
+   return NT_STATUS_OK;
+}
+
+
+/
  Remove a particular pending lock.
 /
 

Modified: trunk/source/locking/locking.c
===
--- trunk/source/locking/locking.c  2006-03-25 01:50:00 UTC (rev 14704)
+++ trunk/source/locking/locking.c  2006-03-25 02:35:40 UTC (rev 14705)
@@ -137,6 +137,45 @@
 }
 
 /
+ Find out if a lock could be granted - return who is blocking us if we can't.
+/
+
+NTSTATUS query_lock(files_struct *fsp,
+   uint16 *psmbpid,
+   SMB_BIG_UINT *pcount,
+   SMB_BIG_UINT *poffset,
+   enum brl_type *plock_type,
+   enum brl_flavour lock_flav)
+{
+   struct byte_range_lock *br_lck = NULL;
+   NTSTATUS status = NT_STATUS_LOCK_NOT_GRANTED;
+
+   if (!OPEN_FSP(fsp) || !fsp-can_lock) {
+   return NT_STATUS_INVALID_HANDLE;
+   }
+
+   if 

svn commit: samba r14706 - in trunk/source/locking: .

2006-03-24 Thread jra
Author: jra
Date: 2006-03-25 02:43:42 + (Sat, 25 Mar 2006)
New Revision: 14706

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

Log:
Remember to treat Windows and POSIX locks differently
on query.
Jeremy.

Modified:
   trunk/source/locking/brlock.c


Changeset:
Modified: trunk/source/locking/brlock.c
===
--- trunk/source/locking/brlock.c   2006-03-25 02:35:40 UTC (rev 14705)
+++ trunk/source/locking/brlock.c   2006-03-25 02:43:42 UTC (rev 14706)
@@ -1119,14 +1119,20 @@
 
/* Make sure existing locks don't conflict */
for (i=0; i  br_lck-num_locks; i++) {
-   /*
-* Our own locks don't conflict.
-*/
-   if (brl_conflict_other(locks[i], lock)) {
-   *psmbpid = locks[i].context.smbpid;
-   *pstart = locks[i].start;
-   *psize = locks[i].size;
-   *plock_type = locks[i].lock_type = *plock_type;
+   struct lock_struct *exlock = locks[i];
+   BOOL conflict = False;
+
+   if (exlock-lock_flav == WINDOWS_LOCK) {
+   conflict = brl_conflict(exlock, lock);
+   } else {
+   conflict = brl_conflict_posix(exlock, lock);
+   }
+
+   if (conflict) {
+   *psmbpid = exlock-context.smbpid;
+   *pstart = exlock-start;
+   *psize = exlock-size;
+   *plock_type = exlock-lock_type;
return NT_STATUS_LOCK_NOT_GRANTED;
}
}



svn commit: samba r14707 - in branches/SAMBA_4_0/source/heimdal/lib/gssapi: .

2006-03-24 Thread abartlet
Author: abartlet
Date: 2006-03-25 05:49:58 + (Sat, 25 Mar 2006)
New Revision: 14707

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

Log:
Initialise default value (the rest of this function sets it to 1 if
this is CFX).

Caught by Valgrind.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/heimdal/lib/gssapi/accept_sec_context.c


Changeset:
Modified: branches/SAMBA_4_0/source/heimdal/lib/gssapi/accept_sec_context.c
===
--- branches/SAMBA_4_0/source/heimdal/lib/gssapi/accept_sec_context.c   
2006-03-25 02:43:42 UTC (rev 14706)
+++ branches/SAMBA_4_0/source/heimdal/lib/gssapi/accept_sec_context.c   
2006-03-25 05:49:58 UTC (rev 14707)
@@ -77,6 +77,7 @@
 {
 krb5_keyblock *key;
 int acceptor = (context_handle-more_flags  LOCAL) == 0;
+*is_cfx = 0;
 
 if (acceptor) {
if (context_handle-auth_context-local_subkey)



svn commit: samba r14708 - in branches/SAMBA_4_0/source/librpc/idl: .

2006-03-24 Thread abartlet
Author: abartlet
Date: 2006-03-25 05:53:04 + (Sat, 25 Mar 2006)
New Revision: 14708

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

Log:
Add a (bogus) UUID and a comment to the PAC defintion.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/librpc/idl/krb5pac.idl


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/krb5pac.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/krb5pac.idl2006-03-25 05:49:58 UTC 
(rev 14707)
+++ branches/SAMBA_4_0/source/librpc/idl/krb5pac.idl2006-03-25 05:53:04 UTC 
(rev 14708)
@@ -5,8 +5,10 @@
 #include idl_types.h
 
 [
+  uuid(5-6-7-8),
   version(0.0),
   pointer_default(unique),
+  helpstring(Active Directory KRB5 PAC),
   depends(security,netlogon,samr),
   helper(librpc/ndr/ndr_krb5pac.h)
 ]