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

7157 Commits

Author SHA1 Message Date
Stefan Metzmacher
26f37cba82 s3:smb2_setinfo: make use of file_fsp_smb2()
metze
2012-06-09 21:23:44 +02:00
Stefan Metzmacher
4bc10b5b72 s3:smb2_getinfo: make use of file_fsp_smb2()
metze
2012-06-09 21:23:44 +02:00
Stefan Metzmacher
4dfadfc61d s3:smb2_find: make use of file_fsp_smb2()
metze
2012-06-09 21:23:44 +02:00
Stefan Metzmacher
3909ad4690 s3:smb2_break: make use of file_fsp_smb2()
metze
2012-06-09 21:23:44 +02:00
Stefan Metzmacher
2bb6a9e07f s3:smb2_close: make use of file_fsp_smb2()
metze
2012-06-09 21:23:44 +02:00
Stefan Metzmacher
9e1e656c60 s3:smb2_flush: make use of file_fsp_smb2()
metze
2012-06-09 21:23:44 +02:00
Stefan Metzmacher
2a804a359a s3:smbd: add file_fsp_smb2()
metze
2012-06-09 21:23:44 +02:00
Stefan Metzmacher
72564052b6 s3:smb2_write: pass fsp->fnum to init_strict_lock_struct()
fsp->fnum is the same as in_file_id_volatile.

When we start to support durable handles we should pass
in_file_id_persistent.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jun  9 18:50:32 CEST 2012 on sn-devel-104
2012-06-09 18:50:32 +02:00
Stefan Metzmacher
0d77585a41 s3:smb2_read: pass fsp->fnum to init_strict_lock_struct()
fsp->fnum is the same as in_file_id_volatile.

When we start to support durable handles we should pass
in_file_id_persistent.

metze
2012-06-09 15:02:47 +02:00
Stefan Metzmacher
4ae96bb952 s3:smb2_lock: use fsp->fnum as locking context
fsp->fnum is the same as in_file_id_volatile.

When we start to support durable handles we should pass
in_file_id_persistent.

metze
2012-06-09 15:02:47 +02:00
Stefan Metzmacher
3b2e5929ec s3:smb2_lock: use smb2req->compat_chain_fsp instead of looking it up again
metze
2012-06-09 15:02:47 +02:00
Stefan Metzmacher
163207a28e s3:smbd: set req->smb2req->compat_chain_fsp in file_fsp()
metze
2012-06-09 15:02:47 +02:00
Stefan Metzmacher
3dbfb25111 s3:smb2_close: add missing TALLOC_FREE(subreq) in smbd_smb2_request_close_done()
metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sat Jun  9 13:57:31 CEST 2012 on sn-devel-104
2012-06-09 13:57:31 +02:00
Stefan Metzmacher
fc96488c64 s3:smbd: readd START_PROFILE(smbd_idle)/END_PROFILE(smbd_idle)
metze
2012-06-09 12:09:17 +02:00
Michael Adam
8a338c65a1 s3:smbd: change set_file_oplock() to return NTSTATUS
Pair-Programmed-With: Volker Lendecke <vl@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  8 23:20:20 CEST 2012 on sn-devel-104
2012-06-08 23:20:20 +02:00
Volker Lendecke
088ca00b92 s3: Replace an if with a boolean short circuit
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:20 +02:00
Volker Lendecke
a3b4a5d779 s3: Assigning ?True:False to a bool is a bit pointless
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:20 +02:00
Volker Lendecke
4aea0c1fa1 s3: Remove unnecessary ()
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:19 +02:00
Volker Lendecke
a51278067b s3: Replace an if with a boolean short circuit
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:19 +02:00
Volker Lendecke
91be6b42f1 s3: Assigning ?True:False to a bool is a bit pointless
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:19 +02:00
Volker Lendecke
e1e1fbcfe6 s3: Remove unnecessary ()
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08 21:29:19 +02:00
Michael Adam
41d830ea4f s3:smbd: remove unnecessary variable readret from read_file()
Pair-Programmed-With: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun  8 18:08:09 CEST 2012 on sn-devel-104
2012-06-08 18:08:08 +02:00
Michael Adam
eb750d5458 s3:smbd: remove ancient DMF_FIX from read_file().
Pair-Programmed-With: Volker Lendecke <vl@samba.org>
2012-06-08 16:10:40 +02:00
Michael Adam
4389097294 s3:include: change connection_struct->cnum to uint32_t
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-06-06 19:37:14 +02:00
Michael Adam
ba1699463b s3:smb: introduce a name TID_FIELD_INVALID for the invalid value for a cnum/tid
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-06-06 19:37:14 +02:00
Michael Adam
aa3a7de368 s3:connections: add a CNUM_OFFSET for mapping between cnum and the bitmap index
This moves the start of the range of valid cnum values up from 0 to CNUM_OFFSET
(currently 1), so that in a later step we can use 0 as invalid cnum value
instead of the current -1. This will allow us to change the type of cnum to
uint32_t from a mix of int and unsigned.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-06-06 19:37:13 +02:00
Stefan Metzmacher
02d9ba6ee1 s3:smbd: change user_struct->vuid to uint64_t
Only sconn->smb1.sessions.next_vuid remains as uint16_t,
so that we do not generate larger values yet.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jun  6 12:07:33 CEST 2012 on sn-devel-104
2012-06-06 12:07:33 +02:00
Stefan Metzmacher
bb27bb081e s3:smbd: let file_close_pid/file_close_user take a uint64_t vuid
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
7d772064b4 s3:smbd: pass down vuid as uint64_t in lanman.c
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
612838dca8 s3:smbd: pass down vuid as uint64_t in ipc.c
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
d3e79a864d s3:smbd: change vuid to uint64_t in uid.c
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
c535668f7b s3:smbd: let fcb_or_dos_open() take a uint64_t vuid
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
9ffb8f1532 s3:smbd: let close_cnum() take a uint64_t vuid
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
69d1f9b836 s3:smbd: use UID_FIELD_INVALID (0) instead of (uint16)-1 when calling close_cnum()
The only thing that's important is that the value is invalid.

metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
2a9a95e673 s3:smbd: let make_connection() take a uint64_t vuid
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
19d05171fa s3:smbd: let conn_clear_vuid_caches() take a uint64_t vuid
metze
2012-06-06 10:18:41 +02:00
Stefan Metzmacher
2477c73b62 s3:smbd: let open_fake_file() take a uint64_t vuid
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
53cd38ebb8 s3:smbd: change conn_ctx->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
21e6db8f7e s3:smbd: change trans_state->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
d4aa494654 s3:include: change smb_request->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
37bfadf4a3 s3:include: change files_struct->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
bc39915f47 s3:smbd: move struct user_struct to globals.h
metze
2012-06-06 10:18:39 +02:00
Stefan Metzmacher
f52e5738a2 s3:smbd: use 'struct user_struct' instead of typedef'ed 'user_struct'
metze
2012-06-06 10:18:39 +02:00
Stefan Metzmacher
9e2e3708aa s3:smbd: move forward declaration of struct aio_extra to smbd.h
metze
2012-06-06 10:18:39 +02:00
Stefan Metzmacher
9b5c2ca14c s3:include: move some prototypes (e.g. smb_register_vfs) to vfs.h
These are called from vfs modules, which should not depend on smbd/proto.h

metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
5306c18f2c s3:smbd: move UCF_ defines to smbd.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
5fc502c624 s3:include: move struct connection_struct (and sub structs) to vfs.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
44482ad452 s3:smbd: move struct trans_state to smbd.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
ce41497769 s3:smbd: move struct privilege_paths to smbd.h
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
659f3e681e s3:smbd: make struct notify_change_buf private to notify.c
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
b5b943dbad s3:smbd: make use of change_notify_fsp_has_changes()
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
dc962c195e s3:smbd: add change_notify_fsp_has_changes()
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
e91c223531 s3:smbd: use print_spool_rap_jobid() in call_trans2ioctl()
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
c2ffe330b4 s3:smbd: use print_spool_rap_jobid() in reply_ioctl()
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
145fe2ac4c s3:smbd: fcb_or_dos_open() can be static
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
0907b1e20c s3:smbd: dup_file_fsp() never gets called for print files
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
cf549ff2bc s3:smbd: make struct vfs_fsp_data private to vfs.c
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
4321e19657 s3:smbd: make use of vfs_remove_all_fsp_extensions() in file_free()
metze
2012-06-06 10:18:37 +02:00
Stefan Metzmacher
cd3e658d82 s3:smbd: add vfs_remove_all_fsp_extensions()
metze
2012-06-06 10:18:36 +02:00
Stefan Metzmacher
05dc497637 s3:smbd: remove typedef for struct write_cache
metze
2012-06-06 10:18:36 +02:00
Stefan Metzmacher
4a91321f3a s3:smbd: make typedef write_cache private to fileio.c
metze
2012-06-06 10:18:36 +02:00
Andrew Bartlett
d2f6d0ba1e build: Rationalise AIO support in configure, ensure on by default
With this change, the define to check for AIO is HAVE_AIO, consistant
with other subsystems.

It is now also on by default in the autoconf build, as it has been for waf.

Andrew Bartlett
2012-06-06 08:23:10 +02:00
Stefan Metzmacher
8693a4fff9 s3:lib: split things into a conn_tdb.h
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jun  5 19:28:35 CEST 2012 on sn-devel-104
2012-06-05 19:28:35 +02:00
Andrew Bartlett
9db04c481d s3-smbd: Remove support for protocols before LANMAN1
This falls out of the removal of security=share, because we now require that
a session setup has been performed before (essentially) all other operations.

Andrew Bartlett
2012-06-05 04:27:36 +02:00
Jeremy Allison
4accd2396e Fix bug #8972 - Directory group write permission bit is set if unix extensions are enabled
We can't manipulate file_attributes if it's a posix call. I'll look
at adding a test for this asap.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jun  5 04:26:11 CEST 2012 on sn-devel-104
2012-06-05 04:26:10 +02:00
Stefan Metzmacher
9c80b91d8f s3:smbd: make conn_close_all() a void function
metze
2012-06-03 21:33:10 +02:00
Stefan Metzmacher
abcd095847 s3:smbd/close: call del_share_mode() directly before TALLOC_FREE(lck)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Jun  3 21:08:19 CEST 2012 on sn-devel-104
2012-06-03 21:08:19 +02:00
Stefan Metzmacher
f66d88d10a s3:smbd/close: remove unused goto out from close_directory()
metze
2012-06-03 17:23:28 +02:00
Stefan Metzmacher
8751c3f2ef s3:smbd/close: do an early return in close_directory()
metze
2012-06-03 17:23:28 +02:00
Stefan Metzmacher
d792f59aeb s3: Fix an assert to trigger in close_remove_share_mode
In case we have a left-over entry in the share mode entry array,
the SMB_ASSERT(got_tokens) is likely to kick in. It happens when
we are about to delete a file with initial delete on close. We don't
have a delete on close token set in the locking.tdb record. We see
the fsp->initial_delete_on_close set, add the delete_on_close token
to lck. Then "delete_file" is being set to true. Then later on we
do the notify_deferred_opens. This walks the list, also checking
for share_mode_stale_pid. We have already deleted our own share
mode entry, share_mode_stale_pid() sees the left-over entry. It not
also deletes that one but also the delete on close token. This leads
to a different view of "delete_file" a.k.a. "got_tokens" further
down in close_remove_share_mode, leading the SMB_ASSERT to fire.

This patch attempts to fix the issue by keeping around our own share
mode entry for almost the whole routine, preventing share_mode_stale_pid()
from removing the delete tokens.

Pair-Programmed-With: Volker Lendecke <vl@samba.org>
2012-06-03 17:23:28 +02:00
Volker Lendecke
b9e11bd63e s3: Do an early return in close_remove_share_mode
Without "lck" we don't have much to clean up

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03 17:23:28 +02:00
Volker Lendecke
2e95b77c99 s3: Make close_remove_share_mode a bit more readable
by introducing a variable simplifying a boolean expression

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03 17:23:28 +02:00
Volker Lendecke
8541829a9a s3: Slightly simplify close_remove_share_mode
Remove a level of indentation by more use of "continue;"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-03 17:23:28 +02:00
Stefan Metzmacher
8486d514f5 s3:smbd/close: avoid procid_is_me()
metze
2012-06-03 17:23:28 +02:00
Stefan Metzmacher
85e6dcf49c s3:smbd/open: avoid procid_is_me()
metze
2012-06-03 17:23:27 +02:00
Stefan Metzmacher
9dba59d026 s3:smbd/oplock: avoid procid_is_me()
metze
2012-06-03 17:23:27 +02:00
Jeremy Allison
8fd02fa2d6 Forward port of Richard Sharpe's <realrichardsharpe@gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process. 2012-05-31 16:08:44 -07:00
Jeremy Allison
f6e41026f8 We are triggering the cleanup_timeout_fn() too often, on exiting when an smbd is idle.
Calls to exit_server_cleanly() should be treated as a "clean" shutdown,
and not trigger the master smbd to call cleanup_timeout_fn.
2012-05-31 12:35:04 -07:00
Stefan Metzmacher
6718747268 s3:smbd: use server_messaging_context() instead of sconn->msg_ctx in exit_server_common()
sconn is not available in the parent anymore.

Thanks to Volker Lendecke <vl@samba.org> for finding this!

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu May 31 18:08:06 CEST 2012 on sn-devel-104
2012-05-31 18:08:05 +02:00
Volker Lendecke
835e25e3b4 s3: Fix some 64-bit warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu May 31 10:06:56 CEST 2012 on sn-devel-104
2012-05-31 10:06:56 +02:00
Jeremy Allison
5d1a8d2a31 Stop spamming the logs with "Could not remove pid XX from serverid.tdb" messages and initiating the cleanup function on every process death.
We now have many sub-processes from smbd that don't serve SMB1/SMB2 requests and
don't register themselves in the serverid.tdb. Only initiate the cleanup
from processes that were explicitly in the child list.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu May 31 04:44:09 CEST 2012 on sn-devel-104
2012-05-31 04:44:09 +02:00
Andrew Bartlett
9f4b6fa0cc s3-param: Use same function name for "max xmit" as lib/param
Again, this helps with merging the FN_ list.

Andrew Bartlett
2012-05-30 04:15:12 +02:00
Stefan Metzmacher
cee146ff7c s3:smb2_ioctl: verify credit charge
Based on a patch from Christian Ambach <ambi@samba.org>.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 29 18:55:29 CEST 2012 on sn-devel-104
2012-05-29 18:55:29 +02:00
Stefan Metzmacher
8b4e677720 s3:smb2_ioctl: add more validation checks
metze
2012-05-29 17:02:13 +02:00
Stefan Metzmacher
4ac57a3c96 s3:smb2_ioctl: add some more validation checks
Based on a patch from Christian Ambach <ambi@samba.org>.

metze
2012-05-29 17:02:13 +02:00
Christian Ambach
aa7cd05e5b s3:smbd/smb2_find add a debug message
like the ones in the other calls that check for max sizes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-29 10:45:32 +02:00
Christian Ambach
1bd3c0aefb s3:smbd/smb2_getinfo add a debug message
like the ones in the other calls that check for max sizes

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-29 10:45:22 +02:00
Christian Ambach
f94d3d17e8 s3:smbd/smb2_setinfo add a debug message
similar to the ones present in other paths

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-29 10:44:55 +02:00
Christian Ambach
ac6417dfc6 s3:smbd/smb2_read improve debug message
make the message similar to the ones in other paths

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-29 10:44:42 +02:00
Stefan Metzmacher
abf566ca99 s3:smbd: fix reply_open_pipe_and_X() to behave like windows (2008 R2)
See rpc.samba3.smb1-pipe-name.

metze
2012-05-28 19:51:59 +02:00
Stefan Metzmacher
e262db6c31 s3:smbd: only strip \\ off the name if present (for ntcreatex)
metze
2012-05-28 19:51:58 +02:00
Stefan Metzmacher
98c14ca61c s3:smb2_create: do not remove leading backslash from pipe names
metze
2012-05-28 19:51:57 +02:00
Jeremy Allison
50fdb32a4d Ensure we only return NT_STATUS_DELETE_PENDING if the share modes are valid.
Ensure we only return *file_existed = true if there were valid share modes.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
89cf7ea944 s3: Check for serverid_exists in close_directory
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
bdc4404ef9 s3: Check for serverid_exists in close_remove_share_mode
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
1b15d8b3da s3: Check for serverid_exists in find_oplock_types
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
e2818d4a0b s3: Check for serverid_exists in smb_posix_unlink
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:38 -07:00
Volker Lendecke
fdcca54ca3 s3: Check for serverid_exists in open_mode_check
Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:37 -07:00
Volker Lendecke
19b6671c07 s3: Check for serverid_exists in notify_deferred_opens
We will remove the check in parse_share_modes soon

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25 09:19:37 -07:00
Stefan Metzmacher
e17fa58d6e s3:smbd: move global smbd_msg_state to smbXsrv_connection
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri May 25 11:01:27 CEST 2012 on sn-devel-104
2012-05-25 11:01:27 +02:00
Stefan Metzmacher
167cccbc19 s3:smbd: move global koplocks to smbd_server_connection
metze
2012-05-25 09:05:35 +02:00
Stefan Metzmacher
3a66ee1ae5 s3:smbd: pass smbd_server_connection to should_notify_deferred_opens()
metze
2012-05-25 09:05:34 +02:00
Stefan Metzmacher
469a2c8e7c s3:smbd: move global oplocks vars to smbd_server_connection
metze
2012-05-25 09:05:34 +02:00
Stefan Metzmacher
2f435bb61a s3:smbd: remove unused get_number_of_exclusive_open_oplocks()
metze
2012-05-25 09:05:33 +02:00
Stefan Metzmacher
64ddb66884 s3:smbd/signing: use smbd_server_connection as talloc parent for its smb1 signing state
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri May 25 00:23:53 CEST 2012 on sn-devel-104
2012-05-25 00:23:53 +02:00
Stefan Metzmacher
b5e9ece1f3 s3:smbd: remove global 'smbd_server_conn' !!!
For now we still use a global 'global_smbXsrv_connection'
in order to pass the connection state to exit_server*().

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu May 24 20:07:20 CEST 2012 on sn-devel-104
2012-05-24 20:07:20 +02:00
Stefan Metzmacher
288a75d8dc s3:smbd: only call file_init_global() in the parent smbd
metze
2012-05-24 18:16:37 +02:00
Stefan Metzmacher
9e45885fcc s3:smbd/files: split file_init_global() out of file_init()
metze
2012-05-24 18:16:37 +02:00
Stefan Metzmacher
48e62f2d46 s3:smbd: remove unused var in smbXsrv_connection_init_tables()
metze
2012-05-24 18:16:37 +02:00
Stefan Metzmacher
a95b2ba043 s3:smbd/msdfs: pass allow_broken_path to resolve_dfspath_wcard()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu May 24 16:14:01 CEST 2012 on sn-devel-104
2012-05-24 16:14:01 +02:00
Stefan Metzmacher
758d61201f s3:smbd/msdfs: pass 'allow_broken_path' to get_referred_path()
Note the DCERPC code should not be smb2 specific!

I wonder why this is at all smb2 specific...

metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
a92f7176bd s3:smbd/msdfs: let create_conn_struct() also fake the 'smbd_server_connection'
metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
0733183594 s3:smbd/files: work without sconn->file_bmap and assign fsp->fnum = -1
For faked connection_structs we do not need valid fnum values,
e.g. in the dfs and printing code.

metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
768004b11d s3:smbd/files: fix error path and correctly cleanup
metze
2012-05-24 14:12:32 +02:00
Stefan Metzmacher
aa7b1e21a8 s3:smbd/proto.h: remove unused resolve_dfspath() prototype
metze
2012-05-23 20:03:10 +02:00
Stefan Metzmacher
97f0a3675f s3:smbd/files: remove unused VALID_FNUM()
metze
2012-05-23 20:03:09 +02:00
Stefan Metzmacher
a0c9a291e7 s3:smb2_server: make use of nt_status_np_pipe()
metze
2012-05-23 20:03:09 +02:00
Stefan Metzmacher
d595d2e5af s3:smbd: use nt_status_np_pipe for smb1
metze
2012-05-23 20:03:08 +02:00
Stefan Metzmacher
d869f0260c s3:smbd: add nt_status_np_pipe()
This mapps between NT_STATUS_CONNECTION_* to NT_STATUS_PIPE_*

metze
2012-05-23 20:03:08 +02:00
Stefan Metzmacher
37866df4ee s3:smbd: use reply_force_doserror(req, ERRSRV, ERRbaduid) on SMBulogoff
We don't support security = share anymore, so we should always have
a valid session.

Found by the raw.context test.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed May 23 12:47:37 CEST 2012 on sn-devel-104
2012-05-23 12:47:37 +02:00
Michael Adam
f9e4105f41 s3:smbd: remove unused 'connection_struct->used'
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 22 16:42:22 CEST 2012 on sn-devel-104
2012-05-22 16:42:22 +02:00
Stefan Metzmacher
ce11eb5b94 s3:smb2_ioctl: Fix Coverity ID 701771 Uninitialized scalar variable
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon May 21 19:27:44 CEST 2012 on sn-devel-104
2012-05-21 19:27:43 +02:00
Jeremy Allison
32cbf20e65 Move the set_write_time() call to after get_existing_share_mode_lock() returns with a share mode.
get_existing_share_mode_lock() isn't really the right
call here, as we're being called after
close_remove_share_mode() inside close_normal_file()
so it's quite normal to not have an existing share
mode here. However, get_share_mode_lock() doesn't
work because that will create a new share mode if
one doesn't exist - so stick with this call (just
ignore any error we get if the share mode doesn't
exist.

The previous commit raised the error message debug
level inside get_share_mode_lock_internal() so
we don't always get a level 1 error message if
get_existing_share_mode_lock() fails.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat May 19 06:26:33 CEST 2012 on sn-devel-104
2012-05-19 06:26:33 +02:00
Stefan Metzmacher
d58f7cd546 s3:smbd: allow creating new spnego sessions only with a 0 vuid
Found by the raw.context test.

metze
2012-05-18 16:36:16 +02:00
Stefan Metzmacher
84ce4484e7 s3:smbd: SMBtdis should return ERRSRV, ERRinvnid instead of NETWORK_NAME_DELETED
Found by the raw.context test.

metze
2012-05-18 16:36:16 +02:00
Volker Lendecke
f5ca3f11e4 s3: Revert the serverid changes, they need more work
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
2012-05-18 13:12:14 +02:00
Volker Lendecke
182faceab2 s3: Check for serverid_exists in close_directory
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
2db3ecbc95 s3: Check for serverid_exists in close_remove_share_mode
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
49237b0cef s3: Check for serverid_exists in find_oplock_types
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
5017bbe70d s3: Check for serverid_exists in smb_posix_unlink
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:22 -07:00
Volker Lendecke
4962ab2aa8 s3: Check for serverid_exists in open_mode_check
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:21 -07:00
Volker Lendecke
689a04bc6c s3: Check for serverid_exists in notify_deferred_opens
We will remove the check in parse_share_modes soon

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 13:17:21 -07:00
Stefan Metzmacher
ff700acdd0 s3:smb2_sesssetup: make use of nt_status_squash() in smbd_smb2_session_setup_recv()
metze
2012-05-17 12:59:08 +02:00
Andrew Bartlett
6bafb4ac25 s3-smbd: Avoid creating a UID ACL entry for SIDs that are mapped as ID_TYPE_BOTH The GID ACL entry is what will be mapped in most cases, and so is sufficient.
Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu May 17 05:08:44 CEST 2012 on sn-devel-104
2012-05-17 05:08:44 +02:00
Andrew Bartlett
f38638d451 s3-smbd: Consider a group with the same SID as sufficient duplication
This code is to ensure that the user does not loose rights when their file
ownership is taken away.  If the owner (an IDMAP_BOTH SID) appears as a group
then a duplicate user is not required.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 03:17:05 +02:00
Andrew Bartlett
5b1c42228b s3-smbd: Handle ID_TYPE_BOTH by mapping to both a group ACL entry and file ownership This will allow groups, such as domain administrators, to own files while correctly handling the rest of the ACL permissions.
Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 03:17:05 +02:00
Andrew Bartlett
367a644c4d We need to split things up into a new helper function add_current_ace_to_acl() in order for there to be more posix ACL elements than NT ACL elements (so a group SID can own a file, but also get the group permissions that will be honoured)
Andrew Bartlett

Slightly modified by Jeremy to reduce diff size.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 03:17:05 +02:00
Jeremy Allison
173f818a29 This covers a case where an ID_TYPE_BOTH mapping creates group permissions, but must own the file. Based on an original patch by Andrew Bartlett. 2012-05-17 03:17:05 +02:00
Andrew Bartlett
59106473d3 s3-smbd: Do not merge UID ACE values with GID ACE values for posix ACL
This might happen when we get a SID mapped to IDMAP_BOTH.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17 03:17:05 +02:00
Stefan Metzmacher
70be41c772 s3:onefs: remove all onefs related code as it not maintained anymore
See https://lists.samba.org/archive/samba-technical/2012-May/083631.html
for the discussion.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed May 16 11:23:05 CEST 2012 on sn-devel-104
2012-05-16 11:23:04 +02:00
Volker Lendecke
c562a534c8 s3: Fix a likely cut&paste error 2012-05-15 16:18:50 +02:00
Andreas Schneider
78af4738e7 s3-auth: Rename to init_system_session_info().
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Tue May 15 13:56:00 CEST 2012 on sn-devel-104
2012-05-15 13:56:00 +02:00
Stefan Metzmacher
e7e67962c7 s3:smb2_close: make the top level code async using
metze
2012-05-14 15:12:33 +02:00
Stefan Metzmacher
b8d999ce84 s3:smb2_close: add add smbd_smb2_close_send/recv as wrapper
metze
2012-05-14 15:12:33 +02:00
Stefan Metzmacher
643e648ed0 s3:smb2_close: don't do any marshalling in smbd_smb2_close() let the caller to it
metze
2012-05-14 15:12:33 +02:00
Stefan Metzmacher
302f767fb7 s3:smb2_tcon: make the top level code async using
metze
2012-05-14 15:12:33 +02:00
Stefan Metzmacher
b19a9dbb5b s3:smb2_tcon: add smbd_smb2_tree_connect_send/recv as wrapper
metze
2012-05-14 15:12:33 +02:00
Volker Lendecke
87542e1310 s3: Make SMB_QUERY_FILE_UNIX_BASIC's devno work for files
According to susv3, st_rdev is valid exactly for char and block devices. Normal
files have st_dev set.
2012-05-14 13:16:32 +02:00
Stefan Metzmacher
8f887ce164 s3:smb2_sesssetup: make the top level code async using
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun May 13 17:59:39 CEST 2012 on sn-devel-104
2012-05-13 17:59:39 +02:00
Stefan Metzmacher
1b8645b4c8 s3:smb2_sesssetup: add smbd_smb2_session_setup_send/recv as wrapper
This just adds smbd_smb2_session_setup_send/recv as wrapper to
the sync smbd_smb2_session_setup function.

This will allow us to change to top level code to work async,
then we can have a 2nd step where we remove the sync
smbd_smb2_session_setup function.

metze
2012-05-13 14:11:02 +02:00
Stefan Metzmacher
70ac2cc831 s3:smb2_sesssetup: pass down in_flags to smbd_smb2_session_setup()
metze
2012-05-13 14:11:01 +02:00
Stefan Metzmacher
7b359bc615 s3:smb2_sesssetup: pass down in_previous_session_id to all layers
metze
2012-05-13 14:11:00 +02:00
Stefan Metzmacher
212e805507 s3:smb2_ioctl: implement FSCTL_VALIDATE_NEGOTIATE_INFO
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat May 12 02:50:42 CEST 2012 on sn-devel-104
2012-05-12 02:50:42 +02:00
Stefan Metzmacher
8963930974 s3:smb2_ioctl: implement FSCTL_VALIDATE_NEGOTIATE_INFO_224
metze
2012-05-12 01:01:35 +02:00
Stefan Metzmacher
b3235d483d s3:smbd: introduce struct smbXsrv_connection
This will represent a transport connection for SMB 1 or 2
in the server. smbd_server_connection will slowly be moved
to the SMB_VFS layer to satisfy the existing modules,
but it will hopefully be protocol independend in future.

metze
2012-05-12 01:01:34 +02:00
Stefan Metzmacher
c8a3c0e0f7 s3:smb2_negprot: setup the protocol at the end of the negprot with a real dialect
metze
2012-05-12 01:01:34 +02:00
Stefan Metzmacher
c11c4df762 s3:smb2_ioctl: allow functions to disconnect the smb connection
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri May 11 20:15:37 CEST 2012 on sn-devel-104
2012-05-11 20:15:37 +02:00
Stefan Metzmacher
739bd25fe0 s3:smb2_ioctl: FSCTL_SRV_ENUMERATE_SNAPSHOTS is handles in SMB_VFS_FSCTL()
metze
2012-05-11 18:19:51 +02:00
Stefan Metzmacher
5e998b805f s3:smb2_ioctl: call SMB_VFS_FSCTL() as fallback for non SMB2 specific functions
metze
2012-05-11 18:19:50 +02:00
Andrew Bartlett
d46ddfa748 s3-smbd: Fix the creation of duplicate SMB_ACL_GROUP entries
The issue was a simple copy and paste bug, which casued a duplicate SMB_ACL_GROUP
to be added when we already had one.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed May  9 13:17:29 CEST 2012 on sn-devel-104
2012-05-09 13:17:28 +02:00
Christian Ambach
09494ed613 s3:smbd fix some compiler warnings 2012-05-08 22:37:05 +02:00
Andrew Bartlett
859aa43f73 s3-python: Add python bindings for posix ACL layer
This will allow us to check that posix ACLs work in the s4 provision, and avoid
--use-s3fs if they do not.

Andrew Bartlett
2012-05-08 04:51:59 +02:00
Stefan Metzmacher
1512ec7772 s3:smb2_negprot: add support for PROTOCOL_SMB3_00
metze
2012-05-06 14:50:39 +02:00
Michael Adam
b954d88dbe s3:smbd: comment the lp_load call in reload_services() 2012-05-05 02:22:00 +02:00
Volker Lendecke
4b59023123 s3: Remove an unused extern declaration 2012-05-04 18:44:29 +02:00
Volker Lendecke
7ae716663a s3: Remove an unused parameter from check_parent_access() 2012-05-04 18:44:29 +02:00
Volker Lendecke
d12fa60ef8 s3: In mkdir_internal, don't retrieve parent_dir from check_parent_access
We have already created that ourselves a few lines above
2012-05-04 18:44:29 +02:00
Volker Lendecke
e1bf9ccffd s3: Fix a typo 2012-05-04 15:02:41 +02:00
Andrew Bartlett
221c0e479d s3-smbd: Use security_session_user_level() rather than nt_token_check_sid()
This allows the unix.whoami test to pass when configured as part of the AD DC.

The struct auth_session_info is slightly different in the AD DC configuration
when using auth_samba4.  In particular, there is a distinction between Guest
and Anonymous logins.

Andrew Bartlett
2012-05-02 01:00:12 +02:00
Richard Sharpe
0dc3f423d2 Add an audit file VFS routine so we can handle auditing with SACLs.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Sat Apr 28 08:05:00 CEST 2012 on sn-devel-104
2012-04-28 08:05:00 +02:00
Volker Lendecke
54a6d7b3b8 s3: oplock_timeout is a talloc child of fsp
Jeremy, I know you like it explicit, but I stumbled across this
explicit TALLOC_FREE and asked myself about a potentially wrong
talloc hierarchy.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Apr 26 23:00:03 CEST 2012 on sn-devel-104
2012-04-26 23:00:03 +02:00
Volker Lendecke
21985a7f10 s3: Remove code TALLOC_FREE already does 2012-04-26 21:26:27 +02:00
Volker Lendecke
2d01099acc s3: Simplify check_reduced_name a bit
It's pointless to do a talloc_asprintf with a SMB_STRDUP on the
result. Use asprintf directly.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr 24 18:18:05 CEST 2012 on sn-devel-104
2012-04-24 18:18:05 +02:00
Volker Lendecke
d1d0f1d11d s3: Fix a typo 2012-04-24 16:44:26 +02:00
Volker Lendecke
1267ced693 s3: Introduce variable "indyniov" for easier reading 2012-04-24 16:44:26 +02:00
Jeremy Allison
5b5b696c1e Fix bug #8882 - Broken processing of %U with vfs_full_audit when force user is set.
When doing a "force user" we need to remember what the "sanitized_username"
was from the original connect.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Apr 23 19:52:19 CEST 2012 on sn-devel-104
2012-04-23 19:52:19 +02:00
Michael Adam
499e7372be s3:id_cache: do not use the in-memory idmap cache (it is going to be removed)
This also removes the ID_CACHE_FLUSH message.
2012-04-20 23:17:36 +02:00
Volker Lendecke
8173331150 s3: Fix Coverity ID 2747: FORWARD_NULL
For the notify cleanup process we have a notify context without a
messaging entry. We will never call notify_add/remove for this, but
the code should protect against this.
2012-04-19 17:37:37 +02:00
Volker Lendecke
ee8d55622f s3: Fix Coverity ID 2749: REVERSE_INULL 2012-04-19 17:37:37 +02:00
Jeremy Allison
124be4cf88 Ensure we have 12 bytes of data for a SMB_SET_CIFS_UNIX_INFO call. Add debug. 2012-04-18 12:38:52 -07:00
Andrew Bartlett
338e5a1d35 s3-dbwrap: push lp_ctx up another layer in the stack
This will allow db_open_tdb() to be called from common code, which may
already have a loadparm context loaded.

It also slowly moves the lp_ctx up the stack, as required to remove
the library loop between smbconf and the registry.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Volker Lendecke
843432d56f s3: New notify implementation
From notify_internal.c:

        /*
         * The notify database is split up into two databases: One
         * relatively static index db and the real notify db with the
         * volatile entries.
         */

This change is necessary to make notify scale better in a cluster
2012-04-17 10:21:02 +02:00
Volker Lendecke
d2fe0bf776 s3: Increase debuglevel for unknown child msgs
Now that we have forked background jobs, this spams log.smbd
2012-04-17 10:21:00 +02:00
Stefan Metzmacher
1e7f8d5ad0 s3:smbd/sesssetup: use a helper variable 'action' to mark guest access
metze
2012-04-16 10:39:50 +02:00
Andrew Bartlett
0eacc47622 param: Change from _lp to lp__ as the prefix for internal parameter wrappers
This will make a merge with the lib/param param code easier, as we can then paste lp_ to the front of
all parameters unconditionally.

Andrew Bartlett
2012-04-16 14:32:38 +10:00
Adrian Bunk
55cbf7ba34 rely on sys/inotify.h for inotify
sys/inotify.h was added to glibc 2.4 in 2006.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Apr 13 21:15:00 CEST 2012 on sn-devel-104
2012-04-13 21:15:00 +02:00
Jeremy Allison
da786cddd6 We never cancel SMB1 aio, only SMB2 aio - and in this case we always return a value.
So pass_cancel is no longer needed.
2012-04-12 15:11:22 -07:00
Jeremy Allison
d399af30c1 Remove cancel_aio_by_fsp(). It can never work and could lead to memory corruption
as outstanding IO's complete. Also we never have any aio's on a call to close_normal_file()
with close_type ERROR_CLOSE.
2012-04-12 15:06:59 -07:00
Jeremy Allison
95839102ad Move the counting of outstanding_aio_calls into the lifecycle of the aio_extra struct.
This way we can't end up with a mismatch between outstanding events and the counter.

We may still have problems with canceling and not correctly freeing the aio
struct, but at least the counter won't get out of sync anymore.
2012-04-12 15:06:58 -07:00
Volker Lendecke
6742aa1fb6 s3: Fix a segfault with debug level 3 on Solaris
printf can not deal with NULL strings
2012-04-12 21:49:32 +02:00
Christian Ambach
2927ca3670 s3:smbd only care about missing level2 support if kernel oplocks are enabled
if kernel oplocks are not enabled for that share, we can grant level2 oplocks

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Apr 11 22:45:21 CEST 2012 on sn-devel-104
2012-04-11 22:45:21 +02:00
Christian Ambach
fbfbc6a252 s3:smbd only initialize kernel oplocks if they are enabled for a share
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-11 11:11:40 -07:00
Christian Ambach
1d9a3d488d s3:smbd add seperate function to initialize kernel oplocks
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-11 11:11:39 -07:00
Christian Ambach
2a36408d40 s3:param convert kernel oplocks to share parameter
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-04-11 11:11:39 -07:00
Volker Lendecke
3cca094514 s3: Use talloc_get_size instead of strlen
We've just talloc_asprintf'ed the fullpath, so talloc_get_size knows the
strlen.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Apr 10 13:20:22 CEST 2012 on sn-devel-104
2012-04-10 13:20:22 +02:00
Volker Lendecke
eff36099c1 s3: Move the aio signal init to the vfs module
On platforms that don't have an RT signal space, signal initialization
fails. aio_fork and aio_pthread don't need the signal, so this would
block them from running as well.
2012-04-09 18:04:55 +02:00
Andrew Bartlett
6aa12fcb30 build: Remove SMB_OFF_T, replace with off_t
Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Apr  6 01:47:43 CEST 2012 on sn-devel-104
2012-04-06 01:47:43 +02:00
Andrew Bartlett
19eee33d82 s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to removexattr.

Andrew Bartlett
2012-04-05 13:39:01 +10:00
Andrew Bartlett
c70ac29c54 s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
c5b17c5555 s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument
to listxattr.

Andrew Bartlett
2012-04-05 13:39:00 +10:00
Andrew Bartlett
b2f7cfa848 s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configure 2012-04-05 13:39:00 +10:00
Andrew Bartlett
1ac7f071ce build: Remove SMB_F* locking defines 2012-04-05 02:39:09 +02:00
Andrew Bartlett
f6e0532024 build: Remove SMB_STRUCT_DIR define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
2320b2144f build: Remove SMB_STRUCT_DIRENT define 2012-04-05 02:39:09 +02:00
Andrew Bartlett
b74fe73a6f build: Remove sys_fopen wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
d166b79852 build: Remove sys_open wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
96108eed10 build: #ifdef LARGE_SMB_OFF_T as off_t is now always 64 bits 2012-04-05 02:39:08 +02:00
Jeremy Allison
704ea4729b Third part of fix for bug #8837 - smbd crashes when deleting directory and veto files are enabled.
Use correct check to see if veto files has been enabled. Even if not
set lp_veto_files() returns a valid string address (to a '\0' character).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr  5 01:36:04 CEST 2012 on sn-devel-104
2012-04-05 01:36:04 +02:00
Jeremy Allison
c10ed730d4 Second part of bugfix for bug #8837 - smbd crashes when deleting directory and veto files are enabled.
Store the 'struct security_token' as well as the 'struct security_unix_token'
inside the locking db when setting a delete on close.
2012-04-04 14:58:42 -07:00
Jeremy Allison
f042de2f34 First part of fix for bug 8837 - smbd crashes when deleting directory and veto files are enabled.
Add some const to the sec_ctx code.
2012-04-04 14:58:42 -07:00
Andrew Bartlett
8ef60901ce s3-vfs: Use new smb_load_module for better diagnostics 2012-04-03 14:25:12 +10:00
Andrew Bartlett
c363815809 s3-smbd: Inline init_modules() into only caller 2012-04-03 14:25:12 +10:00
Jeremy Allison
5df1c11539 Start to add truncate checks on all uses of strlcpy(). Reading lwn
has it's uses :-).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 29 20:48:15 CEST 2012 on sn-devel-104
2012-03-29 20:48:15 +02:00
Jeremy Allison
762928945d Based on code from Richard Sharpe <realrichardsharpe@gmail.com>,
ensure we don't crash on a NULL DACL.
2012-03-29 08:53:43 -07:00
Richard Sharpe
3be2af1df9 Add DEBUG statements to show when access has been denied and why.
Autobuild-User: Richard Sharpe <sharpe@samba.org>
Autobuild-Date: Wed Mar 28 07:07:26 CEST 2012 on sn-devel-104
2012-03-28 07:07:26 +02:00
Volker Lendecke
fa6f61e835 s3: Pass filters explicitly through vfs notify watch
This removes a dependency on "struct notify_entry" and makes the nature of the
API more explicit. We depend upon the VFS module to mask out elements from
e->filter and e->subdir_filter that it took over to handle.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Mar 26 17:45:44 CEST 2012 on sn-devel-104
2012-03-26 17:45:43 +02:00
Volker Lendecke
c3a506b64e s3: Fix a typo 2012-03-26 13:11:02 +02:00
Volker Lendecke
58c8857b72 s3: Rename a variable in inotify_watch for clarity 2012-03-26 13:10:10 +02:00
Volker Lendecke
6355d2e68a s3: Pass "filter" instead of "notify_entry" to inotify_map
This makes the potential modification a bit more obvious
2012-03-26 13:00:53 +02:00
Jelmer Vernooij
c0288e0612 lib/util: Remove obsolete sys_getpid() and sys_fork().
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24 21:55:40 +01:00
Jelmer Vernooij
3be6258912 lib/util: Remove dummy wrappers for setpwent/getpwent/endpwent. 2012-03-24 15:23:02 +01:00
Volker Lendecke
1cc7abf8aa s3: Remove the sys_notify dependency from notify_internal
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar 23 12:12:51 CET 2012 on sn-devel-104
2012-03-23 12:12:51 +01:00
Christof Schmitt
4262eb401f s3:vfs_gpfs: Export disk_norm function
vfs modules implementing the disk_free callback need access
to the function disk_norm for normalizing the data if the parameter
small query is true.
2012-03-22 18:41:22 +01:00
Volker Lendecke
ffe884c8db s3: Fix smbd -i
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Mar 22 18:40:02 CET 2012 on sn-devel-104
2012-03-22 18:40:02 +01:00
Volker Lendecke
d1697b3eaa s3: Remove an unused structure field 2012-03-22 14:18:34 +01:00
Jeremy Allison
86a80cf4fd Fix bug 8823 - source3/smbd/process.c:smb_dump seems to have a memory leak.
Based on code from Richard Sharpe. Move to talloc from malloc.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 22 00:20:41 CET 2012 on sn-devel-104
2012-03-22 00:20:40 +01:00
Volker Lendecke
f3fe53668f s3: Move the notify_ctx to the smbd_server_connection
We only need one notify_ctx per smbd. The notify_array can become quite large.
It's based on absolute paths, so there's no point in having a copy of the
complete array in memory multiple times.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Mar 21 14:26:07 CET 2012 on sn-devel-104
2012-03-21 14:26:06 +01:00
Volker Lendecke
7dcc2bf7af s3: Remove "conn" param from notify_init() 2012-03-21 12:52:10 +01:00
Volker Lendecke
91f77253e7 s3: Remove "conn" param from sys_notify_context_create 2012-03-21 12:52:09 +01:00
Volker Lendecke
6a2bf12f6a s3: Remove "conn" from sys_notify_context 2012-03-21 12:52:09 +01:00
Volker Lendecke
8e256a2734 s3: Pass "conn" to sys_notify_watch() 2012-03-21 12:52:09 +01:00
Volker Lendecke
8044db0a4d s3: Pass "conn" to notify_add() 2012-03-21 12:52:09 +01:00
Volker Lendecke
4319076cca s3: Pass "path" through vfs_notify_watch 2012-03-21 12:52:09 +01:00
Volker Lendecke
8503eecabb s3-notify: Lift "/." handling up one level
This slightly simplifies the code

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar 16 14:28:44 CET 2012 on sn-devel-104
2012-03-16 14:28:42 +01:00
Volker Lendecke
640a7d0db7 s3-notify: Simplify if-expressions 2012-03-16 11:20:11 +01:00
Stefan Metzmacher
148ca9e05f s3:smbd: call file_close_user() before removing tree connects in conn_close_all()
This will help later if we have to handle a SMB2TreeDisconnect different
compared to a SMB2SessionLogoff and a TCPDisconnect.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Mar 15 21:56:09 CET 2012 on sn-devel-104
2012-03-15 21:56:09 +01:00
Michael Adam
c80f70390c s3:smbd: let smbd/nmbd/winbindd child processes terminate if the parent process died.
This applies to all child processes making use of reinit_after_fork().
It is implemented by establishing a pipe between parent and child.
The child watches for EOF on the read end of the pipe, indidcating
an exited parent.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-03-15 18:41:37 +01:00
Volker Lendecke
21f72a1ac3 s3: Use talloc_tos() in notify_send()
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Mar 15 12:43:41 CET 2012 on sn-devel-104
2012-03-15 12:43:41 +01:00
Volker Lendecke
f69c6920d4 s3: Fix lock ordering in notify_add
It's not necessary to keep the global notify record locked during
the inotify and notify_onelevel.tdb operations.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15 11:00:24 +01:00
Volker Lendecke
a1fd41d834 s3: properly free the notify_onelevel record
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15 11:00:24 +01:00
Volker Lendecke
21375a6e58 s3: Replace some callers of cluster_id_equal
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15 11:00:24 +01:00
Volker Lendecke
81ec0cc602 s3: Remove the separate server_id arg to notify_init
The server_id is tied to the messaging_context

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-15 11:00:24 +01:00
Volker Lendecke
157a6916a9 s3: Fix blank line endings
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Mar 15 10:59:46 CET 2012 on sn-devel-104
2012-03-15 10:59:46 +01:00
Andreas Schneider
fd85cd25e0 s3-printing: Check for browseable too. 2012-03-14 17:56:14 +01:00
Christian Ambach
a5ddc2da10 s3:smb2_server: fix a compiler warning
Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Wed Mar 14 16:06:48 CET 2012 on sn-devel-104
2012-03-14 16:06:48 +01:00
Stefan Metzmacher
a3e2151edd s3:smbd: also create ncalrpc/np directory before forking rpc daemons
After the fixes to directory_create_or_exist(), this should not be
needed anymore, but lets try to make autobuild reliable first.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Mar 14 13:44:41 CET 2012 on sn-devel-104
2012-03-14 13:44:41 +01:00
Jeremy Allison
0e376db8b8 Second part of fix for bug #7933 - samba fails to honor SEC_STD_WRITE_OWNER bit with the acl_xattr module.
Error found by Andrew Bartlett <abartlet@samba.org> and Ricky Nance
<ricky.nance@weaubleau.k12.mo.us>.

Don't use a pointer when you really mean a bool flag.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Mar 13 21:56:15 CET 2012 on sn-devel-104
2012-03-13 21:56:15 +01:00
Brad Smith
f0bba969d8 s3: Improve statvfs support
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sun Mar 11 14:18:04 CET 2012 on sn-devel-104
2012-03-11 14:18:04 +01:00
Jelmer Vernooij
ce4531ee31 tdb_wrap: Move to specific directory.
It's a bit confusing to mix low-level and high-level libraries.  We had
multiple libraries in one directory, and there were have circular
dependencies with other libraries outside that directory (in this case,
samba-hostconfig).

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 10 23:13:01 CET 2012 on sn-devel-104
2012-03-10 23:13:01 +01:00
Volker Lendecke
8f93068cf8 s3: Add smb_request_done
This is used to enable async chained command sequences. A synchronous
reply_xxx command does not need to take are anymore about and_x
chaining. The async commands (pipe r/w at this moment) must do so
however. When finished, they must inform the main chain engine that
they are finished with a smb_request_done call.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Mar 10 17:14:05 CET 2012 on sn-devel-104
2012-03-10 17:14:05 +01:00
Volker Lendecke
2c1caf5fcb s3: Remove unused smb_request->done 2012-03-10 15:34:12 +01:00
Volker Lendecke
3a7bc3abb8 s3: Remove unused smb_request->chain_outbuf 2012-03-10 15:34:12 +01:00
Volker Lendecke
572bc64b59 s3: Remove "req_wct_ofs()"
This is fixed up in construct_reply_chain
2012-03-10 15:34:12 +01:00
Volker Lendecke
12068d4aac s3: Fix the read&x offset within a chain 2012-03-10 15:34:12 +01:00
Volker Lendecke
11d087aa04 s3: Remove chain_reply
<insert your favourite tombstone ascii art here>
2012-03-10 15:34:12 +01:00
Volker Lendecke
3b2c9bebc0 s3: Replace chain_reply
This is a new implementation of our andx handling code. The old
code was quite involved in that it was called from within the reply_
handlers. This leads to pretty complex faking of smb_request
structures to give them the same environment, independent of whether
they are called directly or from within chain_reply.

chain_reply needs to go because it blocks really async handling of
chained requests.
2012-03-10 15:34:11 +01:00
Volker Lendecke
c9870a62f5 s3: Add a new set of andx chain handling routines
This is in preparation of getting rid of chain_reply.
2012-03-10 15:34:11 +01:00
Volker Lendecke
90b33a05e9 s3: Make sure the andX chains are ended correctly
Normally chain_reply took care of this. This will go away soon.
2012-03-10 15:34:11 +01:00
Volker Lendecke
a28a740f58 s3: Fix a 64-bit warning
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Mar 10 15:27:09 CET 2012 on sn-devel-104
2012-03-10 15:27:09 +01:00
Jeremy Allison
981e9776f8 Ensure the right tsocket.h is included.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Mar 10 03:47:04 CET 2012 on sn-devel-104
2012-03-10 03:47:04 +01:00
Jeremy Allison
97e1652125 Fix up Christian Ambach's multi-credit code - the CreditCharge field is a 16-bit int read, not a 32-bit one. 2012-03-09 16:48:16 -08:00
Christian Ambach
6e8e3c4613 s3:smb2_server validate message ids with largemtu
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:16 -08:00
Christian Ambach
f6afda0bc8 s3:smb2_server verify creditcharge
for all requests that have max_???? checks, also do a check of the
creditcharge the client has sent (when using largemtu)

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:16 -08:00
Christian Ambach
eec5ece6f5 s3:smb2_server add function to verify creditcharge
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:15 -08:00
Christian Ambach
bd0ad2bbb5 s3:smb2_server: announce LargeMTU for SMB2.1
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:15 -08:00
Christian Ambach
7f131d3cee s3:smb2_server: add supports_multicredit to sconn
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:15 -08:00
Christian Ambach
880f64b556 s3:smb2_server use the correct variables for max read/write
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-09 16:48:15 -08:00
Volker Lendecke
177c61bd72 s3: asprintf->talloc_asprintf
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Mar  9 19:01:06 CET 2012 on sn-devel-104
2012-03-09 19:01:06 +01:00
Volker Lendecke
8a75d3d91e s3: Replace a SMB_ASSERT with an error return 2012-03-09 17:21:55 +01:00
Andrew Bartlett
50547a9950 s3-auth: Follow auth_ntlmssp and use auth4_context for Session Setup
This patch ensures consistency in behaviour between NTLMSSP and NTLM
session setup handlers.  By calling the same layer that auth_ntlmssp
calls, we can not only allow redirection of all authentication to the
AD DC, we ensure that map to guest and username map handling is
consistent, even in the file server alone.

Andrew Bartlett
2012-03-08 10:14:05 +01:00
Ira Cooper
25fbf907e9 s3: piddir creation fix.
Since the piddir got moved from the lockdir by default, the default piddir
wasn't getting created stopping some configurations from running.

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-07 11:00:44 -08:00
Andrew Bartlett
78f85b282e s3-rpc_server: Register embedded RPC services after starting lsasd and spoolssd
This ensures that these services are not accidentally registered in
these child processes.

Andrew Bartlett
2012-03-07 12:46:14 +01:00
Andrew Bartlett
008648a034 s3-smbd make change_to_user_by_session static 2012-03-07 12:46:13 +01:00
Stefan Metzmacher
68b840726b s3:smbd: keep 'num_files' and 'files' directly under smbd_server_connection
The plan is to have files_struct as some kind of low level
abstraction for a smb1/smb2 opens, that can be used by SMB_VFS modules.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Mar  6 23:04:01 CET 2012 on sn-devel-104
2012-03-06 23:04:01 +01:00
Stefan Metzmacher
f6b6e963f6 s3:smbd: keep 'num_connections' and 'connections' directly under smbd_server_connection
The plan is to have connection_struct as some kind of low level
abstraction for a smb1/smb2 tree connects, that can be used by SMB_VFS modules.

metze
2012-03-06 21:26:05 +01:00
Stefan Metzmacher
6ce72a01ab s3:smbd: keep 'num_users' and 'users' directly under smbd_server_connection
The plan is to have users_struct as some kind of low level
abstraction for a smb1/smb2 session, that can be used by SMB_VFS modules.

metze
2012-03-06 21:26:05 +01:00
Stefan Metzmacher
d95dbb86c5 s3:msdfs: set the 'cnum' field to invalid for faked connection_structs
metze
2012-03-06 21:26:05 +01:00
Volker Lendecke
1f62df52aa s3: Move a talloc_strdup out of the main code path
This is only used for AS_GUEST requests

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Mar  6 14:29:50 CET 2012 on sn-devel-104
2012-03-06 14:29:50 +01:00
Volker Lendecke
216769f2ce s3: Move the drain_socket on error to reply_write_and_X
That's the only case where this can happen, so we should not clutter the main
code path.
2012-03-05 15:59:36 +01:00
Volker Lendecke
82b948a816 s3: Use "goto out;" in reply_write_and_X 2012-03-05 15:59:36 +01:00
Volker Lendecke
07386bb533 s3: Remove "size" param from switch_message
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Mar  5 15:13:49 CET 2012 on sn-devel-104
2012-03-05 15:13:49 +01:00
Volker Lendecke
c99d245548 s3: Remove "size" param from smb_dump 2012-03-05 13:35:05 +01:00
Andrew Bartlett
2c7d77c77f s3-smbd: vuser and session_info cannot be NULL here
The callers always supply it. (this is a hold-over from the
security=share removal).

Andrew Bartlett
2012-03-04 23:33:05 +01:00
Andrew Bartlett
d7bb961859 s3-auth: Remove security=share (depricated since 3.6).
This patch removes security=share, which Samba implemented by matching
the per-share password provided by the client in the Tree Connect with
a selection of usernames supplied by the client, the smb.conf or
guessed from the environment.

The rationale for the removal is that for the bulk of security=share
users, we just we need a very simple way to run a 'trust the network'
Samba server, where users mark shares as guest ok.  This is still
supported, and the smb.conf options are documented at
https://wiki.samba.org/index.php/Public_Samba_Server

At the same time, this closes the door on one of the most arcane areas
of Samba authentication.

Naturally, full user-name/password authentication remain available in
security=user and above.

This includes documentation updates for username and only user, which
now only do a small amount of what they used to do.

Andrew Bartlett

                       --------------
                      /              \
                     /      REST      \
                    /        IN        \
                   /       PEACE        \
                  /                      \
                  |      SEC_SHARE       |
                  |    security=share    |
                  |                      |
                  |                      |
                  |       5 March        |
                  |                      |
                  |        2012          |
                 *|     *  *  *          | *
        _________)/\\_//(\/(/\)/\//\/\///|_)_______
2012-03-04 23:33:05 +01:00
Stefan Metzmacher
acfa107ec6 s3:smbd/globals.h: remove unused pollfd pointer
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Mar  4 23:18:10 CET 2012 on sn-devel-104
2012-03-04 23:18:10 +01:00
Andrew Bartlett
b07d504ca4 change low FDs are handled in Samba
We now only close fds 0, 1, 2 when we are a forked daemon, and take
care not to close a file descriptor that we might need for foreground
stdin monitoring.

This should fix stdout logging in the lsa and epmapper deamons (ie in
make test).

Andrew Bartlett
2012-03-04 10:14:34 +01:00
Michael Adam
87fc8c0f64 s3:smbd:smb2_write: improve logging in the error case 2012-03-03 17:03:06 +01:00
Christian Ambach
a1ac670a8c s3:smb2_server: use SMB2_WATCH_TREE
it makes the code easier to understand if it uses the names specified in MS-SMB2 instead
of just the underlying values
2012-03-02 21:47:10 -08:00
Christian Ambach
8b25bc80c9 s3:smb2_server fix a typo 2012-03-02 21:47:09 -08:00
Volker Lendecke
197c185bc7 s3: Fix some blank line endings
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Mar  3 03:41:03 CET 2012 on sn-devel-104
2012-03-03 03:40:56 +01:00
Brad Smith
8bdc289099 s3: Further fix for bug 8777 2012-03-02 10:30:07 +01:00
Volker Lendecke
dcb1cd2933 s3: Enable statvfs usage on NetBSD
linux_statvfs is pretty much what you use when you have susv4.

No real code change, this moves linux_statvfs to the bottom of the
(LINUX) to #ifdef (STAT_STAVFS).
2012-03-02 10:30:07 +01:00
Jeremy Allison
1c2aacd6da Add open_dir_with_privilege() to ensure we're opening the correct directory when doing backup requests.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar  1 03:50:40 CET 2012 on sn-devel-104
2012-03-01 03:50:40 +01:00
Jeremy Allison
bca3fb3ecc Implement FLAG_TRANS2_FIND_BACKUP_INTENT for trans2 with privileges. 2012-02-29 17:04:46 -08:00
Jeremy Allison
3ddd9916f5 Add accessor functions to set a bool "priv" on a directory handle. Not yet used, but will be part of FLAG_TRANS2_FIND_BACKUP_INTENT code. 2012-02-29 17:04:39 -08:00
Jeremy Allison
89c55485c3 Add the implementation of check_reduced_name_with_privilege(). Now to plumb into
SMB1 requests.
2012-02-29 17:04:08 -08:00
Jeremy Allison
442e79efbd Add check_reduced_name_with_privilege(), filename_convert_with_privilege() (currently unimplemented) in order to prepare for adding SeBackup/SeRestore code to the main fileserver.
Not yet plumbed into the main SMB1/SMB2 code.
2012-02-29 15:57:49 -08:00
Volker Lendecke
de870e979b s3: Introduce "req" helper var in reply_lockingX_success
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Wed Feb 29 03:08:53 CET 2012 on sn-devel-104
2012-02-29 03:08:53 +01:00
Volker Lendecke
adac885881 s3: Fix a const warning 2012-02-29 01:32:54 +01:00
Volker Lendecke
e916778e6e s3: More fix for smbd -i
We need a full re-initialize, otherwise we don't re-init the USR1
signal handler
2012-02-28 23:36:15 +01:00
Jeremy Allison
6081fabe7e Fix problem reported by Tom Lee <tlee2951@gmail.com> - when calculating
the share security mask, take priviliges into account for the connecting
user.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Feb 28 20:21:26 CET 2012 on sn-devel-104
2012-02-28 20:21:26 +01:00
Andrew Tridgell
1da318d97d smbd: detect EOF on stdin in --foreground mode
if EOF is detected on stdin then exit
2012-02-28 12:01:08 +01:00
Stefan Metzmacher
615c41ce12 libcli/smb/smb2_signing: pass down 'protocol' to smb2_signing_[sign|check]_pdu()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Feb 27 14:26:32 CET 2012 on sn-devel-104
2012-02-27 14:26:32 +01:00
Andrew Bartlett
c318c94170 s3-param: Align lp_{max,min}protocol with lib/param names
This adds an alisas to ensure that both our loadparm systems know all
the names.

I would like to move to the 'server ..' name as canonical, and this
will be raised on the list.

Andrew Bartlett
2012-02-27 07:36:05 +01:00
Volker Lendecke
341bd82fbf s3: Fix a typo
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sat Feb 25 11:16:41 CET 2012 on sn-devel-104
2012-02-25 11:16:41 +01:00
Brad Smith
71a6d33432 s3: Fix bug 8777, sys_statvfs() wrapper support for OpenBSD/FreeBSD/DragonFly 2012-02-25 09:42:24 +01:00
Andrew Bartlett
0fbefbcb54 s3-auth rename vuid_serverinfo to session_info
This matches the name used elsewhere in the code.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Feb 25 05:24:19 CET 2012 on sn-devel-104
2012-02-25 05:24:19 +01:00
Jeremy Allison
872fb6a3e0 Move dptr code over to TALLOC.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 25 03:50:24 CET 2012 on sn-devel-104
2012-02-25 03:50:24 +01:00
Jeremy Allison
e54cf15387 Make dptr_path() and dptr_wcard() const. 2012-02-24 17:12:52 -08:00
Jeremy Allison
c9ef087722 Fix const warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Feb 24 23:10:56 CET 2012 on sn-devel-104
2012-02-24 23:10:56 +01:00
Volker Lendecke
61953ab35a s3: Simplify smb_splice_chain
No code change, just remove a {} block left over as the else branch
from the previous commit

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Feb 24 18:07:48 CET 2012 on sn-devel-104
2012-02-24 18:07:48 +01:00
Volker Lendecke
b07ae1ab7b s3: Simplify smb_splice_chain
first_request won't be true anymore, we always splice fully existing
records in smbd
2012-02-24 16:34:42 +01:00
Volker Lendecke
4708b97ce5 s3: Simplify smb_splice_chain
With the last commit, bytes_padding is not set anymore
2012-02-24 16:34:40 +01:00
Volker Lendecke
5b7609db56 s3: Simplify smb_splice_chain
bytes_alignment used to be used in libsmb, which uses different code
now
2012-02-24 16:34:35 +01:00
Volker Lendecke
da322e4f3f s3: Simplify smb_splice_chain
We use it in smbd/process.c only now. This only splices in finished
buffers, both callers used the same arguments. Pull that into the
routine itself.
2012-02-24 16:34:34 +01:00
Volker Lendecke
947a8bc44a s3: Turn some SMB_ASSERTS into proper return
We deal with the error properly further up
2012-02-24 16:34:34 +01:00
Volker Lendecke
28901acd27 s3: Fix a DEBUG msg 2012-02-24 16:34:34 +01:00
Matthias Dieter Wallnöfer
101bd184d1 s3:smbd/utmp.c - fix the build on FreeBSD 9 without utmp.h
https://bugzilla.samba.org/show_bug.cgi?id=8709

Reviewed-by: Jelmer

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Feb 23 19:17:25 CET 2012 on sn-devel-104
2012-02-23 19:17:25 +01:00
Volker Lendecke
f1dc8b28b7 s3: smb_request->vwv can be const
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Thu Feb 23 12:37:23 CET 2012 on sn-devel-104
2012-02-23 12:37:22 +01:00
Volker Lendecke
7906d0b50b s3: Fix smbd -i
We end up in a nested event loop without this.

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Feb 21 17:24:28 CET 2012 on sn-devel-104
2012-02-21 17:24:28 +01:00
Volker Lendecke
c86584adaf s3: Fix typos 2012-02-21 15:43:28 +01:00
Volker Lendecke
7af3dfd3af s3: Remove a pointless else branch
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sun Feb 19 23:14:15 CET 2012 on sn-devel-104
2012-02-19 23:14:15 +01:00
Volker Lendecke
f217faef1a s3: get_share_mode_lock_fresh->get_share_mode_lock
get_share_mode_lock_fresh is just a confusing name

Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Sun Feb 19 19:16:41 CET 2012 on sn-devel-104
2012-02-19 19:16:41 +01:00
Volker Lendecke
e5c8484073 s3: get_share_mode_lock->get_existing_share_mode_lock 2012-02-19 17:44:26 +01:00
Jeremy Allison
21528da9cd Fix a bunch of "unused variable" warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104
2012-02-18 06:22:40 +01:00
Andrew Bartlett
2f74f2f180 s3-auth: Add extra error messages on authentication or authorization failure
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-02-17 10:48:09 +01:00
Jeremy Allison
ed85e9fe6a Replace smbd_server_connection_loop_once() with tevent_loop_once() directly.
We no longer need to call poll() directly inside smbd !

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Feb 17 02:49:13 CET 2012 on sn-devel-104
2012-02-17 02:49:13 +01:00
Andrew Bartlett
367c567c5f lib/util: Remove sys_poll as it is no longer needed
sys_poll() is only needed if the signal pipe is set up and used, but as
no signal handler ever writes to the pipe, this can all be removed.

signal based events are now handled via tevent.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-02-16 15:49:21 -08:00
Andrew Bartlett
eb3e34e965 s3-smbd Remove unused code now we always have SPNEGO via gensec
This was previously needed because SPNEGO was only available in the AD DC.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-02-16 15:18:43 +01:00
Christopher R. Hertel (crh)
b5b204184a Rename obscure defined constants.
Replaced the undescriptive SMB_PORT1 and SMB_PORT2 defined constants
with the slightly more descriptive names NBT_SMB_PORT and TCP_SMB_PORT.
Also replaced several hard-coded references to the well-known port
numbers (139 and 445, respectively) as appropriate.

Small changes to clarify some comments regarding the two transport
types.

Signed-off-by: Simo Sorce <idra@samba.org>

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Thu Feb 16 08:29:41 CET 2012 on sn-devel-104
2012-02-16 08:29:41 +01:00
Andrew Bartlett
3cf091cf68 s3-smbd: Avoid starting log lines with the word 'error' 2012-02-16 15:21:11 +11:00
Volker Lendecke
dd5868d41e s3: Add SERVERID_UNIQUE_ID_NOT_TO_VERIFY, bug 8760
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Feb 15 21:10:22 CET 2012 on sn-devel-104
2012-02-15 21:10:22 +01:00
Volker Lendecke
740d4d7550 s3: files_struct->mode is only written, remove it
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Tue Feb 14 19:14:29 CET 2012 on sn-devel-104
2012-02-14 19:14:29 +01:00
Stefan Metzmacher
389bb4fbe1 s3:smbd/oplock_linux: don't overwrite private_data
We set ctx->private_data = sconn a few lines above
and expect 'sconn' in the signal event handler.

Thanks to Christian Ambach <ambi@samba.org> for the
bug report.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Feb 10 21:48:18 CET 2012 on sn-devel-104
2012-02-10 21:48:18 +01:00
Volker Lendecke
f1db71576a s3-smb2: Use the correct indicator if a request was deferred
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Fri Feb 10 16:44:23 CET 2012 on sn-devel-104
2012-02-10 16:44:23 +01:00
Volker Lendecke
6b87623e9d s3-smb2: Make sure we have a subreq set 2012-02-10 15:06:06 +01:00
Björn Baumbach
5ec12732c3 s3-printing: Add new printers to registry.
This fixes bug #8554, #8612 and #8748.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Feb  9 16:39:04 CET 2012 on sn-devel-104
2012-02-09 16:39:04 +01:00
Jeremy Allison
4452082002 Ensure when setting a POSIX ACL, that the uid for a
SMB_ACL_USER_OBJ ACE (the owner ACE entry) has a duplicate
permission entry as an SMB_ACL_USER, and a gid for a
SMB_ACL_GROUP_OBJ ACE (the primary group ACE entry) also has
a duplicate permission entry as an SMB_ACL_GROUP. If not,
then if the ownership or group ownership of this file or
directory gets changed, the user or group can lose their
access.
2012-02-03 16:37:41 -08:00
Jeremy Allison
6a31e0f4f2 Fix mistaken assignment of gid to uid field. 2012-02-03 15:58:12 -08:00
Jeremy Allison
41152d7157 Replace bool flags inside ensure_canon_entry_valid() with pointers.
This will make the second tweak to the ACL mapping on set easier.
2012-02-03 15:28:22 -08:00
Jeremy Allison
d9b9ad2af2 Replace all malloc/free with talloc on tos. 2012-02-03 14:06:38 -08:00
Michael Adam
6ba09e039e s3:smbd:smb2: fix an assignment-instead-of-check bug conn_snum_used()
Accidential "=" instead of "==".

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Wed Feb  1 17:10:15 CET 2012 on sn-devel-104
2012-02-01 17:10:13 +01:00
Volker Lendecke
92b96ac84b s3: Delete streams on directories 2012-01-31 23:30:09 +01:00
Volker Lendecke
a93cdacd16 s3: Simplify an if-statement
is_ntfs_default_stream_smb_fname already contains all checks that
the variable "stream_name" gives us here.
2012-01-31 23:30:09 +01:00
Stefan Metzmacher
507872f90f s3:smbd: inline code in reply_sesssetup_and_X_spnego()
This makes the logic much easier to follow.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jan 31 21:52:45 CET 2012 on sn-devel-104
2012-01-31 21:52:45 +01:00
Stefan Metzmacher
5f79ad5f87 s3:smbd: the spnego session setup don't need to copy the in blob
metze
2012-01-31 20:17:10 +01:00
Stefan Metzmacher
ec0142dd31 s3:smbd: rework reply_spnego_ntlmssp to reply_spnego_generic
This removes the unused spnego_gen_auth_response() wrapping.

metze
2012-01-31 20:17:10 +01:00
Stefan Metzmacher
ee15790d7a s3:smbd: remove unused code from sesssetup.c
metze
2012-01-31 20:17:10 +01:00
Stefan Metzmacher
63f6567ca9 s3:smbd: remove pending_auth_data logic
This is handled by the gensec_spnego module.

metze
2012-01-31 20:17:10 +01:00
Stefan Metzmacher
8327ee94db s3:smbd: always use the gensec code path in sesssetup.c
The other code pathes are unused, because we always have
the spnego gensec module.

metze
2012-01-31 20:17:10 +01:00