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

881 Commits

Author SHA1 Message Date
Björn Jacke
aa830cde6a pam: fix unused variable warning 2010-08-24 11:18:34 +02:00
Volker Lendecke
a16a56f601 s3: PAM_RHOST and PAM_TTY are enums on FreeBSD 2010-08-23 22:59:56 +02:00
Volker Lendecke
8531921e3d s3: Turn two macros into functions 2010-08-22 22:42:21 +02:00
Volker Lendecke
177e394f93 s3: Pass the rhost through smb_pam_accountcheck 2010-08-22 22:42:21 +02:00
Volker Lendecke
265f0b7745 s3: Rename auth.c:backends to auth_backends 2010-08-22 22:42:21 +02:00
Volker Lendecke
6ff012a777 s3: Fix some nonemtpy blank lines 2010-08-22 22:42:21 +02:00
Jeremy Allison
22a0168504 Fix const warning. 2010-08-20 15:56:37 -07:00
Volker Lendecke
ba706d696b s3: Remove smb_pam_accountcheck from the auth modules
We go through the same check in auth/auth.c line 287 after the module has done
its job. So we don't have to do that check twice.
2010-08-19 11:54:36 +02:00
Volker Lendecke
ac7b63384d s3: Lift smbd_server_fd from reload_services() 2010-08-18 11:18:21 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Andreas Schneider
66b6a8cf62 s3-auth: Remove obsolete 'update encrypted' option. 2010-08-16 12:48:27 +02:00
Andrew Bartlett
4f8ef205ac s3:auth Add error paths for invalid password_state values
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-08-14 11:58:13 +10:00
Andrew Bartlett
70211ea6a3 s3:auth Change winbindd -> auth interface to more standard structures
This removes conversions to and from the source3 varient of the
server_info structure when replaced in s3compat, and presents a tidier
interface to winbindd in any case.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-08-14 11:58:13 +10:00
Andrew Bartlett
b1b9752506 s3:auth Change 'make_user_info' to be talloc based
This is an ideal candidate, as it already uses a free function.  It
now uses talloc destructors to clear the passwords if required.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-08-14 11:58:13 +10:00
Andrew Bartlett
e66f6e715f s3:auth Whitespace fixes after auth merge 2010-08-14 11:58:13 +10:00
Andrew Bartlett
23994e1b53 s3:auth Make Samba3 use the new common struct auth_usersupplied_info
This common structure will make it much easier to produce an auth
module for s3compat that calls Samba4's auth subsystem.

In order the make the link work properly (and not map twice), we mark
both that we did try and map the user, as well as if we changed the
user during the mapping.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-08-14 11:58:13 +10:00
Volker Lendecke
39da717fe1 s3: Lift the smbd_messaging_context from reload_services 2010-08-08 18:09:33 +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
ccd4af271f s3: remove global include of samr.h
Guenther
2010-08-06 15:43:38 +02:00
Günther Deschner
c136b84f0d s3-secrets: only include secrets.h when needed.
Guenther
2010-08-05 10:12:25 +02:00
Simo Sorce
3c3237dd0a s3-auth: Remove unimplemented functions 2010-07-28 12:18:28 -04:00
Volker Lendecke
032bf5c629 s3: Fix a typo (missing space) 2010-07-24 11:19:42 +02:00
Simo Sorce
4581902553 s3-dcerpc: Unifiy cli_pipe_auth_data and pipe_auth_data
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-20 15:52:37 +10: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
Simo Sorce
944494d350 s3-auth: Remove unused variable.
It was a spurious remnant after a rebase.
2010-07-19 13:53:34 -04: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
673fcfa377 s3-auth: auth_make ntlmssp_state the parent context
There is no need for a separate mem_ctx member.
Also make the ntlmssp_state a children of auth_ntlmssp_state
Also cleanup auth_ntlmssp_end to free only what is not automatically freed

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:20:02 +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
Simo Sorce
e4bd6eb72f s3-auth: Cleanup and readability fixes
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:19:58 +10:00
Simo Sorce
cdcdaaa6dd s3-ntlmssp: Remove ntlmssp_end and let the talloc hierarchy handle it.
All the members are children of ntlmssp_state anyway.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 14:19:47 +10: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
Volker Lendecke
c186f92437 s3: [ug]id_to_unix_... can not fail
Remove some silly failure checks
2010-07-11 17:33:34 +02:00
Volker Lendecke
328f3ca103 s3: Slightly simplify make_server_info_pw 2010-07-08 13:34:16 +02:00
Volker Lendecke
175d9478fe s3: In make_server_info_info3, check the result of copy_netr_SamInfo3 2010-06-25 17:06:08 +02:00
Volker Lendecke
17cd3d06cb s3: In copy_netr_SamInfo3 copy all of the sids array 2010-06-25 16:58:46 +02:00
Günther Deschner
b4364add89 s3-auth: in make_user_info_for_reply_enc make sure to check length and data
pointer of nt and lm hash.

This fixes kernel cifs client with sec=ntlmv2.

Guenther
2010-06-16 14:42:23 +02:00
Günther Deschner
06417abc7c s3-auth: fix debug message in check_winbind_security().
Guenther
2010-06-16 14:42:23 +02:00
Günther Deschner
185adc4c81 Revert "s4-smbtorture: only pull info when status code indicates success in smbcli_rap_netprintqgetinfo()."
This reverts commit 1f1c04010a.
2010-06-16 12:18:32 +02:00
Günther Deschner
1f1c04010a s4-smbtorture: only pull info when status code indicates success in smbcli_rap_netprintqgetinfo().
Guenther
2010-06-16 12:15:24 +02:00
Günther Deschner
4bb351ac80 s3-auth: Fix valgrind warning (unitialized var) in samu_to_SamInfo3().
Guenther

s3:auth do not fail if there are 0 group sids

Signed-off-by: Günther Deschner <gd@samba.org>
2010-06-11 15:11:31 +02:00
Simo Sorce
4fc36ca802 s3:auth fix samu->info3 conversion
Some pdb_get_ functions where missing because of previous mis-patching
2010-06-11 08:26:39 -04:00
Andreas Schneider
0962763822 s3:misc make use of server_[event/messaging]_context directly
Untangle these functions from smbd specific dependencies so they can be freely
used in multiple servers.
2010-06-10 17:30:45 -04:00
Volker Lendecke
34b29b1198 Revert "s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS"
This reverts commit edba46ce94.

Conflicts:

	source3/auth/auth_ntlmssp.c
2010-06-08 11:38:08 +02:00
Andrew Bartlett
9a747d500f s3:auth add hooks to indicate if signing or sealing is desired with NTLMSSP
This allows the right hooks to be called in GENSEC when s3compat
implements the auth_ntlmssp interface.  Otherwise, we can't do the
signing or sealing as we have not negoitated it's use.

Andrew Bartlett
2010-06-07 23:34:29 +10:00
Andrew Bartlett
edba46ce94 s3:auth Change auth_ntlmssp_server_info API to return NTSTATUS
It's nicer to have an NTSTATUS return, and in s3compat there may be a
reason other than 'no memory' why this can fail.

Andrew Bartlett
2010-06-07 23:34:29 +10:00
Andrew Bartlett
fc956cfcbb s3:auth Rename user_info->domain -> user_info->mapped.domain_name
This is closer to the structure I want for a common struct
auth_usersupplied_info.

Andrew Bartlett
2010-06-07 23:34:28 +10:00
Andrew Bartlett
deabae191b s3:auth Rename user_info->client_domain -> user_info->client.domain_name
This is closer to the structure I want for a common struct
auth_usersupplied_info.

Andrew Bartlett
2010-06-07 23:34:28 +10:00
Andrew Bartlett
7a021df96d s3:auth Rename user_info->internal_username -> user_info->mapped.account_name
This is closer to the structure I want for a common struct
auth_usersupplied_info.

Andrew Bartlett
2010-06-07 23:34:28 +10:00
Andrew Bartlett
23159453d3 s3:auth Rename user_info->smb_name -> user_info->client.account_name
This is closer to the structure I want for a common struct
auth_usersupplied_info.

Andrew Bartlett
2010-06-07 23:34:28 +10:00
Simo Sorce
00089fd74a s3:auth make sure the primary group sid is usable
This function was previously performed under the cover by converting
back and forth from info3 to samu and then later from samu to info3.

Since we now shortcircuit that in some cases, check explicitly using
get_primary_group_sid()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:08 +10:00
Simo Sorce
048575defb s3:auth return the full passwd struct from check_account
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:08 +10:00
Simo Sorce
aaf45cd48e s3:auth remove unused structure member
sids are now completely handled using info3, remove dead code that fills
server info sids and the structure members themselves

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:07 +10:00
Simo Sorce
aa1a3cbad2 s3:auth create nt token from info3 directly
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:07 +10:00
Simo Sorce
e6456df148 s3:auth handle unix domain sids in samu
When we generate a user out of thin air we may end up adding sids
that are not part of the sam domain (unix domain sids).
Handle the case and preserve these sids as extra sids.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:07 +10:00
Simo Sorce
61823fb885 s3:auth set the resolved user sid in the fake sam account
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:07 +10:00
Simo Sorce
ef942172b9 s3:auth check the user is valid first
It makes no sense to go through all the hoops to build samu and
convert it to info3, just to discard them later if the user was
not valid.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:06 +10:00
Simo Sorce
1bb0afa662 s3:auth make sure we set the right username
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-06-07 22:53:06 +10:00
Andreas Schneider
9097bdddd0 s3-auth: Moved smbd user functions to a generic place.
Reviewed-by: Simo Sorce <idra@samba.org>
2010-06-04 12:12:37 -04:00
Andrew Bartlett
a6e07c22a3 s3:auth Rename wksta_name -> workstation_name in auth_usersupplied_info 2010-06-01 17:11:25 +10:00
Simo Sorce
471ed70c49 s3:smbd map_username() doesn't need sconn anymore
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-05-31 18:21:29 +02:00
Günther Deschner
3f24f8d2c6 s3-auth: add "system" bool flag to auth_serversupplied_info.
Guenther
2010-05-31 15:30:59 +02:00
Andrew Bartlett
d6fa371b92 s3:ntlmssp Use a TALLOC_CTX for ntlmssp_sign_packet() and ntlmssp_seal_packet()
This ensures the results can't be easily left to leak.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:11:27 +02:00
Andrew Bartlett
ebae21f023 ntlmssp: Make the ntlmssp.h from source3/ a common header
The code is not yet in common, but I hope to fix that soon.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:56 +02:00
Andrew Bartlett
723ea68d3b s3:auth Remove AUTH_NTLMSSP_STATE typedef.
typedefs are no longer preferred Samba style.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:44 +02:00
Andrew Bartlett
3b706865f6 s3:auth Make AUTH_NTLMSSP_STATE a private structure.
This makes it a little easier for it to writen in terms of GENSEC in future.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-31 15:10:33 +02:00
Simo Sorce
33c633df0b s3:auth make it easier to trace auth modules 2010-05-29 17:08:10 -04:00
Simo Sorce
bd38c0d47d s3:auth fix info3 duplication function 2010-05-29 17:08:02 -04:00
Andrew Bartlett
b455c5e155 s3:auth Fix segfault when the user cannot be found by getpwnam()
Add comment to notify when getpwnam() fails.

Reviewed-by: Simo Sorce <idra@samba.org>
2010-05-29 09:22:53 -04:00
Andreas Schneider
93ac516e15 s3-auth: Added a function to get the server_info from the system user.
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 14:31:39 +02:00
Günther Deschner
c5eeb0d155 s3-auth: fix c++ buildwarnings.
Guenther
2010-05-28 02:49:37 +02:00
Simo Sorce
20fb373202 s3:auth remove login_server from server info
It is not used anymore, we have that information in
info3->base.logon_server already
2010-05-27 19:41:07 -04:00
Simo Sorce
3bb819581b Fix Out of memory checks
Günther pushed an older version of the patch "s3:auth add function to copy a
netr_SamInfo3 structure" that was missing these fixes.
2010-05-27 19:23:54 -04:00
Simo Sorce
2a6a696e32 s3:auth add function to convert wbcAuthUserInfo to netr_SamInfo3
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 01:20:09 +02:00
Simo Sorce
606be25ecf s3:auth Free sampass as soon as we have server_info
We don't keep sampass in server_info anymore
So it makes no sense to keep it around.

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:56:02 +02:00
Simo Sorce
d9cffc01be s3:auth use info3 in auth_serversupplied_info
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:53 +02:00
Simo Sorce
6713f3d945 s3:auth add function to copy a netr_SamInfo3 structure
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:27 +02:00
Simo Sorce
605cfef56c s3:auth: add function to convert samu to netr_SamInfo3
Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-28 00:55:17 +02:00
Roel van Meer
366333c08f Fix bug #7448 - smbd crash when sambaLMPassword and sambaNTPassword entries missing from ldap.
Protect SMBsesskeygen_ntv1() from a NULL pointer.
2010-05-21 14:17:17 -07:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Günther Deschner
5ed3654112 s3-rpc_client: move protos to cli_netlogon.h
Guenther
2010-05-18 21:42:37 +02:00
Günther Deschner
1d2dd47d31 s3-crypto: only include crypto headers when crypto is done.
Guenther
2010-05-18 00:44:27 +02:00
Günther Deschner
ca73e03eb7 security: merge builtin rid tables.
Guenther
2010-05-18 00:44:26 +02:00
Günther Deschner
3b529d50be s3-rpc_misc: clean out include/rpc_misc.h.
Well known rids don't really belong into an rpc header, just use the ones
defined in security.idl.

Guenther
2010-05-18 00:44:26 +02:00
Andrew Bartlett
468fb4fee4 s3:auth Make get_ntlm_challenge more like Samba4
This helps with the upcoming NTLMSSP merge, and allows errors to be returned.

Andrew Bartlett
2010-05-13 10:12:26 +10:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Volker Lendecke
b1a27e81d7 s3: Apply some const 2010-04-12 21:42:54 +02:00
Matthias Dieter Wallnöfer
1a27343366 s3/s4:netlogon IDL - fix up "struct netr_SamInfo6" regarding the "forest" attribute
According to MS-NRPC 2.2.1.4.13 this should be the DNS domainname, not the
forest one.
2010-04-12 18:49:01 +02:00
Volker Lendecke
8e95db9eea s3: Move serverinfo_to_SamInfoX to auth/server_info.c 2010-04-11 22:59:47 +02:00
Volker Lendecke
b8829e74fd s3: Move [make|free]_user_info to auth/user_info.c 2010-04-11 22:59:47 +02:00
Volker Lendecke
18909879cc s3: Move make_server_info_sam to auth/server_info_sam.c 2010-04-11 22:59:47 +02:00
Volker Lendecke
2b1a50c2e5 s3: Move sanitize_username to lib/util_str.c 2010-04-11 22:59:47 +02:00
Volker Lendecke
80708b75f8 s3: Move make_server_info to auth/server_info.c 2010-04-11 22:59:46 +02:00
Volker Lendecke
5792ccc7c8 s3: Move check_sam_security to auth/check_sam.c 2010-04-11 22:59:46 +02:00
Volker Lendecke
04f9e33de1 s3: Make check_sam_security public 2010-04-11 22:59:46 +02:00
Volker Lendecke
a0c175eca9 s3: Replace "auth_context" by "challenge" in need_to_increment_bad_pw_count args 2010-04-11 22:59:45 +02:00
Volker Lendecke
19c0086553 s3: Replace "auth_context" by "challenge" in sam_password_ok args 2010-04-11 22:59:45 +02:00
Volker Lendecke
7ba21a339c s3: Move user_in_group() and create_token_from_username() to token_utils.c
Goal is to be able to call check_sam_security from winbind
2010-04-11 22:59:45 +02:00
Volker Lendecke
b0d65f827e s3: Use talloc_stackframe() in user_in_group 2010-04-11 13:53:21 +02:00
Volker Lendecke
9655f63642 s3: Use talloc_stackframe() in user_in_group_sid 2010-04-11 13:53:21 +02:00