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

2217 Commits

Author SHA1 Message Date
Jeremy Allison
436555aaa7 Fixed a couple of const issues with the new code.
Jeremy.
(This used to be commit e9fb6e45086a6170b6f6d5d3295398708ab1af58)
2003-07-07 17:04:48 +00:00
Gerald Carter
0b18acb841 and so it begins....
* remove idmap_XX_to_XX calls from smbd.  Move back to the
  the winbind_XXX and local_XXX calls used in 2.2

* all uid/gid allocation must involve winbindd now

* move flags field around in winbindd_request struct

* add WBFLAG_QUERY_ONLY option to winbindd_sid_to_[ug]id()
  to prevent automatic allocation for unknown SIDs

* add 'winbind trusted domains only' parameter to force a domain member
  server to use matching users names from /etc/passwd for its domain
  (needed for domain member of a Samba domain)

* rename 'idmap only' to 'enable rid algorithm' for better clarity
  (defaults to "yes")

code has been tested on

  * domain member of native mode 2k domain
  * ads domain member of native mode 2k domain
  * domain member of NT4 domain
  * domain member of Samba domain
  * Samba PDC running winbindd with trusts

Logons tested using 2k clients and smbclient as domain users
and trusted users. Tested both 'winbind trusted domains only = [yes|no]'

This will be a long week of changes.  The next item on the list is
winbindd_passdb.c & machine trust accounts not in /etc/passwd (done
via winbindd_passdb)
(This used to be commit 8266dffab4aedba12a33289ff32880037ce950a8)
2003-07-07 05:11:10 +00:00
Andrew Bartlett
b475d0b889 This changes our Unix primary GID behaviour back to what most people expect:
Samba will now use the user's UNIX primary group, as the primary group when
dealing with the filesystem.  The NT primary group is ignored in unix.

For the NT_TOKEN, the primary group is the NT priamry group, and the unix
primary group is added to the NT_TOKEN as a supplementary group.

This should fix bug #109, but will need to be revisited when we get a full
NT group database.

Also in this commit:
 - Fix debug statements in service.c
 - Make idmap_ldap show if it's adding, or modifying an existing DN
 - Make idmap_ldap show both the error message and error string
(This used to be commit 32e455a714b2090fcfd1f6d73daccf600c15d51b)
2003-07-06 05:51:20 +00:00
Andrew Bartlett
4168d61fb2 This patch cleans up some of our ldap code, for better behaviour:
We now always read the Domain SID out of LDAP.  If the local secrets.tdb
is ever different to LDAP, it is overwritten out of LDAP.   We also
store the 'algorithmic rid base' into LDAP, and assert if it changes.
(This ensures cross-host synchronisation, and allows for possible
integration with idmap).  If we fail to read/add the domain entry, we just
fallback to the old behaviour.

We always use an existing DN when adding IDMAP entries to LDAP, unless
no suitable entry is available.  This means that a user's posixAccount
will have a SID added to it, or a user's sambaSamAccount will have a UID
added.  Where we cannot us an existing DN, we use
'sambaSid=S-x-y-z,....' as the DN.

The code now allows modifications to the ID mapping in many cases.

Likewise, we now check more carefully when adding new user entires to LDAP,
to not duplicate SIDs (for users, at this stage), and to add the sambaSamAccount
onto the idmap entry for that user, if it is already established (ensuring
we do not duplicate sambaSid entries in the directory).

The allocated UID code has been expanded to take into account the space
between '1000 - algorithmic rid base'.  This much better fits into what
an NT4 does - allocating in the bottom part of the RID range.

On the code cleanup side of things, we now share as much code as
possible between idmap_ldap and pdb_ldap.

We also no longer use the race-prone 'enumerate all users' method for
finding the next RID to allocate.  Instead, we just start at the bottom
of the range, and increment again if the user already exists.  The first
time this is run, it may well take a long time, but next time will just
be able to use the next Rid.

Thanks to metze and AB for double-checking parts of this.

Andrew Bartlett
(This used to be commit 9c595c8c2327b92a86901d84c3f2c284dabd597e)
2003-07-04 13:29:42 +00:00
Jeremy Allison
ce72beb2b5 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.
(This used to be commit ff222716a08af65d26ad842ce4c2841cc6540959)
2003-07-03 19:11:31 +00:00
Andrew Bartlett
6dc3885999 Missed this in the previous patch - we now have a seperate idea of the
'unix username' from the NT username, in the auth subsystem at least.

Andrew Bartlett
(This used to be commit df1aa2a669edc9f26007595411720742d7dff5d9)
2003-07-03 14:56:04 +00:00
Richard Sharpe
936d8e4a35 Fixing problems in the iconv discovery stuff in configure.in.
This is the first part of the fix that at least allows configure to
walk the list of supplied locations where libiconv etc might be found.

aclocal.m4 also needs a fix, as does a later test.
(This used to be commit 20786543139c546d112f8f6b6d4d796ee7fed609)
2003-07-02 21:15:59 +00:00
Jeremy Allison
af4d658894 Added fix for Japanese case names in statcache - these can change
size on upper casing. Based on patch from monyo@home.monyo.com.
Jeremy.
(This used to be commit 72e382e99b92666acdaf50a040b14aa16d48b80d)
2003-07-02 20:01:51 +00:00
Jeremy Allison
b55b664539 Whitespace reformat before applying a patch.
Jeremy.
(This used to be commit bbe1276b516e1803a4a9285691674784b989b72f)
2003-07-02 00:08:29 +00:00
Jeremy Allison
b32d48533f Fix for bug 189 from MORIYAMA Masayuki <msyk@mtg.biglobe.ne.jp>. Incorrect
call for Japanese characters.
Jeremy.
(This used to be commit c6de5df01d470c2dab48cdd6298f450fa94f9a8e)
2003-07-01 22:07:27 +00:00
Jeremy Allison
8d4a397d85 Fixed the latest complaint from jcmd :-). We were storing -1 for the
CREATOR_OWNER/CREATOR_GROUP uid/gid entries in the SAMBA_PAI attribute.
Creator Owner and Creator group now show up as inherited correctly (I
think :-). Jim please test.
Jeremy.
(This used to be commit dbbd8dd15582f95fb9c160c6c42ce9f0971ac4b7)
2003-07-01 00:35:11 +00:00
Jeremy Allison
9fda812d01 Finally ! Fixed the ACL ordering bug reported by jcmd. I realised we were
not sorting returned ACE's correctly w.r.t. W2K - implemented the correct
algorithm.
Jeremy.
(This used to be commit fa23a4158ec23c0b8dbdc6c53f29958243107dee)
2003-06-30 18:53:48 +00:00
Jeremy Allison
0e983b32fd Some const correctness. Stop tdb being used as a remote backend. If an
idmap backend is specified cause smbd to ask winbindd (use winbindd if
you want a consistant remote backend solution).
Should work well enough for next beta now...
Jeremy.
(This used to be commit 8f830c509af5976d988a30f0b0aee4ec61dd97a3)
2003-06-27 20:55:48 +00:00
Gerald Carter
f51d769dd3 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
(This used to be commit d7f7fcda425bef380441509734eca33da943c091)
2003-06-25 17:41:05 +00:00
Jeremy Allison
951710b60d Fixed the merge_default_aces() code to work correctly with inheritance.
Hopefully will fix jcmd bugs :-).
Jeremy.
(This used to be commit 482e6c79edefc8aaacbb37f807d2076e59b40e26)
2003-06-23 20:24:08 +00:00
Simo Sorce
f5974dfaae Found out a good number of NT_STATUS_IS_ERR used the wrong way.
As abartlet rememberd me NT_STATUS_IS_ERR != !NT_STATUS_IS_OK

This patch will cure the problem.
Working on this one I found 16 functions where I think NT_STATUS_IS_ERR() is
used correctly, but I'm not 100% sure, coders should check the use of
NT_STATUS_IS_ERR() in samba is ok now.

Simo.
(This used to be commit c501e84d412563eb3f674f76038ec48c2b458687)
2003-06-22 10:09:52 +00:00
Andrew Bartlett
3f5dc14457 Always initialize.
(This used to be commit 75081860af5ace873f53c361ec34d029b7864ff7)
2003-06-21 07:54:03 +00:00
Gerald Carter
93bcb9963b merge of the netsamlogon caching code from APPLIANCE_HEAD
This replaces the universal group caching code (was originally
based on that code).  Only applies to the the RPC code.

One comment: domain local groups don't show up in 'getent group'
that's easy to fix.

Code has been tested against 2k domain but doesn't change anything
with respect to NT4 domains.

netsamlogon caching works pretty much like the universal group
caching code did but has had much more testing and puts winbind
mostly back in sync between branches.
(This used to be commit aac01dc7bc95c20ee21c93f3581e2375d9a894e1)
2003-06-21 04:05:01 +00:00
Jeremy Allison
deef8647c7 Fixed sorting algorithm to prevent problems with W2K clients.
Jeremy.
(This used to be commit fa8ca20ed440673d02ac5669f8d4c6623c1fdb6d)
2003-06-20 20:07:13 +00:00
Jeremy Allison
9251afe35b Mapping of Windows ACL inheritance and protected bits onto extended attributes
if available. Adds new parameter "map acl inheritance" (docs coming soon)
off by default. Allows W2K acl inheritance dialogs to work correctly on
POSIX acls.
Jeremy.
(This used to be commit a83595e80ae539135fa1a65d6066b10ac94fbad1)
2003-06-20 01:12:20 +00:00
Simo Sorce
75a5c0b307 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.
(This used to be commit e341e7c49f8c17a9ee30ca3fab3aa0397c1f0c7e)
2003-06-18 15:24:10 +00:00
Richard Sharpe
3d0d8f609d Fix an spelling mistake.
(This used to be commit 8e37c1d579ed801fd602d698174f981deff435d9)
2003-06-13 17:49:03 +00:00
Andrew Bartlett
1079bd40c5 Don't assume that the SAM knows the unix home directory - look it up by
getpwnam() if need be.

Fixes bug #130

Andrew Bartlett
(This used to be commit a4bc789a3993be4b25955c729b533b86dba666f4)
2003-06-07 03:20:09 +00:00
Gerald Carter
71298881c4 * add in David Lee's utmp patch (defaults to on if available)
* one more try at fixing builds when --with-ldap=no
(This used to be commit b516ab7bdef6b6b2b7f0df8966dbd4c329f46a92)
2003-06-06 22:33:43 +00:00
Andrew Tridgell
53f8d3f01a SMBlockingX timeouts are in units of 2 milliseconds, not 1
(This used to be commit 999cde3227210c90132ade3812e964087f04e541)
2003-06-06 10:42:16 +00:00
Andrew Tridgell
7e82bf284c 2 more places where win2003 forces UCS2
(This used to be commit b64f6e52ec8aa0892b405d3360079ababc8527f4)
2003-06-06 06:01:45 +00:00
Andrew Tridgell
dc5f0b28cf - the ALL_INFO trans2 QFILEINFO level uses a forced UCS2 name
- win2003 returns 0 for ea_size when there are no EAs
(This used to be commit 83e0c21831f32aad2dfb6ebe4a27c7a0d2adb692)
2003-06-06 05:34:02 +00:00
Andrew Tridgell
e35917bb93 make the allocation_size consistent between trans2 QFILEINFO and SMBgetattrE
(This used to be commit 59f1a5e6fd783b977f787dae4ba4bb8b65c41e43)
2003-06-06 05:32:36 +00:00
Andrew Tridgell
6b943b5b21 - the 8.3 name in BOTH_DIRECTORY_INFO is supposed to be always unicode
(to match win2003 behaviour)

- added the STR_TERMINATE_ASCII flag from samba4 so we can get the
  string termination right for the case where it is supposed to be
  non-terminated for UCS2 and terminated when ASCII
(This used to be commit 791a4cc7cf84eca77116bca00aeb5f95560f6705)
2003-06-06 05:15:28 +00:00
Andrew Tridgell
32bf831e25 fixed the string alignment of the QUERY_EA_SIZE trans2 findfirst level
(This used to be commit ff5e37ed293b61c2585c66e7366fae478754cca1)
2003-06-06 04:31:48 +00:00
Andrew Tridgell
d51b463b3f fixed the layout of the FULL_DIRECTORY_INFO trans2 findfirst level
found by samba4 smbtorture SEARCH test
(This used to be commit 5a5f59cf5eec39394b8aec4aab7f2c347d617255)
2003-06-06 04:29:41 +00:00
Andrew Tridgell
7d4b53c2aa removed the 'valgrind fix' that (although it may well remove a
valgrind warning) causes us to return a completely wrong 8.3 filename
in directory searches!

come on guys, this close to a release you need to TEST CODE BEFORE COMMITTING
(This used to be commit 381cea68b81aeb42b088677d2a8bfd410a7da329)
2003-06-06 04:21:43 +00:00
Jeremy Allison
6fe5940109 Added EA operations to VFS layer.
Jeremy.
(This used to be commit 024de9213e414659296cb518a6753e510c64f614)
2003-06-06 00:04:27 +00:00
Andrew Tridgell
b6cb0e914d fixed the termination of several trans2 strings
(This used to be commit 8f23ad3054febe47b667172d680d2d19ad141416)
2003-06-04 06:03:21 +00:00
Andrew Tridgell
878944f1ec shouldn't null terminate trans2 qfileinfo all_info/name
(This used to be commit f7cd16ab58753be25bc9c7b487289361e3882da3)
2003-06-04 05:45:40 +00:00
Andrew Tridgell
3db0d893f3 added the COMPRESSION_INFO trans2 QFILEINFO level and fixed the
IS_NAME_VALID QPATHINFO level
(This used to be commit 1634346e2a6e73af80d4e68d50c6398fb24869a5)
2003-06-01 13:43:21 +00:00
Andrew Tridgell
71b0b6007e fixed the ALL_INFO and ALL_INFORMATION trans2 QFILEINFO levels. The
structure we were using was completely wrong after the first few
parameters.

found by samba4 testsuite. Lots of other stuff also fails, but is
harder to fix.
(This used to be commit 6f34bd423ebb805e1e5a3b61bb5b2ca8530ce69d)
2003-06-01 13:25:16 +00:00
Jeremy Allison
0899066fd6 Got us happy running under valgrind again :-).
Jeremy.
(This used to be commit b6ab9d73610861d225d72845d4df7cf970155e39)
2003-05-31 02:03:58 +00:00
Jeremy Allison
1fdbe30685 Fixes to stop valgrind complaining about uninitialised memory when it's
copying clobbered buffer areas and doing hashes on them and sending
them onto the wire.
Jeremy.
(This used to be commit 7dfcf714ae2e81fece489640e2341f132c9f567d)
2003-05-31 01:48:59 +00:00
Jeremy Allison
974d402d6d Ensure 'blank' entries show up in both default and normal entries to
allow them to be changed. Works well with W2K and above.
Jeremy.
(This used to be commit 685e4e518236079f201650f26152f6f9ad3c61ab)
2003-05-30 23:07:33 +00:00
Jeremy Allison
545e8d4999 Change get_nt_acl() to include security_info wanted. Only return this.
This gets us closer to W2k+ in what we return for file ACLs. Fix horribly
broken make_sec_desc() that screwed up the size when given a SD with no
owner or group (how did it get this bad... ?).
Jeremy.
(This used to be commit 183c9ed4052ab14e269ed1234ca557053f77e77a)
2003-05-29 23:49:31 +00:00
Jeremy Allison
24497516cb Fix bug brought up by Ken Cross that empty ACE's cause existing ACE's to
be applied to new ACE set calls. This is incorrect. Don't think this
has a bugzilla id.
Jeremy.
(This used to be commit cb70d8c9e87801c314d1b926d4e43ee451c04135)
2003-05-28 20:25:31 +00:00
Jeremy Allison
03f046dd99 It seems only NT4 does the VC == 0 session drop code.
Jeremy.
(This used to be commit 30bbf4c8c4cbed0f7980237ea9b78baa785dec3d)
2003-05-28 01:00:58 +00:00
Jeremy Allison
a11797cda2 Correct (?) handling for VC = 0. Trying to fix XP logoff leaving resources
around.
Jeremy.
(This used to be commit bf0916e1da442606311c74ac73ccec2e9710d663)
2003-05-27 21:55:10 +00:00
Gerald Carter
090d70fc3f volker's add_signature() fix; must pass the beginning on the outbuf to get the flags field
(This used to be commit 48c8211084503172f053ad23b308901628f8a978)
2003-05-27 16:30:02 +00:00
Tim Potter
d542a9cabb Fix printf warnings in debug statments.
(This used to be commit d594e60f926e5618cd61585383bee315757ba73a)
2003-05-27 07:13:28 +00:00
Tim Potter
b68e0b3aae Fix shadow parameter warning in free_empty_sys_acl()
(This used to be commit 1b2b7766c8fa89f46f4d1c881ee91c4b0b15773a)
2003-05-27 06:55:06 +00:00
Tim Potter
4e8052640e More fixes for builddir != srcdir.
- Use absolute directories for $builddir and $srcdir in the Makefile

 - Don't try and combine source files in $builddir and $srcdir to build
   proto.h.  It's just too hard to get it right across all targets we
   wish to compile on.  Use a hand created prototype for the single
   function in smbd/build_options.c that we need.  This allows us to ditch
   all the extra sed work that was causing problems: \t not portable - hah!

 - Fix bogus delheaders target to remove the correct files

This appears to work quite nicely now.  Let's see how it goes on the
buildfarm machines.
(This used to be commit 456184463d35c18840c39cb3483b7136247ea764)
2003-05-27 02:35:53 +00:00
Jeremy Allison
f161839a74 Stat opens can have fsp->fd == -1 and will have a share entry. Ensure
that file_find_dif will find them. Fixes a core dump in smbd/open.c.
Jeremy.
(This used to be commit 0e2165630d2ce31076fef6d7098e45c8fd327e23)
2003-05-22 20:31:35 +00:00
Jeremy Allison
78a4f6fc4b More fixes for debug log to catch logic error.
Jeremy.
(This used to be commit 84a7714eba801fefa7ad56493f20813de3943bc5)
2003-05-22 18:56:51 +00:00