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

2000 Commits

Author SHA1 Message Date
Andrew Tridgell
5d4df58b6d amazing! we've had a reversed comparison in our blocking lock code
since 1998 and nobody noticed. It means that sometimes smbd would sit
there forever, and smbd would never get the timing part of blocking
locks right.
-
Andrew Bartlett
b224938e4e Change which session key we negotiate. This uses the NT-based session key that
we previously expected, rather than the LM based key.

A Win2k SPNEGO enabled join goes a *lot* further with this option on.

Andrew Bartlett
-
Andrew Bartlett
fb28abd120 Add const. -
Andrew Bartlett
8955f3d63a Add 'const'. -
Andrew Bartlett
fc0d6e53fc Becouse of changes to the meaning of this feild over time, this doesn't
actually work.  Also, the idea of 'loopback winbind' isn't that bad an idea
anyway (potential PDC/BDC applications).

Given all that, remove it...

Andrew Bartlett
-
Jim McDonough
6eca417d1c Re-add the last empty item to the NTLMSSP info list, but this time do it
with an empty string, not a NULL pointer...

Also, check for security=ads before giving a kerberos spnego response.
-
Andrew Bartlett
23f3321785 Add some const to the 'in' paramaters for these functions.
Andrew Bartlett
-
Andrew Bartlett
81b675b54d Fix segfault in the new NTLMSSP code. jmcd: can you look at this - what
exactly were you trying to do here?

Andrew Bartlett
-
Tim Potter
dad31483b3 Merge of netbios namecache code from APPLIANCE_HEAD.
Tridge suggested a generic caching mechanism for Samba to avoid the
proliferation of little cache files hanging around limpet like in the
locks directory.  Someone should probably implement this at some
stage.
-
Jim McDonough
1f9b3d46c7 Fix NTLMSSP challenge command and auth response. We can now service joins
from win2k AND still use SPNEGO (provided you don't build with kerberos...I
still have to fix that, as we are not properly falling back).
-
Jeremy Allison
8403253f27 Bugfix for problem pointed out by Sean Trace <Sean.Trace@aveva.com>. We can't
check for POSIX errors in the blocking lock code as we may have never made
a POSIX call (could have denied lock before POSIX checked).
Jeremy.
-
Shirish Kalele
cbb6e2fbdb Add RESOLVE_DFSPATH to mkdir operations in HEAD. -
Andrew Bartlett
f393de2310 Make 'remote_machine' private to lib/substitute.c, and fix all the user to use
the new accessor functions.

Andrew Bartlett
-
Andrew Bartlett
e57a896f06 Fix the %m security bug again - and try to make it harder to reintroduce in
future.

This moves us from fstrcpy() and global variables to 'get' and 'set' functions.

In particular, the 'set' function sainity-checks the input, in the same way as
we always have.

Andrew Bartlett
-
Andrew Tridgell
e358d7b24c This fixes a number of ADS problems, particularly with netbiosless
setups.

- split up the ads structure into logical pieces. This makes it much
  easier to keep things like the authentication realm and the server
  realm separate (they can be different).

- allow ads callers to specify that no sasl bind should be performed
(used by "net ads info" for example)

- fix an error with handing ADS_ERROR_SYSTEM() when errno is 0

- completely rewrote the code for finding the LDAP server. Now try DNS
  methods first, and try all DNS servers returned from the SRV DNS
  query, sorted by closeness to our interfaces (using the same sort code
  as we use in replies from WINS servers). This allows us to cope with
  ADS DCs that are down, and ensures we don't pick one that is on the
  other side of the country unless absolutely necessary.

- recognise dnsRecords as binary when displaying them

- cope with the realm not being configured in smb.conf (work it out
  from the LDAP server)

- look at the trustDirection when looking up trusted domains and don't
  include trusts that trust our domains but we don't trust
  theirs.

- use LDAP to query the alternate (netbios) name for a realm, and make
  sure that both and long and short forms of the name are accepted by
  winbindd. Use the short form by default for listing users/groups.

- rescan the list of trusted domains every 5 minutes in case new trust
  relationships are added while winbindd is running

- include transient trust relationships (ie. C trusts B, B trusts A,
  so C trusts A) in winbindd.

- don't do a gratuituous node status lookup when finding an ADS DC (we
  don't need it and it could fail)

- remove unused sid_to_distinguished_name function

- make sure we find the allternate name of our primary domain when
  operating with a netbiosless ADS DC (using LDAP to do the lookup)

- fixed the rpc trusted domain enumeration to support up to approx
  2000 trusted domains (the old limit was 3)

- use the IP for the remote_machine (%m) macro when the client doesn't
  supply us with a name via a netbios session request (eg. port 445)

- if the client uses SPNEGO then use the machine name from the SPNEGO
  auth packet for remote_machine (%m) macro

- add new 'net ads workgroup' command to find the netbios workgroup
  name for a realm
-
Tim Potter
7bf9ca6ca3 Merge of print notify fixes from APPLIANCE_HEAD. -
Tim Potter
81322f4d63 Fixed compiler warning. -
Andrew Tridgell
cf2abf677e make sure we null terminate plaintext passwords -
Andrew Bartlett
3efd462bf2 Rework parinioa to ensure we never get passwords longer than MAX_PASS_LEN, nor
longer than the buffer they claim to be in.

Many thanks to tridge for explaining the macros.

Andrew Bartlett
-
Andrew Tridgell
d4c905e5a0 fixed the length checking for plaintext passwords (thanks to andrewb
for spotting this)
-
Andrew Bartlett
bc17b91c2f fix debug, at idra's suggestion.
Andrew Bartlett
-
Andrew Tridgell
5dee0a7b5e added support for smbd listening on port 445 and 139. It now listens
on both by default, and you can specify a list of ports to listen on
either with "smb ports = " in smb.conf or using the -p option to smbd.

this is needed for proper netbiosless operation.
-
Andrew Tridgell
1a6dfddf67 this fixes plaintext passwords with win2000
there were 2 bugs:

1) we were sending a null challenge when we should have sent an empty
   challenge

2) the password can be in unicode if unicode is negotiated. This means
   our client code was wrong too :(
-
Andrew Tridgell
deff1f9623 always include the (void) for void fns ... -
Simo Sorce
56283601af OK!
Finally the cascaded VFS patch is in.
Testing is very welcome, specially with layered multiple vfs modules.
A big thank to Alexander Bokovoy for his work and patience :)

Simo.
-
Andrew Bartlett
d5bafb2243 Update a pile of Samba's SID lookup code to ensure:
- That we never call winbind recursivly
- That we never use an 'algorithmic' RID when we have a fixed uid or gid mapping
  in either the passdb or the group mapping db.

Also, remove restrictions that say 'this domain only'.  If we have a mapping
configured, allow it to be returned.  If we later decide certian mappings are
invalid, then we sould put that in the code that actually does the map.

Allow 'sid->name' transtations on the fixed 'well known' groups for NT, even
if they are not represented by Unix groups yet.

Andrew Bartlett
-
Andrew Tridgell
c529cee0b2 introduced a get_file_size() macro in trans2.c to make it easier to
experiment with file size returns
-
Andrew Tridgell
7dfdb456d4 an initial fix for handling sparse files in smbd
This gets my test code working, where we previously failed with files
above 20G in size.

I'm still not completely happy with this. There are just too many
fields in trans2.c that we don't fill in.
-
Simo Sorce
161dd6d963 as suggested by Alexander Oswald <oswald@is.haw-hamburg.de>
hide only unwriteable files and not dirs with this one.

may be a hide unwriteable dirs param will follow.
-
Simo Sorce
69765e4faa found nasty bug in intl/lang_tdb.c tdb structure was not tested to not be null before close
this one fixes swat not working with browsers that set more then one language.

along the way implemented language priority in web/neg_lang.c with bubble sort

also changet str_list_make to be able to use a different separator string

Simo.
-
Andrew Tridgell
ea0a12fb60 minor portability fix
samba-patches 820
-
Andrew Bartlett
e69b476626 Fix a missing 'no memory' return in last night's svrsvc code, and use
sys_dup2() in a couple more places.

Andrew Bartlett
-
Andrew Bartlett
50507e131d Another item off my long-term todo list:
Remove the n^2 search for valid 'tty' names from the sesion code when we
don't actually need it.  Its main value is in getting 'well behaved'
numbers for use with utmp, so when we are not doing utmp we don't need
this to get in the way.

Andrew Bartlett
-
Andrew Bartlett
5d2c7816a3 This should fix a nastly little bug where if a user had already done one
session setup, it would not correctly pick up the [homes] share on a subsequent
session setup.

The new rules are:  If you want to connect to [homes], then it must have been
available at session setup time, or you must be in security=share.  At each
session setup, the user's copy of [homes] is updated to ensure it has the right
path etc.

Andrew Bartlett
-
Simo Sorce
e6b38a881b nice day today
add also hide unwriteable as per user request
-
Andrew Bartlett
888d595fab 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 :)
-
Andrew Bartlett
2febc7ce1a If lp_add_home() fails, don't go any further, just return -1.
Andrew Bartlett
-
Andrew Bartlett
83360b211a We must be root to access the passdb, so ensure all calls to local_lookup_sid()
have become_root()/unbecome_root() wrappers.

(this should be the last of them, the rest were done ages ago).

Andrew Bartlett
-
Andrew Bartlett
0229f610a8 Give an idea what service didn't have the directory. -
Andrew Bartlett
993ee671cc Add some const & static, remove unused functions. -
Andrew Bartlett
6465c6727b Make it clear that the 'service' isn't to be touched. (Make it const).
Andrew Bartlett
-
Andrew Bartlett
2afa291404 Update the smbd reply code a little:
I don't like the idea of muliple netprots - becouse I see potential problems
with people being able to maniplate internal samba variables.

This applies in particular to remote names, so don't allow muliple session
requests either.

Also remove a pstrcpy() from the tcon code, we really don't need it.

Andrew Bartlett
-
Andrew Bartlett
790b7c9ab8 Move some startup time initialisation to server.c, so it is all in one place.
I'm not sure that we need that "dummy" talloc init, but anyway...

Also, add some 'const' to the table of smb reply functions.

Andrew Bartlett
-
Andrew Bartlett
4bcb327319 Add support for duplicating stderr into our logfiles.
This is for two things:  To allow panic actions etc to pump out backtraces to
stderr and to allow vangrind to put its stuff in a logfile - making it possible
to debug smbd when launched from inetd.

I've also cleaned up some of the duplicate names in procedures between smbd and
nmbd.

Andrew Bartlett
-
Jeremy Allison
e3f7d6c03f Allow trans2 and nttrans messages to be processed in oplock break state.
As noticed by Lev Iserovich <lev@ciprico.com> this seems to fix a problem
with oplock breaks and Win2k, and we are protected from problems by existing
code in trans2.c and nttrans.c
Jeremy.
-
Jeremy Allison
beb298898d Formatting fixup. Fix shadow warning.
Jeremy.
-
Jeremy Allison
3a9ceb6b3b Don't crash on setfileinfo on printer fsp.
Jeremy.
-
Simo Sorce
e3b3c14820 Unneded extra check on len -
Jeremy Allison
b846bbfa83 We have to look at the length before checking for "~" as the string
may be shorter than 6 chars. Caught by valgrind.
Jeremy.
-
Jeremy Allison
44410af397 Use of uninitialized variable caught by valgrind.
Jeremy.
-