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

58 Commits

Author SHA1 Message Date
Andrew Tridgell
ec2c17c56f added a generic print_guid utility, and get the byte order handing
right
-
Andrew Tridgell
aa5beb63f1 make sure we zero the unusued elements in a SID when parsing -
Andrew Bartlett
587a3d91b7 make this a ZERO_STRUCTP for consitancy with the rest of Samba. -
Andrew Bartlett
fc97398611 (this should have been part of the previous commit)
Add a function to display 'sid types' as strings - makes rpcclient outptut
and DEBUG() logs much eaiser to understand.

Move the enum for SID types to smb.h, becouse is really isn't LSA specific any
more.

Andrew Bartlett
-
Andrew Tridgell
91ad9041e9 used findstatic.pl to make some variables static and remove some dead
code
-
Andrew Bartlett
c264bf2ec9 Patch from ctrlsoft to make the pluggable passdb subsystem use an lp_list
rather than a string when configuring mulitple backends.

Also adjust some of the users of get_global_sam_sid() to cope with the fact
that it just might not exist (uninitialised, can't access secrets.tdb).

More places need conversion.

Add some const and remove silly casts.

Andrew Bartlett
-
Andrew Bartlett
29490f2147 Add const, kill of useless casts and therefore eliminate warnings.
Andrew Bartlett
-
Andrew Bartlett
04f9a8ff4c Latest patch from metze <metze@metzemix.de> to move most of samba across
to using SIDs instead of RIDs.

The new funciton sid_peek_check_rid() takes an 'expected domain sid' argument.

The idea here is to prevent mistakes where the SID is implict, but isn't
the same one that we have in the struct.

Andrew Bartlett
-
Andrew Bartlett
96afea638e Globally replace 'global_sam_sid' with get_global_sam_sid(), a self
initialising function.  This patch thanks to the work of
"Stefan (metze) Metzmacher" <metze@metzemix.de>

This is partly to enable the transition to SIDs in the the passdb.

Andrew Bartlett
-
Andrew Bartlett
743afd96cb Move the code from lib/util_sid.c that deals with the global_sam_sid into
a file that is linked with the passdb.

This is to avoid linking insanity when this global becomes a self-initing
function.
-
Andrew Bartlett
5275c94cdf Better handling of uid/gid -> RID and RID -> uid/gid code.
All uids and gids must create valid RIDs, becouse other code expects this, and
can't handle the failure case. (ACL code in particular)

Allow admins to adjust the base of the RID algorithm, so avoid clashes with
users brought in from NT (for example).

Put all the algorithm code back in one place, so that this change is global.

Better coping with NULL sid pointers - but it still breaks a lot of stuff.

BONUS: manpage entry for new paramater :-)

counter based rids for normal users in tdbsam is disabled for the timebeing,
idra and I will work out some things here soon I hope.

Andrew Bartlett
-
Jeremy Allison
bcf38961a7 Add "Creator Group" - was in 2.2.x and I'm syncing up the two.
Jeremy.
-
Andrew Tridgell
3db97530b6 add a note about the meaning of global_sam_sid -
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.
-
Simo Sorce
ce7e89949a freeing the wrong pointer, sorry my mistake. -
Simo Sorce
49f5cb7a3d util_sid.c - respect a const variabile (addedd strdup)
cli_reg.c  - indentation
pdb_ldap.c - some checks on init fns parameters
pdb_tdb.c  - some checks on init fns parameters + make sure we close the db on failure
-
Andrew Tridgell
c11c27b281 fixed sid_compare_domain() -
Jeremy Allison
7b8fb8d85c Fixup JF's weird SID return :-).
Jeremy
-
Andrew Tridgell
4a6d297686 make sid_binstring available without HAVE_ADS -
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.
-
Andrew Tridgell
789833b44e put sid_to_name behind the winbindd backend interface
I spent quite a while trying to work out how to make this call
via ldap and failed. I then found that MS servers seem use rpc
for sid_to_name, and it works even when in native mode, I ended
up just implementing it via rpc
-
Andrew Tridgell
88241cab98 added a basic ADS backend to winbind. More work needed, but at
least basic operations work
-
Tim Potter
4f21ddb873 Removed totally annoying verbose debug in sid_to_string() -
Tim Potter
2d0922b0ea Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header. -
Jeremy Allison
bc7963bd64 Ignore unmappable (NT Authority, BUILTIN etc.) SIDs in an ACL set.
Jeremy.
-
Andrew Tridgell
c41fc06376 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn. -
Tim Potter
9ee43d61be Added sid_peek_rid() function to return the rid of a sid. Saves mucking
around with copying a sid to a temporary variable and using sid_split_rid().
-
Jeremy Allison
d317998504 Merging Gerald's PDC SAM name fix.
Jeremy.
-
Andrew Tridgell
61293979ce - fixed the sort_acl bug, sorting now works right
- don't allow setting of duplicate ACEs
- fixed a ACE delete bug
-
David O'Neill
59229b9025 Changes from APPLIANCE_HEAD:
source/rpc_parse/parse_lsa.c
        - off by one unistr length bug in init_lsa_trans_name()

    source/lib/util_sid.c
        - resolve more BUILTIN sid values to names.

    source/nsswitch/wb_client.c
        - fix typo in debug message
        - set errno on error so we don't get bogus value from last failure.

    source/rpc_server/srv_spoolss_nt.c
        - add debug to track number of open printer handles for ease of
          tracking handle leaks in the future.

    source/rpc_server/srv_lsa.c
        - fix off-by-one string bug.  This was preventing NT from
          displaying names for well-know SIDs in printer permissions
          dialog.
-
Jeremy Allison
27d72ed1cf Removed the special casing of SIDs in se_access_check. This is now done (correctly)
when the NT_USER_TOKEN is *created*.
Jeremy.
-
Jeremy Allison
d131ad1ce3 Adding Herb's compile warning fixes to HEAD.
Jeremy.
-
Tim Potter
b1a893b741 Removed annoying unecessary debug message. -
Jeremy Allison
81c5380f91 Added code to do SID to uid/gid conversion. Needed for ACL support.
Jeremy.
-
Jeremy Allison
e28d01b744 Added an NT_USER_TOKEN structure that is copied/passed around associated
with the current user. This will allow se_access_check() to quickly do
a SD check without having to translate uid/gid's to SIDs.
Still needs work on pipe calls.
Jeremy.
-
Andrew Tridgell
9ccf3b1dc5 if the sids are not the same pointer and either of the sids are NULL
then the two sids are not equal
-
Tim Potter
f49905e74c Added global_sid_NULL S-1-0-0 to list of global sids. -
Jeremy Allison
151b131ee0 lib/util_sid.c: Uninitialized memory read.
rpc_parse/parse_spoolss.c: Added note about prs_align when marshalling a SEC_DESC...
rpc_server/srv_lsa.c: Tim - your changes broke the display of the 'everyone' group
						when doing file access with no winbindd running. This is a partial
						fix - more when I have analysed this more.
rpc_server/srv_spoolss_nt.c: Fix for the 'change driver' problem ! Hurrah !

Jeremy.
-
Luke Leighton
6de329f6bf added se_access_check. -
Matthew Chapman
7710b4f48d Fixed LsaQueryInformationPolicy level 3 to return primary domain info.
Domain SID is saved in secrets.tdb upon joining domain.

Added "Authenticated Users" and "SYSTEM" well-known SIDs (under
NT Authority).
-
Luke Leighton
06cd46b0ec fixed nttrans.c -
Jeremy Allison
fbfe94a799 Roll back to using static MACHINE.SID after consultation with Andrew. This
code will be removed soon and a SID auto-generated from (probably) primary
hostname and never stored in a file will replace it.
Jeremy.
-
Luke Leighton
8976e26d46 simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
-
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch -
Luke Leighton
f0946d1cca default SID map now reads in "trusted domains" from smb.conf. -
Luke Leighton
3ec269b402 doing a code reshuffle. want to add code to establish trust relationships. -
Luke Leighton
492fdaaf20 rewrote rpcclient enumaliases command. -
Luke Leighton
c8fd555179 - typecast malloc / Realloc issues.
- signed / unsigned issues.
-
Luke Leighton
b2d9cbef6f reverted jeremy's c++-like security descriptor modifications as the
simplest method to get rpcclient's reggetsec command working.  the
buffers passed as arguments in do_reg_get_key_sec() do need to be
locally allocated not dynamically allocated, as two calls to
reg_get_key_sec() are needed.  on the first, the server fills in the
size of the security descriptor buffer needed.  on the second, the
server fills in the security descriptor buffer.
-