1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-04 00:23:49 +03:00
Commit Graph

419 Commits

Author SHA1 Message Date
Michael Adam
4f2d139a18 Remove superfluous parameter fd from SMB_VFS_FSET_NT_ACL().
Michael
2008-01-06 23:08:00 +01:00
Michael Adam
c0c7c1223d Remove superfluous fd parameter from SMB_VFS_FGET_NT_ACL().
Michael
2008-01-06 23:07:59 +01:00
Jeremy Allison
8f36def18e 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.
2008-01-04 15:37:24 -08:00
Jeremy Allison
c4e5a50504 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.
2008-01-04 12:56:23 -08:00
Volker Lendecke
bc3bd7a8e7 Remove tiny code duplication
ndr_size_security_descriptor does the same as sec_desc_size
2007-12-29 23:13:26 +01:00
Volker Lendecke
8aec5d09ba Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid
2007-12-29 23:12:51 +01:00
Michael Adam
b5f600fab5 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
2007-12-19 23:08:01 +01:00
Volker Lendecke
585f5f8831 make use of [un]marshall_sec_desc, allow for fd==-1 in get/set_secdesc 2007-12-16 14:05:30 +01:00
Volker Lendecke
bb35e794ec Replace sid_string_static by sid_string_dbg in DEBUGs 2007-12-15 22:09:36 +01:00
Volker Lendecke
de3a3e3745 Attempt to fix make test :-) 2007-12-07 16:00:01 +01:00
Volker Lendecke
6a58d823e5 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
2007-12-07 14:05:06 +01:00
Volker Lendecke
8f70f691ff More parameter shuffling 2007-12-07 14:05:06 +01:00
Volker Lendecke
d000258b96 Re-arrange create_file() parameters
This changes them to be a bit closer to open_file_ntcreate and thus provides
less surprises to developers
2007-12-07 14:05:05 +01:00
Volker Lendecke
525a6887af There's no point in passing down a 0 2007-12-05 15:47:32 +01:00
Volker Lendecke
51db8d09a4 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.
2007-12-05 13:45:12 +01:00
Volker Lendecke
ca3add2d65 Fix an uninitialized variable 2007-12-05 13:45:12 +01:00
Volker Lendecke
c268be54ee Fix debug 2007-12-05 13:45:12 +01:00
Volker Lendecke
9ef81cb149 Fix attribute calculation for ntcreate&x 2007-12-05 13:45:12 +01:00
Volker Lendecke
f5cdaacd17 Fix error returns 2007-12-05 13:45:12 +01:00
Volker Lendecke
77b31ef44a Fix debugs 2007-12-05 13:45:12 +01:00
Volker Lendecke
8cd27e4a7a Implement create_file()
Rip out the cores of reply_ntcreate_and_X and call_nt_transact_create

Volker
2007-12-05 13:45:12 +01:00
Volker Lendecke
956aae7a57 Reformatting, also allow quotas for transact_create 2007-12-05 13:45:12 +01:00
Volker Lendecke
f3421c3b86 Tiny refactorings 2007-12-05 13:45:12 +01:00
Volker Lendecke
5a9d147e41 Split out sd parsing 2007-12-05 13:45:12 +01:00
Volker Lendecke
7199416053 Reformatting 2007-12-05 13:45:12 +01:00
Volker Lendecke
5bf4647dea Align formatting, one TALLOC_FREE is enough 2007-12-05 13:45:12 +01:00
Volker Lendecke
753e640f49 Move pulling the ea list out of the way 2007-12-05 13:45:11 +01:00
Volker Lendecke
fb900184fe Reformatting 2007-12-05 13:45:11 +01:00
Volker Lendecke
f6d62226a3 Put posix semantic calculation in the same place in both routines 2007-12-05 13:45:11 +01:00
Volker Lendecke
a855808f48 Tiny refactoring
Reformatting, consolidate oplock calculation to the same place in both routines
2007-12-05 13:45:11 +01:00
Volker Lendecke
481e35eba8 Tiny refactoring 2007-12-05 13:45:11 +01:00
Volker Lendecke
4b1f0d1d93 TALLOC_FREE early 2007-12-05 13:45:11 +01:00
Volker Lendecke
4a2d502903 consolidate srvstr_get_path in ntcreate_and_X 2007-12-05 13:45:11 +01:00
Volker Lendecke
b79b16d637 Tiny refactoring 2007-12-05 13:45:11 +01:00
Volker Lendecke
7f15a9f5a2 tiny refactoring 2007-12-05 13:45:11 +01:00
Volker Lendecke
f4cc9cab51 In nttransact_create, we also need to check for delete readonly 2007-12-01 10:43:54 -08:00
Volker Lendecke
dcbe1bf942 Make [f]get_nt_acl return NTSTATUS 2007-11-13 15:47:01 +01:00
Jeremy Allison
5d1d650d19 Fix bug #5073. Allow "delete readonly = yes" to correctly
override deletion of a file. Fix from David Shaw <dshaw@jabberwocky.com>
Jeremy.
2007-11-12 11:39:35 -08:00
Jeremy Allison
d50d14c300 Remove the smb_read_error global variable and replace
it with accessor functions. "One global or pstring a day...." :-).
Jeremy.
2007-11-03 15:12:42 -07:00
Jeremy Allison
39d265375c 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.
2007-10-31 15:45:45 -07:00
Jeremy Allison
f35a266b3c 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.
2007-10-18 17:40:25 -07:00
Jeremy Allison
f70ac2e258 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.
2007-10-10 12:30:58 -05:00
Volker Lendecke
b64df8a3c5 r25184: Fix some C++ warnings and an uninitialized variable 2007-10-10 12:30:49 -05:00
Jeremy Allison
39c211a702 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
2007-10-10 12:30:44 -05:00
Günther Deschner
98f2e10e3f 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
2007-10-10 12:30:43 -05:00
Jeremy Allison
7f0db75fb0 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.
2007-10-10 12:30:41 -05:00
Jeremy Allison
0c9a8c4dff 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.
2007-10-10 12:30:41 -05:00
Jeremy Allison
cf6b6f9c3a 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.
2007-10-10 12:30:40 -05:00
Jeremy Allison
dee8beba7a 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.
2007-10-10 12:30:32 -05:00
Volker Lendecke
6585ea2cb7 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
2007-10-10 12:30:24 -05:00