1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-21 01:59:07 +03:00

518 Commits

Author SHA1 Message Date
Michael Adam
ee24c629a6 Remove superfluous fd parameter from SMB_VFS_FGET_NT_ACL().
Michael
(This used to be commit c0c7c1223da29c68359dac64a340c1c710d5f3d2)
2008-01-06 23:07:59 +01:00
Jeremy Allison
29562987c3 Now conn is part of smb_request, we don't need it as
an extra parameter. This cleans up quite a few places
we were passing it around without needing it.
Jeremy.
(This used to be commit 8f36def18e9f980e8db522e1de41e80cfd5f466e)
2008-01-04 15:37:24 -08:00
Jeremy Allison
9254bb4ef1 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
(This used to be commit c4e5a505043965eec77b5bb9bc60957e8f3b97c8)
2008-01-04 12:56:23 -08:00
Volker Lendecke
7cbdb48475 Remove tiny code duplication
ndr_size_security_descriptor does the same as sec_desc_size
(This used to be commit bc3bd7a8e7c6e9e27acb195c86abb92c0f53112f)
2007-12-29 23:13:26 +01:00
Volker Lendecke
a59280792c Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid
(This used to be commit 8aec5d09ba023413bd8ecbdfbc7d23904df94389)
2007-12-29 23:12:51 +01:00
Michael Adam
233eb0e560 Change the prototype of the vfs function get_nt_acl().
Up to now, get_nt_acl() took a files_struct pointer (fsp) and
a file name. All the underlying functions should need and now
do need (after the previous preparatory work), is a connection_struct
and a file name. The connection_struct is already there in the
vfs_handle passed to the vfs functions. So the files_struct
argument can be eliminated.

This eliminates the need of calling open_file_stat in a couple
of places to produce the fsp needed.

Michael
(This used to be commit b5f600fab53c9d159a958c59795db3ba4a8acc63)
2007-12-19 23:08:01 +01:00
Volker Lendecke
8c6e781c3c make use of [un]marshall_sec_desc, allow for fd==-1 in get/set_secdesc
(This used to be commit 585f5f8831f13260808a82611656fc6ca5caee81)
2007-12-16 14:05:30 +01:00
Volker Lendecke
900288a2b8 Replace sid_string_static by sid_string_dbg in DEBUGs
(This used to be commit bb35e794ec129805e874ceba882bcc1e84791a09)
2007-12-15 22:09:36 +01:00
Volker Lendecke
a23d09081f Attempt to fix make test :-)
(This used to be commit de3a3e3745e58cbfa777ae426e38bad3d74230d4)
2007-12-07 16:00:01 +01:00
Volker Lendecke
ca4eee5bbe Pass only internal oplock request values to create_file
Other callers (e.g. reply_open_and_X) might have other ideas of the bit
shuffling
(This used to be commit 6a58d823e51ccc8efd6682005e367c9096abc993)
2007-12-07 14:05:06 +01:00
Volker Lendecke
ce535b4dd8 More parameter shuffling
(This used to be commit 8f70f691ffa3e171a73d04a1c867aa6fca4d4583)
2007-12-07 14:05:06 +01:00
Volker Lendecke
c55e44b6a7 Re-arrange create_file() parameters
This changes them to be a bit closer to open_file_ntcreate and thus provides
less surprises to developers
(This used to be commit d000258b96b9bb714efdfe982947370a6dfb5d55)
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 525a6887afcae8d8e740cf194a412c21da899649)
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 51db8d09a4652d626c093f7bacf075c1c168fc33)
2007-12-05 13:45:12 +01:00
Volker Lendecke
756ce14d49 Fix an uninitialized variable
(This used to be commit ca3add2d65a242029f08482f3b82ea56b7059538)
2007-12-05 13:45:12 +01:00
Volker Lendecke
14d1bd2506 Fix debug
(This used to be commit c268be54ee3bdd59980a6217a0e8e59dd3ec5ce2)
2007-12-05 13:45:12 +01:00
Volker Lendecke
bef09af757 Fix attribute calculation for ntcreate&x
(This used to be commit 9ef81cb14952cad96c71409c04a2cc6579e3311c)
2007-12-05 13:45:12 +01:00
Volker Lendecke
aa6f0a0151 Fix error returns
(This used to be commit f5cdaacd1784d3801d638fa9984b52c57dad6ebd)
2007-12-05 13:45:12 +01:00
Volker Lendecke
72ca4a68de Fix debugs
(This used to be commit 77b31ef44a9f7c1c9b80d90653a49affee8e0372)
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 8cd27e4a7a1a2df0ff686ebe0b1a779511effd27)
2007-12-05 13:45:12 +01:00
Volker Lendecke
727746b8fb Reformatting, also allow quotas for transact_create
(This used to be commit 956aae7a57364debf724a7ef0bd0074119a24d24)
2007-12-05 13:45:12 +01:00
Volker Lendecke
db1a23586a Tiny refactorings
(This used to be commit f3421c3b86aece4f8303e864c5df97485db77f88)
2007-12-05 13:45:12 +01:00
Volker Lendecke
ffeb5aaaa4 Split out sd parsing
(This used to be commit 5a9d147e41b260cb620f026291786eeb95ebc64f)
2007-12-05 13:45:12 +01:00
Volker Lendecke
825dddff8f Reformatting
(This used to be commit 719941605333a453c4219aed45780862c94a5c7c)
2007-12-05 13:45:12 +01:00
Volker Lendecke
222cd323ca Align formatting, one TALLOC_FREE is enough
(This used to be commit 5bf4647dea71305d9a92875a751b24c8a2e4a916)
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 753e640f49125c319d7b8f2db262e273a1727691)
2007-12-05 13:45:11 +01:00
Volker Lendecke
adb8d1b179 Reformatting
(This used to be commit fb900184feeda37691cf9bd57c029988648de9f8)
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 f6d62226a33cdff41ad7881996d856b7130ef15c)
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 a855808f4851a800055bfee5df39ca72057e55f9)
2007-12-05 13:45:11 +01:00
Volker Lendecke
acaea7ece8 Tiny refactoring
(This used to be commit 481e35eba8e130041848887ec5fb6212e331eb14)
2007-12-05 13:45:11 +01:00
Volker Lendecke
cb7706cf2c TALLOC_FREE early
(This used to be commit 4b1f0d1d93d1e7bd0b4fa641d4e9629af8234d71)
2007-12-05 13:45:11 +01:00
Volker Lendecke
692725d974 consolidate srvstr_get_path in ntcreate_and_X
(This used to be commit 4a2d502903934f4c3dc6b31595fe77a2013dbc21)
2007-12-05 13:45:11 +01:00
Volker Lendecke
c6cb3ed323 Tiny refactoring
(This used to be commit b79b16d637d41a356c036c6aac932e4504d2d7b0)
2007-12-05 13:45:11 +01:00
Volker Lendecke
80287d65d0 tiny refactoring
(This used to be commit 7f15a9f5a281052d2bed13a622b2fc9a24c62096)
2007-12-05 13:45:11 +01:00
Volker Lendecke
5066f7c878 In nttransact_create, we also need to check for delete readonly
(This used to be commit f4cc9cab518e97c1049aaad7516aba212ae15c95)
2007-12-01 10:43:54 -08:00
Volker Lendecke
15953b82eb Make [f]get_nt_acl return NTSTATUS
(This used to be commit dcbe1bf942d017a3cd5084c6ef605a13912f795b)
2007-11-13 15:47:01 +01:00
Jeremy Allison
86558e0376 Fix bug . Allow "delete readonly = yes" to correctly
override deletion of a file. Fix from David Shaw <dshaw@jabberwocky.com>
Jeremy.
(This used to be commit 5d1d650d192d4782421b5c3c2be1b632d4318279)
2007-11-12 11:39:35 -08: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 d50d14c300abc83b7015718ec48acc8b3227a273)
2007-11-03 15:12:42 -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 39d265375cf55eedddef2c4faa65398df73d5ed2)
2007-10-31 15:45:45 -07: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 f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-18 17:40:25 -07:00
Jeremy Allison
e6228e2541 r25309: Volker's fix for bug - 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 f70ac2e25847e41ecf54ae9d66e3247e1996b152)
2007-10-10 12:30:58 -05:00
Volker Lendecke
ad97bcf813 r25184: Fix some C++ warnings and an uninitialized variable
(This used to be commit b64df8a3c504ab7749c21ffb26e4771a9a0a328f)
2007-10-10 12:30:49 -05:00
Jeremy Allison
eacd314057 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
(This used to be commit 39c211a702e91c34c1a5a689e1b0c4530ea8a1ac)
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 98f2e10e3f7a86b1b30619a25ee15a489ad10d43)
2007-10-10 12:30:43 -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 7f0db75fb0f24873577dcb758a2ecee74fdc4297)
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 0c9a8c4dff10974dbffd2a302ae982896122fcc0)
2007-10-10 12:30:41 -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 cf6b6f9c3a38b68d2671c753f412772344506742)
2007-10-10 12:30:40 -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 dee8beba7a92b8a3f68bbcc59fd0a827f68c7736)
2007-10-10 12:30:32 -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 6585ea2cb7f417e14540495b9c7380fe9c8c717b)
2007-10-10 12:30:24 -05:00
Volker Lendecke
b578db69e9 r24702: Remove the old API pointers
(This used to be commit 17df313db42199e26d7d2044f6a1d845aacd1a90)
2007-10-10 12:30:14 -05:00