1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

1014 Commits

Author SHA1 Message Date
Jeremy Allison
1832c95910 Fix bug 8314] - smbd crash with unknown user.
All other auth modules code with being called with
auth_method->private_data being NULL, make the auth_server
module cope with this too.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Jul 23 02:55:01 CEST 2011 on sn-devel-104
2011-07-23 02:55:01 +02:00
Stefan Metzmacher
ab9d99cece s3:auth_server: make use of cli_state_remote_name()
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
823ce6f50f s3:auth_domain: we already have the dc_name, it's the same as cli->desthost
metze
2011-07-22 17:06:09 +02:00
Stefan Metzmacher
b76951ba8f s3:auth_domain: add some const to sockaddr_storage
metze
2011-07-22 17:06:08 +02:00
Jeremy Allison
fafd386910 Fix const warning.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jul 22 01:58:39 CEST 2011 on sn-devel-104
2011-07-22 01:58:39 +02:00
Andrew Bartlett
57ab47c02e s3-auth fix dummy function in the not-with-kerberos case 2011-07-20 11:40:02 +10:00
Andrew Bartlett
d8cce7d466 s3-auth Replace False with false in auth_util.c
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Jul 20 02:31:15 CEST 2011 on sn-devel-104
2011-07-20 02:31:15 +02:00
Andrew Bartlett
c2ce806790 s3-auth Replace True with true in auth_util.c 2011-07-20 09:17:15 +10:00
Andrew Bartlett
bdd794cd62 s3-auth Fix spelling 2011-07-20 09:17:15 +10:00
Andrew Bartlett
d2a661a531 s3-auth Remove pointless destructor in make_server_info
All the callers allocate ->info3 as a talloc child already.

As regardes the TALLOC_ZERO(), I added this originally out of parinoia
many years ago.  We do not consistantly zero session keys in memory,
and for NTLMv2 and Kerberos they are random for each sesssion, so
breaking into smbd far enough to read an old session key isn't a
particularly interesting attack, compared with (say) reading the
keytab or the password database.  (NTLM and LM session keys are fixed
derivitives of the passwords however).

Andrew Bartlett
2011-07-20 09:17:15 +10:00
Andrew Bartlett
15123d96ff s3-auth inline make_auth_session_info into only caller 2011-07-20 09:17:15 +10: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
9d09b66f41 auth: Set NETLOGON_GUEST and use it to determine guest status
These additional measures should help ensure we do not accidentily upgrade
a guest to an authenticated user in the future.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:14 +10:00
Andrew Bartlett
52b28ec813 auth: Split out make_user_info_SamBaseInfo and add authenticated argument
This will allow the source3 auth code to call this without needing to
double-parse the SIDs

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
594597eb65 s3-auth reimplement copy_session_info via NDR pull/push
This ensures we do not miss elements.  Pattern copied from auth_netlogond.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
9d96b78f31 s3-auth Remove pointless destructor
All the users of this structure allocate info3 on the session_info

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
86f2a197df s3-auth Avoid redundant copies in create_local_token()
These values were not read before being overwritten again.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:12 +10:00
Andrew Bartlett
4363b71f62 s3-auth Add comments to copy_session_info_serverinfo_guest()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:12 +10:00
Andrew Bartlett
74815e08d9 s3-auth inline copy_serverinfo_session_info into only caller
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:12 +10:00
Andrew Bartlett
140435f399 s3-auth use a cached auth_serversupplied_info in make_server_info_guest()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:12 +10:00
Andrew Bartlett
fc19c699a9 s3-auth remove extra from auth3_session_info
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:12 +10:00
Andrew Bartlett
894fc14a2e s3-auth Clarify inputs and ouptuts by using elements from server_info
This allows us not the put all of these elements into the auth3_session_info
if they are only used as inputs to these functions.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:12 +10:00
Andrew Bartlett
d22ff66afa s3-auth assert that security_token is present in the copy, and explain why nss_token can be skipped
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
eea444f465 s3-auth: Remove unused lm_session_key from auth3_session_info
The long term authorization state needs only the final, negotiated
session key, and not the original LM key that may possibly have been
an input.

The special case of the guest account simply needs both values filled
back in with the zeros to avoid changing behaviour in the cached
server_info.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +10:00
Andrew Bartlett
058f5e60c5 s3-auth remove unused copy_serverinfo
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:11 +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
d7d8a5ed94 s3-auth Add struct auth3_session_info to aid transition to auth_session info
This will allow a gradual conversion of the required elements from the
current struct auth_serversupplied_info.

This commit adds the structure definition and some helper functions to
copy between the two structures.

At this stage these structures and functions are IDENTICAL to the
existing code, and so show the past history of that code.  The plan is
to slowly modify them over the course of the patch series, so that the
changes being made a clear.

By using a seperate structure to auth_serversupplied_info we can
remove elements that are not needed after the authentication, and we
can choose a layout that best reflects the needs of runtime users,
rather than the internals of the authentication subsystem.

By eventually using the auth_session_info from auth.idl, we will gain
a single session authorization structure across the whole codebase,
allowing more code to be shared, and a much more transparent process
for forwarding authorization credentials over the named pipe proxy.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
e244319599 s3-auth Add const to indicate input elements
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
fa18267042 auth: Preserve guest flag on transition via netr_SamInfo3
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
f47662f363 s3-auth Restore nss_token behaviour by reading from server_info
The implementation of copy_serverinfo(), used to copy server_info into
session_info never copied the nss_token variable, and so
17d8f0ad30 introduced this regression.

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
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
f97bdebbbe s3-auth: Fix account check over ncalrpc. 2011-07-13 14:09:35 +02:00
Stefan Metzmacher
1f50d04a5c s3:auth_server: use cli_echo() to check if the server is alive
This works over port 139 and also 445. send_keepalive() would
only work on port 139.

metze
2011-07-11 18:18:28 +02:00
Stefan Metzmacher
8c29afe14e s3:auth_server: make use of cli_state_is_connected()
metze
2011-07-11 18:18:28 +02:00
Stefan Metzmacher
a7b9c628af s3:auth_server: use cli->is_guestlogin instead of parsing cli->inbuf.
cli->inbuf is not the valid response buffer of the session setup response.

metze
2011-07-08 14:09:07 +02:00
Stefan Metzmacher
ce751946dd s3:auth: remove unused variable
metze
2011-07-08 14:09:06 +02:00
Stefan Metzmacher
f0085eedf0 s3:auth_unix: remove unused var
metze
2011-07-08 13:51:46 +02:00
Andrew Bartlett
6b97a3b1ff s3-build allow_undefined_symbols=False is the default now 2011-07-04 19:03:52 +10:00
Andrew Bartlett
5d4b197418 s3-auth libauth no longer requires undefined symbols 2011-07-04 18:58:32 +10:00
Andreas Schneider
66badc1740 s3-auth: Remove global smbd_server_conn from auth_unix.c.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:04 +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
6b86590342 s3-auth: Only reload the config file.
We only need to reload the config file. This removes a dependency to
smbd.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:27:53 +10:00