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

6395 Commits

Author SHA1 Message Date
Volker Lendecke
303962e370 s3: Fix smbcontrol smbd idmap kill S-1-5-21-...
The calls to sid_to_gid and sid_to_uid create id mapping entries themselves,
which makes it pretty difficult to reliably delete id mapping entries
everywhere just using a SID.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Sep  5 16:30:41 CEST 2011 on sn-devel-104
2011-09-05 16:30:41 +02:00
Volker Lendecke
76ba67862f s3: Reformat msg_idmap.c to match Samba coding 2011-09-05 14:58:46 +02:00
Stefan Metzmacher
491c975dfe s3:smbd: make use of PROTOCOL_SMB2_02
metze
2011-09-05 13:25:00 +02:00
Stefan Metzmacher
0ed0a66956 libcli/smb: move smb2_signing.c to the toplevel
metze
2011-09-05 13:17:32 +02:00
Jeremy Allison
17f6e02723 Part 5 of bugfix for bug #7509 - smb_acl_to_posix: ACL is invalid for set (Invalid argument)
Be smarter about setting default permissions when a ACL_GROUP_OBJ isn't given. Use the
principle of least surprises for the user.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Sep  3 00:16:05 CEST 2011 on sn-devel-104
2011-09-03 00:16:05 +02:00
Jeremy Allison
2a1453e231 Part 4 of bugfix for bug #7509 - smb_acl_to_posix: ACL is invalid for set (Invalid argument)
Be smarter about setting default permissions when a ACL_USER_OBJ isn't given. Use the
principle of least surprises for the user.
2011-09-02 13:36:10 -07:00
Jeremy Allison
c528fc5cac Part 3 of bugfix for bug #7509 - smb_acl_to_posix: ACL is invalid for set (Invalid argument)
Don't call check_owning_objs() to convert ACL_USER->ACL_USER_OBJ and
AC_GROUP->ACL_GROUP_OBJ for default (directory) ACLs, we do this separately
inside ensure_canon_entry_valid().
2011-09-02 12:22:34 -07:00
Jeremy Allison
a5038ace24 Part 2 of bugfix for bug #7509 - smb_acl_to_posix: ACL is invalid for set (Invalid argument)
Only map CREATOR_OWNER/CREATOR_GROUP to ACL_USER_OBJ/ACL_GROUP_OBJ in
a default(directory) ACL set.
2011-09-02 11:58:56 -07:00
Jeremy Allison
2b935b49f3 Part 1 of bugfix for bug #7509 - smb_acl_to_posix: ACL is invalid for set (Invalid argument)
Remove the code I added for bug "6878 - Cannot change ACL's inherit flag". It is incorrect
and causes the POSIX ACL ACL_USER_OBJ duplication.
2011-09-02 11:21:08 -07:00
Jeremy Allison
786fe9fab2 Fix bug 8429 - Compound SMB2 requests on an IPC connection can corrupt the reply stream.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Aug 31 21:18:11 CEST 2011 on sn-devel-104
2011-08-31 21:18:11 +02:00
Jeremy Allison
726b4685aa Based on metze's fix for Bug 8407 - SMB2 server can return requests out-of-order when processing a compound request. (cherry picked from commit 19db1c98c6ba3cb5e883e16e865c44900ce17444) 2011-08-31 19:49:31 +02:00
Stefan Metzmacher
0d450d166b s3:smb2_server: keep compound_related on struct smbd_smb2_request
metze
(cherry picked from commit cda93f04eb4e7e975b192a5fd33275ec638140ac)
2011-08-31 19:49:31 +02:00
Volker Lendecke
781074664d s3: Fix bug 8334, do not fork the echo handler for smb2
If a smb1 negprot negotiated smb2 we forked the echo responder. This will
eventually lead to a panic from

[2011/08/30 10:33:29.212578,  0, pid=3846917] smbd/smb2_server.c:243(smbd_smb2_request_create)
  Invalid SMB packet: first request: 0x0009

because from the echo responder we always read using the normal smb1 protocol
handling routine. If that is a bit down the smb2 stream, we get a non-negprot
packet and panic.

BTW, the echo responder is not required for smb2 anyway, Microsoft confirmed
that it probes the server liveness using TCP keepalives and not smb2 echo
requests.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Aug 31 17:58:48 CEST 2011 on sn-devel-104
2011-08-31 17:58:48 +02:00
Christian Ambach
b58e7bb88e s3:smb2 fix Bug 8428 - wrong reply to DHnC (durable handle reconnect)
According to [MS-SMB2] 3.3.5.9.7
(http://msdn.microsoft.com/en-us/library/cc246784%28v=PROT.13%29.aspx),
smbd must reply with NT_STATUS_OBJECT_NAME_NOT_FOUND as it does not
support durable file-handles yet.

I have seen w2k8r2 running xcopy /C ending up in an endless loop
trying to get back the original file handle from smbd sending the same
requests over and over.

Metze, Jeremy, please check!

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

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Aug 30 22:20:36 CEST 2011 on sn-devel-104
2011-08-30 22:20:36 +02:00
Jeremy Allison
dec3b21cd1 Fix bug 8412 - Microsoft Office 2007 (Microsoft Word) fails to save as on a Samba share with SMB2. 2011-08-29 16:47:16 -07:00
Michael Adam
316834cf42 s3:smbd: remove an unused variable in dptr_create() 2011-08-25 23:55:06 +02:00
Volker Lendecke
f533b50105 s3: Pass smbd_server_connection to (unused) server_encryption_shutdown 2011-08-25 21:36:19 +02:00
Volker Lendecke
7e70f85350 s3: Pass smbd_server_connection to srv_encrypt_buffer 2011-08-25 21:36:19 +02:00
Volker Lendecke
d4c4705e55 s3: Pass smbd_server_connection to srv_decrypt_buffer 2011-08-25 21:36:19 +02:00
Volker Lendecke
08262fe964 s3: Pass smbd_server_connection to srv_free_enc_buffer 2011-08-25 21:36:19 +02:00
Volker Lendecke
f9ef138ec7 s3: Pass smbd_server_connection to is_encrypted_packet 2011-08-25 21:36:19 +02:00
Volker Lendecke
b4b9918cc8 s3: Pass sconn to valid_smb_header 2011-08-25 21:36:19 +02:00
Volker Lendecke
4cb6e1284c s3: Explicitly pass smb_srv_trans_enc_ctx to srv_enc_ctx 2011-08-25 21:36:18 +02:00
Andreas Schneider
61ada700a6 s3-id_cache: Use better names for id cache management ops
The IDMAP term is normally associated with Winbind's idmap stuff.
These functions deal with id caching not id mapping.

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andreas Schneider
177db0a880 s3-id_cache: Move id caches mgmt out of smbd
We must leave the MSG_IDMAP_KILL operation in SMBD as it uses smbd
specific internal globals and makes sense only in the context of a smbd
daemon.
The rest is moved under lib/ as we need to deal with id cache cleanups
in other daemons too (like lsasd).

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Simo Sorce
23e7e1c158 s3-rpc_server: Replace RPC_SERVICE_MODE_DAEMON checks
Use rpc_daemon_type() macros where appropriate instead.

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:03 -04:00
Andreas Schneider
7b715f15b1 s3-smbd: Start lsasd as deamon.
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:05:02 -04:00
Jeremy Allison
a6d06c0697 Fix bug #8370 - vfs_chown_fsp broken -- returns in the wrong directory
Ensure we always use vfs_ChDir() to keep the singleton cache coherent.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Aug 19 00:43:05 CEST 2011 on sn-devel-104
2011-08-19 00:43:04 +02:00
Volker Lendecke
1022c28e15 s3: Fix bug 8360
OS/2 sends an unexpected write&x/read&x chain

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Aug 14 08:48:58 CEST 2011 on sn-devel-104
2011-08-14 08:48:58 +02:00
Andrew Bartlett
daa78ead19 s3-smbd Avoid races creating 'ncaclrpc dir' with epmd in a child process 2011-08-13 20:18:41 +10:00
Stefan Metzmacher
42cde0480b s3:smb2_server: make sure we prefer responses over requests on the client socket
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Aug 12 16:46:43 CEST 2011 on sn-devel-104
2011-08-12 16:46:43 +02:00
Volker Lendecke
38fb4df694 s3: Adapt msg_idmap.c to Samba coding conventions 2011-08-10 19:56:09 +02:00
Volker Lendecke
223fbc9c62 s3: Fix some nonempty blank lines 2011-08-10 19:56:09 +02:00
Simo Sorce
c3cfa6be47 s3-printing: Do not try to force reload.
Be more correct in load printers at startup.
If async process have already started we do not need to force a reload, but we
just need to load the printers. If other process have not finished initializing
it makes no sense to try to force them as they are masking SIGHUP unitl init is
done anyway.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:06 +02:00
Simo Sorce
0de09289ae s3-printing: Force pcap reload when all ready
This way we are sure the cache is primed properly and messages can be sent to
processes if necessary as all messaging has been set up.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:05 +02:00
Simo Sorce
d36a8dc896 s3:spoolssd Start spoolssd from printing_subsystem_init
Use a child for the background updater process
Forward printer update messages from spoolss to background update process.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
9ce6416673 s3-printing: Rework how the background process is started
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:04 +02:00
Simo Sorce
05455b459a lib-util: Make useful function a common utility.
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Andreas Schneider
dd3a927959 s3-smbd: Pass tevent context to smbd_server_connection_loop_once().
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-09 10:41:47 +02:00
Stefan Metzmacher
47bffb9b92 s3:smb2_server: make sure we grant credits on async read/write operations (bug #8357)
Currently we skip, the "gone async" interim response on read and write,
this caused the aio code path to grant 0 credits to the client
in the read/write responses.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sun Aug  7 22:23:57 CEST 2011 on sn-devel-104
2011-08-07 22:23:57 +02:00
Volker Lendecke
dfa8a5fca5 s3: Make srv_enc_ctx static
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Aug  5 18:29:24 CEST 2011 on sn-devel-104
2011-08-05 18:29:24 +02:00
Volker Lendecke
3b5e7c55d8 s3: Fix a debug message 2011-08-05 17:12:07 +02:00
Volker Lendecke
eb2d3961d8 s3: Fix some nonempty blank lines 2011-08-05 17:12:06 +02:00
Andrew Bartlett
fec25c3a62 ntlmssp: Add ntlmssp_blob_matches_magic()
This avoids having the same check in 3 different parts of the code

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Aug  3 12:45:04 CEST 2011 on sn-devel-104
2011-08-03 12:45:04 +02:00
Andrew Bartlett
8fca9741fe s3-auth rename auth_ntlmssp_steal_session_info()
There is no longer any theft of memory as the underlying routines now
produce a new auth_session_info for this caller, allocating it
on the supplied memory context.

Andrew Bartlett
2011-08-03 18:48:05 +10:00
Andrew Bartlett
b0dd2cde86 s3-smbd Be consistent with %U subs on guest logins
The NTLMSSP code always specified "" as the username, and this makes
guest logins via the old-style session setup do the same.

Andrew Bartlett
2011-08-03 18:48:05 +10:00
Andrew Bartlett
d3524f2eae s3-auth use auth_generic_start to get full GENSEC in Samba3 session setup
This tests if the auth_generic_start() hook is available on the auth
context during the negprot, and if so it uses auth_generic_start() to
hook to GENSEC to handle the full SPNEGO blob.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Andrew Bartlett
23bbf4e758 s3-smbd clarify behaviour by not passing an OID that will not be used
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Andrew Bartlett
36112a442f s3-smbd Ensure we do not read past the end of a possible NTLMSSP blob
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Andrew Bartlett
9a45bf3952 s3-auth set session_info->sanitized_username in create_local_token()
Rather than passing this value around the callers, and eventually
setting it in register_existing_vuid(), we simply pass it to
create_local_token().  This also removes the need for
auth_ntlmssp_get_username().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Andrew Bartlett
8b983d2326 s3-ntlmssp Split auth_ntlmssp_start into two functions
This helps map on to the GENSEC semantics better, and ensures that the
full set of desired features are set before the mechanism starts.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:04 +10:00
Andrew Bartlett
778bf87d8d s3-ntlmssp Remove calls to auth_ntlmssp_and_flags from the server
This is changed so that the callers ask for the additional flags
that they need, starting with no additional flags.

This helps to create a proper abstraction layer in
ntlmssp_wrap/auth_ntlmssp.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
6d7ac4f1ad s3-ntlmssp Add mem_ctx argument to auth_ntlmssp_update
This clarifies the lifetime of the returned token.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:03 +10:00
Andrew Bartlett
a942401c1f s3-ntlmssp Use auth_ntlmssp_*() functions in more places
This allows auth_ntlmssp_get_ntlmssp_state() to be removed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:02 +10:00
Andrew Bartlett
8a650243b3 s3-auth Move map to guest to directly after the check_password calls
This means we no longer need two different map to guest functions
and have consistent logic with fewer layering violations.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-08-03 18:48:02 +10:00
Jeremy Allison
785c65e875 We don't need check_name() here. All possible paths to dptr_create()
have already called check_name.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Aug  3 03:00:55 CEST 2011 on sn-devel-104
2011-08-03 03:00:55 +02:00
Volker Lendecke
5068a0d14d s3: Fix smb2 handling error returns from aio
Found when reading with aio_fork beyond the end of file.

Metze, Jeremy, please check!

Without this we get

[2011/08/02 21:02:54.082661,  0] lib/util.c:778(smb_panic_s3)
  PANIC (pid 2302): smbd/smb2_read.c:593: Type mismatch: name[NULL] expected[struct smbd_smb2_read_state]
[2011/08/02 21:02:54.094316,  0] lib/util.c:882(log_stack_trace)
  BACKTRACE: 23 stack frames:
   #0 bin/smbd(log_stack_trace+0x2d) [0xb72873d8]
   #1 bin/smbd(smb_panic_s3+0x7c) [0xb7287529]
   #2 bin/smbd(smb_panic+0x2f) [0xb7277e1f]
   #3 /root/git/s3-work/source3/bin/libtalloc.so.2 [0xb6c6bc48]
   #4 /root/git/s3-work/source3/bin/libtalloc.so.2 [0xb6c6ec79]
   #5 /root/git/s3-work/source3/bin/libtalloc.so.2(_talloc_get_type_abort+0x34) [0xb6c6ecb3]
   #6 bin/smbd [0xb6fbc405]
   #7 bin/smbd(_tevent_req_notify_callback+0x4a) [0xb729a85a]
   #8 bin/smbd [0xb729a888]
   #9 bin/smbd(_tevent_req_done+0x19) [0xb729aa73]
   #10 bin/smbd [0xb6fae517]
   #11 bin/smbd [0xb6fad258]
   #12 bin/smbd(smbd_aio_complete_aio_ex+0xf5) [0xb6fad6e8]
   #13 /root/git/inst/modules/vfs/aio_fork.so [0xb66d4992]
   #14 bin/smbd(run_events_poll+0x400) [0xb7297df2]
   #15 bin/smbd(smbd_process+0xd75) [0xb6f9d3a7]
   #16 bin/smbd [0xb756f07b]
   #17 bin/smbd(run_events_poll+0x400) [0xb7297df2]
   #18 bin/smbd [0xb7298254]
   #19 bin/smbd(_tevent_loop_once+0x9e) [0xb72986ac]
   #20 bin/smbd(main+0x185c) [0xb7570e59]
   #21 /lib/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb6b08455]
   #22 bin/smbd [0xb6f14e01]

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Aug  2 22:33:15 CEST 2011 on sn-devel-104
2011-08-02 22:33:15 +02:00
Volker Lendecke
d20e968cff s3: Move deferred_open_queue to smbd_server_connection 2011-08-02 19:18:09 +02:00
Volker Lendecke
cb69d105f5 s3: Pass sconn explicitly to get_deferred_open_message_smb 2011-08-02 19:18:08 +02:00
Volker Lendecke
f9d183f931 s3: Pass sconn explicitly to open_was_deferred 2011-08-02 19:18:08 +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
04253dfd9f s3: Explicitly pass sconn to remove_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
Simo Sorce
a68f16cb56 s3:server Consolidate printing related initialization
Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Aug  2 17:37:44 CEST 2011 on sn-devel-104
2011-08-02 17:37:44 +02:00
Simo Sorce
2e8a85ec72 s3:smbd - Move printing queue stuff
This way we can properly deal with pcap updates in the background queue process
if it is enabled (on by default) and not perform these actions in the main
smbd process.

Signed-off-by: Günther Deschner <gd@samba.org>
2011-08-02 15:28:03 +02:00
Andreas Schneider
aca4dbe000 s3-rpc_server: Use rpc_spoolss_mode(). 2011-08-01 11:08:37 +02:00
Andreas Schneider
d189d2bf32 s3-rpc_server: Use rpc_epmapper_mode().
Remove embedded mode cause this will not work. It was only there for
testing.
2011-08-01 11:08:36 +02:00
Andreas Schneider
d597bf4dad s3-rpc_server: Rename to rpc service setup. 2011-08-01 08:50:34 +02:00
Jeremy Allison
1d4d9194ab Secod part of bugfix for bug #8335 - file copy aborts with smb2_validate_message_id: bad message_id
Modify the credit granting algorithm to closer to what I believe
Windows does.

Split up max_credits into 1/16ths, and then scale
the requested credits by how many 16ths have been
currently granted. Less than 1/16th == grant all
requested (100%), scale down as more have been
granted. Never ask for less than 1 if the client
asked for at least 1.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul 29 20:37:42 CEST 2011 on sn-devel-104
2011-07-29 20:37:42 +02:00
Volker Lendecke
190b5432f0 s3: Make map_open_params_to_ntcreate() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
0102c6e2bc s3: Make is_executable() available in lib/ 2011-07-29 16:43:17 +02:00
Volker Lendecke
6d67d41444 s3: We only need base_name in map_open_params_to_ntcreate 2011-07-29 16:43:17 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Michael Adam
1abdd9b2bb s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and
make the fallbacke implementation functoins non-static and create a
dbwrap_private.h header file that contains their prototypes.
2011-07-29 12:23:13 +02:00
Volker Lendecke
5812645f49 s3: Priorize the async echo responder over the client
Without this, an active client connection can starve the echo responder. This
leads to apparently "lost" SMBs.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Jul 28 18:53:38 CEST 2011 on sn-devel-104
2011-07-28 18:53:38 +02:00
Volker Lendecke
4dd0a3b5e2 s3: Remove unused smbd_echo_reader() 2011-07-28 17:42:23 +02:00
Volker Lendecke
710e5d9256 s3: Use smbd_echo_read_send in the async echo handler 2011-07-28 17:42:23 +02:00
Volker Lendecke
27afb8910f s3: Add smbd_echo_read_send/recv
Read a SMB packet in the echo responder, giving the parent one second to step
in
2011-07-28 17:42:23 +02:00
Jeremy Allison
d82256ca11 Use existing ISDOT and ISDOTDOT macros.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jul 28 02:09:20 CEST 2011 on sn-devel-104
2011-07-28 02:09:20 +02:00
Simo Sorce
759a04e58a s3-rpc_server: Move pipe/handles functions
Put InternalPipes related functions in rpc_handles.c and out of rpc_ncacn_np.c
rpc_handles.c is the only file that really uses them after all and ncacn_np.c
is the wrong place for that stuff.
While ther remove unnecessary wrapper functions now that the InternalPipes
static variable is directly accessible.

Also move all pipes_struct related header stuff in its own rpc_pipes.h header.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-07-21 18:40:23 +02:00
Andrew Bartlett
6622821063 s3-auth Remove seperate guest boolean
Instead, we base our guest calculations on the presence or absense of the
authenticated users group in the token, ensuring that we have only
one canonical source of this important piece of authorization data

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:14 +10:00
Andrew Bartlett
9fcc617ff5 s3-auth Use the common auth_session_info
This patch finally has the same structure being used to describe the
authorization data of a user across the whole codebase.

This will allow of our session handling to be accomplished with common code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
128ae06a61 s3-auth use auth_user_info not netr_SamInfo3 in auth3_session_info
This makes auth3_session_info identical to auth_session_info

The logic to convert the info3 to a struct auth_user_info is
essentially moved up the stack from the named pipe proxy in
source3/rpc_server to create_local_token().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
e2049e77e4 s3-auth Use guest boolean in auth_user_info_unix
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10: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
6d741e918f s3-auth Use *unix_token rather than utok in struct auth3_session_info
This brings this structure one step closer to the struct auth_session_info.

A few SMB_ASSERT calls are added in some key places to ensure that
this pointer is initialised, to make tracing any bugs here easier in
future.

NOTE: Many of the users of this structure should be reviewed, as unix
and NT access checks are mixed in a way that should just be done using
the NT ACL.  This patch has not changed this behaviour however.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
f16d8f4eb8 s3-auth Use struct auth3_session_info outside the auth subsystem
This seperation between the structure used inside the auth modules and
in the wider codebase allows for a gradual migration from struct
auth_serversupplied_info -> struct auth_session_info (from auth.idl)

The idea here is that we keep a clear seperation between the structure
before and after the local groups, local user lookup and the session
key modifications have been processed, as the lack of this seperation
has caused issues in the past.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
485898458a debug: log early messages to stdout, and keep it open
The --log-stdout option was compromised by the log file descriptors being
closed once the file process forked.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:09 +10:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
Remove
int toupper_ascii(int c);
int tolower_ascii(int c);
int isupper_ascii(int c);
int islower_ascii(int c);

and replace with their _m equivalents, as they are identical.
2011-07-19 13:19:29 -07:00
Andreas Schneider
8b085c02eb s3-smbd: Pass event and messaging context to smbd_parent_housekeeping(). 2011-07-14 16:10:47 +02:00
Andreas Schneider
68520ec02c s3-smbd: Pass ev_ctx to remove_child_pid(). 2011-07-14 16:10:47 +02:00
Andreas Schneider
7da54eab64 s3-smbd: Pass msg_ctx to smbd_accept_connection. 2011-07-14 16:10:47 +02:00
Andreas Schneider
fa1bba26aa s3-smbd: Pass ev_ctx to smbd_setup_sig_chld_handler(). 2011-07-14 16:10:47 +02:00
Andreas Schneider
55a025e041 s3-smbd: Pass ev_ctx and msg_ctx to smbd_accept_connection(). 2011-07-14 16:10:46 +02:00
Andreas Schneider
0b8f8f18fb s3-smbd: Pass ev_ctx and msg_ctx to open_sockets_smbd(). 2011-07-14 16:10:46 +02:00
Andreas Schneider
a3dc8f71d2 s3-smbd: Pass ev_ctx to smbd_parent_loop(). 2011-07-14 16:10:46 +02:00
Andreas Schneider
4c446c0297 s3-smbd: Create ev_ctx and msg_ctx and use it. 2011-07-14 16:10:45 +02:00
Stefan Metzmacher
0633c0f600 s3:smbd: s/SMBkeepalive/NBSSkeepalive
metze
2011-07-12 09:44:04 +02:00
Stefan Metzmacher
aca920b27c s3:smbd: use PROTOCOL_SMB2_02 instead PROTOCOL_SMB2
metze
2011-07-12 08:18:00 +02:00
Stefan Metzmacher
f5d320ac0f s3:smb2_create: use smbd_calculate_access_mask() instead of smbd_check_open_rights()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jul 11 22:45:01 CEST 2011 on sn-devel-104
2011-07-11 22:45:01 +02:00
Stefan Metzmacher
a1046389ff s3:smb2_tcon: return the correct maximal_access on the share
metze
2011-07-11 21:33:29 +02:00
Stefan Metzmacher
58eed1b295 s3:smbd: return the real share access mask in the SMBtconX response
metze
2011-07-11 21:33:29 +02:00
Stefan Metzmacher
581d8fa36b s3:smbd: use smbd_calculate_access_mask() also for fake_files
metze
2011-07-11 21:33:29 +02:00
Stefan Metzmacher
896f105ed4 s3:smbd: check the share level access mask in smbd_calculate_access_mask()
I think we should reject invalid access early,
before we might create new files.

Also smbd_check_open_rights() is only called if the file existed.

metze
2011-07-11 21:33:20 +02:00
Stefan Metzmacher
ce66d4e4a8 s3:smbd: make smbd_calculate_access_mask() non-static
metze
2011-07-11 21:23:08 +02:00
Stefan Metzmacher
18f967a248 s3:smbd/msdfs: let create_conn_struct() check the share security descriptor
metze
2011-07-11 21:23:08 +02:00
Jeremy Allison
fe3992541d Move smbd_smb2_request_check_tcon() smbd_smb2_request_check_session() next to their only user and make them static. Add comments.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul  8 21:01:40 CEST 2011 on sn-devel-104
2011-07-08 21:01:40 +02:00
Stefan Metzmacher
dbfb88aef3 s3:smb2_server: add some comments about change_to_user() and change_to_root_user()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jul  8 13:45:46 CEST 2011 on sn-devel-104
2011-07-08 13:45:46 +02:00
Andrew Bartlett
cda8686940 lib/param: Merge struct loadparm_service into common
This is handled by a common header and a .c file that is included into
both loadparm.c files.

In the process, _lp functions were renamed to lp__ to allow the common
function definition declarations to be used by source3 and source4
(which have different macro definitions).

The only parameter to change type is 'strict_locking' which was a
bool, and is now an int, to accommodate the 'Auto' value from source3.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Jul  8 12:35:56 CEST 2011 on sn-devel-104
2011-07-08 12:35:56 +02:00
Andrew Bartlett
6e6aaacedb lib/util Move bitmap.c to lib/util 2011-07-08 11:23:23 +02:00
Jeremy Allison
8dc7029561 Fix bug #8293 - SMB2 doesn't rotate the log files often enough.
Move the num_requests field out of the smb1 struct into the generic
struct smbd_server_connection struct. Use it to count SMB2 requests
as well as SMB1 and ensure that check_log_size() is called every 50
SMB2 requests.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul  8 01:14:53 CEST 2011 on sn-devel-104
2011-07-08 01:14:53 +02:00
Stefan Metzmacher
eea210eba7 s3:smb2_server: call change_to_root_user() or smbd_smb2_request_check_tcon()
For all requests which don't operate on a tcon, we should call
change_to_root_user(), to match the SMB1 behavior.

For SMB1 we do the following operations without AS_USER:

/* 0x70 */ { "SMBtcon",reply_tcon,0},
/* 0x71 */ { "SMBtdis",reply_tdis,DO_CHDIR},
/* 0x72 */ { "SMBnegprot",reply_negprot,0},
/* 0x73 */ { "SMBsesssetupX",reply_sesssetup_and_X,0},
/* 0x74 */ { "SMBulogoffX",reply_ulogoffX, 0}, /* ulogoff doesn't give a valid TID */
/* 0x75 */ { "SMBtconX",reply_tcon_and_X,0},
...
/* 0x2b */ { "SMBecho",reply_echo,0},
...
/* 0xa4 */ { "SMBntcancel",reply_ntcancel, 0 },

For SMB2tdis we still call smbd_smb2_request_check_tcon()
as close_cnum() calls change_to_root_user() when needed.

metze

Signed-off-by: Jeremy Allison <jra@samba.org>
2011-07-07 14:17:17 -07:00
Christian Ambach
9a3e2d1c02 s3:smbd fix a compile warning on AIX 5.3
use the correct alias instead of FD directly

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Tue Jul  5 19:51:42 CEST 2011 on sn-devel-104
2011-07-05 19:51:42 +02:00
Volker Lendecke
4deca5d728 s3: Fix bug 8102
We can't allow open with access that has been denied via the share
security descriptor

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jul  5 16:21:54 CEST 2011 on sn-devel-104
2011-07-05 16:21:53 +02:00
Volker Lendecke
720fa46f94 s3: Calculate&store the maximum share access mask
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-05 13:28:08 +02:00
Volker Lendecke
1c022d2e41 s3: Return "granted" from share_access_check
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-07-05 13:28:03 +02:00
Christian Ambach
ad4a10dd05 s3:smb2 fix smbd crash on premature end of smb2 conn (Bug 8286)
when smbd tries to clean up locks after a premature end of a smb2
connection, lock_db has already been freed and so it crashes

this patch changes the order in which items are freed so that
lock_db is still around when it is needed

Jeremy, Metze, please check

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Mon Jul  4 20:00:26 CEST 2011 on sn-devel-104
2011-07-04 20:00:26 +02:00
Stefan Metzmacher
7c96e96e98 s3:smb2_server: there's no reason to check the session id twice on a smb2_tcon request
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jul  4 17:34:13 CEST 2011 on sn-devel-104
2011-07-04 17:34:13 +02:00
Stefan Metzmacher
601b138e92 s3:smb2_create: call 'return' after smbd_server_connection_terminate()
This is not strictly needed in the fork process model, but we hopefully
support other models in future.

metze
2011-07-04 16:21:45 +02:00
Andrew Bartlett
c599d075cb s3-lib Move event_add_idle() to source3/lib/events.c
This allows libauth not to depend on smbd_base.

Andrew Bartlett
2011-07-04 18:53:59 +10:00
Andreas Schneider
aee04ef330 s3-smbd: Remove client_address from smbd_server_connection struct.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:40 +10:00
Andreas Schneider
b2511a280a s3-smbd: Remove obsolete smbd_set_server_fd().
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:36 +10:00
Andreas Schneider
2f92ffb1a4 s3-smbd: Replace client_id in smbd session setup.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:30 +10:00
Andreas Schneider
ea2917c7a2 s3-smbd: Replace client_id in smbd session.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:28 +10:00
Andreas Schneider
73d28912a4 s3-smbd: Replace client_id in smbd service.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:26 +10:00
Andreas Schneider
ae05a7aec6 s3-smbd: Replace client_id in smbd reply.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:24 +10:00
Andreas Schneider
ad0f765a09 s3-smbd: Exit cleanly if we can't create an address string.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:21 +10:00
Andreas Schneider
d99acd26a2 s3-smbd: Replace client_id in smbd connection.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:18 +10:00
Andreas Schneider
a513086c2a s3-smbd: Replace client_id in smbd process.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:16 +10:00
Andreas Schneider
7e46a84bb7 s3-auth: Pass the remote_address down to user_info.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:02 +10:00
Andreas Schneider
45f70db010 s3-auth: Added remote_address to ntlmssp server.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:00 +10:00
Andreas Schneider
541f3cf639 s3-rpc_server: Migrate rpc function to tsocket_address.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:27:58 +10:00
Christian Ambach
847ca0a5d7 s3:smbd do not panic when CTDB is unhealthy (Bug #8278)
when CTDB is unhealthy, log a message and exit cleanly
instead of creating a core file

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Thu Jun 30 13:18:12 CEST 2011 on sn-devel-104
2011-06-30 13:18:12 +02:00
Jeremy Allison
5882c75d40 Second part of fix for bug #8219 - SMB Panic from Windows 7 Client.
Pass in the correct vector to the signing algorithm in an async
response - we must start with vector[1] which has the SMB2_HDR_BODY
length, not vector[0] which is the 4 byte packet length. Also
note we're passing in 2 vectors not 3.

Metze please review.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun 29 20:09:21 CEST 2011 on sn-devel-104
2011-06-29 20:09:21 +02:00
Andrew Bartlett
489f528857 param: Merge param headers into lib/param/loadparm.h
This defines a common table format, so we can in future define a
common table.

Andrew Bartlett
2011-06-29 15:44:09 +10:00
Jeremy Allison
1fffddb238 Fix bug #8219 - SMB Panic from Windows 7 Client
Caused by referencing an uninitialized variable in the
duplicated struct smbd_smb2_request when sending a signed
intermediate reply.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun 29 04:37:28 CEST 2011 on sn-devel-104
2011-06-29 04:37:28 +02:00
Andrew Bartlett
ecc0177f2c s3-smbd Remove set but unused variables
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Jun 28 10:43:26 CEST 2011 on sn-devel-104
2011-06-28 10:43:26 +02:00
Stefan Metzmacher
2bb325ad91 s3:smb2_ioctl/FSCTL_PIPE_TRANSCEIVE: generate STATUS_BUFFER_OVERFLOW if needed (bug #8260)
This should fix DCERPC responses with fragments larger than 1024 bytes.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Jun 24 11:25:36 CEST 2011 on sn-devel-104
2011-06-24 11:25:36 +02:00
Jeremy Allison
5d7d52ceea Fix bug #8254 - "acl check permissions = no" does not work in all cases
Move lp_acl_check_permissions() into can_delete_file_in_directory()
where it makes sense. Remove ACL check when requesting DELETE_ACCESS
when lp_acl_check_permissions is false.

Thanks to John Janosik @ IBM for noticing this.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jun 24 01:18:11 CEST 2011 on sn-devel-104
2011-06-24 01:18:11 +02:00
Andrew Bartlett
734e1b6812 s3-param Remove 'announce version' parameter
The only users I can find of this on the internet involve confused
users, and our own documentation recommends never setting this.  Don't
confuse our users any longer.

Andrew Bartlett
2011-06-23 13:47:27 +02:00
Andrew Bartlett
b373d0e777 s3-build: Provide a run-time shim to work around duplicate symbols
The become_root() and similar 'smbd' functions that are used widely in
Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c.

These have been replaced by a runtime plugin mechanim, which ensures
that standlone binaries still do nothing, while in smbd the correct
function is used.

This avoids having these as duplicate symbols in the smbd binary,
which can cause unpredictable behaviour.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:51 +10:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
a4993f647c ldb: replace 'struct TDB_DATA' with 'TDB_DATA'
The typedef is TDB2 compatible, the struct isn't.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
5a7874e119 tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for < 0 instead of == -1.

Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Rusty Russell
eb8cb4f548 source3/smdb/files.c: file_name_hash to use Jenkins hash from CCAN.
Rather than tdb's internal one.
2011-06-20 11:18:34 +02:00
Volker Lendecke
5290faca7a s3: Fix Coverity ID 2582: FORWARD_NULL
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Jun 19 20:46:43 CEST 2011 on sn-devel-104
2011-06-19 20:46:43 +02:00
Volker Lendecke
df6b877cc2 s3: Fix connecting to ctdb as non-root
This is at least one instance which I could identify

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jun 14 19:06:39 CEST 2011 on sn-devel-104
2011-06-14 19:06:39 +02:00
Volker Lendecke
2817eed741 s3: Fix count_current_connections
"False" is not really a valid return value for "int"..
2011-06-14 17:55:30 +02:00
Stefan Metzmacher
8096b1a9a4 s3:smbd/quotas: add #include "system/filesys.h" (bug #8224)
This should fix the build on FreeBSD

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jun 14 09:38:49 CEST 2011 on sn-devel-104
2011-06-14 09:38:49 +02:00
Andrew Bartlett
74eed8f3ed s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
16b1c77644 lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
8d4a8389bb s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()
Using the standard macro makes it easier to move code into common, as
TALLOC_MEMDUP isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
5e26e94092 s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
d5e6a47f06 s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Jeremy Allison
19213b83d6 Ensure when creating a directory, if we make any changes due to inheritance parameters, we update the stat returned.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Jun  9 00:46:39 CEST 2011 on sn-devel-104
2011-06-09 00:46:38 +02:00
Jeremy Allison
c6bc1eeb7b Part 4 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
We don't need to check mode bits as well as dev/ino to
ensure we're in the same place.
2011-06-08 14:26:02 -07:00
Jeremy Allison
5fb27814ad Part 3 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
When changing ownership on a new file make sure we
must have a valid stat struct before making the inheritance
calls (as they may look at it), and if we make changes we
must have a valid stat struct after them.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun  8 03:07:04 CEST 2011 on sn-devel-104
2011-06-08 03:07:04 +02:00
Jeremy Allison
40c54a736d Part 2 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
When changing ownership on a new file make sure we
also change the returned stat struct to have the correct uid.
2011-06-07 16:48:14 -07:00
Jeremy Allison
cabed2fb17 Part 1 of bugfix for #8211 - "inherit owner = yes" doesn't interact correctly with "inherit permissions = yes" and POSIX ACLs
When changing ownership on a new directory make sure we
also change the returned stat struct to have the correct uid.
2011-06-07 16:42:02 -07:00
Andrew Bartlett
de46ad9084 lib/util use modules_path(), data_path() and shlib_ext() from source3
This brings these helpful utility functions in common, as they are not
based on either loadparm system.

(The 'modules dir' parameter from Samba4 will shortly be removed, so
there is no loss in functionality)

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Jeremy Allison
06fb258500 release_ip() is only used with CLUSTER_SUPPORT. 2011-06-01 23:53:07 +02:00
Jeremy Allison
febde0de54 Move fd_close on error path to be identical to all other error paths.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun  1 22:30:03 CEST 2011 on sn-devel-104
2011-06-01 22:30:03 +02:00
Jeremy Allison
61e8c5949a TALLOC_FREE already checks for null. 2011-06-01 12:12:26 -07:00
Jeremy Allison
5a2b5b6cfe Fix bug #8175 - smbd deadlock.
Force the open operation (which is the expensive one anyway) to
acquire and release locks in a way compatible with the more common
do_lock check.

Jeremy.
2011-06-01 12:11:53 -07:00
Rusty Russell
0204ae6229 lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Rusty Russell
56e72337b0 lib/util/time.c: timeval_current_ofs_msec
Several places want "milliseconds from current time", and several were
simply doing "msec * 1000" which can (and does in one place) result in
a usec value over 1 a million.

Using a helper to do this is safer and more readable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Andrew Bartlett
7630e73dac s3-param prepare for some lp_ functions to return const 2011-06-01 04:19:05 +02:00
Jeremy Allison
c7d2f6d35a Remove the char * argument from the SMB_VFS_GETWD() call. Now always
returns malloc'ed memory.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Jun  1 04:06:12 CEST 2011 on sn-devel-104
2011-06-01 04:06:12 +02:00
Volker Lendecke
d77854fbb2 struct make "struct shadow_copy_data" its own talloc context 2011-05-31 21:47:07 +02:00
Volker Lendecke
0ec9a90c29 s3: Remove SHADOW_COPY_DATA typedef 2011-05-31 21:47:07 +02:00
Volker Lendecke
0fcafbf69b s3: Support shadow copy display over SMB2
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue May 31 12:53:10 CEST 2011 on sn-devel-104
2011-05-31 12:53:10 +02:00
Andrew Bartlett
38fee2b521 s3-smbd Fix conn_msg.c: Cannot return in a void function 2011-05-31 02:57:19 +02:00
Michael Adam
2e6f8f7bda s3:smbd/proto.h: add _SMBD_PROTO_H_ guard 2011-05-31 01:44:27 +02:00
Michael Adam
e1bad49f3e s3:smbd/proto.h: add GPL/Copyright header 2011-05-31 01:44:27 +02: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
Andrew Bartlett
33e8126c3c s3-param split service.c into param and smbd components
The dependency chain of find_service can't be satisfied sensibly
outside smbd, so don't include this in the main 'param' subsystem.

Also remove the duplicate find_service() and conn_snum_used() from
dummysmbd.c: The WAF build does not need these dummies any more, but
file.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
ade01f083c s3-smbd Split conn.c into 3 files
The idea with this split is to make it easier to handle dependencies,
avoiding having the loadparm code depend on the global server
variables, without resorting to dummy functions and linker tricks.

conn_clear_vuid_cache() is brought in from uid.c to make it static

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Andrew Bartlett
8524924a46 s3-smbd provide struct smbd_server_connection * to conn_snum_used
This provides the 'sconn' parameter to this key functions, that
is currently duplicated in dummysmbd.c, which causes duplicate symbol
issues in the waf build.

This has natrually caused a number of consequential changes across the
codebase, includning not passing a messaging context into initial
reload_services():

This causes problems because the global smbd_server_connection isn't
yet set up, as there isn't a connection here, just the initial
process.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Volker Lendecke
c981d4fa12 s3: Safely mark our sconn as smb2 if we have that protocol
Otherwise smbd will crash at an unclean exit. Without this conn_close_all will
do a close_cnum() on all connection_struct's. In smb2, those are talloc
children of the smbd_smb2_tcon's. sconn is talloc_free'ed after the
conn_close_all, but the smbd_smb2_tcon destructor will still reference
tcon->compat_conn, referencing then free'ed (and null'ed out) memory.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon May 30 22:49:53 CEST 2011 on sn-devel-104
2011-05-30 22:49:53 +02:00
Volker Lendecke
bcc08dcc52 s3: Add ioctl code to smbd_smb2_ioctl_send debug
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon May 30 12:47:27 CEST 2011 on sn-devel-104
2011-05-30 12:47:27 +02:00
Volker Lendecke
87e99150d0 s3: Reply correctly to a bad nbt session request 2011-05-29 21:10:26 +02:00
Jeremy Allison
e05c9cdcb6 Fix bug #6911 - Kerberos authentication from vista to samba fails when security blob size is greater than 16 kB
We were not correctly checking the output of asn1_start_tag().
asn1_start_tag() returns -1 and sets data->has_error if the
remaining blob size is too short to contain the tag length.
We were checking data->has_error and returning NT_STATUS_OK
(to allow the second asn.1 parse to fail in that case). We
should not be checking data->has_error in this case, but
falling through to the code that already checks the length.

Thanks to Jim for reproducing this for me. We don't get bitten
by this as we announce a max buffer size of 16k, greater than
Windows's 4k, which means that most krb5 spnego packets already
fit.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri May 27 02:57:27 CEST 2011 on sn-devel-104
2011-05-27 02:57:27 +02:00
Jeremy Allison
95a55e2fea Fix bug 8133 - strange behavior for the file (whose filename first character is period ) in SMB2 case.
When doing SMB2 renames, we need to match all filetypes (no attributes field in the SMB2 call).
By default a file starting with a period is returned as FILE_ATTRIBUTE_HIDDEN in Samba.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri May 20 19:26:04 CEST 2011 on sn-devel-104
2011-05-20 19:26:03 +02:00
Jeremy Allison
38c77db989 Optimization. If the attributes passed to can_rename() include both FILE_ATTRIBUTE_HIDDEN and FILE_ATTRIBUTE_SYSTEM then there's no point in reading the source DOS attribute, as we're not going to deny the rename on attribute match. 2011-05-20 09:18:13 -07:00
Christian Ambach
df650fa8cf s3:smbd remove unused code
in the early CTDB days, the RELEASE_IP message was defined
and some code was added to react on such a message to make
smbd exit if the IP address it was using for the server socket
is removed by CTDB.
Later, it was discovered that we need to stop smbd immediately
and logic was added to ctdb_conn to call release_ip() without
going through the messaging system.

So this code is not used and can be removed

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Fri May 20 16:18:24 CEST 2011 on sn-devel-104
2011-05-20 16:18:24 +02:00
Volker Lendecke
8a2eff871f s3: Fork the echo handler only after SMB1 negprot is done
This enables activating the echo responder also if SMB2 is enabled, albeit it
will only be used for SMB1 at this moment.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri May 20 15:06:03 CEST 2011 on sn-devel-104
2011-05-20 15:06:03 +02:00
Volker Lendecke
f043babcbd s3: Fix an uninitialized variable 2011-05-20 13:22:27 +02:00
Christian Ambach
642c6ba2b9 Fix Bug 8152 - smbd crash in release_ip()
release_ip() needs the private_data, but it was never saved away
to feed it into release_ip() later

Autobuild-User: Christian Ambach <ambi@samba.org>
Autobuild-Date: Thu May 19 21:21:14 CEST 2011 on sn-devel-104
2011-05-19 21:21:14 +02:00
Andrew Bartlett
da662b82b8 s3-lib Replace StrnCaseCmp() with strncasecmp_m()
strncasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Jeremy Allison
2873429555 Fix bug #8144 - touch /mnt/newfile fails to set timestamp with CIFS client.
The extra checks added for Windows correctness in our metadata changing paths
to ensure the file handle has been opened with the correct access mask to
allow FILE_WRITE_ATTRIBUTES etc. caused problems with the POSIX open code.

The old POSIX open code maped O_RDONLY into FILE_READ, O_WRONLY into FILE_WRITE,
and O_RDWR into FILE_READ|FILE_WRITE. This patch extends the mapping to add
FILE_WRITE_ATTRIBUTES, FILE_READ_ATTRIBUTES and FILE_WRITE_EA, FILE_READ_EA to
allow POSIX opens to set these values.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed May 18 02:22:32 CEST 2011 on sn-devel-104
2011-05-18 02:22:32 +02:00
Volker Lendecke
fc79169ca4 s3: conn->sconn in smbd_server_connection_read/write_handler
"struct smbd_server_connection" is called sconn elsewhere, avoid confusion

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue May 17 19:00:20 CEST 2011 on sn-devel-104
2011-05-17 19:00:20 +02:00
Jeremy Allison
8cf14c21b3 Fix the SMB2 showstopper, found by an extended torture test from Volker.
In the oplock refactoring, the algorithm underwent an unnoticed change.
In 3.5.x stat_opens were silently (i.e. no explicit code had comments
explaining this) ignored when looking for oplock breaks and share mode
violations. After the refactoring, the function find_oplock_types()
no longer ignored stat_open entries in the share mode table when looking
for batch and exclusive oplocks. This patch adds two changes to find_oplock_types()
to ignore the case where the incoming open request is a stat open being
tested against existing opens, and also when the incoming open request
is a non-stat open being tested against existing stat opens. Neither
of these cause an oplock break or share mode violation. Thanks a *lot*
to Volker, who persevered in reproducing this problem.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon May 16 22:38:20 CEST 2011 on sn-devel-104
2011-05-16 22:38:20 +02:00
Jeremy Allison
fe21bdc43c Ensure we always write the correct incoming mid into the share mode
table entries.
2011-05-16 10:41:51 -07:00
Simo Sorce
d31181214c rpc_server: Always use rpc_pipe_open_interface()
This way we can configure which rpc service we actually want to connect to.
By default it uses an "embedded" interface and calls rpc_pipe_open_internal()

Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri May 13 14:40:26 CEST 2011 on sn-devel-104
2011-05-13 14:40:26 +02:00
Volker Lendecke
2b40899bd3 s3: Slightly simplify smbd_smb2_request_next_vector
Metze, Jeremy, please check!
2011-05-12 11:48:29 +02:00
Andrew Tridgell
45e26fdeec s3-smbd: expose smbd_set_server_fd()
this allows the fd to be setup by subsystems that want to use the s3
server core code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sun May  8 12:01:13 CEST 2011 on sn-devel-104
2011-05-08 12:01:13 +02:00
Günther Deschner
27022587e3 s3-libsmb: move protos to libsmb/proto.h
Guenther
2011-05-06 16:37:18 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Andrew Bartlett
c83aed2568 s3-smbd ntstatus_to_dos() pulls the DOS error codes out internally
This means we don't need to duplicate that logic here.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
fa289e8982 s3-lib Remove unused dos error codes from errmap_unix
This also makes unix_nt_errmap private to errmap_unix.c and errormap.c
so the tables themselves cannot be duplicate symbols until merged.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
1475013963 lib/util Move source3 tdb_wrap_open() into the common code.
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in
the top level build, these options are not available for these
databases.  However, having two different tdb_wrap lists is a worse
fate, so this will do for now.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Tridgell
2fc8ad8887 s3-auth: fixed bug with usernames longer than sizeof(char *)
using sizeof(user) when user is "fstring user" as a C parameter
actually returns sizeof(char *), which means that long usernames
aren't allowed.

Jeremy, you need a longer username :-)

Cheers, Tridge

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-05-06 14:49:47 +10:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +02:00
Jeremy Allison
02af307585 More simple const fixes. 2011-05-05 23:56:07 +02:00
Jeremy Allison
38492b16fe Fixup build without --with-aio.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu May  5 21:38:23 CEST 2011 on sn-devel-104
2011-05-05 21:38:23 +02:00
Jeremy Allison
4f41be356a Fix many const compiler warnings. 2011-05-05 10:41:59 -07:00
Volker Lendecke
1c407da7c3 s3: Fix a typo
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu May  5 16:10:35 CEST 2011 on sn-devel-104
2011-05-05 16:10:35 +02:00
Volker Lendecke
82b9fa3a19 s3: Fix dup_smb2_vec3
Metze, Jeremy, please check!

Thanks,

Volker

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu May  5 13:39:40 CEST 2011 on sn-devel-104
2011-05-05 13:39:40 +02:00
Jeremy Allison
8380835fc6 Fix warning messages caused by addition of null check in fstrcpy macro. 2011-05-04 12:12:15 -07:00
Jeremy Allison
18582016d9 Fix off-by-one when used with safe_strcpy. 2011-05-04 12:12:14 -07:00
Jeremy Allison
cabd9e70e2 Simple +1 changes in hardcoded lengths when changing from safe_strcpy to strlcpy. 2011-05-04 12:12:14 -07:00
Jeremy Allison
265338c194 BUGFIX when converting from safe_strcpy to strlcpy.
We must have a blob legth > 0 in order to safely copy
the (possibly) 16 bytes + 1 byte zero character safely.
2011-05-04 12:12:14 -07:00
Volker Lendecke
0232604875 s3: Handle EINTR from sys_poll correctly
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue May  3 18:06:48 CEST 2011 on sn-devel-104
2011-05-03 18:06:48 +02:00
Björn Jacke
cd9a7c143c s3: reply_readbraw_error needs an sconn as argument also in the non-LFS code path
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Tue May  3 13:04:11 CEST 2011 on sn-devel-104
2011-05-03 13:04:11 +02:00
Günther Deschner
0e76eddcc8 s3: include ntdomain.h before including generated srv_ headers.
Guenther
2011-05-02 15:03:44 +02:00
Günther Deschner
61cd1067ef s3-smbd: avoid using pipes_struct when only session_info is needed.
Guenther
2011-05-02 15:03:43 +02:00
Günther Deschner
c233c21425 s3-proto: move remaining spoolss protos to own header file.
Guenther
2011-05-02 15:03:43 +02:00
Günther Deschner
047d8c073b s3-proto: move more rpc_server prototypes out of proto.h
Guenther
2011-05-02 15:03:43 +02:00
Jeremy Allison
2cb53f066e Fix bug #8112 - POSIX extension opens of a directory are denied with EISDIR.
Ensure create_options are passed down to SMB_VFS_CREATE_FILE().
Correctly set create_options is SMB_O_DIRECTORY is set or pathname
is known to be a directory.

Jeremy.
2011-04-29 16:15:55 -07:00
Jeremy Allison
76739435fc Fix bug 8111 - CIFS VFS: unexpected error on SMB posix open
We are conflating the O_CREAT|O_EXCL with the O_TRUNC
processing, they need to be separate. We need to chose
using (O_CREAT|O_EXCL) first, then modify if O_TRUNC is
set. This needs two separate switch statements.

Jeremy
2011-04-29 23:31:06 +02:00
Günther Deschner
bbacaec4e9 s3-proto: move more headers to rpc_server/rpc_ncacn_np.h where they origin from.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Apr 29 22:05:07 CEST 2011 on sn-devel-104
2011-04-29 22:05:07 +02:00
Günther Deschner
bc781bf7d9 s3-proto: remove duplicate prototypes.
Guenther
2011-04-29 21:01:05 +02:00
Günther Deschner
50883cfeb4 s3-tevent: only include ../lib/util/tevent wrappers where needed.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
2011-04-29 14:00:30 +02:00
Günther Deschner
12476223c6 s3-tsocket: only include ../lib/tsocket/tsocket.h where needed.
Guenther
2011-04-29 12:19:04 +02:00
Günther Deschner
bc6f24e89f s3-build: remove some unused headers.
Guenther
2011-04-29 12:19:03 +02:00
Andrew Bartlett
0520da2bbe s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
0eca33bbf6 s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
08c90d6f2d s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
0a3c84b554 s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:13 +10:00
Andrew Bartlett
317e19aeb3 s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:12 +10:00
Andrew Bartlett
7f66ebde2e s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY
This means we use just one constant for this file attribute.

Andrew Bartlett
2011-04-29 16:38:12 +10:00
Volker Lendecke
77ea148f7f s3: Fix a typo
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Apr 26 13:31:08 CEST 2011 on sn-devel-104
2011-04-26 13:31:08 +02:00
Jeremy Allison
d00f1febd5 No longer need to call SMB_VFS_LSTAT - check name hasn't changed above is sufficient.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Apr 25 23:35:37 CEST 2011 on sn-devel-104
2011-04-25 23:35:37 +02:00
Jeremy Allison
eeb24c1773 Correctly detect and deny symlinks anywhere in a path (not just the last component) if "follow symlinks = no". 2011-04-25 22:49:04 +02:00
Stefan Metzmacher
9127e555ab s3:smbd/trans2: make use of BVAL() and remove ugly LARGE_SMB_OFF_T ifdef's
We rely on uint64_t for a long time now...

metze
2011-04-24 09:48:49 +02:00
Stefan Metzmacher
4a4a774e61 s3:smbd/nttrans: make use of BVAL() and remove ugly LARGE_SMB_OFF_T ifdef's
We rely on uint64_t for a long time now...

metze
2011-04-23 11:17:46 +02:00
Volker Lendecke
018595e258 s3: Fix Coverity ID 2335, CHECKED_RETURN 2011-04-22 10:06:36 +02:00
Jeremy Allison
e919e767fb Cosmetic. Fix bad indentation.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Apr 22 03:16:43 CEST 2011 on sn-devel-104
2011-04-22 03:16:43 +02:00
Jeremy Allison
20baa11f33 Remove duplicate code - move to parent_dirname() as a common function. 2011-04-21 17:09:50 -07:00
Günther Deschner
c7073f8b54 s3-vfs: rename open function to open_fn.
This should finally fix the AIX build and allow to remove AIX specific ifdefs.

Guenther

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

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr 21 02:01:20 CEST 2011 on sn-devel-104
2011-04-21 02:01:20 +02:00
Günther Deschner
ae61a5c3d0 s3-smbd: fix the AIX 5.3 build.
(AIX defines open to be open64)

Guenther
2011-04-20 18:16:28 +02:00
Jeremy Allison
e49893c68e Use handle based xattr set if available.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Apr 15 22:11:12 CEST 2011 on sn-devel-104
2011-04-15 22:11:12 +02:00
Jeremy Allison
525ccd589e Ensure vfs_chown_fsp() is safe against races. 2011-04-15 12:21:39 -07:00
Jeremy Allison
4389bf4bc9 Ensure change_dir_owner_to_parent() can't be raced.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Apr 14 23:39:55 CEST 2011 on sn-devel-104
2011-04-14 23:39:55 +02:00