1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

40 Commits

Author SHA1 Message Date
Jeremy Allison
28a0bc5f57 AS/U on a sparc now joins and authenticates against a Samba PDC !
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
158d9cada8 Fixed wild pointer diff found by insure.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ab0ecc39d6 This is a *big* checkin that may break some things, but implements the
new open mechanism Andrew & I discussed.

config.sub:
configure: Included the QNX patch.

include/vfs.h:
smbd/vfs-wrap.c:
smbd/vfs.c: Added ftruncate vfs call (needed).

Note that we will also need locking calls in the vfs (to be added).

lib/util_unistr.c:
nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump.
                          Also fix for sidsize DOS bug.

locking/locking.c: Check value of ret before using it for memdup.

printing/printing.c: Convert print_fsp_open to return an allocated fsp.

rpc_server/srv_lsa.c: Fix for NT domain logons.

I have removed all use of lp_share_modes() from the code (although I
left the parameter in the table for backwards compatibility). It no longer makes
sense for this to exist.

smbd/close.c: Removed lp_share_modes().
smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code.
smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail.

smbd/nttrans.c:
smbd/reply.c:
smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/
               open_file_stat to return an fsp from the call.

smbd/open.c: Changed all occurrences of open_file_shared/open_directory/
             open_file_stat to return an fsp from the call.

In addition I have fixed a long standing race condition in the deny mode
processing w.r.t. two smbd's creating a file. Andrew, please note that
your original idea of using open with O_EXCL in this case would not work
(I went over the races very carefully) and so we must re-check deny modes
*after* the open() call returns. This is because there is a race between
the open with O_EXCL and the lock of the share mode entry. Imagine the
case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL,
but is pre-empted before it locks the share modes and creates the deny
mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY
and a deny mode of DENY_NONE and the two opens would be allowed.

The *only* way to fix this race is to lock the share modes after the
open and then do the deny mode checks *after* this lock in the case
where the file did not originally exist.

This code will need extensive testing but seems to initially work.

Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
36fb5bc72f updates from the TNG branch 0001-01-01 00:00:00 +00:00
Luke Leighton
5086e6425f logic for domainsidsize is if size is zero, there's no sid, so don't
advance over it and 4-byte align.

this _used_ to be "regardless of domainsidsize, advance by domainsidsize+3"
which is wrong.
0001-01-01 00:00:00 +00:00
Jeremy Allison
491eea8a20 include/byteorder.h: ALIGN4/ALIGN2 macros.
include/includes.h: Added SMB_BIG_UINT_BITS.
lib/util.c: Removed align2/align4 - use macros.
libsmb/namequery.c: Use ALIGN2.
locking/locking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T.
                   Needed to move to hiding POSIX locks at a lower layer.
nmbd/nmbd_processlogon.c: Use ALIGN2/ALIGN4 macros.
smbd/blocking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T.
smbd/reply.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
0da440c8fe add a comment 0001-01-01 00:00:00 +00:00
Andrew Tridgell
1682faa1b0 some updates to the process logon code to reflect lukes latest
research plus some cleanups
0001-01-01 00:00:00 +00:00
Andrew Tridgell
1ac46c4011 damn, the test was the wrong way around for short_resuest 0001-01-01 00:00:00 +00:00
Andrew Tridgell
426c904333 changed the definition of dos_PutUniCode
the previous definition could result is us overflowing a buffer. The
null termination was always added yet the size returned did not
include the null termination.

the new function takes a BOOL null_terminate, and always returns the
total number of bytes consumed by the string.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
f6b56ae93e the final part of the nmbd merge between head and tng - this gets the
GETDC stuff sorted out
0001-01-01 00:00:00 +00:00
Jeremy Allison
9f879ec396 lib/system.c: Fixed gcc warnings.
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0.
Others - preparing for multiple pdu write code.
Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
27ef178926 richard got the short request for GETDC right (hooray!) win9x _and_ nt
now work.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
453a822a76 first pass at updating head branch to be to be the same as the SAMBA_2_0 branch 0001-01-01 00:00:00 +00:00
Luke Leighton
4aea261cb0 responses to UDP samquery go back to SERVER<00> not DOMAIN<1c>, the
request name.

modified createuser rpcclient command to examine name being added.  if it
ends in a $, assume that a workstation trust account is being added.
0001-01-01 00:00:00 +00:00
Luke Leighton
98ddeaf442 added regqueryval command (experimental) to get reg_io_q_info() and
reg_io_r_info() working properly.  previously they weren't well
understood (well, they were the first of the registry functions i did,
back in december 97, ok??? :-)

set ntversion to 0x1 in SAMQUERY, so that we reply same as NT4 srv.
0001-01-01 00:00:00 +00:00
Luke Leighton
25c70e3c98 - added DCE/RPC "fault" PDU support.
- disabled (AGAIN) the GETDC "if (MAILSLOT\NTLOGON)" code that will get
NT5rc2 to work but WILL break win95 (AGAIN).  this needs _not_ to be
re-enabled but to be replaced with a better mechanism.

- added SMBwrite support (note: SMBwriteX already existed) as NT5rc2 is
sending DCE/RPC over SMBwrite not SMBwriteX.
0001-01-01 00:00:00 +00:00
Matthew Chapman
8a603a8793 Fix for Win95 not being able to find PDC (for User/Server Manager, and
password change requests), from Michael Stockman <pgmtekn@algonet.se>.
GETDC on \MAILSLOT\NET\NETLOGON necessarily returns less information
than the NTLOGON version.
0001-01-01 00:00:00 +00:00
Luke Leighton
baf55934dc SAMLOGON query - alignment issue is beginning to get to me. 0001-01-01 00:00:00 +00:00
Luke Leighton
9d01e9d86a alignment issue for UDP SAMLOGON response. 0001-01-01 00:00:00 +00:00
Luke Leighton
de290627f0 alignment issue in UDP SAMLOGON response. 0001-01-01 00:00:00 +00:00
Luke Leighton
74c7d626cd oh dear, it's this one again. removed check for MAILSLOT\NTLOGON because
it's wrong.  i've seen a packet from nt client on MAILSLOT\NETLOGON
with appended undocumented unicode tacked on the end and the response
contained undocumented unicode tacked on the end.
0001-01-01 00:00:00 +00:00
Matthew Chapman
ce24191939 Always null-terminate strings.
Also some string length and sizeof(pointer) corrections.
0001-01-01 00:00:00 +00:00
Matthew Chapman
a1d39af1ce UNICODE cleanup (see lib/util_unistr.c).
No more ugly static library buffers and all functions take a destination
string length (especially unistrcpy was rather dangerous; we were only
saved by the fact that datagrams are limited in size).
0001-01-01 00:00:00 +00:00
Andrew Tridgell
be697c9ef0 removed the SID stuff from the head branch as well.
This allows the removal of PASSDB_OBJ, RPC_CLIENT_OBJ and
RPC_PARSE_OBJ from nmbd in the head branch.

so nmbd just went on a diet :)
0001-01-01 00:00:00 +00:00
Andrew Tridgell
a2bacc0895 took out Lukes change as it breaks domain logons for Win95 clients
(ie. it breaks Sues machine).

Luke, your comment was:

  put unicode strings after SAMLOGON query regardless of whether it's
  an NT mailslot or a non-NT mailslot, after having observed this behaviour
  out of NT machines.

perhaps you could post the relevant tcpdump or netmon capture so we
can see what is going on? I suspect that what you saw isn't exactly
what the win95 boxes are generating. Maybe you saw a GETDCxxx instead
of a GETDC000 ? Maybe we need a switch based on the GETDC request
type?

We won't know unless we see sniffs.
0001-01-01 00:00:00 +00:00
Luke Leighton
c101113ec2 fixing smbd encrypted rpcs (data lens, alloc hints, sequence nums argh).
put unicode strings after SAMLOGON query regardless of whether it's
an NT mailslot or a non-NT mailslot, after having observed this behaviour
out of NT machines.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7958787d9b Missed one removed multi-statement line. Grrr.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ea3ab46f12 Fixed bug introduced by me in dead code elimination.
Bug was caused by multiple C statements on a line.
IMHO this is a *BUG* and will be treated as such....
Fixed all such multiple statements in this file.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
e0567433bd Changes to test in configure if capabilities are enabled on a system.
Changes to get Samba to compile cleanly with the IRIX compiler
with the options : -fullwarn -woff 1209,1174 (the -woff options
are to turn off warnings about unused function parameters and
controlling loop expressions being constants).
Split prototype generation as we hit a limit in IRIX nawk.
Removed "." code in smbd/filename.c (yet again :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
7d455ee637 added a dest_port parameter to send_mailslot() so we send replies to
the correct port in environments like ip masq.
0001-01-01 00:00:00 +00:00
Jeremy Allison
7d332b2493 chgpasswd.c: Changed back to getsmb... from getsam...
ldap.c: Stoped dummy_function being prototyped.
loadparm.c: Fixed slprintf sizes.
nisppass.c: Fixed safe_strcpy sizes.
nmbd_processlogon.c: Changed back to getsmb... from getsam...
nttrans.c: Just a dump of new code.
passdb.c: Moved stuff around a lot - stopped any lookups by rid. This
          needs to be indirected through a function table (soon).
password.c: Changed back to getsmb... from getsam...
reply.c: Changed back to getsmb... from getsam...
slprintf.c: Fixed prototype problems.
smb.h: Fixed prototype problems.
smbpass.c: Changed to getsmbfile....
smbpasswd.c: Changed back to getsmb... from getsam...
lib/rpc/server/srv_netlog.c: Changed back to getsmb... from getsam...
lib/rpc/server/srv_samr.c: Fixed rid lookup - use uid or gid lookup.
lib/rpc/server/srv_util.c: Changed back to getsmb... from getsam...
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2d77445400 This is a security audit change of the main source.
It removed all ocurrences of the following functions :

sprintf
strcpy
strcat

The replacements are slprintf, safe_strcpy and safe_strcat.

It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.

Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.

Jeremy.
0001-01-01 00:00:00 +00:00
Luke Leighton
57b01ad4ff created "passdb.c" which is an interface point to (at present) either
smbpasswd or ldap passwd, at compile-time (-DUSE_LDAP).

_none_ of the functions in ldap.c or smbpass.c should be called directly:
only those in passdb.c should be used.

-DUSE_LDAP is unlikely to compile at the moment.
0001-01-01 00:00:00 +00:00
Jeremy Allison
866406bfe3 This looks like a big change but really isn't.
It is changing the global variables "myname" and "myworkgroup"
to "global_myname" and "global_myworkgroup" respectively.

This is to make it very explicit when we are messing
with a global (don't ask - it makes the domain client
code much clearer :-).

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
1161cfb7f2 Modified interfaces to getting smb password entries from
get_smbpwd_entry (now an internal function to smbpass.c)
to a more UNIX-like :

getsmbpwnam() - get entry by name.
getsmbpwuid() - get entry by uid.

Changed the type returned by the smbpasswd enumeration
functions to be a void * so that people don't come to
depend on it being a FILE *.

These abstractions should make it much easier to
replace the smbpasswd file with a better backend
in future.

Other files changed are to match the above changes.

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
118ba4d77a "For I have laboured mightily on Luke's code, and hath broken
all I saw" - the book of Jeremy, chapter 1 :-).

So here is the mega-merge of the NTDOM branch server code.
It doesn't include the new client side pieces, we'll look
at that later.

This should give the same functionality, server wise, as
the NTDOM branch does, only merged into the main branch.

Any fixes to domain controler functionality should be
added to the main branch, not the NTDOM branch.

This code compiles without warnings on gcc2.8, but will
need further testing before we are sure all the working
functionality of the NTDOM server branch has been
correctly carried over.

I hereby declare the server side of the NTDOM branch
dead (and all who sail in her :-).

Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b9c1697723 This is *not* a big change (although it looks like one).
This is merely updating the Copyright statements from 1997 to 1998.
It's a once a year thing :-).
NO OTHER CHANGES WERE MADE.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3605da0557 Added Lanman announce patch from Jacco de Leeuw <leeuw@wins.uva.nl>.
Also added code to stop old Samba servers that announce the workgroup
name as master browser name when they are a local master browser.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d80b0cb645 This is it ! The mega-merge of the JRA_NMBD_REWRITE branch
back into the main tree.
For the cvs logs of all the files starting nmbd_*.c, look
in the JRA_NMBD_REWRITE branch. That branch has now been
discontinued.
Jeremy.
0001-01-01 00:00:00 +00:00