1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

131 Commits

Author SHA1 Message Date
Jeremy Allison
250c980119 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.
(This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
2002-11-12 23:15:52 +00:00
Andrew Bartlett
aa208a58e2 Make it easier to track things down here - add some debugs on failure.
(This used to be commit 62ee7b7dc08e7be261211de8f85b8e9be4df7b54)
2002-11-08 22:14:31 +00:00
Jeremy Allison
158ae87aa9 Reverted a fix from Volker (sorry). We need to move this fix to the correct
place.
Jeremy.
(This used to be commit e46e38beabe8ae5b1ba1941dcffecbc89165ce2a)
2002-10-23 22:23:39 +00:00
Jeremy Allison
b064077145 Debug level 12 is a typo.
Jeremy.
(This used to be commit 4d9b205362997f897be4739efd52ee2cfde4c6cb)
2002-10-23 01:55:40 +00:00
Jeremy Allison
7689a9c969 First cut of new ACL mapping code from Andreas Gruenbacher <agruen@suse.de>.
This is not 100% the same as what SuSE shipped in their Samba, there is
a crash bug fix, a race condition fix, and a few logic changes I'd like to
discuss with Andreas. Added Andreas to (C) notices for posix_acls.c
Jeremy.
(This used to be commit a81d700ae9c82d4b7ea631ab7862162a2ed3d512)
2002-10-23 01:22:45 +00:00
Volker Lendecke
c7731c988e Same segfault as in add_groupmem.
Volker
(This used to be commit 1f702dcd2ced6f64a619e3ddbb570f41f7f0986b)
2002-10-21 20:33:00 +00:00
Volker Lendecke
5dbf435408 This moves the group mapping API into the passdb backend.
Currently this calls back to mapping.c, but we have the framework
to get the information into LDAP and the passdb.tdb (should we? I
think so..).

This has received moderate testing with net rpc vampire and
usrmgr. I found the add_groupmem segfault in add_aliasmem as
well, but that will be another checkin.

Volker
(This used to be commit f30095852fea19421ac8e25dfe9c5cd4b2206f84)
2002-10-21 19:28:56 +00:00
Volker Lendecke
0c35d78632 This fixes some bugs for NT4 usrmgr.exe
Volker
(This used to be commit 32d6bcf3acefc77873a7241cc0c7e26241a65301)
2002-10-19 07:50:48 +00:00
Andrew Bartlett
4ac9ccfde4 Nice *big* patch from metze.
The actual design change is relitivly small however:

It all goes back to jerry's 'BOOL store', added to many of the elements in a
SAM_ACCOUNT.  This ensured that smb.conf defaults did not get 'fixed' into
ldap.  This was a great win for admins, and this patch follows in the same way.

This patch extends the concept - we don't store values back into LDAP unless
they have been changed.  So if we read a value, but don't update it, or we
read a value, find it's not there and use a default, we will not update
ldap with that value.  This reduced clutter in our LDAP DB, and makes it
easier to change defaults later on.

Metze's particular problem was that when we 'write back' an unchanged value,
we would clear any muliple values in that feild.  Now he can still have his
mulitivalued 'uid' feild, without Samba changing it for *every* other
operation.

This also applies to many other attributes, and helps to eliminate a nasty
race condition.  (Time between get and set)

This patch is big, and needs more testing, but metze has tested usrmgr, and
I've fixed some pdbedit bugs, and tested domain joins, so it isn't compleatly
flawed ;-).

The same system will be introduced into the SAM code shortly, but this fixes
bugs that people were coming across in production uses of Samba 3.0/HEAD, hence
it's inclusion here.

Andrew Bartlett
(This used to be commit 7f237bde212eb188df84a5d8adb598a93fba8155)
2002-10-12 03:38:07 +00:00
Volker Lendecke
0672da5c43 Third part of my fix for usrmgr. Assuming automagic mapping
only in parts of srv_samr_nt is not good.

This is soo broken. :-)

Volker
(This used to be commit 74e4a3479f380b320daa0d46c0ba4daa9f98c18f)
2002-10-08 15:29:13 +00:00
Simo Sorce
650e0274a1 try to put every security descriptors related definitions in the same file.
also try to uniform names to a clean scheme.

first part.
(This used to be commit a123e05877caf90c28980be2d84b1d0b46e4fd21)
2002-10-06 23:53:34 +00:00
Volker Lendecke
4b5c0793de Second part of my fix -- incorrect merge.
(This used to be commit 2613d3a48a8d60c3db38406a1abd943dbe0b7d09)
2002-09-30 06:45:58 +00:00
Volker Lendecke
cdeffe6d90 We have to hand out info on Builtin here as well. They are stored in
group mapping not as local, but as WKN_GRP.

Volker
(This used to be commit cb05dcab2de117ea4db54af313a05905cd5a0d0a)
2002-09-29 10:39:03 +00:00
Andrew Bartlett
a5c8985215 Patch from "Kai Krueger" <kai@kruegernetz.de> to get some more of our access
control bits right on the SAMR pipe.

Andrew Bartlett
(This used to be commit e87948c777b59592b130da081ef5d25600455d29)
2002-09-26 13:31:49 +00:00
Andrew Bartlett
ad514000db Patch from "Stefan (metze) Metzmacher" <metze@metzemix.de> to do a *much*
better job of working with usrmgr.   Previously we were blanking out entires,
and all sort of mischif.

The new patch (which I've now had a chance to test/modify) also takes care not
to expand % values (ie we go \\%L\%U -> \\server\user, we don't want to store
\\server\user back) and to correctly notice 'not set' compared to 'null string'
etc.

Andrew Bartlett
(This used to be commit ab878b6cc4132594fc33f78aeebf0d8b7266c150)
2002-09-26 10:25:34 +00:00
Volker Lendecke
06ce201a29 Ok, getting a bit more ambitious. Stop me, if this is wrong. ;-)
When creating a group you have to take care of the fact that the
underlying unix might not like the group name. This change gets around
that problem by giving the add group script the chance to invent a
group name. It then must only return the newly created numerical gid.

Volker
(This used to be commit b959419ed38e66a12b63cad3e5fbfa849f952acc)
2002-09-23 16:21:01 +00:00
Volker Lendecke
1a01635486 trivial comment fix
(This used to be commit 9d6331524089d76c5832b9ba001fb0e8a05f39d7)
2002-09-19 12:34:39 +00:00
Andrew Bartlett
cc5088b5f4 Only cache the user list on the SAMR handle for a particular
acb_mask/all_machines flag combination.  The avoids a bug where we were listing
users in the 'trusting domains' dialog in usrmgr.

We might also need to invalidate the cache for some other SAMR actions.

Andrew Bartlett
(This used to be commit 65047aee7fefefaecded9772184a54c046ab1784)
2002-09-04 22:02:53 +00:00
Andrew Bartlett
724d1c3d2d Add a fix for 'query_disp_info level 2', which should return all machines in
the DC's SAM.  We were only returning workstations, not PDCs or BDCs.

Win2k's 'Computer Manager' tool uses this to list all computers in the domain
(as opposed to using NetBIOS).

Andrew Bartlett
(This used to be commit 004090edffef6cc04c286b9924b8c47ea3260ef2)
2002-08-30 23:56:37 +00:00
Volker Lendecke
1f02551bb1 Removed some misleading comment.
Volker
(This used to be commit 70cf2f1e2f0187c546a0193824ab85a416c5236c)
2002-08-30 08:24:26 +00:00
Jelmer Vernooij
8e729a4d84 Move samr_make_sam_obj_sd to lib/util_seaccess.c. samtest now compiles and
links successfully!
(This used to be commit 0ea4bcb6b772a0d95d20f7c1a2a0c08a0ba9e466)
2002-08-29 16:38:43 +00:00
Herb Lewis
b294ce9986 add proto for forward reference
(This used to be commit 7573fd1746dfe5034deb51a6d205e15af6ff81de)
2002-08-28 14:19:40 +00:00
Jelmer Vernooij
2b2b0f7119 Put in intermediate version of new SAM system. It's not stable yet, code
might be ugly, etc - please don't blame me for anything but instead try to fix
the code :-). Compiling of the new sam system can be enabled with the
configure option --with-sam

Removing passdb/passgrp.c as it's unused
fix typo in utils/testparm.c
(This used to be commit 4b7de5ee236c043e6169f137992baf09a95c6f2c)
2002-08-28 04:54:43 +00:00
Tim Potter
3a226d149d Return access granted in create_user2.
(This used to be commit 8ebc295f4a487993474390e0686d2aa9313be8d1)
2002-08-16 17:35:38 +00:00
Andrew Bartlett
b84315e2d5 Return the error if get_group_domain_entries() fails.
(This used to be commit bc9e9e3e2e0d861f34de26a9ef8b627a86c9954d)
2002-08-16 08:47:10 +00:00
Tim Potter
9b38f76ab1 Rename unknown_0 field in create_user2 reply in the actual struct.
(This used to be commit 482d873c26bf02e27ffcd92042b476eda765a5ff)
2002-08-15 19:40:34 +00:00
Jim McDonough
5e42dcfe46 Add SAMR 0x3e, which is samr_connect4. Seems to be the same as our
existing connect (which I've been told is really connect2), with one
extra dword.  We've only seen 0x00000002 there...
(This used to be commit 266344634944dff30f56453f9d86c490e7ac7a55)
2002-08-06 18:02:56 +00:00
Andrew Bartlett
a564900074 Mimir has been busy with patches again, and sent in the following
patches:

Andrew Bartlett

From his e-mail:

Below I attach the following patches as a result of my work
on trusted domains support:
 1) srv_samr_nt.c.diff
    This fixes a bug which caused to return null string as
    the first entry of enumerated accounts list (no matter what
    entry, it was always null string and rid) and possibly
    spoiled further names, depeding on their length.
    I found that while testing my 'net rpc trustdom list'
    against nt servers and samba server.
 2) libsmb.diff
    Now, fallback to anonymous connection works correctly.
 3) smbpasswd.c.diff
    Just a little fix which actually allows one to create
    a trusting domain account using smbpasswd
 4) typos.diff
    As the name suggests, it's just a few typos fix :)
(This used to be commit 888d595fab4f6b28318b743f47378cb7ca35d479)
2002-07-26 13:05:29 +00:00
Andrew Bartlett
2582e955e7 More use of intermediate variables to avoid issues with pointer size and casts.
Andrew Bartlett
(This used to be commit 88b68f79721b5fea7ddcad5a83b9555528c75c20)
2002-07-21 00:08:16 +00:00
Andrew Bartlett
29075c97d3 More fixes towards warnings on the IRIX compiler
(and yes, some of these are real bugs)

In particular, the samr code was doing an &foo of various types, to a function
that assumed uint32.  If time_t isn't 32 bits long, that broke.

They are assignment compatible however, so use that and an intermediate
variable.

Andrew Bartlett
(This used to be commit 30d0998c8c1a1d4de38ef0fbc83c2b763e05a3e6)
2002-07-20 13:02:47 +00:00
Tim Potter
b1aec128e4 Remove C++ comments.
(This used to be commit 180374c4440765f3d08e5690967beb387ae3b54d)
2002-07-05 04:08:32 +00:00
Andrew Bartlett
e48b3fe83c More code from "Kai Krueger" <kai@kruegernetz.de>, this time starting to make
the 'user cannot change password' button work.  Needs help from a future SAM
backend, but at least this parses the data, and returns an error.

Andrew Bartlett
(This used to be commit 0c4afe075aa018ec2be10f36fd3f0a5af2a032f1)
2002-07-04 13:11:54 +00:00
Andrew Bartlett
cd383bdc30 Patch to add security descriptors to the SAMR pipe.
This is not the final solution, I think this will probably changed with the
move to the new SAM subsystem, but it allows some research and gives us
somthing to start with.

It should also help with getting proper NT_TOKEN passing set-up.

Original patch by "Kai Krueger" <kai@kruegernetz.de>, which I have modified to
pass back NTSTATUS returns in more places and to use a little more common code.

Andrew Bartlett
(This used to be commit 43b72493708e74e089989db42a003a3862c793e6)
2002-07-04 08:45:45 +00:00
Andrew Bartlett
8e52737efc Break up the passdb objects (to allow RPC clients to link without brining in
*.o) and implment new enum_dom_users code in the SAMR RPC subsystem.

Incresingly, we are using the pdb_get_{user,group}_sid() functions, in the
eventual hope that we might one day support muliple domains off a single
passdb.  To extract the RID, we use sid_peek_check_rid(), and supply an
'expected' domain SID.

The id21 -> SAM_ACCOUNT and id23 -> SAM_ACCOUNT code has been moved to
srv_samr_util.c, to ease linking in passdb users.

Compatiblity code that uses 'get_global_sam_sid()' for the 'expected' sid is in
pdb_compat.c

Andrew Bartlett
(This used to be commit 5a2a6f1ba316489d118a8bdd9551b155226de94f)
2002-07-03 07:37:54 +00:00
Andrew Bartlett
8e387b8178 I'm going to try and check this against Win2k shortly, but I'm certain that
'NT_STATUS_OK' is not the right answer here.  Try NO_MORE_ENTRIES for now.

Andrew Bartlett
(This used to be commit c98b9a965905f1876b4884f932ff2e0237d85b03)
2002-06-25 11:21:41 +00:00
Simo Sorce
a60e37096d more debug classess activated
(This used to be commit 897e64d2e0c1d04ab93441ccaffe369bf43be46e)
2002-06-18 09:20:13 +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
ae6bdb2cd5 This (hopefully) fixes a bug reported by Kai Krueger <kai@kruegernetz.de>
involving the use of lp_winbind_gid() without checking if they have been
set.

Also revert the 'clashing user' check back to a Get_Pwnam() - I probably should
never have changed it.

Andrew Bartlett
(This used to be commit 1d6ba405589cee4e1582bc91cf659b89564899d4)
2002-06-09 08:45:35 +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
ebe58d8569 Update the SAMR pipe for more use of NTSTATUS and to talloc the stored list of
users/groups for better memory accounting.

Andrew Bartlett
(This used to be commit fe7c5efe91ab77784af9dbb56716170f4c6fd057)
2002-06-04 23:10:02 +00:00
Tim Potter
c3bd192703 Restrict anonymous checks for the SAMR pipe. This is done by
returning access denied for a SAMR_CONNECT by an anonymous user which
seems to be the way 2K does it rather than blocking individual RPC
calls like NT.

Also checked is the SAMR_GET_DOM_PWINFO rpc which for some reason
doesn't require a policy handle to return information.  No idea what
it's actually used.
(This used to be commit 40c68fa85c31c1baf7ba2c8ed62cd06c34711913)
2002-06-03 03:02:39 +00:00
Simo Sorce
a27a0e01e2 change: pdb_getsampwrid() ->pdb_getsampwsid()
passdb interface change, now the passdb modules will be asked for SID not for rid, the modules have been updated with a passthrough function that calls the old getsampwrid() functions.

srv_samr_nt.c functions that made use of the pdb_getsampwrid funcion has been updated to use the SID one.
(This used to be commit f5c6496c33fa7f5c2826540ffb4a49d8a5790fb3)
2002-05-26 19:11:52 +00:00
Andrew Bartlett
20efe2fe6c Clean up a few unused functions, add a bit of static etc.
Importantly:

The removal of the silly 'delete user script' behaviour when secuity=domain.

I have left the name the same - as it still does the (previously documented,
but not in smb.conf(5)) sane behaviour of deleting users on request.

When we decide what to do with the 'add user' functionality, we might
rename it.

Andrew Bartlett
(This used to be commit cdcfe3671eb7570e15649b77f708e6579055e7bc)
2002-05-25 07:37:44 +00:00
Andrew Bartlett
b87eee9836 Add a bit more const, and kill of (finally!) sys_getpwnam and sys_getpwuid.
These might be reimplmented as simple pass-through functions, but all users
really should be doing 'getpwnam_alloc' or 'getpwuid_alloc' to ensure that
there are not shared static buffers.

I don't beleive we actually need a getpw*() cache inside samba - if we do
then I think we should look at our code design first.

(some of these changes are for platforms I don't have access to, but
they look sane)

Andrew Bartlett
(This used to be commit 9d8431b04f41dceffe4c45cc969472ee59f7282f)
2002-05-22 12:44:45 +00:00
Andrew Bartlett
4c0399915c Much better support for both non-algorithic RIDs (where the RID is stored in
the passdb) and RIDs not in the passdb, due to being NIS users etc.

The main fix here is to add become_root()/unbecome_root() at critical places.

This (finally) fixes the bug where you could not see local users's names
in a file's security properties as non-root.  Tested.

The similar bug in uid_to_sid is also fixed, but is not (yet) Tested.

Andrew Bartlett
(This used to be commit 79327a305e20d78ab5ca21d01c39b5f49dc0d632)
2002-04-11 23:43:40 +00:00
Jeremy Allison
a5dc8cb591 Don't core dump listing thousands of users in usrmgr.
Jeremy.
(This used to be commit c6566fa5fadf37a2b133e7be1f13c0de93efab34)
2002-03-29 21:50:21 +00:00
Andrew Bartlett
93d25c293f Make sure to initaliase SAM_ACCOUNT pointers to NULL, otherwise pdb_init_sam()
fails.

Andrew Bartlett
(This used to be commit 56009ffbaa00259d15f286248a7ab73c55371819)
2002-03-21 03:53:44 +00:00
Simo Sorce
050b80356e second step to gain free uid<->rid mapping
we still need to free gid<->rid mapping and few other stuff
(This used to be commit aa4b6f8181f34196a28951264dd8b631a5deef7f)
2002-03-19 13:57:53 +00:00
Simo Sorce
32334bc655 more verbose checking in talloc and util_pw
fixed tdbsam memory corruption (and segfault)
reducing calls to pdb_uid_to_user_rid and countrary to 0 to move to a non alghoritmic rid allocation with some passdb modules.
(This used to be commit 9836af7cd623357feaec07bc49cfb78f0aa01fc3)
2002-03-18 23:57:14 +00:00