1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

4011 Commits

Author SHA1 Message Date
Volker Lendecke
30d31a3f85 Make fname arg to create_file a "const char *"
(This used to be commit da94b5f9e3)
2007-12-07 14:05:05 +01:00
Volker Lendecke
b2ca9253e9 There's no point in passing down a 0
(This used to be commit 525a6887af)
2007-12-05 15:47:32 +01:00
Volker Lendecke
188daba1a7 Move create_file to open.c
I'm checking in this long sequence of micro-checkins for review, the overall
patch from 3b057022a5 to this is not too large.
(This used to be commit 51db8d09a4)
2007-12-05 13:45:12 +01:00
Volker Lendecke
756ce14d49 Fix an uninitialized variable
(This used to be commit ca3add2d65)
2007-12-05 13:45:12 +01:00
Volker Lendecke
14d1bd2506 Fix debug
(This used to be commit c268be54ee)
2007-12-05 13:45:12 +01:00
Volker Lendecke
bef09af757 Fix attribute calculation for ntcreate&x
(This used to be commit 9ef81cb149)
2007-12-05 13:45:12 +01:00
Volker Lendecke
aa6f0a0151 Fix error returns
(This used to be commit f5cdaacd17)
2007-12-05 13:45:12 +01:00
Volker Lendecke
72ca4a68de Fix debugs
(This used to be commit 77b31ef44a)
2007-12-05 13:45:12 +01:00
Volker Lendecke
3f1ed0fc19 Implement create_file()
Rip out the cores of reply_ntcreate_and_X and call_nt_transact_create

Volker
(This used to be commit 8cd27e4a7a)
2007-12-05 13:45:12 +01:00
Volker Lendecke
727746b8fb Reformatting, also allow quotas for transact_create
(This used to be commit 956aae7a57)
2007-12-05 13:45:12 +01:00
Volker Lendecke
db1a23586a Tiny refactorings
(This used to be commit f3421c3b86)
2007-12-05 13:45:12 +01:00
Volker Lendecke
ffeb5aaaa4 Split out sd parsing
(This used to be commit 5a9d147e41)
2007-12-05 13:45:12 +01:00
Volker Lendecke
825dddff8f Reformatting
(This used to be commit 7199416053)
2007-12-05 13:45:12 +01:00
Volker Lendecke
222cd323ca Align formatting, one TALLOC_FREE is enough
(This used to be commit 5bf4647dea)
2007-12-05 13:45:12 +01:00
Volker Lendecke
177bf9a877 Move pulling the ea list out of the way
(This used to be commit 753e640f49)
2007-12-05 13:45:11 +01:00
Volker Lendecke
adb8d1b179 Reformatting
(This used to be commit fb900184fe)
2007-12-05 13:45:11 +01:00
Volker Lendecke
629278abdf Put posix semantic calculation in the same place in both routines
(This used to be commit f6d62226a3)
2007-12-05 13:45:11 +01:00
Volker Lendecke
96a1fb4b5d Tiny refactoring
Reformatting, consolidate oplock calculation to the same place in both routines
(This used to be commit a855808f48)
2007-12-05 13:45:11 +01:00
Volker Lendecke
acaea7ece8 Tiny refactoring
(This used to be commit 481e35eba8)
2007-12-05 13:45:11 +01:00
Volker Lendecke
cb7706cf2c TALLOC_FREE early
(This used to be commit 4b1f0d1d93)
2007-12-05 13:45:11 +01:00
Volker Lendecke
692725d974 consolidate srvstr_get_path in ntcreate_and_X
(This used to be commit 4a2d502903)
2007-12-05 13:45:11 +01:00
Volker Lendecke
c6cb3ed323 Tiny refactoring
(This used to be commit b79b16d637)
2007-12-05 13:45:11 +01:00
Volker Lendecke
80287d65d0 tiny refactoring
(This used to be commit 7f15a9f5a2)
2007-12-05 13:45:11 +01:00
Jeremy Allison
0e9a1c24a0 Fix crash bug with vl's new trans handling in old transs
calls. Make this look like the (working) transs2 handling
(replace inbuf, not write to outbuf - outbuf isn't allocated
yet so you get a null deref).
Jeremy.
(This used to be commit f04e37a630)
2007-12-04 12:53:21 -08:00
Jeremy Allison
b9342eaaa6 Remove unused wpstring and macros. Stop using pstrcpy in smbd/*.c
Jeremy.
(This used to be commit e72bce5b62)
2007-12-03 15:19:22 -08:00
Volker Lendecke
a2366187ad Bump up debug level
Fix bug 5115
(This used to be commit d3c839c22e)
2007-12-02 12:54:11 +01:00
Volker Lendecke
5066f7c878 In nttransact_create, we also need to check for delete readonly
(This used to be commit f4cc9cab51)
2007-12-01 10:43:54 -08:00
Jeremy Allison
f692694b99 Remove PSTRING_LEN from smbd/ nmbd/.
Remove pstring from libsmb/clidfs.c except for a nasty
hack (that will be removed when pstrings are gone from
client/).
Jeremy.
(This used to be commit cc257b71d1)
2007-11-29 17:25:41 -08:00
Jeremy Allison
d2cf97aeba Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
(This used to be commit ba9e2be2b5)
2007-11-29 13:24:54 -08:00
Volker Lendecke
d4bfafa29c Fix bug 5055
(This used to be commit 8bcd2df841)
2007-11-26 15:28:13 +01:00
Stefan Metzmacher
c20077e825 smbd: close_stat() should be static
metze
(This used to be commit e186b60afa)
2007-11-23 11:47:28 +01:00
Jeremy Allison
61b37c73ee Paranoia check that space_remaining never goes -ve.
Jeremy.
(This used to be commit 76f9c0b2dc)
2007-11-20 15:31:18 -08:00
Jeremy Allison
cae4c742a8 Always check return from push_ascii.
Jeremy.
(This used to be commit 9c3d10521e)
2007-11-19 17:43:28 -08:00
Jeremy Allison
b059e2cbf1 Ensure we use PATH_MAX for symlinks.
Jeremy.
(This used to be commit a90ef69350)
2007-11-16 17:06:57 -08:00
Jeremy Allison
6ff701e695 Match the 3.0.27a version of this function.
Jeremy.
(This used to be commit 629406cbe7)
2007-11-16 13:14:24 -08:00
Jeremy Allison
acb829ecc3 Add MAX_DNS_NAME_LENGTH, remove more pstrings.
Jeremy.
(This used to be commit a1725f4ff7)
2007-11-15 18:27:26 -08:00
Michael Adam
3f437f681a Fix an implicit cast warning.
Michael
(This used to be commit 4ab3b23a63)
2007-11-16 00:45:59 +01:00
Jeremy Allison
68be9a8200 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Michael Adam
8ab992524a Fix potential orphaned open files.
Calling can_access_file could lead to orphaned open files
when SMB_VFS_GET_NT_ACL returned ENOSYS (not implemented).

Michael
(This used to be commit f4f700cf0c)
2007-11-13 23:26:38 +01:00
Jeremy Allison
052efa9a33 Remove last pstring from smbd/*.c
Jeremy.
(This used to be commit f1680bada9)
2007-11-13 12:51:31 -08:00
Volker Lendecke
15953b82eb Make [f]get_nt_acl return NTSTATUS
(This used to be commit dcbe1bf942)
2007-11-13 15:47:01 +01:00
Jeremy Allison
9441d1ba87 More pstring removal from smbd/*.c
Jeremy.
(This used to be commit 01663c2312)
2007-11-12 18:12:26 -08:00
Jeremy Allison
d5791deefa Remove pstrings from lanman.c
Jeremy.
(This used to be commit 7bfd25c756)
2007-11-12 17:59:18 -08:00
Jeremy Allison
79266500cd Remove all pstrings from smbd/chgpasswd.c.
Jeremy.
(This used to be commit eaf14c701b)
2007-11-12 15:02:50 -08:00
Jeremy Allison
86558e0376 Fix bug #5073. Allow "delete readonly = yes" to correctly
override deletion of a file. Fix from David Shaw <dshaw@jabberwocky.com>
Jeremy.
(This used to be commit 5d1d650d19)
2007-11-12 11:39:35 -08:00
Jeremy Allison
d068bc64b6 Three more pstring removals.
Jeremy.
(This used to be commit c15819b757)
2007-11-11 21:46:52 -08:00
Volker Lendecke
7e9d639ed1 Cosmetic fix
Do directory vs file open before entering open_file_stat
(This used to be commit cd62122916)
2007-11-11 23:45:02 +01:00
Jeremy Allison
2b3c44e4fb Always define PATH_MAX. Makes code simpler (removes
a bunch of #defines). Remove pstring from msdfs.c.
Jeremy.
(This used to be commit e203ba2227)
2007-11-10 22:31:34 -08:00
Jeremy Allison
41ae2a0a17 Remove last pstring from sesssetup.c
Jeremy.
(This used to be commit 9ed12bfc48)
2007-11-10 15:36:47 -08:00
Jeremy Allison
54d65bfb9a Fix the build when realpath doesn't take null
as a last arg.
Jeremy.
(This used to be commit 6312522538)
2007-11-10 15:02:08 -08:00
Jeremy Allison
acc0218f13 Remove pstring from service.c.
Jeremy.
(This used to be commit cdd9e5cc83)
2007-11-10 14:43:39 -08:00
Jeremy Allison
6c25260ec1 Remove more static fstring/pstrings. Fix socket option
set on wrong fd (-1).
Jeremy.
(This used to be commit 52fe04df8e)
2007-11-09 15:09:16 -08:00
Stefan Metzmacher
f9578af966 ndr: change NTSTAUS into enum ndr_err_code (samba3 callers)
lib/messages_local.c
rpc_client/ndr.c
smbd/notify_internal.c
utils/net_rpc_registry.c

metze
(This used to be commit c2645d2164)
2007-11-09 21:23:16 +01:00
Stefan Metzmacher
1c87d79199 prepare changes in ndr code
metze
(This used to be commit 9ba00e7c16)
2007-11-09 21:23:14 +01:00
Volker Lendecke
637f9d9bf0 Fix some warnings
(This used to be commit 0a1f524e8c)
2007-11-09 15:16:26 +01:00
Volker Lendecke
e63bcdd720 Remove the silly "user_socket_options" global variable
This is better done with a 'lp_do_parameter(-1, "socket options", ..);
(This used to be commit 814bed029e)
2007-11-09 15:11:54 +01:00
Jeremy Allison
ae74aa9993 Constrain "min receivefile size" to max of BUFFER_SIZE
(128k). Add debug error messages so we can see why
writeX large is denied. Ensure we don't allow recvfile
writes on IPC$.
Jeremy.
(This used to be commit 6bf053a6a1)
2007-11-07 21:47:00 -08:00
Michael Adam
30a48a5c6c Try to fix the build on irix.
There were two callers of set_smb_read_error() in irix_oplocks.c
not converted to the new prototype.

Michael
(This used to be commit e398a8d7b6)
2007-11-07 22:28:26 +01:00
Michael Adam
7d899b5e7b Move some access check functions that are not posix-acl specific
to a new source file of their own.

Michael
(This used to be commit 9dd18bb534)
2007-11-06 19:32:10 +01:00
Michael Adam
754159ed9b Don't repeat fast-pathing...
Michael
(This used to be commit c61b4222d3)
2007-11-06 19:30:36 +01:00
Michael Adam
dbfee4efbf This is a proposed patch for Bug #5023.
The three can_* access check functions in smbd/posix_acls.c that are used in
smbd/open.c and smbd/nttrans.c explicitly called check_posix_acl_group_access()

This lead to errors with nfsv4 acls (ZFS and GPFS).

This changes the can_* functions to get the nt_acl via VFS layer and call
se_access_check on that. It also removes check_posix_acl_group_access()
which has no more callers.

NOTE: The can_* functions should really not be in smbd/posix_acls.c but
in a separate file (I propose smbd/access.c).

Michael
(This used to be commit 6f961a23de)
2007-11-06 19:26:53 +01:00
Michael Adam
1fd78e226b Add a const.
Michael
(This used to be commit 7b582af210)
2007-11-06 18:16:23 +01:00
Michael Adam
3fd2d4ed85 Add two const's.
Michael
(This used to be commit bf23c4ddff)
2007-11-05 23:23:35 +01:00
Jeremy Allison
36441da424 Remove the horror that was the global smb_rw_error.
Each cli struct has it's own local copy of this variable,
so use that in client code. In the smbd server, add one
static to smbd/proccess.c and use that inside smbd. Fix
a bunch of places where smb_rw_error could be set by
calling read_data() in places where we weren't reading
from the SMB client socket (ie. winbindd).
Jeremy.
(This used to be commit 255c2adf7b)
2007-11-05 11:12:56 -08:00
Volker Lendecke
082da3d287 Fix a debug message
(This used to be commit a86849e4f9)
2007-11-05 03:40:18 +01:00
Volker Lendecke
ec1ecd92c9 Make load_registry_service return the share number
(This used to be commit 934964c90f)
2007-11-05 02:45:14 +01:00
Jeremy Allison
58fbb512cc Forgot arg type.
Jeremy.
(This used to be commit 46f3b04dde)
2007-11-04 17:15:35 -08:00
Jeremy Allison
4721050df5 Don't believe len returned from read_smb_length_return_keepalive(),
it may be a UNIX large writeX (which wraps len in that case).
Stevef this should fix your 128k write bug.
Jeremy.
(This used to be commit de2ebffa3c)
2007-11-04 15:38:43 -08:00
Jeremy Allison
5b0b4f23ef Remove most of the remaining globals out of lib/util_sock.c.
I have a plan for dealing with the remaining..... Watch
this space.
Jeremy.
(This used to be commit 963fc76852)
2007-11-03 23:20:10 -07:00
Jeremy Allison
25074433f4 I can't get away without a 'length' arg. :-).
Jeremy.
(This used to be commit 95d01279a5)
2007-11-03 18:41:26 -07:00
Jeremy Allison
6658165d5e Stop get_peer_addr() and client_addr() from using global
statics. Part of my library cleanups.
Jeremy.
(This used to be commit e848506c85)
2007-11-03 18:15:45 -07:00
Jeremy Allison
73d4079680 Remove the smb_read_error global variable and replace
it with accessor functions. "One global or pstring a day...." :-).
Jeremy.
(This used to be commit d50d14c300)
2007-11-03 15:12:42 -07:00
Jeremy Allison
329365684b Change the client library to write directly out of
the incoming buffer in the non-signed case. Speeds
up writes by over 10% or so. Complete the server
recvfile implementation.
Jeremy.
(This used to be commit 81ca5853b2)
2007-11-02 12:21:34 -07:00
Jeremy Allison
414ab2ce46 Argggh. smblen doesn't include the +4, so my smb_doff calculations
shouldn't either :-).
Jeremy.
(This used to be commit c3de44b6b0)
2007-11-02 10:35:10 -07:00
Jeremy Allison
10500184bf Ensure we can't accidently do a pipe write with
unread bytes in the socket buffer.
Jeremy
(This used to be commit 84d22f7747)
2007-11-01 22:42:21 -07:00
Jeremy Allison
bece9609cd Be careful and take care of the correct lengths in large
writeX calls.
Jeremy.
(This used to be commit 2d3ff9c502)
2007-11-01 22:24:39 -07:00
Jeremy Allison
c94b2898cd Ensure we detect a large writeX when using recvfile.
More changes needed to make the UNIX_LARGE_WRITEX_CAP
writes work (I'll add these tomorrow).
Jeremy.
(This used to be commit 1c71546b61)
2007-11-01 21:51:45 -07:00
Jeremy Allison
8bad80efb0 Add brackets so as not to break the POSIX caps return.
Jeremy.
(This used to be commit 47dbddcb53)
2007-11-01 18:30:02 -07:00
Jeremy Allison
0bb1a6ec2d Note when we're setting change time, not write time, and send
message accordingly. Apart from not supporting create time we
now pass the S4 RAW-NOTIFY torture.
Jeremy.
(This used to be commit 8a77f520fa)
2007-10-31 16:32:48 -07:00
Jeremy Allison
8f1f2f04c7 Fix some cases where file_set_dosmode was being passed
False instead of NULL. Fix more of the notifications to
be correct for Samba4 RAW-NOTIFY torture (we had missed
one when calling set_ea_dos_attribute().
Jeremy.
(This used to be commit 39d265375c)
2007-10-31 15:45:45 -07:00
Jeremy Allison
695c4a7a74 Fix vfstest link - move socket calls into smbd/process.c
not smbd/server.c
Jeremy
(This used to be commit 8fbefe18a2)
2007-10-31 14:24:52 -07:00
Jeremy Allison
133fad90b5 Make explicit draining the socket on RECVFILE. Add
capability for large UNIX write if not signing and
recvfile set. Cope with large UNIX write length on
incoming processing. Stevef - we can now test 1-16Mb
writes from CIFFS.
Jeremy.
(This used to be commit 8cf78776b0)
2007-10-31 14:01:35 -07:00
Jeremy Allison
ff82c0a037 Handle the disk full error case correctly.
Jeremy.
(This used to be commit b7088bb9c2)
2007-10-30 18:18:40 -07:00
Jeremy Allison
360c02328f Ensure we don't prematurely clean out the bytes read.
Jeremy.
(This used to be commit 247675695d)
2007-10-30 17:42:02 -07:00
Jeremy Allison
c3250149e1 Add new parameter, "min receivefile size" (by default set
to zero). If non-zero, writeX calls greater than this
value will be left in the socket buffer for later handling
with recvfile (or userspace equivalent). Definition of
recvfile for your system is left as an exercise for
the reader (I'm working on getting splice working :-).
Jeremy.
(This used to be commit 11c03b75dd)
2007-10-30 16:22:24 -07:00
Stefan Metzmacher
851ef9e22f start smbd, nmbd and winbindd with the same startup message
at debug level 0.

metze
(This used to be commit 95f76ae7a5)
2007-10-30 15:44:27 +01:00
Volker Lendecke
6ca0d8124c Enable vfs objects = /full/path/to/object.so
Right now I'm testing a vfs object. I can't right now in make test, because
"vfs objects" assumes the .so files to be in $libdir/vfs. This patch parses the
module name out of the object name in case it starts with "/". The module name
is assumed to be the last path component's basename.
(This used to be commit 95cc019af7)
2007-10-28 12:30:44 -04:00
Volker Lendecke
a97b33baad Two patches
Hi!

Can you check and push them?

Thanks,

Volker

From b488af5905e2dee12a1a72a3b40801ae5c26f24f Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@sernet.de>
Date: Sat, 27 Oct 2007 14:20:09 +0200
Subject: [PATCH] Fix some warnings and errors
(This used to be commit e17d3e10e8)
2007-10-27 12:50:36 -07:00
Jeremy Allison
38c34ffd6b Ensure we don't terminate if we fail to bind to a socket,
only fail if we can't bind to any socket.
Jeremy.
(This used to be commit 2ec6224b55)
2007-10-25 14:11:35 -07:00
Jeremy Allison
fac788d6e2 Don't terminate on an invalid address family.
Jeremy.
(This used to be commit d04a8a6cdc)
2007-10-24 16:11:01 -07:00
Jeremy Allison
f88b7a076b This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
(This used to be commit 98e154c312)
2007-10-24 14:16:54 -07:00
Gerald (Jerry) Carter
80b7bcb5fb Add test for "struct in6_addr" to the HAVE_IPV6 configure test.
Also make use of "if defined(HAVE_IPV6)" rather than testing for
AF_INET6 since this is not sufficient on HP-UX 11.11 to ensure
a working IPv6 implementation.
(This used to be commit 620785df4e)
2007-10-19 13:09:26 -07:00
Jeremy Allison
9a85533914 Fix the popt / bool issues. Some places we used BOOL
where we meant int. Fix this. Thanks to metze for
pointing this out.
Jeremy.
(This used to be commit 793a9d24a1)
2007-10-19 11:38:36 -07:00
Stefan Metzmacher
7f82fbad50 fix startup of smbd, nmbd, winbindd
jra: POPT_ARG_VAL arguments need int values.
     I assume there're more places like this
     in the cmdline tools.

     Please fix this properly, as my commit is just
     a hack to get make test working again.

in samba4 we have a workaround for this see
smbd/server.c

metze
(This used to be commit 9cb1937fe8)
2007-10-19 10:34:06 +02:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Jeremy Allison
cb5436bcc3 Add const to the get_peer_addr() and get_socket_addr()
calls. Use the IPv6 varient for get_peer_addr().
Jeremy.
(This used to be commit baf1f52e34)
2007-10-11 15:36:13 -07:00
Jeremy Allison
8e54530b52 Add start of IPv6 implementation. Currently most of this is avoiding
IPv6 in winbindd, but moves most of the socket functions that were
wrongly in lib/util.c into lib/util_sock.c and provides generic
IPv4/6 independent versions of most things. Still lots of work
to do, but now I can see how I'll fix the access check code.
Nasty part that remains is the name resolution code which is
used to returning arrays of in_addr structs.
Jeremy.
(This used to be commit 3f6bd0e1ec)
2007-10-10 18:25:16 -07:00
Jeremy Allison
39d30c5499 Fix valgrind-found memory overwrite.
(This used to be commit 183df4754b)
2007-10-10 17:24:44 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Volker Lendecke
0ebab65706 r25534: Apply some const
Why? It moves these structs from the data into the text segment, so they
will never been copy-on-write copied. Not much, but as in German you say
"Kleinvieh macht auch Mist...."
(This used to be commit 0141e64ad4)
2007-10-10 12:31:12 -05:00
Volker Lendecke
4b21570812 r25502: Fix bug 5006
Thanks to Joerg.Bernau at web.de
(This used to be commit 492977016f)
2007-10-10 12:31:10 -05:00
Jelmer Vernooij
bb9f1e5146 r25498: Remove checks that are always true.
(This used to be commit 2f2bdfa0df)
2007-10-10 12:31:10 -05:00
Jeremy Allison
0d87820380 r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal with
the ripple effects this causes. utmp has to change etc. Remove some
global varables and store address/port in the unexpected db.
Jeremy.
(This used to be commit 18c6a2211d)
2007-10-10 12:31:09 -05:00
Jeremy Allison
152a1f4a7d r25391: Fix bug #4978 : Store DOS Attributes fails when copying folders.
Jeremy.
(This used to be commit 713277391a)
2007-10-10 12:31:01 -05:00
Volker Lendecke
aea0d4b9a0 r25327: Normalize the path we return for 'msdfs proxy'
We now accept both \\server\tmp and \server\tmp. There are other places
where this might be necessary, but at least the functionality is a bit
easier now.
(This used to be commit 25cc27df97)
2007-10-10 12:31:00 -05:00
Volker Lendecke
e0402fa870 r25324: Fix "msdfs proxy"
Jeremy, please check!
(This used to be commit d4eddf88d2)
2007-10-10 12:30:59 -05:00
Volker Lendecke
fb7ee0804c r25311: Patch from Heinrich Mislik <Heinrich.Mislik@univie.ac.at> to fix AIX
quotas.

Heinrich, I trust you on that, I don't even have compiled this :-)

Volker
(This used to be commit a8312a1d7b)
2007-10-10 12:30:58 -05:00
Jeremy Allison
e6228e2541 r25309: Volker's fix for bug #4984 - samba4 torture test
to follow. Ensure we don't prepend "./" as a root
directory - this is an invalid pathname for unix_convert().
Jeremy.
(This used to be commit f70ac2e258)
2007-10-10 12:30:58 -05:00
Michael Adam
30fc640057 r25286: Fix one more caller of unistr2_to_ascii() that passed
in -1 for maxlen.

Michael
(This used to be commit cd3d652d0d)
2007-10-10 12:30:57 -05:00
Volker Lendecke
ad97bcf813 r25184: Fix some C++ warnings and an uninitialized variable
(This used to be commit b64df8a3c5)
2007-10-10 12:30:49 -05:00
Jeremy Allison
bb4773e30f r25173: Use the append_buffer version in a loop.
Jeremy.
(This used to be commit 37cf2c2727)
2007-10-10 12:30:48 -05:00
Jeremy Allison
b91b785306 r25167: Fix breakage from mangling rewrite. Use the
new name if unmangling succeeded, not if it
failed. Jerry - please re-test, this should
fix your bug.
Jeremy.
(This used to be commit c215d6e849)
2007-10-10 12:30:47 -05:00
Jeremy Allison
539635cd94 r25163: Fix wrong ctx passed to talloc_asprintf_append().
Found by Metze's code review (thanks Metze !).
Jeremy.
(This used to be commit a7370eea6b)
2007-10-10 12:30:47 -05:00
James Peach
8b6366b301 r25161: Don't panic if setgroups fails in non-root mode.
(This used to be commit ea226c5ed9)
2007-10-10 12:30:46 -05:00
James Peach
45a2713b47 r25142: Panic if setting the group list fails while switching security
contexts. Patch from Tim Prouty <tim.prouty@isilon.com>.
(This used to be commit a136de663f)
2007-10-10 12:30:45 -05:00
Jeremy Allison
dd16ae2506 r25141: More pstring removal.
Jeremy.
(This used to be commit cfcf7cf03e)
2007-10-10 12:30:45 -05:00
Jeremy Allison
eacd314057 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
(This used to be commit 39c211a702)
2007-10-10 12:30:44 -05:00
Günther Deschner
1a292def31 r25135: Remove one END_PROFILE(SMBntcreateX) from call_nt_transact_create() which
appears to be a leftover. Should fix the build with profiling enabled.

Jeremy, please check.

Guenther
(This used to be commit 98f2e10e3f)
2007-10-10 12:30:43 -05:00
Jeremy Allison
d5c9d87946 r25118: More pstring elimination.
Jeremy.
(This used to be commit 7632f8fb40)
2007-10-10 12:30:41 -05:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Jeremy Allison
3a9d382164 r25111: Move to talloced pathnames on most code paths.
There are now ony 17 pstrings left in reply.c,
and these will be easy to remove (and I'll be
doing that shortly). Had to fix an interesting
bug in pull_ucs2_base_talloc() when a source
string is not null terminated :-).
Jeremy.
(This used to be commit 0c9a8c4dff)
2007-10-10 12:30:41 -05:00
Jeremy Allison
327ca9167e r25103: Ensure we don't return unwritten memory (valgrind caught).
Jeremy.
(This used to be commit b3f0d39d11)
2007-10-10 12:30:40 -05:00
Jeremy Allison
351eb37a25 r25102: Rewrite msdfs code to use talloced filenames. Passes make test
and make valgrindtest. Final step will be to change srvstr_get_path()
to return talloced memory in the major codepaths.
Jeremy.
(This used to be commit cf6b6f9c3a)
2007-10-10 12:30:40 -05:00
Volker Lendecke
4ee8b2937d r25055: Add file_id_string_tos
This removes file_id_string_static and file_id_string_static2
(This used to be commit 638c848c9a)
2007-10-10 12:30:36 -05:00
Jeremy Allison
62e3caf0fe r25011: We don't use mangle_map any more.
Jeremy.
(This used to be commit 2e0999c1df)
2007-10-10 12:30:33 -05:00
Jeremy Allison
132ee3990a r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based
interface. More development will come on top of this. Remove the
"mangled map" parameter.
Jeremy.
(This used to be commit dee8beba7a)
2007-10-10 12:30:32 -05:00
Volker Lendecke
ff0947fbed r24949: Remove some static buffers
(This used to be commit df648d47ff)
2007-10-10 12:30:29 -05:00
Jeremy Allison
dacdde6e5c r24813: Reformat to 80 columns.
Jeremy.
(This used to be commit c6c8f5a897)
2007-10-10 12:30:25 -05:00
Jeremy Allison
3b0422ee01 r24811: Simple reformatting to fit the 80 columns rule.
Jeremy.
(This used to be commit 0cdf046dae)
2007-10-10 12:30:24 -05:00
Volker Lendecke
929e1d9920 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05:00
Jeremy Allison
d76e724b10 r24791: Fix logic error in timeout of blocking lock processing found by
Ronnie. If a lock timeout expires, we must check we can get the
lock before responding with failure. Volker is writing a torture test.
Jeremy.
(This used to be commit 45380f356b)
2007-10-10 12:30:22 -05:00
Volker Lendecke
b578db69e9 r24702: Remove the old API pointers
(This used to be commit 17df313db4)
2007-10-10 12:30:14 -05:00
Volker Lendecke
3aed02989f r24699: Actually write 24 zeros instead of zero 24's...
Jeremy, please check ;-)
(This used to be commit 85b64bde7d)
2007-10-10 12:30:14 -05:00
Volker Lendecke
7bd8ad3c92 r24661: Fix some obvious diffs between 3_2 and 3_2_0
Jeremy, there are two remaining diffs in sesssetup.c which I don't really
know which one is right. Can you take a look?

Thanks,

Volker
(This used to be commit d82f354487)
2007-10-10 12:30:13 -05:00
Volker Lendecke
5993ddf240 r24659: Some formatting changes helping to minimize the 3_2_0 diff
(This used to be commit c5caea43af)
2007-10-10 12:30:13 -05:00
Jeremy Allison
f1041f98ce r24639: Add parameter "directory name cache size" - parameterize
use of directory name cache, 100 by default. Will be needed
to turn this off for *BSD systems.
Jeremy.
(This used to be commit bea8e9840f)
2007-10-10 12:30:13 -05:00
Jeremy Allison
a689f6082b r24638: Remove redundent setting of vuid.
Jeremy
(This used to be commit fd682c3f39)
2007-10-10 12:30:12 -05:00
Stefan Metzmacher
8dd00920ef r24621: - deferr calling build_options();exit(0);
- use poptPrintUsage() to give the user more info

metze
(This used to be commit a95d9d1ef9)
2007-10-10 12:30:11 -05:00
Simo Sorce
281931ea77 r24603: In case of error we need to free prefix_cache otherwise on re-init the first
statement will return positively but prefix_cache_hashes would be NULL
(This used to be commit fdc20894a0)
2007-10-10 12:30:10 -05:00
Stefan Metzmacher
2e498b48bb r24599: patch from Karolin Seeger <ks@sernet.de>:
smbd, nmbd and winbindd can be started with invalid options currently.
The first patch attached would be a possible solution.
It contains an exit if an invalid option has been used. The main problem
is, that existing setups with wrong options or missing arguments in start
scripts will break (which is the right behaviour from my point of view).

metze
(This used to be commit 8532e3182a)
2007-10-10 12:30:09 -05:00
Volker Lendecke
a9184f49d3 r24595: Fix Coverity ID 393
In this error case we would have used "start" not having it initialized
(This used to be commit 751834fff9)
2007-10-10 12:30:08 -05:00
Jeremy Allison
644b43d993 r24590: Reformatting to coding standards. Added my (C) in places it already should
have been :-).
Jeremy.
(This used to be commit 41611a22ed)
2007-10-10 12:30:08 -05:00
Jeremy Allison
57e2718e09 r24589: Refactor our vuid code so that we keep the same
vuid that was allocated whilst the connection is
being constructed and after the connection has been set up.
This is what Windows does and at least one client
(and HP printer) depends on this behaviour. As it
depends on the req struct not yet ported to SAMBA_3_2_0
(Volker, hint hint.... :-) I am not yet adding this
to that branch, but will investigate that tomorrow.
Jeremy.
(This used to be commit a54f2805df)
2007-10-10 12:30:08 -05:00
Volker Lendecke
f5ab9ddd76 r24549: Fix unix_convert to return the already converted part
This API will change anyway when moving away from pstrings.

It took so long to fix, because that rename bug I just fixed gave make
test failures that had nothing to do with this one.

I have samba4 tests for both bugs, will check them in when the build
farm has caught up
(This used to be commit d4f442ed9b)
2007-10-10 12:29:56 -05:00
Volker Lendecke
2efabbbf4b r24548: Fix the case-changing renames
This was broken when I changed reply_mv to wrap in a open_file_ntcreate
call, unix_convert on the destination was called twice
(This used to be commit fddc9db911)
2007-10-10 12:29:56 -05:00
Volker Lendecke
f65041cbf1 r24512: Fix RAW-NOTIFY
With the inbuf consistency checks we have to more correctly fake the
inbuf
(This used to be commit 2b8ecda30f)
2007-10-10 12:29:53 -05:00
Jeremy Allison
891fa216ea r24501: Added bcc test for reply_tcon & removed Vl's comment :-).
Jeremy.
(This used to be commit 9d9ed41f21)
2007-10-10 12:29:53 -05:00
Jeremy Allison
a662a62e5a r24500: Add check that bcc is correct in an incoming packet.
Jeremy.
(This used to be commit 267a0ac48d)
2007-10-10 12:29:52 -05:00
Jeremy Allison
077d5d2e36 r24498: More extra code into a function, reply_openerror.
Jeremy.
(This used to be commit 43ddfb8c91)
2007-10-10 12:29:52 -05:00
Volker Lendecke
bcc7bdcfe3 r24497: Revert r24485 -- this needs more thought
(This used to be commit 01f701ba1e)
2007-10-10 12:29:52 -05:00
Volker Lendecke
93fc3a0248 r24485: Even in the failure case unix_convert must pass the already converted
part of the string to the caller.
(This used to be commit 301ae3d68b)
2007-10-10 12:29:51 -05:00
Jeremy Allison
622abf53f9 r24476: Fix the mappings in reply_opeXXX calls. Now to test renames.
Jeremy.
(This used to be commit 74d10b09a6)
2007-10-10 12:29:51 -05:00
Jeremy Allison
522418ce16 r24475: Fix the error mapping for SMB_POSIX_PATH_OPEN.
Jeremy.
(This used to be commit 6dac315ba1)
2007-10-10 12:29:51 -05:00
Jeremy Allison
606f10945f r24474: Map error value NT_STATUS_OBJECT_NAME_COLLISION
to ERRDOS, ERRfilexists for NTCreateX and NTTransCreate.
Jeremy.
(This used to be commit 5b2316d173)
2007-10-10 12:29:51 -05:00
Jeremy Allison
fd9c413786 r24470: Start fixing up the mapping of OBJECT_NAME_COLLISION
to DOS error ERRDOS, ERRfilexists on open calls.
Jeremy.
(This used to be commit 4674486450)
2007-10-10 12:29:50 -05:00
Jeremy Allison
ed70bc0d8e r24468: Don't forget the +4 for length :-).
Jeremy.
(This used to be commit 4d01e0b744)
2007-10-10 12:29:50 -05:00
Jeremy Allison
a1f593cd73 r24467: Do range checking on incoming smb request.
Jeremy.
(This used to be commit dbd58dd647)
2007-10-10 12:29:50 -05:00
Jeremy Allison
3dd3c4cd01 r24464: Now Volker removed the readbmpx we don't need cached errors any more.
Jeremy.
(This used to be commit 9256ec0a20)
2007-10-10 12:29:50 -05:00
Volker Lendecke
6051d51654 r24461: Fix Bug 4852, thank to anto <sistemac@prosoft.ba> for reporting it.
(This used to be commit 0fecd8a0c3)
2007-10-10 12:29:49 -05:00
Volker Lendecke
716e01d97e r24457: Convert reply_tcon to the new API
Jeremy, I really apologize for doing this, but I just wanted to enjoy
converting the last SMB call :-)

I've left one little task for you there, I'm not certain that checking
the inbuf length is correct here.

Volker
(This used to be commit 1e08fddafd)
2007-10-10 12:29:49 -05:00
Volker Lendecke
24f42c5cef r24453: Remove the read and write bmpx calls
Talked to both Tridge and Jeremy about this, Tridge said that there is a
special error message persuading OS/2 to fall back to other methods.
The calls now checked in always return the error message we used to
return when "read bmpx = False" was set (the default): ERRSRV, ERRuseSTD.

If someone has a reproducable test case where this is really needed, we
can always dig it up from version control and convert it to the new API.
But that time without that silly parameter, and with a torture test case
for "make test" please :-)

Volker
(This used to be commit d941aae2df)
2007-10-10 12:29:49 -05:00
Jeremy Allison
2823bf10b5 r24445: Convert SMBwritebraw. No test suite unfortunately.... I need to write one for this.
Jeremy
(This used to be commit edc17dfcbd)
2007-10-10 12:29:48 -05:00
Volker Lendecke
527905a09a r24444: Convert reply_find[n]close to the new API
(This used to be commit 6af8595346)
2007-10-10 12:29:48 -05:00
Volker Lendecke
5edcc342c6 r24443: Convert reply_search/fclose to the new API
(This used to be commit a8a33c377e)
2007-10-10 12:29:48 -05:00
Volker Lendecke
f93b093d5f r24442: Convert reply_copy to the new API
(This used to be commit 0cb00c5475)
2007-10-10 12:29:48 -05:00
Volker Lendecke
9c2bfffece r24441: Convert reply_ioctl to the new API
(This used to be commit a5af7ebb7f)
2007-10-10 12:29:48 -05:00
Volker Lendecke
c5572072e5 r24440: Convert the reply_sendXX functions to the new API
(This used to be commit a64bc31098)
2007-10-10 12:29:48 -05:00
Volker Lendecke
90741da80b r24439: Convert reply_get/setattrE to the new API
(This used to be commit 6b0ad071d8)
2007-10-10 12:29:47 -05:00
Volker Lendecke
05fafc1df2 r24436: Convert reply_lockread/writeunlock to the new API
(This used to be commit 1b6add251c)
2007-10-10 12:29:47 -05:00
Volker Lendecke
2ea14d4e98 r24433: Convert reply_ntrename to the new API
(This used to be commit 42b07a52b9)
2007-10-10 12:29:46 -05:00
Volker Lendecke
591669ba06 r24431: Convert the reply_printXX calls to the new API
(This used to be commit e528479f56)
2007-10-10 12:29:46 -05:00
Volker Lendecke
4a989dac81 r24430: Convert reply_writeclose to the new API
(This used to be commit 6def2ee03b)
2007-10-10 12:29:46 -05:00
Volker Lendecke
3f172071d4 r24429: reply_setdir is not used...
(This used to be commit ca27a718b0)
2007-10-10 12:29:46 -05:00
Volker Lendecke
0f73d64f7d r24428: Convert reply_unlock to the new API
(This used to be commit 01c7426fc0)
2007-10-10 12:29:45 -05:00
Volker Lendecke
ca70ea9310 r24427: Convert reply_lock to the new API
(This used to be commit 212f43ddea)
2007-10-10 12:29:45 -05:00
Volker Lendecke
4c7212b4e4 r24426: Convert reply_read to the new API
(This used to be commit 30aada0ef8)
2007-10-10 12:29:45 -05:00
Volker Lendecke
7c25bf4511 r24425: Convert reply_write to the new API
(This used to be commit 244965f7b6)
2007-10-10 12:29:45 -05:00
Volker Lendecke
fe502551c3 r24423: Convert reply_lseek to the new API
(This used to be commit bd22885386)
2007-10-10 12:29:44 -05:00
Volker Lendecke
dee4ab1533 r24422: Convert reply_ctemp to the new API
(This used to be commit 3cc22fd74f)
2007-10-10 12:29:44 -05:00
Volker Lendecke
06ed827edf r24417: Convert reply_setatr to the new API
(This used to be commit 56bab5ea4c)
2007-10-10 12:29:43 -05:00
Volker Lendecke
73b3ae9c55 r24415: Convert reply_getatr to the new API
(This used to be commit 1a08b97a93)
2007-10-10 12:29:43 -05:00
Volker Lendecke
5fe4384cd9 r24414: Convert reply_mv to the new API
(This used to be commit fa341e4840)
2007-10-10 12:29:42 -05:00
Volker Lendecke
2da44a2dee r24412: Convert reply_open to the new API
(This used to be commit 394987f522)
2007-10-10 12:29:42 -05:00
Volker Lendecke
a12e7ef30a r24409: Check wct in reply_open
(This used to be commit ee6f212ed0)
2007-10-10 12:29:41 -05:00
Volker Lendecke
ec5b2a7181 r24408: Remove reply_prep_legacy from reply_lockingX
(This used to be commit e0db5fd11b)
2007-10-10 12:29:41 -05:00
Volker Lendecke
29df25351d r24406: Push reply_prep_legacy into reply_lockingX
(This used to be commit bce87ebdc0)
2007-10-10 12:29:41 -05:00
Volker Lendecke
439d6020e9 r24405: Check wct in reply_lockingX
(This used to be commit c4972632f8)
2007-10-10 12:29:41 -05:00
Volker Lendecke
ae89ba48ec r24404: Remove get_OutBuffer usage from blocking.c
(This used to be commit cb8fab5663)
2007-10-10 12:29:41 -05:00
Volker Lendecke
e0880fa7bd r24403: Remove reply_prep_legacy from send_nttrans_replies
(This used to be commit a6400ca6e2)
2007-10-10 12:29:40 -05:00
Volker Lendecke
df6edb0d3c r24402: Fix a 64-bit warning
(This used to be commit 73d99d6f9a)
2007-10-10 12:29:40 -05:00
Volker Lendecke
f7f176dd0d r24401: Push reply_prep_legacy into send_nt_replies
(This used to be commit 489436a656)
2007-10-10 12:29:40 -05:00
Volker Lendecke
52a738301a r24400: Fix a valgrind bug
(This used to be commit 7c65deaed7)
2007-10-10 12:29:40 -05:00
Volker Lendecke
6a5bdb79e1 r24399: Change change_notify_reply to use send_nt_replies_new
(This used to be commit be67bb50ee)
2007-10-10 12:29:40 -05:00
Volker Lendecke
b41b38031f r24398: Convert call_nt_transact_notify_change to the new API
(This used to be commit 607b3ab8bc)
2007-10-10 12:29:40 -05:00
Volker Lendecke
bba684f2c0 r24394: Convert call_nt_transact_rename to the new API
(This used to be commit 189876a664)
2007-10-10 12:29:39 -05:00
Volker Lendecke
4f111b6e78 r24393: Convert call_nt_transact_set_user_quota to the new API
(This used to be commit 4cb60abd4c)
2007-10-10 12:29:39 -05:00
Volker Lendecke
3038f27a59 r24392: Minor simplifications
(This used to be commit 96a9435874)
2007-10-10 12:29:39 -05:00
Volker Lendecke
4b485d807e r24391: Convert call_nt_transact_get_user_quota to the new API
(This used to be commit 0e47a6643e)
2007-10-10 12:29:39 -05:00
Jeremy Allison
d701a47c73 r24387: Convert readbraw to the new api. Volker, keep checking in
your patches please :-). I'll work on SMBreadBmpx tomorrow.
Jeremy.
(This used to be commit 27e183afa8)
2007-10-10 12:29:38 -05:00
Jeremy Allison
5cc0a6b43c r24386: Piss off Volker (not deliberately) by checking in a reply_mknew -> conversion.
Sorry vl, remove one of your 15 patches :-).
Jeremy.
(This used to be commit a7648ed9d4)
2007-10-10 12:29:38 -05:00
Volker Lendecke
6624bf7fd2 r24385: Convert call_nt_transact_query_security_desc to the new API
(This used to be commit f44e0aac2b)
2007-10-10 12:29:38 -05:00
Volker Lendecke
ff355558e3 r24384: Convert call_nt_transact_set_security_desc to the new API
(This used to be commit 925ed1e186)
2007-10-10 12:29:38 -05:00
Volker Lendecke
89dfa3883f r24383: Convert call_nt_transact_ioctl to the new API
(This used to be commit 8e6485e078)
2007-10-10 12:29:38 -05:00
Volker Lendecke
89f27bb35b r24382: Remove reply_prep_legacy from call_nt_transact_create
(This used to be commit 73392485f4)
2007-10-10 12:29:37 -05:00
Volker Lendecke
8590265e94 r24381: Push reply_prep_legacy into call_nt_transact_create
(This used to be commit ca18ba96be)
2007-10-10 12:29:37 -05:00
Volker Lendecke
20b3daec50 r24368: Push down reply_prep_legacy one level
Not pretty, but necessary to convert the calls one by one
(This used to be commit 523a463be4)
2007-10-10 12:29:37 -05:00
Volker Lendecke
1b034a8f9e r24367: Push reply_prep_legacy into handle_nttrans
(This used to be commit 8b5e51c266)
2007-10-10 12:29:37 -05:00
Volker Lendecke
2a375f12be r24362: Initialize padding also when no params are sent back
(This used to be commit 03c5e960a2)
2007-10-10 12:29:36 -05:00
Volker Lendecke
1d8e64aece r24361: Push reply_prep_legacy down in reply_nttrans[s]
(This used to be commit d97a2e91d3)
2007-10-10 12:29:36 -05:00
Volker Lendecke
6216cd58c2 r24359: Fix the build
(This used to be commit b2ac1a3ec5)
2007-10-10 12:29:36 -05:00
Volker Lendecke
6bee410431 r24358: Push reply_prep_legacy into reply_nttrans[s]
(This used to be commit 197c231079)
2007-10-10 12:29:36 -05:00
Volker Lendecke
ecb32af916 r24357: Check wct in reply_nttrans[s]
(This used to be commit 9ab87e644e)
2007-10-10 12:29:35 -05:00
Volker Lendecke
2d8e4456cd r24356: Add send_nt_replies_new wrapper
(This used to be commit 8a910d37cc)
2007-10-10 12:29:35 -05:00
Stefan Metzmacher
5af3e2d613 r24355: move reply_outbuf() to the place where it's used
metze
(This used to be commit c7ed550483)
2007-10-10 12:29:35 -05:00
Volker Lendecke
5d39acf2f8 r24351: Remove reply_prep_legacy from reply_read_and_X
(This used to be commit 8f3e3a2100)
2007-10-10 12:29:32 -05:00
Volker Lendecke
2fb27fcb69 r24349: For large read&x we need more than 64k of outbuf.
(This used to be commit f7e2eec35f)
2007-10-10 12:29:32 -05:00
Volker Lendecke
a0ad547ccb r24348: Do not use inbuf/outbuf in the sendfile path of read_and_X
(This used to be commit 595ea708ee)
2007-10-10 12:29:31 -05:00
Volker Lendecke
6dcf0c64cf r24347: fake_sendfile does not need Inbuf/Outbuf
In the future, we might put the new Linux splice(2) syscall here. This
should also work for reply_write, but getting that in is a bit trickier.
We need to decide very early before fetching the whole buffer that we
have a write call.
(This used to be commit 32921c878a)
2007-10-10 12:29:31 -05:00
Volker Lendecke
d198962d14 r24346: Push reply_prep_legacy into send_file_readX
(This used to be commit cded66a7dc)
2007-10-10 12:29:31 -05:00
Volker Lendecke
921fbb25eb r24332: schedule_aio_read_and_X does not need InBuf/OutBuf
(This used to be commit 9ad91bd205)
2007-10-10 12:29:30 -05:00
Volker Lendecke
d90f6fa1bd r24328: Restore chain_reply error handling
Get the whole smb header from the second chained function, in particular
the error fields
(This used to be commit 0eb831ca0e)
2007-10-10 12:29:30 -05:00
Volker Lendecke
26f6826dfc r24327: First round of fixes to chain_reply
The argument to smb_setlen does not contain the nbt header of 4 bytes

The chained function might allocate outbuf itself (as now happens with
reply_read_and_X). This would erroneously overwrite the caller's outbuf.
Give it an outbuf pointer of it's own
(This used to be commit f923bba908)
2007-10-10 12:29:29 -05:00
Volker Lendecke
bf47a89c98 r24326: Fix the build for Solaris CC
(This used to be commit 7af4c1f547)
2007-10-10 12:29:29 -05:00
Volker Lendecke
bb373dbd6c r24325: Push down reply_prep_legacy in reply_read_and_X
(This used to be commit 9d2354129d)
2007-10-10 12:29:29 -05:00
Volker Lendecke
8e146e4b7b r24324: No reply_prep_legacy() in reply_pipe_read_and_X
(This used to be commit 304843315c)
2007-10-10 12:29:29 -05:00
Volker Lendecke
8d6dcd94eb r24323: Remove the reply_read_and_X wrapper function
(This used to be commit 96b2187894)
2007-10-10 12:29:29 -05:00
Volker Lendecke
61ee2d3720 r24322: Wrap reply_read_and_X in reply_prep_legacy
(This used to be commit 7926b5dfb8)
2007-10-10 12:29:28 -05:00
Volker Lendecke
23998e1da8 r24320: Fix the wct checks in reply_trans2 and the reply_trans calls
No idea what I've been smoking here.

Thanks to Stefan for closely looking
(This used to be commit 708f5af2e8)
2007-10-10 12:29:28 -05:00
Volker Lendecke
d465b468c1 r24319: Check wct in reply_read_and_X
(This used to be commit 9ddacdfa13)
2007-10-10 12:29:28 -05:00
Volker Lendecke
c898c51984 r24318: Print a prominent warning when reply_prep_legacy is called
This is a temporary function anyway
(This used to be commit 9269e3d588)
2007-10-10 12:29:27 -05:00
Volker Lendecke
3c5811c272 r24314: Attempt to fix bug 4868
(This used to be commit 0ced8fcfe1)
2007-10-10 12:29:27 -05:00
Stefan Metzmacher
5cc4dbd449 r24312: revision 24091 removed the 'FORCE'...
metze
(This used to be commit 34d821daf0)
2007-10-10 12:29:27 -05:00
Stefan Metzmacher
a5f412f305 r24311: add a reply_force_nterror() macro
metze
(This used to be commit b9ae00f498)
2007-10-10 12:29:27 -05:00
Stefan Metzmacher
c25f22562e r24310: we should not call END_PROFILE(SMBntcreateX); twice...
metze
(This used to be commit 7a98e09f2e)
2007-10-10 12:29:27 -05:00
Stefan Metzmacher
66294f9db5 r24309: if no protocol matches, just return choise 0xffff
as we've done before revision 24002

metze
(This used to be commit 6014ecbbfd)
2007-10-10 12:29:26 -05:00
Stefan Metzmacher
aece6db714 r24308: this needs a better fix that compiles...
metze
(This used to be commit 1a177eb08d)
2007-10-10 12:29:26 -05:00
Stefan Metzmacher
f210f7c432 r24307: fill in choise with value -1 on error
as we've done before revision 24002

metze
(This used to be commit 2961a35e90)
2007-10-10 12:29:26 -05:00
Stefan Metzmacher
9239b8e8d3 r24306: the check_fsp() function has an explicit user argument
so use it...

metze
(This used to be commit 4154bee0d9)
2007-10-10 12:29:26 -05:00
Volker Lendecke
12d94f77f9 r24279: Remove reply_prep_legacy from reply_write_and_X
(This used to be commit f18b7a9a28)
2007-10-10 12:29:24 -05:00
Volker Lendecke
a6810cb9a3 r24278: Push down reply_prep_legacy in reply_write_and_X
Remove the need for reply_prep_legacy for reply_pipe_write_and_X
(This used to be commit de143d5fa6)
2007-10-10 12:29:24 -05:00
Stefan Metzmacher
3e8fc031c8 r24272: try to fix the build on irix...
metze
(This used to be commit dd7e94258b)
2007-10-10 12:29:24 -05:00
Volker Lendecke
b0dc209c19 r24271: Push reply_prep_legacy into reply_write_and_X
(This used to be commit 607e7d2447)
2007-10-10 12:29:24 -05:00
Volker Lendecke
1f67efab7c r24270: Fix some END_PROFILE(SMBwriteX)
(This used to be commit 36f2347561)
2007-10-10 12:29:23 -05:00
Volker Lendecke
bb9664302b r24269: Check wct in reply_write_and_X
(This used to be commit 1297fac117)
2007-10-10 12:29:23 -05:00
Volker Lendecke
456305325c r24268: Fix two crashes for spoolss
strlcpy does not like a NULL source. Fix a use-after-free.
(This used to be commit c2a2145017)
2007-10-10 12:29:22 -05:00
Volker Lendecke
d18b7b1223 r24254: Fix a segfault in r24102
The really pure bugfix would have replaced pparam by *pparam, but we pulled
the fid anyway.

Metze, in line 2421 the FSP_BELONGS_CONN is commented out, is that intended?
The FSCTL_CREATE_OR_GET_OBJECT_ID ioctl did not have it.

Volker
(This used to be commit 2c1376225b)
2007-10-10 12:29:21 -05:00
Jeremy Allison
d75a38ae26 r24253: From Jan Martin <Jan.Martin@rwedea.com>.
----------------------------------------------------------
In rare cases, Samba 3.0.25b shows directory contents at the wrong
position in the file tree when displaying a subdirectory of a DFS link.

The problem occurs whenever Windows XP asks for a DFS referral for a
subdirectory of a DFS link with a trailing backslash.
Windows does not do this very often, but we saw it several times per day
on our central DFS server.

smbd/msdfs.c, dfs_path_lookup() does the following with the requested
path:
- in line 390, the local copy 'localpath' is 'unix_convert'ed; the
trailing backslash is removed inside unix_convert
- in lines 417-20, 'dfspath' (another copy of the requested path) is
mangled another way without removing trailing backslashes

That's why the following loop (lines 435-461) that is meant to
synchronously cut off the last path component from both strings until it
comes to a DFS link, does not handle both strings the same.  When the
original path ended with a backslash, 'canon_dfspath' has always one
component more than 'localpath', so that *consumedcntp gets too big in
line 446. This value is reported to the client.
----------------------------------------------------------

Bug #4860.

Jeremy.
(This used to be commit 42d1c6713a)
2007-10-10 12:29:21 -05:00
Volker Lendecke
b0ed26faf0 r24244: Complete the conversion of reply_trans[s]
Remove reply_prep/post_legacy from send_trans_replies
(This used to be commit c08366f840)
2007-10-10 12:29:20 -05:00
Volker Lendecke
d274724ebb r24243: Remove reply_prep_legacy from api_reply
(This used to be commit b01664b43b)
2007-10-10 12:29:20 -05:00
Volker Lendecke
43a77ab149 r24242: Remove reply_prep_legacy from api_rpc_trans_reply
(This used to be commit 160f65946a)
2007-10-10 12:29:20 -05:00
Volker Lendecke
40f6afcea2 r24241: Remove reply_prep_legacy from api_WNPHS and api_SNPHS
(This used to be commit 8702450e91)
2007-10-10 12:29:20 -05:00
Volker Lendecke
b8de67a2f2 r24240: Push down reply_prep_legacy one level inside api_fd_reply
(This used to be commit 0bb95639d6)
2007-10-10 12:29:20 -05:00
Volker Lendecke
fbe15d8db9 r24239: Push reply_prep_legacy into api_fd_reply
(This used to be commit e2a9649792)
2007-10-10 12:29:20 -05:00
Volker Lendecke
bcd0bf8e5e r24238: Push down reply_prep_legacy one level
(This used to be commit a6a2d97fac)
2007-10-10 12:29:19 -05:00
Volker Lendecke
d57a88a994 r24237: Add send_trans_reply_new
(This used to be commit f0598b3ca0)
2007-10-10 12:29:19 -05:00
Volker Lendecke
97a817dceb r24236: Push reply_prep_legacy() into named_pipe()
(This used to be commit b38f9347e8)
2007-10-10 12:29:19 -05:00
Volker Lendecke
3bb9f20bc3 r24235: Make handle_trans reply to errors itself
(This used to be commit 06d0c74b74)
2007-10-10 12:29:19 -05:00
Volker Lendecke
abc519ff43 r24234: Reformatting -- SCNR
(This used to be commit 040d6d5db6)
2007-10-10 12:29:19 -05:00
Volker Lendecke
e41528c3f4 r24233: Push reply_prep_legacy into handle_trans
(This used to be commit dc27c3c668)
2007-10-10 12:29:19 -05:00
Volker Lendecke
0cfea6de67 r24232: Push down reply_prep_legacy inside reply_transs
(This used to be commit 511f8bc030)
2007-10-10 12:29:18 -05:00
Volker Lendecke
1d3c1de502 r24231: Push allocating InBuffer/OutBuffer into reply_transs
(This used to be commit 74ae19cca6)
2007-10-10 12:29:18 -05:00
Volker Lendecke
f1822fe737 r24230: Push down reply_prep_legacy in reply_trans
The last checkin was for reply_trans, not reply_transs
(This used to be commit 50a2bfd9e0)
2007-10-10 12:29:18 -05:00
Volker Lendecke
133ef281c0 r24229: Push allocating InBuffer/OutBuffer into reply_transs
(This used to be commit 39a7809aa4)
2007-10-10 12:29:18 -05:00
Volker Lendecke
5d2031915e r24225: Convert reply_flush to the new API
(This used to be commit f843c02f07)
2007-10-10 12:29:18 -05:00
Volker Lendecke
bf160bb621 r24224: Check wct in reply_trans
(This used to be commit fc8759e63c)
2007-10-10 12:29:18 -05:00
Volker Lendecke
c847b2afe7 r24223: Convert reply_echo to the new API
(This used to be commit 4863ff2899)
2007-10-10 12:29:17 -05:00
Jeremy Allison
01ee1c7909 r24164: Fix for write cache corruption bug reported by Jean-Francois Panisset <panisset@A52.com>.
Awaiting confirmation from reporter.
Jeremy.
(This used to be commit 7bd65060bd)
2007-10-10 12:29:17 -05:00
Volker Lendecke
c7a425f30f r24163: Remove the send_trans2_replies_new wrapper
This changes send_trans2_replies to not depend on large buffers anymore
and finishes the trans2 conversion.
(This used to be commit b1d133e4ff)
2007-10-10 12:29:16 -05:00
Volker Lendecke
c2fb81bbf0 r24162: send_trans2_replies is now static in trans2.c
(This used to be commit 47261fb6fe)
2007-10-10 12:29:16 -05:00
Volker Lendecke
72ce8ef168 r24161: handle_trans2 takes care of errors itself, no need to do it in reply_transs2
(This used to be commit ca26b43e02)
2007-10-10 12:29:16 -05:00
Volker Lendecke
9f3062d8a7 r24160: process_trans2 in smbd/blocking.c used send_trans2_replies.
Fake a struct smb_request here.

Volker
(This used to be commit f712d1c92b)
2007-10-10 12:29:16 -05:00
Volker Lendecke
1d8851f4c7 r24159: Convert reply_transs2 to the new API
(This used to be commit a55a4d71ff)
2007-10-10 12:29:15 -05:00
Volker Lendecke
e2f0b5dd2a r24156: Convert reply_trans2 to the new API
(This used to be commit a9c2d75b42)
2007-10-10 12:29:15 -05:00
Volker Lendecke
675a484670 r24155: Check wct in reply_trans2
(This used to be commit e0a708c79b)
2007-10-10 12:29:15 -05:00
Volker Lendecke
c28bd38aa6 r24154: handle_trans2 does not reference inbuf/outbuf anymore
(This used to be commit 8eb016a91e)
2007-10-10 12:29:14 -05:00
Volker Lendecke
2516942a4b r24153: Convert call_trans2setfsinfo to the new API.
This *might* break the transport encryption stuff. I need to check that.
(This used to be commit 82b34d7bdb)
2007-10-10 12:29:14 -05:00
Volker Lendecke
4514ea2034 r24152: Convert call_trans2ioctl to the new API
(This used to be commit db4e6781c4)
2007-10-10 12:29:14 -05:00
Volker Lendecke
70496e030f r24151: Convert call_trans2getdfsreferral to the new API
(This used to be commit 642c58648b)
2007-10-10 12:29:14 -05:00
Volker Lendecke
ccd0b815e8 r24150: Convert call_trans2qfsinfo to the new API
(This used to be commit cdd86497b9)
2007-10-10 12:29:14 -05:00
Volker Lendecke
24e97edc78 r24149: Convert call_trans2setfilepathinfo to the new API
(This used to be commit 50aa149cef)
2007-10-10 12:29:13 -05:00
Volker Lendecke
67fde05d68 r24148: Remove some inbuf refs from subcommands of call_trans2setfilepathinfo
(This used to be commit 09ed6537b3)
2007-10-10 12:29:13 -05:00
Volker Lendecke
f2e2c22b6f r24147: Remove some inbuf refs from call_trans2setfilepathinfo
(This used to be commit a13c42be75)
2007-10-10 12:29:13 -05:00
Volker Lendecke
fe92fdc67d r24145: Fix a comment
(This used to be commit 34a00d8aa9)
2007-10-10 12:29:13 -05:00
Volker Lendecke
bd627a1597 r24144: Fix the build
In a function returning void the "return;" needs to stand alone on some
compilers
(This used to be commit 28affcca8e)
2007-10-10 12:29:12 -05:00
Volker Lendecke
44c5ee4ca6 r24143: Convert call_trans2qfilepathinfo to the new API
(This used to be commit 0b84e29120)
2007-10-10 12:29:12 -05:00
Volker Lendecke
fa2b8a447a r24142: Remove some direct inbuf references from call_trans2qfilepathinfo
(This used to be commit c9c0133d55)
2007-10-10 12:29:12 -05:00
Volker Lendecke
2945d4492d r24141: Add check_fsp as a replacement for CHECK_FSP
(This used to be commit a3d77a576f)
2007-10-10 12:29:12 -05:00
Volker Lendecke
e3a53acafe r24140: Convert call_trans2findnotifyfirst/next to the new API
(This used to be commit 46d9c51631)
2007-10-10 12:29:11 -05:00
Volker Lendecke
133a8bbe07 r24139: Convert call_trans2mkdir to the new API
(This used to be commit d0b7f409e1)
2007-10-10 12:29:11 -05:00
Volker Lendecke
a1d70fcad7 r24138: Convert call_trans2findnext to the new API
(This used to be commit af1855e4ce)
2007-10-10 12:29:11 -05:00
Volker Lendecke
e5ad62702b r24137: Convert call_trans2findfirst to the new API
(This used to be commit 238edebab7)
2007-10-10 12:29:11 -05:00
Volker Lendecke
4d34c5eef7 r24136: 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
(This used to be commit 9b1614f8cb)
2007-10-10 12:29:10 -05:00
Volker Lendecke
b91704d47b r24135: 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
(This used to be commit 248f15ff14)
2007-10-10 12:29:10 -05:00
Volker Lendecke
d526657d5f r24134: 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
(This used to be commit d9eef977dc)
2007-10-10 12:29:10 -05:00
Volker Lendecke
b62bd05b93 r24133: Explicitly pass flags2 down to push_string_fn
This needs a bit closer review, it also touches the client libs
(This used to be commit 824eb26738)
2007-10-10 12:29:10 -05:00
Volker Lendecke
6c6fed5e65 r24130: Explicitly pass flags2 to srvstr_push
This is in preparation of the trans2 conversion: srvstr_push should not
look at inbuf directly.
(This used to be commit 5fd7e6a382)
2007-10-10 12:29:09 -05:00
Stefan Metzmacher
4b15f31f10 r24120: add a file_id_create() hook into the VFS layer
it's needed for some cluster filesystems to
overload this function.

metze
(This used to be commit cdaa24e804)
2007-10-10 12:29:08 -05:00
Volker Lendecke
a0a9a301d2 r24119: Convert reply_exit to the new API
(This used to be commit d4d550aa2b)
2007-10-10 12:29:08 -05:00
Volker Lendecke
bfbd756535 r24106: Pass fnum instead of buf/offset into get_rpc_pipe_p
(This used to be commit eb353412c6)
2007-10-10 12:29:07 -05:00
Volker Lendecke
a2d6aa829f r24102: Pass the fid instead of inbuf and an offset to file_fsp.
This removes the buf==NULL condition in file_fsp(), but wherever it is called
we do have a buffer anyway.

Volker
(This used to be commit d70a1f82fe)
2007-10-10 12:29:07 -05:00