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

148 Commits

Author SHA1 Message Date
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.
-
Simo Sorce
d30939a091 fix some possible memleaks and not tested reallocs spotted by Andreas Moroder -
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Simo Sorce
5ceecc7bef move to SAFE_FREE() -
Andrew Tridgell
1d36250e33 converted another bunch of stuff to NTSTATUS -
Andrew Tridgell
1b778bc7d2 started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs -
Jeremy Allison
0f5b187387 Fixed malloc -> talloc problems pointed out by Simo.
Jeremy
-
Tim Potter
2e33940360 Held a shoot-out between NT_STATUS_NO_PROBLEMO and NT_STATUS_NOPROBLEMO.
According to the incorruptible judges find and grep, the latter won.

Mmm - procrastination.  (-:
-
Tim Potter
914e78f053 Removed unused variable. -
Jean-François Micouleau
3056357cd8 implement:
LSA_ENUM_PRIVS
	LSA_PRIV_GET_DISPNAME
	LSA_ENUM_ACCOUNTS
	LSA_OPENACCOUNT
	LSA_ENUMPRIVSACCOUNT
	LSA_GETSYSTEMACCOUNT

It's a work in progress. nobody should expect it to work

	J.F.
-
Andrew Tridgell
debb471267 The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
-
Jeremy Allison
7079300da6 Added LsaGetConnectedCredentials patch from Manoj Naik <manoj@almaden.ibm.com>.
Jeremy.
-
Tim Potter
84a22d5f0a Merge of lsa_lookup_names() i18n bugfix from appliance. -
Tim Potter
e7a4dd7612 Merge of i18n domain name fix for lsa_query_info_policy() from appliance
branch.
-
Jeremy Allison
b32b1afe25 Fix for insure missmatched parameter error.
Jeremy.
-
Jeremy Allison
acf32f277d Fix noticed by John Trostel - we need to return our account SID for level 5.
Jeremy.
-
Jeremy Allison
2a5b513c44 Finally got name & SID returns correct.
Jeremy.
-
Jeremy Allison
37581bdf1e JF pointed out we were returning the wrong info for Domain member with info
levels 3 and 5. I *hate* LSAQueryInfoPolicy() :-).
Jeremy.
-
Jeremy Allison
0d6c7dedd2 Tidyup return of zero-permissions (map to ACE_DENIED, GENERIC_ALL, Everyone).
Jeremy.
-
Jeremy Allison
45e96777d0 Last tweak (I promise :-). Fallback to returning our SID if we're a domain
member but can't get the domain sid.
Jeremy.
-
Jeremy Allison
58dd295882 Final ! Fix.
Jeremy.
-
Jeremy Allison
f2680842d7 Last attempt at fix...
Jeremy.
-
Jeremy Allison
c202ebe3b6 Return correct error message if we can't get the SID secret.
Jeremy.
-
Jeremy Allison
b318a754e7 Fixed a Dr. Watson when viewing permissions - we were missing the "standalone
server" case.
Jeremy.
-
Jeremy Allison
28a0bc5f57 AS/U on a sparc now joins and authenticates against a Samba PDC !
Jeremy.
-
Jeremy Allison
e7ecb9410f Fixed reading of strings from big-endian RPC clients.
Jeremy.
-
Jeremy Allison
d22c606703 Ensure we return the correct names/sids on query info. AS/U showed us what
we should return here.
Jeremy.
-
Jeremy Allison
0be41d5158 Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
-
Jeremy Allison
0e6a34510e Sync up handle creation with 2.2 branch. We can now join AS/U domains and
authenticate against them. Big/little endian issues fixed.
Jeremy.
-
Jeremy Allison
94b72c19fe Don't return stack structures...
Jeremy.
-
Jeremy Allison
1cc96e0340 Separated lsa code into interface and implementation.
Jeremy.
-
Jeremy Allison
72e7c261e8 Added implementation file for lsa.
Jeremy.
-