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

5840 Commits

Author SHA1 Message Date
Simo Sorce
5685914344 s3-rpc_server: Convert rpc_connect_spoolss_pipe into a generic interface.
This way we have one common way to open internal pipes whether they
are shortcircuited or piped to an external process.
2010-09-15 12:53:42 +02:00
Jeremy Allison
b3fccd10a6 Fix bug 7409 - Thousands of reduce_name: couldn't get realpath.
Don't log this at level 1 - every EACCES will generate one.
Thanks to muehlfeld@medizinische-genetik.de for pointing this out.

Jeremy.
2010-09-13 16:54:21 -07:00
Andrew Bartlett
3bb77516b8 s3-privs Convert from user_has_privileges() -> security_token_has_privilege()
This new call is available in the merged privileges code, and
takes an enum as the parameter, rather than a bitmask.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:09 +10:00
Andrew Bartlett
d1bb21b0d5 s3:auth Remove NT_USER_TOKEN
The all UPPER case typedef is no longer the preferred Samba style
and this makes it easier to see that this is the IDL-derivied structure

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:06 +10:00
Andrew Bartlett
4bfc8d3b1a s3-auth Change struct nt_user_token -> struct security_token
This common structure is defined in security.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:05 +10:00
Jeremy Allison
a89b0ef53b Add check missing from previous patch after talloc_strdup().
Jeremy.
2010-09-10 23:33:18 -07:00
Jeremy Allison
1787c1dfc3 Factor out the recent changes into a function - check_parent_exists().
Fix this to ensure that if "start" is manipulated, then "dirpath"
is changed also.

Ensures that when the path:

/a/long/file/name/path.txt

is processed, we first stat:

/a/long/file/name/path.txt

and if this fails, we try to stat:

/a/long/file/name

if this path exists (the normal case when creating a new
entry in a directory) then we no longer do the individual
path name walk, but only do case insensitive lookup on the
last component. If the stat fails we do the full pathname
walk as normal in 3.5.x and below. Metze, examine this
change for your back-port.

Jeremy.
2010-09-10 23:28:15 -07:00
Andreas Schneider
fc1a5dbffb s3-spoolss: Don't leak memory on the session counter list.
Thanks Günther, please check.
2010-09-10 16:10:46 +02:00
Jeremy Allison
e6b85c2a7b More paranoia to ensure SD's can't be set on read-only shares.
Jeremy.
2010-09-09 15:28:43 -07:00
Andreas Schneider
021539570b s3-msdfs: Make auth_serversupplied_info const. 2010-09-09 16:00:08 +02:00
Jeremy Allison
bec9baf88a Don't rely on the underlying ACL modules to enforce share level
security when setting ACLs, check at the call level as well.

Jeremy.
2010-09-08 20:54:38 -07:00
Jeremy Allison
fcac46a612 Optimization suggested by Metze. Without this patch,
FindFirst with 'path\to\some\dir\with\files\*'

triggers the following stat calls

path\to\some\dir\with\files\* => ENOENT
path\
path\to\
path\to\some\
path\to\some\dir\
path\to\some\dir\with\
path\to\some\dir\with\files\
path\to\some\dir\with\files\* => ENOENT

With this patch we get :

path\to\some\dir\with\files\* => ENOENT
path\to\some\dir\with\files = OK

Jeremy.
2010-09-08 16:55:24 -07:00
Björn Jacke
f69085e5ff s3: use monotonic clock for aio timeout 2010-09-07 20:29:13 +02:00
Volker Lendecke
df19469295 s3: On Solaris, iov_len is an int
We can't use &iov.iov_len passing it to a size_t *
2010-09-05 16:41:28 +02:00
Volker Lendecke
5648c3f67e s3: messaging_ctdbd_connection() was only called with procid_self()
Eventually we'll get this right...
2010-08-31 17:07:41 +02:00
Björn Jacke
079baa7688 s3: use fine grained time in netprot response 2010-08-31 15:51:11 +02:00
Andrew Bartlett
8c15cf54ae s3-auth Rename NT_USER_TOKEN user_sids -> sids
This is closer to the struct security_token from security.idl
2010-08-31 10:20:14 +10:00
Volker Lendecke
6beb5563f3 s3: Fix a segfault in the printer code using create_conn_struct 2010-08-30 23:06:32 +02:00
Volker Lendecke
1d3bd5b1c0 s3: Fix some uninitialized variable warnings 2010-08-30 15:57:14 +02:00
Simo Sorce
f3501cf848 s3-smbd: use make_server_info_krb5() in smb2 too.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-30 14:24:46 +02:00
Simo Sorce
a413a86daa s3-smbd: use make_server_info_krb5()
Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-30 14:24:38 +02:00
Simo Sorce
ce60d6d9cf s3-smbd: User helper function to resolve kerberos user for smb2
Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-30 14:22:13 +02:00
Simo Sorce
94adbf3726 s3-smbd: Use helper function to resolve kerberos user
Signed-off-by: Günther Deschner <gd@samba.org>
2010-08-30 14:21:53 +02:00
Volker Lendecke
fbf3d03550 s3: Fix an uninitialized variable 2010-08-29 23:14:49 +02:00
Volker Lendecke
f687d43454 s3: Fix the build without cluster 2010-08-29 23:14:49 +02:00
Volker Lendecke
e466bb4af4 s3: Remove smbd_server_fd()
This breaks the perfcol_onefs() build.

Tim, Steve, this use of smbd_server_fd is replacable by calls into
substitute.c. I don't have a onefs environment around to build a fix, so I've
decided to insert an #error, making it not compile. The fix should be pretty
obvious, you can get the socket data via "%I" and "%i" substitutions.
2010-08-29 21:55:25 +02:00
Volker Lendecke
e784e160ec s3: Remove two uses of smbd_server_fd()
Actually, this is a bit cheating. But those two files depend on
smbd_server_conn anyway, it does not make things worse.
2010-08-29 21:55:25 +02:00
Volker Lendecke
744cc26451 s3: Remove smbd_server_fd() from smbd_register_ips 2010-08-29 21:55:24 +02:00
Volker Lendecke
5bbc4df168 s3: Lift smbd_server_fd() from msg_release_ip() 2010-08-29 21:55:24 +02:00
Volker Lendecke
467208e9f4 s3: Lift smbd_server_fd() from release_ip() 2010-08-29 21:55:24 +02:00
Volker Lendecke
6432383926 s3: Remove a use of smbd_server_fd() in smbd main()
The effect this might have is that we set the socket options a bit later in
inetd mode.
2010-08-29 21:55:24 +02:00
Volker Lendecke
70df6fcb2a s3: Pass sconn to check_reload
This removes a use of smbd_server_fd()
2010-08-29 21:55:24 +02:00
Volker Lendecke
babfe23717 s3: Pass sconn instead of msg_ctx to housekeeping_fn 2010-08-29 21:55:24 +02:00
Volker Lendecke
4a58c640cc s3: Set the client_id in substitute.c once
This never changes during a client connection's life, so we can set it
once.
2010-08-29 21:55:23 +02:00
Volker Lendecke
0a8d49575c s3: Remove some references to smbd_server_fd() 2010-08-28 15:05:27 +02:00
Volker Lendecke
755ef5cf11 s3: Remove smbd_server_fd() from set_local_machine_name() 2010-08-28 14:06:10 +02:00
Stefan Metzmacher
db6d1c6276 s3:smbd: s/sa_len/sa_socklen , because sa_len is a macro on IRIX
metze
2010-08-28 08:28:01 +02:00
Jeremy Allison
04f021e692 Fix bug #7653 - When SMB2 is on, Windows 7 clients can not connect as guest to a share.
Fix "security = share" with SMB2 by mapping internally
to "security = user" and "map to guest = Bad User".

Jeremy.
2010-08-27 15:25:04 -07:00
Jeremy Allison
5115f789c0 Fix bug #7651 - mknod and mkfifo fails with "No such file or directory"
Ensure we check the correct stat struct once we've created the
special fix. Thanks to izh1979@gmail.com for pointing out the
bug.

Jeremy.
2010-08-26 16:46:45 -07:00
Günther Deschner
7a05ca2c9c s3-build: use dbwrap.h only where needed.
Guenther
2010-08-26 00:25:55 +02:00
Günther Deschner
184339825d s3-build: include mangle.h only where needed.
Guenther
2010-08-26 00:20:29 +02:00
Günther Deschner
b5bdcdd65e s3-build: only include "fake_file.h" where needed.
Guenther
2010-08-26 00:20:28 +02:00
Günther Deschner
aba1bf4b5e s3-build: only include memcache.h where needed.
Guenther
2010-08-26 00:20:28 +02:00
Günther Deschner
e978a3d3f4 s3-lsa: separate out init_lsa headers.
Guenther
2010-08-25 22:50:39 +02:00
Michael Adam
be598569bb s3:smbd: add nfs quota support to the linux-non-sysquota code
This is based on the implementation for solaris and FreeBSD.
It makes rpc calls out to the nfs server to retrieve quota
information.
2010-08-25 14:05:51 +02:00
Volker Lendecke
d3a0ff311e s3: Make char_flags and base_reverse const arrays
This moves those arrays from dynamic to static, shared memory, removing them
from globals.c.

I did it by dumping the result of init_tables() with dump_data(). Some massage
by an editor macro made it the initializer.
2010-08-24 22:45:41 +02:00
Volker Lendecke
2d81721a3f s3: Move "trans_num" to smbd_server_connection 2010-08-24 21:06:41 +02:00
Volker Lendecke
1808dd0a85 s3: Make srv_send_smb take an sconn instead of a sock fd 2010-08-24 21:06:41 +02:00
Volker Lendecke
177e394f93 s3: Pass the rhost through smb_pam_accountcheck 2010-08-22 22:42:21 +02:00
Volker Lendecke
70c5bed4b2 s3: Replace calls to check_access by allow_access
We already have both the name and address of the client stored now
2010-08-22 14:28:34 +02:00
Volker Lendecke
f35811bfe0 s3: Use sconn->client_id in session_claim 2010-08-20 21:28:44 +02:00
Volker Lendecke
8f7bf85c40 s3: Remove an unused variable 2010-08-18 17:13:48 +02:00
Volker Lendecke
4b5e252354 s3: Add "client_id" to pipes_struct 2010-08-18 11:18:23 +02:00
Volker Lendecke
6d10684556 s3: Remove unneeded "client_address" from connection_struct 2010-08-18 11:18:23 +02:00
Volker Lendecke
7b6835ec1d s3: Add smbd_server_connection->client_id 2010-08-18 11:18:22 +02:00
Volker Lendecke
ac7b63384d s3: Lift smbd_server_fd from reload_services() 2010-08-18 11:18:21 +02:00
Günther Deschner
59289d4fa9 s3-build: only include smb_signing.h where needed.
Guenther
2010-08-18 09:20:13 +02:00
Volker Lendecke
26ff858934 s3: Remove smbd_server_fd() from session_claim 2010-08-17 22:52:03 +02:00
Volker Lendecke
f8ecec21e2 s3: Remove smbd_server_fd() from read_smb_length() 2010-08-17 22:44:04 +02:00
Volker Lendecke
840b0f523b s3: Move read_smb_length() to smbd/reply.c 2010-08-17 22:44:04 +02:00
Volker Lendecke
a58cea0026 s3: Lift smbd_server_fd() from receive_smb_raw_talloc 2010-08-17 22:44:03 +02:00
Volker Lendecke
1f0afe1aed s3: Lift smbd_server_fd() from read_smb_length_return_keepalive 2010-08-17 22:44:03 +02:00
Volker Lendecke
7d164498db s3: Lift smbd_server_fd() from read_data()
All callers have appropriate debug messages themselves
2010-08-17 22:44:03 +02:00
Volker Lendecke
9671547d17 s3: Lift smbd_server_fd() from read_fd_with_timeout() 2010-08-17 22:44:03 +02:00
Volker Lendecke
40ae8b74b6 s3: Remove smbd_server_fd() from write_data()
This completely removes the DEBUG(0, ..) error message from write_data(). I've
gone through all callers of write_data() and made sure that they have their own
equivalent error message printing.
2010-08-17 12:46:53 +02:00
Volker Lendecke
68e86969fa s3: Remove smbd_server_fd() from smbd_process 2010-08-16 22:39:25 +02:00
Volker Lendecke
0bd39c73be s3: Remove smbd_server_fd() from smbd_echo_loop 2010-08-16 22:39:25 +02:00
Volker Lendecke
2cd643865d s3: Remove smbd_server_fd() from smbd_echo_reader 2010-08-16 22:39:25 +02:00
Volker Lendecke
a23483310d s3: Remove smbd_server_fd() from smbd_echo_reply 2010-08-16 22:39:25 +02:00
Volker Lendecke
bb867df269 s3: Remove smbd_server_fd() from keepalive_fn 2010-08-16 22:39:25 +02:00
Volker Lendecke
a2bf46e9ec s3: Remove smbd_server_fd() from smbd_server_connection_handler 2010-08-16 22:39:25 +02:00
Volker Lendecke
8e7a92bc24 s3: Remove smbd_server_fd() from smbd_server_connection_read_handler 2010-08-16 22:39:25 +02:00
Volker Lendecke
6737c3dd32 s3: Remove smbd_server_fd() from chain_reply 2010-08-16 22:39:25 +02:00
Volker Lendecke
b9d052c728 s3: Remove smbd_server_fd() from construct_reply 2010-08-16 22:39:24 +02:00
Volker Lendecke
61989a9e54 s3: Remove smbd_server_fd() from switch_message 2010-08-16 22:39:24 +02:00
Volker Lendecke
ee796255ce s3: Remove smbd_server_fd() from smbd_server_connection_loop_once 2010-08-16 22:39:24 +02:00
Volker Lendecke
95b232a008 s3: Remove smbd_server_fd() from receive_smb_raw_talloc_partial_read 2010-08-16 22:39:24 +02:00
Volker Lendecke
4a27c10903 s3: Remove smbd_server_fd() from make_connection 2010-08-16 22:39:24 +02:00
Volker Lendecke
897d09174d s3: Remove smbd_server_fd() from share_sanity_checks 2010-08-16 22:39:24 +02:00
Volker Lendecke
05604b315b s3: Remove smbd_server_fd() from setup_new_vc_session 2010-08-16 22:39:24 +02:00
Volker Lendecke
a98604d7f2 s3: Remove smbd_server_fd() from make_connection_snum 2010-08-16 22:39:24 +02:00
Volker Lendecke
910e3df7dd s3: Remove smbd_server_fd() from reply_echo 2010-08-16 22:39:23 +02:00
Volker Lendecke
495bb1efb3 s3: Remove smbd_server_fd() from reply_writebraw 2010-08-16 22:39:23 +02:00
Volker Lendecke
36cfc1d145 s3: Remove smbd_server_fd() from send_file_readX 2010-08-16 22:39:23 +02:00
Volker Lendecke
209b3aee1c s3: Remove smbd_server_fd() from send_file_readbraw 2010-08-16 22:39:23 +02:00
Volker Lendecke
cc5f838319 s3: Remove smbd_server_fd() from reply_readbraw_error 2010-08-16 22:39:23 +02:00
Volker Lendecke
59645506a0 s3: Remove smbd_server_fd() from sendfile_short_send 2010-08-16 22:39:23 +02:00
Volker Lendecke
6f85247494 s3: Remove smbd_server_fd() from fake_sendfile 2010-08-16 22:39:23 +02:00
Volker Lendecke
3e28c05e98 s3: Remove smbd_server_fd from netbios_session_retarget 2010-08-16 22:39:22 +02:00
Volker Lendecke
2d571fdddb s3: Remove smbd_server_fd from vfs_pwrite_data 2010-08-16 22:39:22 +02:00
Volker Lendecke
30ce02299b s3: Remove smbd_server_fd from vfs_write_data 2010-08-16 22:39:22 +02:00
Volker Lendecke
a92efa0e47 s3: Remove smbd_server_fd from send_trans2_replies 2010-08-16 22:39:17 +02:00
Volker Lendecke
50b3ee57e2 s3: Remove smbd_server_fd from smbd_initialize_smb2 2010-08-16 22:39:17 +02:00
Volker Lendecke
0e12c216dc s3: Remove smbd_server_fd from reply_special 2010-08-16 22:39:17 +02:00
Volker Lendecke
7a1c32c98a s3: Remove smbd_server_fd from pipe_write_done 2010-08-16 22:39:16 +02:00
Volker Lendecke
7c0c7f3337 s3: Remove smbd_server_fd from send_break_message_smb1 2010-08-16 22:39:16 +02:00
Volker Lendecke
e34c5e235d s3: Remove smbd_server_fd from api_dcerpc_cmd_read/write_done 2010-08-16 22:39:16 +02:00
Volker Lendecke
215d803cdb s3: Remove smbd_server_fd from send_trans_reply 2010-08-16 22:39:16 +02:00
Volker Lendecke
9878fa6f72 s3: Remove smbd_server_fd from send_nt_replies 2010-08-16 22:39:16 +02:00
Volker Lendecke
774bae74d1 s3: Remove smbd_server_fd from blocking_lock_reply_error 2010-08-16 22:39:16 +02:00
Volker Lendecke
9115beb88c s3: Remove smbd_server_fd from generic_blocking_lock_error 2010-08-16 22:39:16 +02:00
Volker Lendecke
c9458a756c s3: Remove smbd_server_fd from handle_aio_read/write_complete 2010-08-16 22:39:16 +02:00
Volker Lendecke
bda7c70bc0 s3: Remove smbd_server_fd from schedule_aio_write_and_X 2010-08-16 22:39:16 +02:00
Volker Lendecke
2f53d1deb7 s3: Add "sock" to smbd_server_connection 2010-08-16 22:39:16 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Volker Lendecke
98187fe309 s3: Increase debug level for shutdown_other_smbds 2010-08-15 09:50:13 +02:00
Volker Lendecke
02002a52f2 s3: Add debugs to shutdown_other_smbds 2010-08-15 09:50:12 +02:00
Volker Lendecke
13a4922ae6 s3: Remove a conn NULL check from claim_connection
We've already dereferenced conn before
2010-08-14 12:27:17 +02:00
Volker Lendecke
ad871b73a2 s3: Fix some error messages 2010-08-13 22:53:06 +02:00
Andreas Schneider
ca8db7fd63 s3-smbd: Publish nt printers.
Reloading of the printers requires rpc services up and running! The
first call in reload_services will be skipped.

Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-13 12:20:10 -04:00
Andreas Schneider
aff002e829 s3-smbd: Move rpc services init to smbd parent.
The move to the parent makes it possible to use an internal rpc pipe
really early and as we migrated serveral parts of samba to rpc function
this is required. This should speed up the fork of a smbd a bit cause
the rpc services are already running.

We still have several problems here which aren't solved. We don't have a
dependency tree here. For example we have to make sure that the registry
is initialized before we can use the winreg pipe. The spoolss server
requires winreg, so we have to start winreg before we can start the
spoolss server. I'm sure there are more dependencies.

Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-13 12:20:10 -04:00
Andreas Schneider
62a2a9e27f s3-smbd: Regroup some init functions.
Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-13 12:20:10 -04:00
Andreas Schneider
9ab62b774f s3-smbd: Fixed indent.
Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-13 12:20:10 -04:00
Andreas Schneider
e18039062c s3-smbd: Cleanup the order of the init functions.
Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-13 12:20:10 -04:00
Andreas Schneider
120bd9775a s3-smbd: Make sure the event context is initialized.
Signed-off-by: Simo Sorce <idra@samba.org>
2010-08-13 12:20:10 -04:00
Volker Lendecke
f7e14a8e5e s3: Reduce the load on the echo handler
If the parent is fast enough, the echo handler should not step in. When the
socket becomes readable, the echo handler goes to sleep for a second. If within
that second, the parent has picked up the SMB request from the net, the echo
handler will just go back to select().
2010-08-12 13:32:16 +02:00
Volker Lendecke
c672797a0a s3: Slightly simplify the logic in smbd_server_echo_handler 2010-08-12 13:31:51 +02:00
Volker Lendecke
c7a2e52ef1 s3: Slightly simplify the logic in smbd_server_connection_handler 2010-08-12 13:31:51 +02:00
Volker Lendecke
277248a4a7 s3: ?true:false is a *bit* pointless :-) 2010-08-12 12:26:56 +02:00
Jeremy Allison
e0f79dabee Fix bug #7608 - Win7 SMB2 authentication causes smbd panic
We need to call setup_ntlmssp_server_info() if status==NT_STATUS_OK,
or if status is anything except NT_STATUS_MORE_PROCESSING_REQUIRED,
as this can trigger map to guest.

Jeremy.
2010-08-09 16:16:24 -07:00
Volker Lendecke
016418d6c2 s3: Remove the smbd_messaging_context from load_printers 2010-08-08 23:37:47 +02:00
Volker Lendecke
1c1d83a532 s3: Remove the smbd_messaging_context from pcap_cache_reload 2010-08-08 23:37:47 +02:00
Volker Lendecke
d0ac5c69fb s3: Remove the smbd_messaging_context from smb_conf_updated 2010-08-08 23:37:47 +02:00
Volker Lendecke
10a76f5d42 s3: Remove the smbd_messaging_context from spoolss_init_cb 2010-08-08 23:37:47 +02:00
Volker Lendecke
b71f2af1a6 s3: Remove some smbd_messaging_context references from smbd_process 2010-08-08 23:37:47 +02:00
Volker Lendecke
37d71a56fd s3: Pass sconn to smbd_process 2010-08-08 23:37:47 +02:00
Volker Lendecke
1702b17494 s3: Lift the server_messaging_context from housekeeping_fn 2010-08-08 23:37:46 +02:00
Volker Lendecke
e64bd85d90 s3: Lift the server_messaging_context from check_reload 2010-08-08 23:37:46 +02:00
Volker Lendecke
53ed39de4a s3: Make check_reload() static 2010-08-08 23:37:46 +02:00
Volker Lendecke
1b60ead64a s3: Lift the server_messaging_context from update_monitored_printq_cache 2010-08-08 18:09:38 +02:00
Volker Lendecke
bc760e79c8 s3: Lift the smbd_messaging_context from start_background_queue 2010-08-08 18:09:33 +02:00
Volker Lendecke
75b4dfd14d s3: Lift the smbd_messaging_context from smbd_setup_sig_hup_handler 2010-08-08 18:09:33 +02:00
Volker Lendecke
5281e62941 s3: Lift the smbd_messaging_context from smbd_sig_hup_handler 2010-08-08 18:09:33 +02:00
Volker Lendecke
39da717fe1 s3: Lift the smbd_messaging_context from reload_services 2010-08-08 18:09:33 +02:00
Volker Lendecke
7c7ffb70fb s3: Lift the smbd_messaging_context from reload_printers 2010-08-08 18:09:33 +02:00
Volker Lendecke
99b2da4504 s3: Lift the smbd_messaging_context from is_printer_published 2010-08-08 16:03:26 +02:00
Volker Lendecke
7d08c25f98 s3: Lift the smbd_messaging_context from nt_printer_publish 2010-08-08 16:03:25 +02:00
Volker Lendecke
e43ffde91f s3: Lift the smbd_messaging_context from nt_printer_remove 2010-08-08 16:03:25 +02:00
Volker Lendecke
80cda2e807 s3: Lift the smbd_messaging_context from nt_printing_tdb_migrate 2010-08-08 16:03:15 +02:00
Volker Lendecke
2d3623529f s3: Lift the smbd_messaging_context from rpc_pipe_open_internal 2010-08-08 16:03:15 +02:00
Volker Lendecke
33256d6478 s3: Lift the smbd_messaging_context from np_open 2010-08-08 16:03:15 +02:00
Volker Lendecke
d5b8a993e0 s3: Remove a direct reference to smbd_server_conn 2010-08-08 16:03:15 +02:00
Stefan Metzmacher
ac9f06c9b9 s3:smbd: fix valgrind warning, sizeof(16) != 16...
metze
2010-08-08 11:05:16 +02:00
Volker Lendecke
72fd7fb49d s3: Remove some references to smbd_messaging_context() 2010-08-07 14:36:59 +02:00
Volker Lendecke
c9b654f581 s3: Remove smbd_messaging_context() from send_stat_cache_delete_message() 2010-08-07 13:16:48 +02:00
Volker Lendecke
b03bc8822b s3: Remove a pointless "else" 2010-08-07 10:30:20 +02:00
Günther Deschner
0f8e032628 s3-netlogon: remove global include of netlogon.h.
This reduces precompiled headers by another 4 MB and also slightly speeds up the
build.

Guenther
2010-08-06 15:46:16 +02:00
Günther Deschner
257a1f1097 s3-krb5: include krb5pac.h where needed.
Guenther
2010-08-06 15:43:37 +02:00
Andreas Schneider
ce2a086119 s3-popt: Only include popt-common.h when needed. 2010-08-05 12:08:31 +02:00
Günther Deschner
c136b84f0d s3-secrets: only include secrets.h when needed.
Guenther
2010-08-05 10:12:25 +02:00
Günther Deschner
e7a6a3ec0d s3: avoid global include of ads.h.
Guenther
2010-08-05 00:32:02 +02:00
Günther Deschner
813fbbd68c s3-build: avoid to globally include printing and spoolss headers.
This shrinks precompiled headers by 3MB and will slightly speed up any build.

Guenther
2010-07-31 00:50:31 +02:00
Volker Lendecke
a8cd3ef99e s3: Do the ftruncate write cache optimization in one place
Instead of hand-tuning all the cases that are below this piece of code, this is
a general case that we can catch upfront.
2010-07-29 22:46:44 +02:00
Volker Lendecke
a86cad3921 Revert "s3: Avoid pwrite calls for the 1-byte writes with zero content"
This reverts commit 6763730304.
2010-07-29 22:46:44 +02:00
Volker Lendecke
fec8505e0b s3: Avoid an unnecessary ftruncate call
If we just created the file, it has length 0 by definition. This is still done
while holding the share mode lock, so no race around wrt other cifs clients.
2010-07-29 22:46:36 +02:00
Simo Sorce
c4b3c9ec0f smbd: Fix build warning 2010-07-28 12:44:37 -04:00
Andreas Schneider
6457f814f5 s3-uid: Use struct pipes_struct. 2010-07-28 10:39:25 +02:00
Andreas Schneider
b95d5563dd s3-printing: Added automatic migration of printing tdbs.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:15 -04:00
Simo Sorce
c18913a2c2 s3-smbd: Convert reply_printqueue to use spoolss.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:14 -04:00
Simo Sorce
21cd59e7a5 s3-smbd: Use the right check to test if we can print.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:14 -04:00
Simo Sorce
bdab6b10d2 s3-printing: Moved printing.c headers to include/printing.h.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:14 -04:00
Simo Sorce
849cc65654 s3-smbd: Migrated to new spoolss functions for printing.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:13 -04:00
Simo Sorce
a1fe2ed68a s3-spoolss: Use winreg_delete_printer_key to delete printers.
Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Simo Sorce
44bc6714b0 s3-printing: Converted printer publishing functions.
Use spoolss_PrintInfo2 and winreg calls.

Signed-off-by: Jim McDonough <jmcd@samba.org>
2010-07-27 10:27:10 -04:00
Volker Lendecke
1528a4ffbe s3: use dump_data in query FILE_BASIC_UNIX_INFO
Jeremy, please check! To me this is a lot more readable than the decimal
listing of the bytes.
2010-07-25 20:45:46 +02:00
Jeremy Allison
5002b3a90d Add approriate TALLOC_CTX's thoughout the spnego code. No more implicit NULL contexts.
Jeremy.
2010-07-20 16:17:58 -07:00
Jeremy Allison
cce19c5162 Fix one more data_blob -> data_blob_talloc. Move away from implicit NULL context tallocs.
Jeremy.
2010-07-20 14:59:31 -07:00
Jeremy Allison
4ed9437b7e Add TALLOC_CTX argument to spnego_parse_negTokenInit, reduce
use of malloc, and data_blob().

Jeremy.
2010-07-20 13:35:43 -07:00
Jeremy Allison
f5def289d3 Fix warning - no return value for a non-void fn.
Jeremy.
2010-07-20 09:34:32 -07:00
Simo Sorce
e958b39042 s3-auth: Move auth_ntlmssp wrappers in their own file
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:31 +10:00
Simo Sorce
a04bbd281c s3-auth: Refactor and rename auth_ntlmssp_server_info()
Rename it to auth_ntlmssp_steal_server_info() to make it clear that
the server_info struct is stolen from the auth_ntlmssp_state structure.
Use talloc_move instead of manual steal&clear
Add comments to explain what is going on.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:24 +10:00
Jeremy Allison
0bb8d133c9 Remove gen_negTokenInit() - change all callers to spnego_gen_negTokenInit().
We now have one function to do this in all calling code. More rationalization
to follow.

Jeremy.
2010-07-19 17:14:26 -07:00
Jeremy Allison
8cba4a0c96 Move the addition of the 16 byte guid out of spnego_gen_negTokenInit() and
into negprot_spnego() where it belongs (it's not an SPNEGO operation).
Add a TALLOC_CTX for callers of negprot_spnego(). Closer to unifying all
the gen_negTokenXXX calls.

Jeremy.
2010-07-19 16:45:16 -07:00
Jeremy Allison
625a511389 Remove parse_negTokenTarg(), as it's actually incorrect. We're processing
negTokenInit's here. Use common code in spnego_parse_negTokenInit().

Jeremy.
2010-07-19 15:41:45 -07:00
Volker Lendecke
6763730304 s3: Avoid pwrite calls for the 1-byte writes with zero content
When a write cache is empty and we write one 0, there is no point in actually
writing into the write cache, which would trigger a potentially superfluous
write cache flush. We can rely on posix semantics to give us 0's when
subsequent read calls want to read from file areas not written yet.

Jeremy, please check!
2010-07-19 22:06:28 +02:00
Simo Sorce
c09dcb903c s3-auth: Use talloc hierarchies to properly free auth_ntlmssp_state contexts
Turn auth_ntlmssp_end into a destructor and attach it to auth_ntlmssp_state.
Remote auth_ntlmssp_end and use TALLOC_FREE in the callers.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:20:04 +10:00
Simo Sorce
e60ed80754 s3-auth: Simplify how we free the auth_context
Turn the freeing function into a destructor and attach it to the
auth_context.
Make all callers TALLOC_FREE() the auth_context instead of calling
the free function.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:20:00 +10:00
Volker Lendecke
55512f4791 s3: Work better without the aio sighandler
Refuse async I/O if we can't set up the signal handler
2010-07-18 21:22:41 +02:00
Jeremy Allison
e058de31e8 Make the "map to guest" parameter work correctly with NTLMSSP (spnego
and raw) under SMB2. Still need to investigate fixing this with krb5
auth (does this make sense ?).

Jeremy.
2010-07-16 11:05:34 -07:00
Volker Lendecke
ff93d58b60 s3: Fix crashes in the printing code
create_conn_struct did not create the conn->sconn!=NULL assumption we now
depend on. Thanks to Andreas Schneider for testing!
2010-07-15 10:38:37 +02:00
Andrew Bartlett
0d95cee58f s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS
This fixes a bug where register_existing_vuid() could be called with a
NULL server_info if the alloction failed.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-07-14 16:22:49 +10:00
Andrew Bartlett
1debe30689 s3:smbd Give the kerberos session key a parent
Nothing will free this, so this prevents a memory leak.

Andrew Bartlett

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-07-14 16:22:49 +10:00
Andrew Bartlett
39d1a525d1 s3:smbd Fix segfault if register_existing_vuid() fails
The register_existing_vuid() call will handle both the ntlmssp_end and
vuid invalidation internally, so we don't want to do it again.

Andrew Bartlett

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-07-14 16:22:49 +10:00
Jeremy Allison
5bdb8b472c Revert "Remove the global char *LastDir."
Volker pointed out I'd missed the "last directory" cache
part of this code. Return us to caching the directory we're
in (reduces sys call load).

Mea maxima culpa.

Jeremy.

This reverts commit 2f30aea332.
2010-07-13 09:30:35 -07:00
Ira Cooper
c0aa55d550 s3: Cleanup of the initial SMB2 counters patch.
This reorganizes smbd_smb2_request_dispatch to have a central exit point,
and use the normal profiling macros.

Signed-off-by: Jeremy Allison <jra@samba.org>
2010-07-09 16:29:39 -07:00
Volker Lendecke
1c0cb365a8 s3: Optimize the write cache for sequential writes
In case of the one-byte allocating writes we don't work work optimally because
we start the write cache at the current offset. This patch tries to avoid this
case.
2010-07-09 08:50:41 +02:00
Günther Deschner
690ed0c5e2 s3-rpc: when using rpc_pipe_open_internal, make sure to go through NDR.
Otherwise a lot of information that is usually generated in the ndr_push remains
in an uninitialized state.

Guenther
2010-07-08 16:35:26 +02:00
Ira Cooper
90b1a1d296 s3: Add SMB2 performance counters.
A performance counter was added for every base type of SMB2 op.
2010-07-07 18:06:59 -07:00
Günther Deschner
ca460113ea s3-notify: use autogenerated FILE_NOTIFY_INFORMATION marshalling in smbd.
Guenther
2010-07-07 13:54:57 +02:00
Chere Zhou
00056e73c1 s3:smbd: Align change notify replies on 4-byte boundary
MS-CIFS section 2.2.7.4.2 states this is mandatory.  WinXP clients
don't seem to care, but a Win7 client will send an immediate Close()
to the directory handle when receiving an incorrectly aligned
change notify response.
2010-07-06 13:28:02 -07:00
Volker Lendecke
b0f76a37d3 s3: Remove procid_self() from cancel_pending_lock_requests_by_fid_smb2() 2010-07-05 11:06:31 +02:00
Volker Lendecke
a521ad4b5a s3: Remove procid_self() from remove_pending_lock() 2010-07-05 11:06:31 +02:00
Volker Lendecke
e168b85f00 s3: Remove procid_self() from fill_deferred_open_entry() 2010-07-05 11:06:31 +02:00
Volker Lendecke
9b0fbcf35a s3: Remove smbd_messaging_context() from shutdown_other_smbds() 2010-07-05 11:06:30 +02:00
Volker Lendecke
0ea7aed746 s3: Remove smbd_messaging_context() from make_connection_snum() 2010-07-05 11:06:30 +02:00
Volker Lendecke
a2d7cd5558 s3: Remove smbd_messaging_context() from reprocess_blocked_smb2_lock() 2010-07-05 11:06:30 +02:00
Volker Lendecke
3df821acc4 s3: Remove smbd_messaging_context() from remove_pending_lock() 2010-07-05 11:06:29 +02:00
Volker Lendecke
411412dc65 s3: Remove smbd_messaging_context() from push_blocking_lock_request_smb2() 2010-07-05 11:06:29 +02:00
Volker Lendecke
8aa3f47dc9 s3: Remove procid_self() from irix_oplocks_read_fde_handler() 2010-07-05 11:06:29 +02:00
Volker Lendecke
c63f75f17c s3: Remove smbd_messaging_context() from smb_set_posix_lock() 2010-07-05 11:06:29 +02:00
Volker Lendecke
8ea271bb2e s3: Remove smbd_messaging_context() from linux_oplock_signal_handler() 2010-07-05 11:06:28 +02:00
Volker Lendecke
02a42a0a1d s3: Remove procid_self() from blocking_lock_cancel_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
f60c6f55c9 s3: Remove procid_self() from process_blocking_lock_queue() 2010-07-05 11:06:28 +02:00
Volker Lendecke
a9aa582de5 s3: Remove procid_self() from remove_pending_lock_requests_by_mid_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
a07c1586ba s3: Remove procid_self() from cancel_pending_lock_requests_by_fid() 2010-07-05 11:06:28 +02:00
Volker Lendecke
c49f6a681d s3: Remove procid_self() from generic_blocking_lock_error() 2010-07-05 11:06:28 +02:00
Volker Lendecke
d42806a013 s3: Remove procid_self() from push_blocking_lock_request() 2010-07-05 11:06:28 +02:00
Volker Lendecke
eb29f84b5f s3: Remove smbd_messaging_context() from blocking_lock_cancel_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
dd48e0afe0 s3: Remove smbd_messaging_context() from process_trans2() 2010-07-05 11:06:28 +02:00
Volker Lendecke
ae75a90b18 s3: Remove smbd_messaging_context() from process_lockingX() 2010-07-05 11:06:27 +02:00
Volker Lendecke
e606b27114 s3: Remove smbd_messaging_context() from reply_lockingX_error() 2010-07-05 11:06:27 +02:00
Volker Lendecke
fef875f64f s3: Remove smbd_messaging_context() from push_blocking_lock_request() 2010-07-05 11:06:27 +02:00
Volker Lendecke
75e16757e3 s3: Remove smbd_messaging_context() from contend_level2_oplocks_begin_default() 2010-07-05 11:06:27 +02:00
Volker Lendecke
d1587f9924 s3: Remove smbd_messaging_context() from reply_to_oplock_break_requests() 2010-07-05 11:06:27 +02:00
Volker Lendecke
b01a41d05b s3: Remove smbd_messaging_context() from smbd_do_locking() 2010-07-05 11:06:27 +02:00
Volker Lendecke
914b1c034f s3: Remove smbd_messaging_context() from rename_open_files() 2010-07-05 11:06:27 +02:00
Volker Lendecke
8da0575507 s3: Remove smbd_messaging_context() from reply_unlock() 2010-07-05 11:06:27 +02:00
Volker Lendecke
9a3f53075e s3: Remove smbd_messaging_context() from reply_lock() 2010-07-05 11:06:27 +02:00
Volker Lendecke
80cc726b4a s3: Remove smbd_messaging_context() from reply_writeunlock() 2010-07-05 11:06:26 +02:00
Volker Lendecke
298da9a0a4 s3: Remove smbd_messaging_context() from reply_lockread() 2010-07-05 11:06:26 +02:00
Volker Lendecke
ba3b101c45 s3: Remove smbd_messaging_context() from send_break_message() 2010-07-05 11:06:26 +02:00
Volker Lendecke
e6a089484b s3: Remove smbd_messaging_context() from exit_server_common() 2010-07-05 11:06:26 +02:00
Volker Lendecke
6c53365d11 s3: Remove smbd_messaging_context() from close_normal_file() 2010-07-05 11:06:26 +02:00
Volker Lendecke
f22e58bcd3 s3: Remove smbd_messaging_context() from notify_deferred_opens() 2010-07-05 11:06:26 +02:00
Volker Lendecke
07854cb099 s3: Remove procid_self() from make_connection_snum() 2010-07-05 11:06:25 +02:00
Volker Lendecke
5387d6ee16 s3: Remove procid_self() from claim_connection() 2010-07-05 11:06:25 +02:00
Volker Lendecke
33242471e5 s3: Remove NULL checks from claim_connection()
Nowadays this is only called from make_connection_snum() where we always
provide a connection_struct.
2010-07-05 11:06:25 +02:00
Volker Lendecke
faef081e96 s3: Remove procid_self() from push_blocking_lock_request_smb2() 2010-07-05 11:06:25 +02:00
Volker Lendecke
c89b55b573 s3: Remove procid_self() from reply_negprot() 2010-07-05 11:06:25 +02:00
Volker Lendecke
2d7cce6b7c s3: Remove procid_self() from break_kernel_oplock() 2010-07-05 11:06:25 +02:00
Volker Lendecke
13441a9e18 s3: Remove procid_self() from session_claim() 2010-07-05 11:06:25 +02:00
Volker Lendecke
f1d6eed962 s3: Remove procid_self() from exit_server_common 2010-07-05 11:06:25 +02:00
Volker Lendecke
23790c9a8f s3: Add sconn_server_id() 2010-07-05 11:06:24 +02:00
Volker Lendecke
58b9595bab s3: Add missing prototype for smb2_opcode_name 2010-07-05 11:06:24 +02:00
Volker Lendecke
9cc52e8411 s3: Add msg_ctx to smbd_server_connection
It would be obvious to initialize this in smbd_init_globals(), but there the
messaging_context can't be initialized yet because we don't have smb.conf
loaded yet.
2010-07-05 11:06:23 +02:00
Volker Lendecke
a27bd84bf8 s3:Fix a bogus uninitialized variable warning 2010-07-05 11:06:23 +02:00
Volker Lendecke
300667e4a9 s3: Pass procid_self() explicitly to messaging_ctdbd_connection() 2010-07-05 11:06:23 +02:00
Volker Lendecke
849f72b254 s3: Create a unique id for the smbd parent 2010-07-05 11:06:23 +02:00
Volker Lendecke
23a31becac s3: Remove unused msg_flags from connections.tdb
This breaks rolling code upgrade!
2010-07-04 21:49:03 +02:00
Volker Lendecke
b0c83d50f9 s3: Replace register_message_flags() with serverid_register_msg_flags()
message_send_all is now done by walking the serverid.tdb, not the
connections.tdb anymore.

Günther, Simo, please check!
2010-07-04 21:49:03 +02:00
Volker Lendecke
7f0e6df883 s3: Pass the new server_id through reinit_after_fork 2010-07-04 17:29:23 +02:00
Volker Lendecke
b3194be286 s3: Fix some type-punned warnings 2010-07-04 16:41:14 +02:00
Volker Lendecke
b01958b0bd s3: Remove serverid_[de]register_self
This removes some deep references to procid_self()
2010-07-04 16:41:14 +02:00
Volker Lendecke
f8e7077d5c s3: Don't attempt to deregister from serverid twice
The parent has to take care of crashed child processes anyway, so we don't have
to clean up in the child
2010-07-04 13:48:10 +02:00
Günther Deschner
6625aada81 s3-libsmb: move change_trust_account_password out of smbd into libsmb.
Guenther
2010-06-30 21:46:08 +02:00
Ira Cooper
3549425b30 s3: Change exit on immediate socket failure.
This change makes it so socket errors early in the smbd child
    process cause orderly exits not coredumps.

Signed-off-by: Jeremy Allison <jra@samba.org>
2010-06-28 12:08:03 -07:00
Andreas Schneider
e716924590 s3-smbd: Make sure that status is initialized when used.
Found by clang-analyzer.
2010-06-28 12:56:13 +02:00
Andreas Schneider
6ac050f73f s3-lanman: Make sure count is not used uninitialized if we jump to out.
Found by clang-analyzer.
2010-06-28 12:56:13 +02:00
Andreas Schneider
06a1766315 s3-lanman: Make sure that job_info is not undefined.
Found by clang-analyzer.
2010-06-28 12:56:13 +02:00
Jeremy Allison
afc6d2f46d Don't use frame as the talloc ctx in open_schannel_session_store(), as this breaks running from inetd
(we free frame below). Use NULL instead.

Jeremy.
2010-06-25 13:29:00 -07:00