1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

181 Commits

Author SHA1 Message Date
Stefan Metzmacher
61d8674727 s3:smbd/close: avoid usage of server_event_context()
metze
2011-12-12 14:35:42 +01:00
Volker Lendecke
1c46fb5c3e s3: Use autogenerated open_files.idl 2011-12-02 22:43:05 +01:00
Jeremy Allison
865bc0c0ac Remove the check for FILE_WRITE_ATTRIBUTES from smb_set_file_time(). It
is called from places like fileio.c that need to update the write time
on a file handle only open for write, without neccessarily having
FILE_WRITE_ATTRIBUTES permission. Move all checks to before the
smb_set_file_time() callers.
2011-11-15 17:41:48 -08:00
Frank Lahm
c3bdcab516 First part of fix for bug #8419 - Make VFS op "streaminfo" stackable.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Oct 17 21:39:32 CEST 2011 on sn-devel-104
2011-10-17 21:39:32 +02:00
Frank Lahm
7a0b5d6fc5 Add support for VFS op streaminfo chaining in all relevant VFS modules.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Oct 14 03:26:06 CEST 2011 on sn-devel-104
2011-10-14 03:26:06 +02:00
Volker Lendecke
502fdae7f1 s3: Pass sconn explicitly to schedule_deferred_open_message_smb 2011-08-02 19:18:08 +02:00
Volker Lendecke
77f5246f09 s3: Fix some nonempty blank lines 2011-08-02 19:18:08 +02:00
Andrew Bartlett
9289537993 s3-auth Use struct auth_user_info_unix for unix_name and sanitized_username
This is closer to the layout of struct auth_session_info in auth.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
e5dd03d199 s3-globals Remove smbd_event_context() (use server_event_context())
This has been a wrapper around server_event_context() for some time
now, and removing this from dummmysmbd.c assists with library
dependencies.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Günther Deschner
ab36d597e7 s3-messages: make ndr_messaging.h part of messages.h.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
af300a9fcb s3-auth: smbd needs auth.h
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
9bd06f6bc7 s3-build: only include transfer_file.h where needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Andrew Bartlett
04f5ef83b9 s3-auth struct security_unix_token replaces UNIX_USER_TOKEN 2011-03-01 06:29:04 +01:00
Jeremy Allison
7464793c9d Fix bug found against the new Mac client @ Connectathon. Mac clients
don't open with FILE_WRITE_ATTRIBUTES when just doing a write, so updating
the write time on close fails as smb_set_file_time() now (correctly) checks
for FILE_WRITE_ATTRIBUTES in the access_mask before allowing client time
update. This is an internal time update being done on a close, not a handle-based
client request.
2011-02-23 02:17:21 +01:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11:00
Jeremy Allison
0122a4f417 Put OpenDir() back the way it was - don't overload with an fsp arg. Create OpenDir_fsp for new usage.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Feb 10 02:43:31 CET 2011 on sn-devel-104
2011-02-10 02:43:31 +01:00
Jeremy Allison
1607ebfe86 Allow SMB2_FIND to actually use the open fd handle if we support fdopendir. Fallback to pathname opendir if not. 2011-02-09 15:13:40 -08:00
Jeremy Allison
224fc03cb5 Pass fsp to dptr_CloseDir(). Cope with setting the fd if we're closing an fd that opendir knows about. 2011-02-08 15:06:00 -08:00
Jeremy Allison
44732734cc Fix bug #7863 - Unlink may unlink wrong file when hardlinks are involved.
Do this by keeping a linked list of delete on close tokens, one for
each filename that identifies a path to the dev/inode. Use the
jenkins hash of the pathname to identify the correct token.
2011-01-25 14:23:19 -08:00
Volker Lendecke
1b373d6044 s3: Fix a deadlock between smbd and ctdbd
Do the notification after we released the share mode lock. Inside notify_fname
we take out another tdb lock. With ctdb also accessing our databases, this can
lead to deadlocks. Putting this notify after the TALLOC_FREE(lck) above we
avoid locking two records simultaneously. Notifies are async and informational
only, so calling the notify_fname without holding the share mode lock should
not do any harm.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Jan 21 12:29:21 CET 2011 on sn-devel-104
2011-01-21 12:29:21 +01:00
Volker Lendecke
924357ab52 s3: Remove smbd_server_conn from msg_close_file 2010-10-03 18:17:09 +02:00
Volker Lendecke
97b76364e7 s3: Attempt to fix a ton of warnings on the build farm 2010-10-03 10:51:08 +02:00
Volker Lendecke
b448e42de4 s3: Lift smbd_server_conn from file_find_dif 2010-09-28 07:36:16 +02:00
Volker Lendecke
c9b654f581 s3: Remove smbd_messaging_context() from send_stat_cache_delete_message() 2010-08-07 13:16:48 +02:00
Simo Sorce
849cc65654 s3-smbd: Migrated to new spoolss functions for printing.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:13 -04:00
Volker Lendecke
6c53365d11 s3: Remove smbd_messaging_context() from close_normal_file() 2010-07-05 11:06:26 +02:00
Volker Lendecke
f22e58bcd3 s3: Remove smbd_messaging_context() from notify_deferred_opens() 2010-07-05 11:06:26 +02:00
Jeremy Allison
62e0a744e2 Fix a long-standing bug with async io that would only be triggered by SMB2.
On normal or shutdown close, ensure we wait for any pending IO to
complete before returning. Implement a blocking aio_suspend inside
vfs_aio_fork.c. These changes pass make test when the aio_fork module
is used by default on the test shares.

Jeremy.
2010-06-04 21:00:24 -07:00
Jeremy Allison
4ad1943d29 Make us pass all SMB2 lock tests except MULTIPLE-UNLOCK and CONTEXT. Them next :-).
Jeremy.
2010-05-07 01:20:26 -07:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Jeremy Allison
e15939b456 Plumb SMB2 stubs into all the places we defer SMB1 operations.
Rename functions to be internally consistent. Next step is
to cope queueing single (non-compounded) SMB2 requests to
put some code inside the stubs.

Jeremy.
2010-04-09 19:26:34 -07:00
Jeremy Allison
984eee7e29 Switch over to using get_currect_XXX() accessor functions.
Jeremy.
2010-03-15 14:49:15 -07:00
Jeremy Allison
4b85a0ea7f Rever e80ceb1d73 "Remove more uses of "extern struct current_user current_user;"."
As requested by Volker, split this into smaller commits.

Jeremy.
2010-03-15 14:48:54 -07:00
Jeremy Allison
e80ceb1d73 Remove more uses of "extern struct current_user current_user;".
Use accessor functions to get to this value. Tidies up much of
the user context code. Volker, please look at the changes in smbd/uid.c
to familiarize yourself with these changes as I think they make the
logic in there cleaner.

Cause smbd/posix_acls.c code to look at current user context, not
stored context on the conn struct - allows correct use of these
function calls under a become_root()/unbecome_root() pair.

Jeremy.
2010-03-12 13:56:51 -08:00
Jeremy Allison
105f876eb4 Fix bug #7033 - SMBrmdir call always returns true, even on failure to delete a directory.
Argh. Missed the second (and essential) part of the fix for the above :-(.

Jeremy
2010-01-12 16:55:31 -08:00
Jeremy Allison
47c1d9b39f Fix bug #6876 - Delete of an object whose parent folder does not have delete rights fails even if the delete right is set on the object.
Final fix for the vfs_acl_xattr and vfs_acl_tdb code.
Ensure we can delete a file even if the underlying POSIX
permissions don't allow it, if the Windows permissions do.

Jeremy.
2010-01-12 16:04:44 -08:00
Jeremy Allison
91e0bdd86c Refactor reply_rmdir to use handle based code. All
calls are now handle based. Put rmdir into close.c
and make it private.
Jeremy.
2009-12-03 13:01:10 -08:00
Volker Lendecke
19a7a6cbe3 s3: "check_magic" only looks at the size 2009-11-29 11:22:03 +01:00
Volker Lendecke
44ce5603dd s3: Pass the "fake dir create times" parameter to sys_*stat
Step 0 to restore it as a per-share paramter
2009-11-29 11:22:01 +01:00
Jeremy Allison
c99dd5c23e Got the logic simplification worked out so we still pass
BASE-DELAYWRITE and also RAW-CLOSE.
Jeremy.
2009-11-05 22:58:12 -08:00
Jeremy Allison
977fa4e377 Revert commit "0551284dc08eb93ef7b2b2227a45e5ec21d482fb" - simplify
the logic. This was incorrect (I'll revisit this tomorrow).
Jeremy.
2009-11-05 21:27:25 -08:00
Jeremy Allison
0551284dc0 Simplify the logic - remove extraneous argument and calls to set_close_write_time().
We were treating a file time set on close as a sticky write time set, and I don't
think it is. I will add a torture test later to RAW-CLOSE to confirm this.
Jeremy.
2009-11-05 17:40:01 -08:00
Jeremy Allison
2f09516a6b Fix explicit set of write time on close.
Jeremy.
2009-11-05 17:12:11 -08:00
Jeremy Allison
7f9fe127ba Get closer to an accurate model of Windows timestamp changes.
"Normal" non truncate writes always cause the timestamp to
be set on close. Once a close is done on a handle this can
reset the sticky write time to current time also.
Updated smbtorture4 confirms this.
Jeremy.
2009-11-05 16:20:11 -08:00
Jeremy Allison
6f22cd10ad Remove lots of duplicate code and move it into one
function vfs_stat_fsp(). Stops code looking at fsp->posix_open
except for exceptional circumstances.
Jeremy.
2009-10-02 13:45:38 -07:00
Stefan Metzmacher
f00a3bfee7 s3:smbd: store a dirptr on the files_struct for SMB2 Query Directory
metze
2009-08-19 22:12:42 +02:00
Tim Prouty
23c703a01e s3: Remove unnecessary callers of get_full_smb_filename
This often times means explicitly denying certain operations on a stream
as they are not supported or don't make sense at a particular level.  At
some point in the future these can be enabled, but for now it's better to
remove ambiguity
2009-07-21 12:04:59 -07:00