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

58 Commits

Author SHA1 Message Date
Andrew Tridgell
e6fa31d6cb added a generic print_guid utility, and get the byte order handing
right
(This used to be commit ec2c17c56f06e122868b2a55bc7c292106ad3911)
2002-08-19 16:55:29 +00:00
Andrew Tridgell
ab0b4e6f58 make sure we zero the unusued elements in a SID when parsing
(This used to be commit aa5beb63f1b1133c4ad28118ddd33e21198d79bb)
2002-07-31 09:32:45 +00:00
Andrew Bartlett
d7bdcee189 make this a ZERO_STRUCTP for consitancy with the rest of Samba.
(This used to be commit 587a3d91b7226f4e96c4320322f62c6490a3c6ac)
2002-07-13 09:18:55 +00:00
Andrew Bartlett
8dc39c1112 (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
(This used to be commit fc9739861104df4ddc93efab3275275307e4fbb9)
2002-07-08 00:40:57 +00:00
Andrew Tridgell
9930b0b065 used findstatic.pl to make some variables static and remove some dead
code
(This used to be commit 91ad9041e9507d36eb3f40c23c5d4df61f139ef0)
2002-07-01 09:12:41 +00:00
Andrew Bartlett
0d7ac4bc2c 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
(This used to be commit c264bf2ec93037d2a9927c00295fa60c88b7219d)
2002-06-14 02:58:03 +00:00
Andrew Bartlett
baef1358d2 Add const, kill of useless casts and therefore eliminate warnings.
Andrew Bartlett
(This used to be commit 29490f214750acd44cee6c4ab1354722d82d853a)
2002-06-14 00:47:08 +00:00
Andrew Bartlett
bad738e653 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
(This used to be commit 04f9a8ff4c7982f6597c0f6748f85d66d4784901)
2002-06-13 14:06:08 +00:00
Andrew Bartlett
b0ffabdcca 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
(This used to be commit 96afea638e15d4cbadc57023a511094a770c6adc)
2002-06-07 14:33:33 +00:00
Andrew Bartlett
39d0a1b832 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.
(This used to be commit 743afd96cb54b4966e3afad11ea987f968b98651)
2002-06-07 12:45:51 +00:00
Andrew Bartlett
163a855d26 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
(This used to be commit 5275c94cdf0c64f347d4282f47088d084b1a7ea5)
2002-04-13 09:35:52 +00:00
Jeremy Allison
dac047366a Add "Creator Group" - was in 2.2.x and I'm syncing up the two.
Jeremy.
(This used to be commit bcf38961a7786c5cf1eb7568b87c19712c3ea9cc)
2002-03-13 01:29:30 +00:00
Andrew Tridgell
683ba419ff add a note about the meaning of global_sam_sid
(This used to be commit 3db97530b62ac12d334d0244ea52db8750cebf2e)
2002-03-10 01:51:15 +00:00
Andrew Tridgell
b48750fba6 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.
(This used to be commit 9930cf97330dd93985c5558cec6b24406e90c228)
2002-01-31 09:37:26 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-30 06:08:46 +00:00
Simo Sorce
78528b4ec6 freeing the wrong pointer, sorry my mistake.
(This used to be commit ce7e89949ae1755f9faa008784a5b1a9b137945e)
2001-12-30 22:55:04 +00:00
Simo Sorce
0608a60390 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
(This used to be commit 49f5cb7a3df6d673f86e6769319aa657e30d8380)
2001-12-30 19:21:25 +00:00
Andrew Tridgell
279276c9ca fixed sid_compare_domain()
(This used to be commit c11c27b2812ceb06a52afbb7662f82a8676b1707)
2001-12-19 08:37:03 +00:00
Jeremy Allison
dccc1ed3f8 Fixup JF's weird SID return :-).
Jeremy
(This used to be commit 7b8fb8d85c406b8755f60cf14dc2377bc59eda53)
2001-12-18 19:44:14 +00:00
Andrew Tridgell
e051c2c430 make sid_binstring available without HAVE_ADS
(This used to be commit 4a6d29768665f71b72cf48ee34ee9a9c451232f6)
2001-12-10 00:39:01 +00:00
Jean-François Micouleau
922eb763d7 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.
(This used to be commit 6c87e96149101995b7d049657d5c26eefef37d8c)
2001-12-04 21:53:47 +00:00
Andrew Tridgell
6f907af4e7 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
(This used to be commit 789833b44e342c0b5de463ed8f9b5f7474a99f27)
2001-12-03 11:11:14 +00:00
Andrew Tridgell
2285b99cb1 added a basic ADS backend to winbind. More work needed, but at
least basic operations work
(This used to be commit 88241cab983b2c7db7d477c6c4654694a7a56cd3)
2001-12-03 06:04:18 +00:00
Tim Potter
ade911c1c6 Removed totally annoying verbose debug in sid_to_string()
(This used to be commit 4f21ddb8737d3f72a84465d3384351ccd2b07d15)
2001-11-05 22:57:14 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-10-02 04:29:50 +00:00
Jeremy Allison
0492effcf3 Ignore unmappable (NT Authority, BUILTIN etc.) SIDs in an ACL set.
Jeremy.
(This used to be commit bc7963bd643422cce081b6284e3bdd49ae3a02ab)
2001-09-22 06:45:24 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-07-04 07:36:09 +00:00
Tim Potter
281629ac06 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().
(This used to be commit 9ee43d61be1284b72fd04054c44545847c73120f)
2001-05-10 00:48:06 +00:00
Jeremy Allison
c6e8e75a64 Merging Gerald's PDC SAM name fix.
Jeremy.
(This used to be commit d31799850440c6c2267a4edb217d447df75aab5a)
2001-05-03 02:50:11 +00:00
Andrew Tridgell
8d070c60fc - fixed the sort_acl bug, sorting now works right
- don't allow setting of duplicate ACEs
- fixed a ACE delete bug
(This used to be commit 61293979ce2aded58a5ef2a54b3b05d1d278f7cf)
2001-02-23 07:20:11 +00:00
David O'Neill
27922c0430 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.
(This used to be commit 59229b9025cff54cbdd05e374616ffbf9c6fee33)
2001-01-15 18:36:50 +00:00
Jeremy Allison
276364e2a4 Removed the special casing of SIDs in se_access_check. This is now done (correctly)
when the NT_USER_TOKEN is *created*.
Jeremy.
(This used to be commit 27d72ed1cf8ece2bede812341279ba5a7262ace4)
2000-12-12 02:36:14 +00:00
Jeremy Allison
23f78fd7b9 Adding Herb's compile warning fixes to HEAD.
Jeremy.
(This used to be commit d131ad1ce3f6e72e295f865a463f8dcbfa6f8d42)
2000-10-04 01:03:23 +00:00
Tim Potter
1ef79dbcab Removed annoying unecessary debug message.
(This used to be commit b1a893b74114ee4ab6a295ac0cb0e8fdccda3f53)
2000-09-28 00:07:19 +00:00
Jeremy Allison
641d9e85ea Added code to do SID to uid/gid conversion. Needed for ACL support.
Jeremy.
(This used to be commit 81c5380f91839b6416c8a42739dadf00e7388528)
2000-08-23 00:45:40 +00:00
Jeremy Allison
f87399915b 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.
(This used to be commit e28d01b744b3dbd33e0e54af4e7f426fa8c082b8)
2000-08-03 22:38:43 +00:00
Andrew Tridgell
5a98f9cb35 if the sids are not the same pointer and either of the sids are NULL
then the two sids are not equal
(This used to be commit 9ccf3b1dc5baf0e00d032d8b932ab0fb5b1e11b1)
2000-07-25 20:26:50 +00:00
Tim Potter
084af3c5be Added global_sid_NULL S-1-0-0 to list of global sids.
(This used to be commit f49905e74c6e3891b5816b136fd1d0d77c392e2f)
2000-07-06 06:48:54 +00:00
Jeremy Allison
ec1c58fcc0 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.
(This used to be commit 151b131ee01ef916c072bcdaa9943a2e984a0f45)
2000-06-24 00:15:08 +00:00
Luke Leighton
1bdbb4e601 added se_access_check.
(This used to be commit 6de329f6bf9c26e132869cf43d4976d4881e285c)
2000-06-08 08:41:28 +00:00
Matthew Chapman
badb7fc0d2 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).
(This used to be commit 7710b4f48d3e8532df5e37f99a779758f750efdb)
2000-05-29 01:23:48 +00:00
Luke Leighton
54695647ef fixed nttrans.c
(This used to be commit 06cd46b0ec10b32af54edd8256d2fdbec45e1371)
2000-05-27 01:56:26 +00:00
Jeremy Allison
e1083ea7df 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.
(This used to be commit fbfe94a799cda7f728bc920d4f0655d4f537e3b6)
2000-04-12 00:37:08 +00:00
Luke Leighton
fbd17c8daf simple mods to add msrpc pipe redirection. default behaviour: fall back
to using internal msrpc code in smbd.
(This used to be commit 8976e26d46cb991710bc77463f7f928ac00dd4d8)
2000-01-03 19:19:48 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-13 13:27:58 +00:00
Luke Leighton
e9b8c7743a default SID map now reads in "trusted domains" from smb.conf.
(This used to be commit f0946d1ccafeb5f541935b41f2d54bcbc06797ed)
1999-12-02 16:31:24 +00:00
Luke Leighton
a56bea383b doing a code reshuffle. want to add code to establish trust relationships.
(This used to be commit 3ec269b402ba6898d905ea1029c427e1b645faf4)
1999-11-20 19:43:37 +00:00
Luke Leighton
de573ca891 rewrote rpcclient enumaliases command.
(This used to be commit 492fdaaf2009e7d7e840323357a333fdf9c4d2e1)
1999-11-01 21:09:24 +00:00
Luke Leighton
5612824426 - typecast malloc / Realloc issues.
- signed / unsigned issues.
(This used to be commit c8fd555179314baf1672a23db34dc8ad9f2d02bf)
1999-10-25 19:03:27 +00:00
Luke Leighton
8598bf2a7f 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.
(This used to be commit b2d9cbef6f65bb696df8d8f49aa0c240e0bb1f50)
1999-08-03 20:30:25 +00:00