1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

181 Commits

Author SHA1 Message Date
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Günther Deschner
bb191c1098 r3875: Allow to look up at least or own sid in _lsa_lookup_sids.
This fixes Bugzilla #1076 and Exchange 5.5 SP4 can then be finally
installed on NT4 in a samba-controlled domain.

Guenther
2007-10-10 10:53:22 -05:00
Volker Lendecke
d7b2e41f00 r1340: _samr_lookupsids with more than 32 (MAX_REF_DOMAINS) SIDs failed. This
happened because init_dom_ref did not find the domain in question in
the list of already mentioned domains.

Could others please double-check this?

Thanks,

Volker
2007-10-10 10:52:07 -05:00
Jeremy Allison
735e49ddc3 r911: Patch from "Jerome Borsboom" <j.borsboom@erasmusmc.nl>, don't
overwrite error code.
Jeremy.
2007-10-10 10:51:48 -05:00
Jeremy Allison
c179451b07 r810: Fix from "Jerome Borsboom" <j.borsboom@erasmusmc.nl> to ensure error status
codes don't get overwritten.
Jeremy.
2007-10-10 10:51:46 -05:00
Jeremy Allison
d97b9146a1 r801: Fix from "Jianliang Lu" <j.lu@tiesse.com> to return correct group
types.
Jeremy.
2007-10-10 10:51:46 -05:00
Gerald Carter
911a28361b r196: merging struct uuid from trunk 2007-10-10 10:51:13 -05:00
Gerald Carter
b393469d95 r116: volker's patch for local group and group nesting 2007-10-10 10:51:10 -05:00
Jim McDonough
68022f5ebc r91: Fix lsalookupnames. Previously we'd fail if we didn't find the name, but
we never checked if it was a domain user and didn't find a local one.
2007-10-10 10:51:08 -05:00
Jeremy Allison
a47127e90e Fixup correct (as per W2K3) returns for lookupsids as well as lookupnames.
Inspired by Volkers patch.
Jeremy.
-
Jeremy Allison
37a52c3168 Fix based on Volker's code to correctly return code from lsa_lookup_sids
on unmapped sids.
Jeremy.
-
Jeremy Allison
3a3e336030 Fix up name canonicalization (needed for krb5 keytab support later).
Remove source_env handler (no longer used in any codepath).
Jeremy.
-
Gerald Carter
c6594e3557 Fix UNISTR2 length bug in LsaQueryInfo(3) that cause SID resolution to fail on local files on on domain members; bug 875 -
Gerald Carter
68283407e0 more access fixes for group enumeration in LDAP; bug 281 -
Simo Sorce
c78f2d0bd1 split some security related functions in their own files.
(no need to include all of smbd files to use some basic sec functions)

also minor compile fixes
couldn't compile to test these due to some kerberos problems wirh 3.0,
but on HEAD they're working well, so I suppose it's ok to commit
-
Jeremy Allison
f82c273a42 Fix for #480. Change the interface for init_unistr2 to not take a length
but a flags field. We were assuming that 2*strlen(mb_string) == length of ucs2-le string.
This is not the case. Count it after conversion.
Jeremy.
-
Jeremy Allison
28b315a750 Ensure that dup_sec_desc copies the 'type' field correctly. This caused
me to expose a type arguement to make_sec_desc(). We weren't copying
the SE_DESC_DACL_AUTO_INHERITED flag which could cause errors on
auto inherited checks.
Jeremy.
-
Herb Lewis
a6a39c61e8 get rid of some sompiler warnings on IRIX -
Jim McDonough
a2bd8f0bfa Update my copyrights according to my agreement with IBM -
Jeremy Allison
ff222716a0 Removed strupper/strlower macros that automatically map to strupper_m/strlower_m.
I really want people to think about when they're using multibyte strings.
Jeremy.
-
Simo Sorce
e341e7c49f Ok, this patch removes the privilege stuff we had in, unused, for some time.
The code was nice, but put in the wrong place (group mapping) and not
supported by most of the code, thus useless.

We will put back most of the code when our infrastructure will be changed
so that privileges actually really make sense to be set.

This is a first patch of a set to enhance all our mapping code cleaness and
stability towards a sane next beta for 3.0 code base

Simo.
-
Andrew Bartlett
5fc78eba20 Set our 'global sam name' in one place. For domain controllers, this is
lp_workgroup(), for all other server this is global_myname().

This is the name of the domain for accounts on *this* system, and getting
this wrong caused interesting bugs with 'take ownership' on member servers
and standalone servers at Snap.

(They lookup the username that they got, then convert that to a SID - but
becouse the domain out of the smbpasswd entry was wrong, we would fail the
lookup).

Andrew Bartlett
-
Andrew Bartlett
898ff89632 Oops...
Andrew Bartlett
-
Andrew Bartlett
3be0327103 Make our 'get DNS domain name' code try a bit harder - if gethostname() doesn't
include a domain portion, do a gethostbyname() lookup on that name.

Use this name in our PolicyPrimaryDomainInformation reply (_lsa_query_info2)
that Win2k uses when trying to trust us as a trusted domain.

(We need to do a better mapping between our Netbios and Win2k domain names,
but this will do for now - particularly annoying is the way this possibly needs
to map with our kerberos realm).

Andrew Bartlett
-
Jeremy Allison
98ed7e0cbb Merge of Andrew Bartlett's SID limit fix from HEAD.
Jeremy.
-
Jeremy Allison
f755711df8 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
-
Andrew Bartlett
2044d60bbe Merge passdb from HEAD -> 3.0
The work here includes:
 - metze' set/changed patch, which avoids making changes to ldap on unmodified
attributes.

 - volker's group mapping in passdb patch

 - volker's samsync stuff
 - volkers SAMR changes.

 - mezte's connection caching patch

 - my recent changes (fix magic root check, ldap ssl)

Andrew Bartlett
-
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release -
Jelmer Vernooij
e01596853e Sync 3.0 branch with HEAD -
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 -
Andrew Bartlett
e60c509813 Add a become_root()/unbecome_root() pair to allow acces to the passdb for
SID lookup.  This fixes a bug where SIDs (rather than names) are displayed in windows ACL lists
-
Jeremy Allison
c6566fa5fa Don't core dump listing thousands of users in usrmgr.
Jeremy.
-
Jeremy Allison
f169f3f4df Ensure we return a parseable value if invalid handle given.
Jeremy.
-
Andrew Tridgell
9930cf9733 this fixes the problem of not being able to add a SD to a file on a
non-domain Samba server from a NT4 client.

Note that this exactly reverses a change by Jeremy on the 18th of
December 2001, reverting the code back to what JF originally wrote. I
have looked carefully with a sniffer and JFs original NULL sid is
correct (ie. it matches what NT4 does) and also fixes the problem.

Sending a blank sid (which is what jeremy's patch did) causes NT4 to
give a classic "parameter is incorrect error" and prevents the
addition of new ACLs.
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Andrew Bartlett
6e7667125d Move the lsa code across to the changed args for lookup_name, and surround it
in become_root()/unbecome_root().

Also only allocate the memory the client reqests - and don't allow the client
to trigger an SMB_ASSERT if they ask for 'more'.

Up the maximum number of sids allowed, and note that this is an arbiary guess,
and can be raised without consequence.

Andrew Bartlett
-
Andrew Tridgell
48aa90c48c - portablitity fixes for cc -64 on irix
- fixed gid* bug in rpc_server
-
Jeremy Allison
7b8fb8d85c Fixup JF's weird SID return :-).
Jeremy
-
Jeremy Allison
dd13daf52b I'm pretty sure we need to return our netbios name for LSA_QUERY_INFO
level 5 when we're a standalone server. This makes the security dialogs
return correct info. JF - please check !
Jeremy.
-
Jean-François Micouleau
1fbb01868b in lsa_query_info at level 5 in member mode, we must reply our machine
name and not our domain name.

I thought it has been already fixed !

	J.F.
-
Jean-François Micouleau
a217c4e4ff there is no unknown field in LSA_SEC_QOS
some cleanup of the lsa_open_policy and lsa_open_policy2 parser. the
length fields are not correct but that's what NT send. We don't anymore
underflow or overflow the decoding.

added the domain admins group to the default SD.

we are now checking the desired access flag in the lsa_open_policy_X()
calls and in most functions also.

        J.F.
-
Jean-François Micouleau
84289a9bf4 add lsa_query_secobj server code. level 4 is the ACL, level 1 is the
owner. that's basic stuff.

got the POLICY_ define from TNG but they are also in an include file in
the NT SDK.

	J.F.
-
Jean-François Micouleau
6c87e96149 added a boolean to the group mapping functions to specify if we need or
not the privileges. Usually we don't need them, so the memory is free
early.

lib/util_sid.c: added some helper functions to check an SID.

passdb/passdb.c: renamed local_lookup_rid() to local_lookup_sid() and pass
an RID all the way. If the group doesn't exist on the domain SID,
don't return a faked one as it can collide with a builtin one. Some rpc
structures have been badly designed, they return only rids and force the
client to do subsequent lsa_lookup_sid() on the domain sid and the builtin
sid !

rpc_server/srv_util.c: wrote a new version of get_domain_user_groups().
Only the samr code uses it atm. It uses the group mapping code instead of
a bloody hard coded crap. The netlogon code will use it too, but I have to
do some test first.

	J.F.
-
Jean-François Micouleau
3f0a9ef2b8 Changed again how the privilege list is handled in the group mapping code.
This time it's a PRIVILEGE_SET struct instead of a simple uint32 array. It
makes much more sense. Also added a uint32 systemaccount to the GROUP_MAP
struct as some privilege showing in USRMGR.EXE are not real privs but a
bitmask flag. I guess it's an heritage from NT 3.0 ! I could setup an NT
3.1 box to verify, but I'm too lazy (yes I still have my CDs).

Added 3 more LSA calls: SetSystemAccount, AddPrivileges and
RemovePrivileges, we can manage all this privilege from UserManager.

Time to change the NT_USER_TOKEN struct and add checks in all the rpc
functions. Fun, fun, fun.

        J.F.
-
Jean-François Micouleau
75ee50bbef return NO_MORE_ENTRIES in lsa_enum_trust_dom. UserManager is happier :-)
J.F.
-
Jean-François Micouleau
f29774e589 Changed how the privileges are stored in the group mapping code. It's now
an array of uint32. That's not perfect but that's better.

Added more privileges too.

Changed the local_lookup_rid/name functions in passdb.c to check if the
group is mapped. Makes the LSA rpc calls return correct groups

Corrected the return code in the LSA server code enum_sids.

Only enumerate well known aliases if they are mapped to real unix groups.
Won't confuse user seeing groups not available.

Added a short/long view to smbgroupedit.

now decoding rpc calls to add/remove privileges to sid.

        J.F.
-
Jean-François Micouleau
646651018a added lsa_enum_sids to rpcclient
fixed lsa_enum_rpivs server code. This time it works as W2K.
fixed smbgroupedit to compile and work.

	J.F.
-
Jean-François Micouleau
f2766932d6 fixing enum_privs and get_dispname server code.
That works as expected now.

	J.F.
-
Jean-François Micouleau
fa63cb78e3 add a command to rpcclient: enumprivs
J.F.
-
Jeremy Allison
29730027d8 Fixes from John Trostel (modified somewhat by me) to ensure that all lookup_XX
functions correctly deal with the SID_NAME_TYPE. One fix for connection user
lookup in LSA.
Jeremy.
-