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

3878 Commits

Author SHA1 Message Date
Andreas Schneider
43604dd321 s3-spoolss: Use tmp_ctx in winreg_delete_printer_key_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
bed0672b03 s3-spoolss: Free local in winreg_printer_binding_handle. 2011-07-27 08:49:58 +02:00
Simo Sorce
99e03bee7a s3-spoolss: Improve memory efficiency.
p->mem_ctx is a relatively long lived context as it will not be freed until
a full request is served. In spoolss we do a lot of operations including
opening new pipes to connect to winreg.
Use more shortlived temporary contexts to avoid leaking a lot of memory on
p->mem_ctx and carrying it around untill all the operations in the current call
are done.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-07-27 08:49:58 +02:00
Andreas Schneider
fe7e4ac462 s3-rpc_server: Copy correct local tsocket address. 2011-07-27 08:49:58 +02:00
Simo Sorce
b19b05cd0a s3-rpc_server: Do not set msg_ctx twice
msg_ctx was already passed to make_base_pipes_struct,
no need to set it again.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Fri Jul 22 00:47:28 CEST 2011 on sn-devel-104
2011-07-22 00:47:28 +02:00
Andreas Schneider
fb2ee304a8 s3-rpc_server: Pass msg_ctx to make_base_pipes_struct().
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Jul 21 21:08:32 CEST 2011 on sn-devel-104
2011-07-21 21:08:31 +02:00
Simo Sorce
156a0ffe54 s3-rpc_server: Create common function to allocate pipes_struct
Avoid code duplication and fix bug where a new pipe was not added to
InternalPipes upon creation in make_server_pipes_struct()

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Jul 21 19:50:02 CEST 2011 on sn-devel-104
2011-07-21 19:50:02 +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
Andreas Schneider
0d8f65b346 s3-rpc_server: Fixed header define. 2011-07-21 18:40:23 +02:00
Andreas Schneider
6a4a6efdc9 s3-rpc_server: Remove unused endpoint information. 2011-07-21 18:40:23 +02:00
Andreas Schneider
4a6a588e44 s3-rpc_server: We need to copy the session_info for external pipes.
Andrew please check!
2011-07-21 18:40:23 +02:00
Andreas Schneider
19288f9784 s3-rpc_server: Duplicate the pipe name. 2011-07-21 18:40:23 +02:00
Andreas Schneider
3a43ef52db s3-rpc_server: Free the np dir. 2011-07-21 18:40:22 +02:00
Andreas Schneider
304e8116a9 s3-rpc_server: Fix messaging context in the pipes struct. 2011-07-21 18:40:22 +02:00
Andreas Schneider
f5da8ed889 s3-rpc_server: Add my copyright. 2011-07-21 18:40:22 +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
03b153ce54 s3-rpc_server remove per-element copies of auth_session_info
This is not required any more now that they are the same structure,
and shows the value in having a common structure across the codebase.

In particular, now any additional state that needs to be added to the
auth_session_info will be transparently available across the named
pipe proxy, without a need to modify the mapping layer.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +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
8d72e612ac s3-rpc_server read and write the unix_token and unix_info across named_pipe_auth
This ensures that the exact same token is used on both sides of the
pipe, when a full token is passed (ie, source3 to source3, but not yet
source4 to to source3 as the unix info isn't calculated there yet).

If we do not have unix_token, we fall back to the old behaviour and go
via create_local_token().  (However, in this case the security_token
is now overwritten, as it is better to have it match the rest of the
session_info create_local_token() builds).

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
ec5f1b78af s3-auth Use system boolean in auth_user_info_unix
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +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
55ad1da888 Add my copyright
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:09 +10:00
Andreas Schneider
df09511cf2 s3-rpc_server: Fixed segfaults in rpc daemons.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Mon Jul 18 14:01:02 CEST 2011 on sn-devel-104
2011-07-18 14:01:02 +02:00
Günther Deschner
ee1f25dc2a lsa: lsa_CreateTrustedDomainEx takes lsa_TrustDomainInfoAuthInfo, not
lsa_TrustDomainInfoAuthInfoInternal.

Guenther
2011-07-15 17:56:39 +02:00
Günther Deschner
3af3e4843f lsa: rename auth info argument in lsa_CreateTrustedDomainEx2
Guenther
2011-07-15 17:55:20 +02:00
Andreas Schneider
8faee7bd9b s3-rpc_server: Pass event and messaging context to accept function.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Jul 14 17:22:16 CEST 2011 on sn-devel-104
2011-07-14 17:22:16 +02:00
Andreas Schneider
c69f2c4de9 s3-librpc: Pass messaging context to dcerpc register functions. 2011-07-14 16:10:47 +02:00
Andreas Schneider
5e0ff955ad s3-epmapper: Fix adding tcpip endpoints.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Wed Jul 13 15:22:11 CEST 2011 on sn-devel-104
2011-07-13 15:22:11 +02:00
Günther Deschner
f4add4fbf5 s3-waf: split out LIBCLI_WINREG_INTERNAL as LIBCLI_WINREG was pulling in rpc server code in undesired places.
Andreas, please check.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Jul  8 18:34:44 CEST 2011 on sn-devel-104
2011-07-08 18:34:43 +02:00
Günther Deschner
72b1f8be56 s3-printing: safe a ton of roundtrips by reusing existing winreg binding_handles.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:02 +02:00
Günther Deschner
0a1ec73b96 s3-printing: use winreg_internal functions.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
ada5380d20 s3-printing: add winreg_internal functions.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
a762eda519 s3-printing: add winreg_printer_binding_handle and remove most of srv_spoolss_util.c.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
74e416031b s3-printing: move driver_info_ctr_to_info8 to init_spoolss.h
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
dd5375b4a1 s3-printing: move os2 related functions to printing/nt_printing_os2.c.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Andreas Schneider
1caa7a852c s3-waf: Fix linking bugs causing segfaults.
As auth_util.c is linked several times the static variables have
different address on different calls. This leads to segfaults.

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Jul  7 16:50:05 CEST 2011 on sn-devel-104
2011-07-07 16:50:05 +02:00
Volker Lendecke
f924913259 s3: Remove some unused variables
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Jul  5 18:40:11 CEST 2011 on sn-devel-104
2011-07-05 18:40:11 +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
Volker Lendecke
0bec150ab1 s3: Fix an enum/int mixup
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Jul  4 18:47:59 CEST 2011 on sn-devel-104
2011-07-04 18:47:59 +02:00
Andrew Bartlett
b8b504a484 s3-samr Send IP address only to PAM remote hostname hook on password set
The previous behaviour was to attempt to do a reverse hostname lookup,
where enabled.  This new behaviour matches the new behaviour in the
modules called by auth stack.

Andrew Bartlett
2011-07-04 18:28:46 +10:00
Andreas Schneider
2bcbeea05e s3-rpc_server: Remove client_id and server_id from pipes struct.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:43 +10:00
Andreas Schneider
726b6c6e52 s3-epmapper: Replace server_id in the epmapper.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:14 +10:00
Andreas Schneider
784035fd53 s3-spoolss: Replace client_id in the spoolss server.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:12 +10:00
Andreas Schneider
5f228fff2a s3-samr: Replace client_id in samr server.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:10 +10:00
Andreas Schneider
f0361924fb s3-rpc_server: Replace client_id in dcerpc gssapi server.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:08 +10:00
Andreas Schneider
7acaf405e4 s3-rpc_server: Remove unused client_id in srv_pipe.c.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:06 +10:00