1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-11 00:23:51 +03:00
Commit Graph

205 Commits

Author SHA1 Message Date
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Jeremy Allison
80d1da7e6c r23530: Fix bugs #4678 and #4697 which had the same root cause.
In make_server_info_pw() we assign a user SID in our
authoritative SAM, even though this may be from a
pure "Unix User" that doesn't exist in the SAM.
This causes lookups on "[in]valid users" to fail as they
will lookup this name as a "Unix User" SID to check against
the user token. Fix this by adding the "Unix User"\unix_username
SID to the sid array. The correct fix should probably be
changing the server_info->sam_account user SID to be a
S-1-22 Unix SID, but this might break old configs where
plaintext passwords were used with no SAM backend.
Jeremy
2007-10-10 12:23:26 -05:00
Volker Lendecke
3d3d61687e r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and
replace all data_blob(NULL, 0) calls.
2007-10-10 12:22:01 -05:00
Volker Lendecke
450e4d94f6 r22819: Fix Bug 4613. We just dumped the must change & friends. With the
pass_last_changed == 0 we now return "Change now!" instead of "Change
never"
2007-10-10 12:22:00 -05:00
Volker Lendecke
4ad9f8aa61 r22740: Move debug_*_user_token to token_utils.c 2007-10-10 12:21:53 -05:00
Jeremy Allison
8968808c3b r22589: Make TALLOC_ARRAY consistent across all uses.
Jeremy.
2007-10-10 12:19:49 -05:00
Jeremy Allison
f6fa3080fe r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
2007-10-10 12:19:44 -05:00
Gerald Carter
3b24dae9e7 r22390: Patchset sent to samba-technical to address the winbind
loop when allocating a new id for a SID:

auth_util.patch		Revert create_local_token() to
			the 3.0.24 codebase

idmap_type.patch	Have the caller fillin the
			id_map.xid.type field when
			resolving a SID so that if we allocate
			a new id, we know what type to use

winbindd_api.patch	Remove the WINBINDD_SIDS_TO_XIDS calls
			from the public winbindd interface
			for the 3.0.25 release

idmap_rid.patch		Cleanup the idmap_rid backend to not
			call back into winbindd to resolve
			the SID in order to verify it's type.
2007-10-10 12:19:30 -05:00
Volker Lendecke
9de16f25c1 r22135: Check in most of Michael Adam's net conf utility. A good share of this patch
is moving functions around to fix some linker dependencies for the registry.

Michael, I've renamed your auth_utils2.c to token_utils.c.

Thanks!

Volker
2007-10-10 12:19:16 -05:00
Andrew Bartlett
5fe3328e66 r22022: - Clarify the comments
- make sure never to free an uninitialised variable

- ensure to free result on getpwnam_alloc failure

Andrew Bartlett
2007-10-10 12:19:03 -05:00
Andrew Bartlett
e3e0ec25e6 r22020: Make it more clear that both the vuser struct and it's contents are
talloc_free()'ed at the end of a session.

Rework the passwd cache code to use talloc_unlink and
talloc_reference, to more carefully manage the cache.

Andrew Bartlett
2007-10-10 12:19:03 -05:00
Stefan Metzmacher
fa322f0cc9 r22001: change prototype of dump_data(), so that it takes unsigned char * now,
which matches what samba4 has.

also fix all the callers to prevent compiler warnings

metze
2007-10-10 12:18:59 -05:00
Stefan Metzmacher
f948005ca6 r21999: remove useless casts
metze
2007-10-10 12:18:58 -05:00
Günther Deschner
7edbb636f7 r21536: Fix copy/paste typo.
Guenther
2007-10-10 12:18:11 -05:00
Volker Lendecke
3c879745cf r20824: Send access to the trusted domain passwords through the pdb backend, so that
in the next step we can store them in LDAP to be replicated across DCs.

Thanks to Michael Adam <ma@sernet.de>

Volker
2007-10-10 12:17:10 -05:00
Simo Sorce
9e8715e4e1 r20774: I thought I committed this before Xmas holidays ...
This change is needed to make it possible to not expire
caches in disconnected mode.

Jerry, please can you look at this and confirm it is ok?

Simo.
2007-10-10 12:17:08 -05:00
Simo Sorce
4a81ee9608 r20169: Support for fallback to legacy mapping code was not completely tested.
Add necessary fixes.
2007-10-10 12:16:28 -05:00
Simo Sorce
50cd8bffee r20116: Start merging in the work done to create the new idmap subsystem.
Simo.
2007-10-10 12:16:25 -05:00
Jeremy Allison
f83b6de44f r20098: Properly fix issues with create_token_from_username()
reported by James. Ensure that this function allocates
everything on the temporary context except the return
memory. Never call this with a null mem context, and
now use conn->mem_ctx instead in smbd/service.c.
Remove separate free functions for conn->ngroups
and conn->nt_user_token as they are now always
talloc'ed off the conn->mem_ctx. Future optimization
will be to remove conn->mem_ctx and make all objects
pointed to in the conn struct talloc'ed off conn itself.
Easy to free then :-).
Jeremy.
2007-10-10 12:16:24 -05:00
Jeremy Allison
0ffca7559e r20090: Fix a class of bugs found by James Peach. Ensure
we never mix malloc and talloc'ed contexts in the
add_XX_to_array() and add_XX_to_array_unique()
calls. Ensure that these calls always return
False on out of memory, True otherwise and always
check them. Ensure that the relevent parts of
the conn struct and the nt_user_tokens are
TALLOC_DESTROYED not SAFE_FREE'd.
James - this should fix your crash bug in both
branches.
Jeremy.
2007-10-10 12:16:24 -05:00
Volker Lendecke
fea52801de r19991: Sorry for this 2000-liner...
The main thing here is a rewrite of srv_winreg_nt.c. The core functionality
has moved to registry/reg_api.c which is then usable by the rest of Samba as
well.

On that way it fixes creating keys with more than one element in the
path. This did not work before.

Two things that sneaked in (sorry :-) is the change of some routines from
NTSTATUS to WERROR the removed "parent" argument to regkey_open_internal.

Volker
2007-10-10 12:16:18 -05:00
Simo Sorce
550f651499 r19980: Implement pam account stack checks when obey pam restrictions is true.
It was missing for security=server/domain/ads

Simo.
2007-10-10 12:16:17 -05:00
Volker Lendecke
fb3983ae1f r19773: TALLOC_FREE checks for NULL itself 2007-10-10 12:15:54 -05:00
Volker Lendecke
adfc82f0e6 r19008: Fix a segfault 2007-10-10 12:14:57 -05:00
Gerald Carter
3da9f80c28 r18271: Big change:
* autogenerate lsa ndr code
* rename 'enum SID_NAME_USE' to 'enum lsa_SidType'
* merge a log more security descriptor functions from
  gen_ndr/ndr_security.c in SAMBA_4_0

The most embarassing thing is the "#define strlen_m strlen"
We need a real implementation in SAMBA_3_0 which I'll work on
after this code is in.
2007-10-10 11:51:18 -05:00
Volker Lendecke
089b51e28c r18029: More C++ stuff 2007-10-10 11:43:23 -05:00
Volker Lendecke
70edd716ef r17924: Get rid of warnings now that talloc is merged.
Destructors now take a pointer to the "real" destroyed object as an argument.

Volker
2007-10-10 11:38:59 -05:00
Jeremy Allison
45d77ae122 r17875: Fix (rather theoretical, but still...) null deref found by
Stanford checker.
Jeremy.
2007-10-10 11:38:56 -05:00
Gerald Carter
0298a3466b r17736: Apply the Unix group patch when creating the token for a
username map.
2007-10-10 11:38:47 -05:00
Gerald Carter
3848199287 r17710: Thanks to Thomas Bork for testing and continued feedback on this.
Comments from the patch:

/* Add the "Unix Group" SID for each gid to catch mapped groups
   and their Unix equivalent.  This is to solve the backwards
   compatibility problem of 'valid users = +ntadmin' where
   ntadmin has been paired with "Domain Admins" in the group
   mapping table.  Otherwise smb.conf would need to be changed
   to 'valid user = "Domain Admins"'.  --jerry */
2007-10-10 11:38:46 -05:00
Jeremy Allison
1e1fcb5eb2 r17402: Added lookup_name_smbconf() to be called when looking
up names from smb.conf. If the name is unqualified it
causes the lookup to be done in WORKGROUP\name, then
"Unix [users|groups]"\name rather than searching the
domain. Should fix the problems with "force user"
selecting a domain user by preference.
Jeremy.
2007-10-10 11:38:31 -05:00
Volker Lendecke
d12b08fc61 r17399: Some C++ warnings 2007-10-10 11:38:31 -05:00
Jeremy Allison
16ebccbc58 r17393: Remove Volker's ASSERT that num_groupsids > 0.
For guest connection they may well be zero.
This should fix up the buildfarm (fingers
crossed).
Jeremy.
2007-10-10 11:38:31 -05:00
Jeremy Allison
6d822b8567 r17392: Commit Volker's fix for the valid users problem.
Let's look at the build farm now... :-).
Jeremy.
2007-10-10 11:38:31 -05:00
Jeremy Allison
65003e1b25 r17391: Revert the second part of the valid users fix - the
netlogon code uses pdb_get_group_sid() which could
return a S-1-1-22 unix sid. Who knew.... :-(.
I'm going to test Volker's fix instead. Once
3.0.23b is out we *have* to rip out the pdb_set_group_sid()
code....
Jeremy.
2007-10-10 11:38:31 -05:00
Jeremy Allison
79b1e668e2 r17388: Fix the "valid users"/token issue for now. Volker,
please come in and fix it in a less ugly way once
you have some time. Thanks,
Jeremy.
2007-10-10 11:38:30 -05:00
Jeremy Allison
0b5b2b53ec r17378: Fix the issues people have been having with mapped
users (username map) and failure to connect to a
share. Essentially, even on a standalone system
we were going into the create_token_from_username()
code (I think by mistake) if the username was mapped.
Fixes bug #3991.

Volker & Jerry - please go over this with a very careful eye
and let me know if this isn't correct (I think it is,
but this isn't my code and it's a dangerous area for
me to be playing in :-).

Jeremy
2007-10-10 11:38:29 -05:00
Volker Lendecke
19d0269000 r17022: Fix the build farm -- maybe this is the real fix, testing more 2007-10-10 11:19:20 -05:00
Volker Lendecke
f6e3ee147f r17016: Different and smaller fix for the valid users = username problem.
If no winbind is around, the best we can do to get the user's token correct is
to ask unix via create_token_from_username. More investigation is needed if
this also fixes the +groupname for unmapped groups problems more cleanly.

Volker
2007-10-10 11:19:20 -05:00
Volker Lendecke
7a629118ee r17011: Back out r17010 after talking to Jerry. Another fix pending...
Volker
2007-10-10 11:19:19 -05:00
Volker Lendecke
5e07ab750a r17010: If winbind is not around, add S-1-22-1-<uid> to the user's token.
See the comment in the patch for the reason.

Volker
2007-10-10 11:19:19 -05:00
Jeremy Allison
9dafb7f48c r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
2007-10-10 11:19:14 -05:00
Volker Lendecke
9ec5ccfe85 r16865: This is a proposal to fix bug 3915. Before sending patches around, this is
what svn is for.

The idea is that we fall back to a pure unix user with S-1-22 SIDs in the
token in case anything weird is going on with the 'force user'.

Volker
2007-10-10 11:19:12 -05:00
Volker Lendecke
dc403cec88 r16864: Intermediate checkin -- swap the sid_check_is_in_unix_users and
sid_check_is_in_our_domain cases.

Volker
2007-10-10 11:19:12 -05:00
Volker Lendecke
03c665c307 r16766: A warning found by RHEL3. This might actually be 3.0.23 code, maybe there are
vasprintf implementations that don't like a NULL format.

Volker
2007-10-10 11:19:10 -05:00
Gerald Carter
fa477969fb r16749: BUG 3905: don't fail in create_local_nt_token() when a
checking for the builtin Administrators group membership.
security = server has no domain info in secrets.tdb
2007-10-10 11:19:09 -05:00
Gerald Carter
ce7846d6f1 r16471: Bug reported by Vitaly Protsko <villy@sft.ru> in 3.0.23rc1.
Add missing automatic add of the Administrators SID in the absence
of winbindd and precense of Domain Admins SID in the user's token.
2007-10-10 11:18:55 -05:00
Jeremy Allison
a0d368197d r16241: Fix Klocwork #106 and others like it.
Make 2 important changes. pdb_get_methods()
returning NULL is a *fatal* error. Don't try
and cope with it just call smb_panic. This
removes a *lot* of pointless "if (!pdb)" handling
code. Secondly, ensure that if samu_init()
fails we *always* back out of a function. That
way we are never in a situation where the pdb_XXX()
functions need to start with a "if (sampass)"
test - this was just bad design, not defensive
programming.
Jeremy.
2007-10-10 11:17:27 -05:00
Jeremy Allison
79e693798c r16209: Klocwork bug #66, ensure no null deref.
Jeremy.
2007-10-10 11:17:25 -05:00