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

93 Commits

Author SHA1 Message Date
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Günther Deschner
351e749246 r15240: Correctly disallow unauthorized access when logging on with the
kerberized pam_winbind and workstation restrictions are in effect.

The krb5 AS-REQ needs to add the host netbios-name in the address-list.

We don't get the clear NT_STATUS_INVALID_WORKSTATION code back yet from
the edata of the KRB_ERROR but the login at least fails when the local
machine is not in the workstation list on the DC.

Guenther
(This used to be commit 8b2ba11508)
2007-10-10 11:16:29 -05:00
Jeremy Allison
83b987befd r12107: Move to a tdb-based wins database. At the moment we still
use it as though it were an in-memory db and dump out to
a flat file every 2 mins, but that can now change.
Jeremy.
(This used to be commit a342681792)
2007-10-10 11:05:45 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
571cc4811b r2224: Make nmbd more robust against bad netbios packets.
Jeremy.
(This used to be commit dd9b17abd6)
2007-10-10 10:52:36 -05:00
Herb Lewis
84cea46162 r776: I should have just cut and pasted from my build area and I would
have gotten this right :-)
(This used to be commit 548070274e)
2007-10-10 10:51:37 -05:00
Herb Lewis
bb8a4a7991 r775: merge trunk 774 to samba 3_0 - fix bad compare in for loop
(This used to be commit 3cb8f1d535)
2007-10-10 10:51:37 -05:00
Jeremy Allison
a0034d3586 Ensure we don't truncate strcmps to nstring anymore...
Jeremy.
(This used to be commit d7cf64b1e4)
2004-03-13 02:47:21 +00:00
Jeremy Allison
6b9dbbcd24 Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com (MORIYAMA Masayuki).
Don't use nstrings to hold workgroup and netbios names. The problem with them is that MB netbios
and workgroup names in unix charset (particularly utf8) may be up to 3x bigger than the name
when represented in dos charset (ie. cp932). So go back to using fstrings for these but
translate into nstrings (ie. 16 byte length values) for transport on the wire.
Jeremy.
(This used to be commit b4ea493599)
2004-03-13 02:16:21 +00:00
Jeremy Allison
fd2d4f87d4 First part of patch from moriyama@miraclelinux.com (MORIYAMA Masayuki) to
fix up netbios names with mb strings. Includes reformat of libsmb/nmblib.c
so it's readable.
Jeremy.
(This used to be commit 966e49a48c)
2004-03-13 00:28:53 +00:00
Herb Lewis
220d663b74 if we are truncating to the . we need to start at the beginning in case
there are multiple "."'s in the name.

This code is protected with an #ifdef TRUNCATE_NETBIOS_NAME and this
is #define'd to 1 directly above. Should we also get rid of the #ifdef?
(This used to be commit 0375dace24)
2004-03-12 21:35:15 +00:00
Jeremy Allison
9fdc1363be Fix the character set handling properly in nmbd. Also fix bug where
iconv wasn't re-initialised on reading of "charset" parameters. This
caused workgroup name to be set incorrectly if it contained an
extended character.
Jeremy.
(This used to be commit 84ae44678a)
2003-08-27 01:25:01 +00:00
Jeremy Allison
5dfeda0002 Use correct size (17 not 16) when doing a push_ascii(). Ensure that
wins hook is called with unix charset.
Jeremy.
(This used to be commit ecb8057387)
2003-08-22 21:41:50 +00:00
Jeremy Allison
647a048ad0 Ensure nmb_namestr() converts back from CH_DOS to CH_UNIX.
Jeremy.
(This used to be commit eb79272743)
2003-08-22 00:26:37 +00:00
Andrew Bartlett
1478bcd847 Try again to fix up 'session request' name exchange. This time we actualy
get the names...

Andrew Bartlett
(This used to be commit 7c9e204f7e)
2003-07-27 03:29:40 +00:00
Andrew Bartlett
455bb6de90 Some small fixes to our charset conversion code:
- Treat the NMB names in the 'session request' packet as 'ASCII'.  This means
   that we do not get invalid multibyte from the wire, even if we truncate
   in the conversion.  (Otherwise we panic when we try to strupper_m it).

 - Remove acnv_uxu2(), as it was duplicated by push_ucs2_allocate()
 - Remove acnv_dosu2(), as it is not used.

 - In push_ucs2(), with the STR_UPPER flag, do the case conversion *after*
   the UCS2 conversion, when it we know that the length can't change.  Also
   faster, as we don't need to do another 2 UCS2 conversions.

Andrew Bartlett
(This used to be commit 912035af11)
2003-07-27 02:28:25 +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 ff222716a0)
2003-07-03 19:11:31 +00:00
Andrew Tridgell
49d71c7e7b fixed a pstrcpy() that is not on a pstring
(This used to be commit f644b3d6d2)
2003-06-06 05:31:30 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jeremy Allison
ccdfed5587 Ensure global_scope() returns "", not the NULL string. Froma tpot fix.
Jeremy.
(This used to be commit 0ff254264e)
2002-12-06 19:59:04 +00:00
Jeremy Allison
2f194322d4 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 f755711df8)
2002-11-12 23:20:50 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Christopher R. Hertel
6f366b7809 Copying commit from HEAD.
My seven-year-old daughter calls me 'Captain Pedantic'.  I don't know which
is freakier... the name or the fact that a seven-year-old knows what it
means.

Small change to correct the value we place in the DGM_LENGTH field of
NBT Datagram messages.  We have been counting the full datagram, but it's
fairly clear in the RFCs that we should only count the source name,
destination name, and payload.  We've been overcharging by 14 bytes
(the size of the NBT DGM header).

This fix brings us in line with what Windows does, and what the RFCs
say should be done.  I'm a little surprised that this didn't cause any
bugs or error messages.  I guess no one actually checks this field.
(This used to be commit c06a2ece75)
2002-04-22 03:09:23 +00:00
Jeremy Allison
69adbb0ce3 Fix from Michael Steffens <michael_steffens@hp.com> to make signal
processing work correctly in winbindd. This is a really good patch
that gives full select semantics to the Samba modified select.
Jeremy.
(This used to be commit 3af16ade17)
2002-01-31 23:26:12 +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 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Andrew Tridgell
4d726d0091 prevent a bogus insure wild ptr message
(This used to be commit 1976a8f875)
2001-11-27 03:50:53 +00:00
Andrew Bartlett
fab88997b0 This patch applied, except without the structure changes to nmblib.c
Andrew Bartlett.

From kai@cmail.ru Mon Oct 29 18:50:42 2001
Date: Fri, 19 Oct 2001 17:26:06 +0300
From: Andrew V. Samoilov <kai@cmail.ru>
To: samba-technical@lists.samba.org
Subject: [patch]: makes some arrays const to be shared between processes

Hi!

This patch makes some arrays const. So these arrays go to text/rodata
segment and are shared between all of the processes which use shared
library with these arrays.

Regards,
Andrew V. Samoilov.

P.S. Please cc your answer to kai@cmail.ru,
I don't subscribed to this list.


ChangeLog:
	* cliconnect.c (prots): Make const.
	* clierror.c (rap_errmap): Likewise.
	* nmblib.c (nmb_header_opcode_names): Likewise.
	(lookup_opcode_name): Make opcode_namep const. Eliminate i.
	* nterr.c (nt_err_code_struct): Typedef const.
	* smberr.c (err_code_struct): Make const.
	(err_classes): Likewise.
(This used to be commit cb84485a2b)
2001-10-29 08:12:44 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Simo Sorce
bcbd75f7ad move to SAFE_FREE()
(This used to be commit 48fc6a6cd5)
2001-09-17 03:33:37 +00:00
Andrew Tridgell
4294f6f2c8 allow for the NULL in make_nmb_name()
(This used to be commit b6c78d4c6f)
2001-08-20 18:05:12 +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 c41fc06376)
2001-07-04 07:36:09 +00:00
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Jeremy Allison
2ef68c7e92 Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812)
2001-04-13 19:12:06 +00:00
Tim Potter
f9a2be7822 Convert netbios name to dos codepage in make_nmb_name(). This allows
nmblookup and smbclient to work with i18n netbios names.
(This used to be commit 2eabb7c229)
2001-02-02 17:42:00 +00:00
Jeremy Allison
9c6acf4595 Fix from RFritz@lbl.gov for Linux ECONREFUSED async errors on Linux.
Jeremy.
(This used to be commit dd804fdb96)
2000-10-06 22:37:42 +00:00
Andrew Tridgell
8843a6379d Linux kernel oplocks now seem to work, but need a _lot_ of testing
I had to modify sys_select() to not loop on EINTR. I added a wrapper
called sys_select_intr() which gives the old behaviour.
(This used to be commit b28cc4163b)
2000-06-11 05:57:58 +00:00
Jeremy Allison
2c978311dc Ho hum - forgot timeout case.
Jeremy.
(This used to be commit 597ecd724e)
2000-05-10 18:53:03 +00:00
Jeremy Allison
5dfa33bf71 Fix from David Collier-Brown - sys_select return was not being checked.
Jeremy.
(This used to be commit a9c4371a2d)
2000-05-10 18:27:58 +00:00
Luke Leighton
4acd40ee00 moved nmblib-specific code from util.c to nmblib.c.
(This used to be commit 1b9077a1d5)
2000-03-27 01:33:43 +00:00
Jeremy Allison
1f28a34552 Multiple-dot scope handling fix from Greg Bowering gb@pobox.com
Jeremy.
(This used to be commit 693a582c23)
2000-02-23 22:29:27 +00:00
Andrew Tridgell
6e8548acb3 fixed a comment
(This used to be commit 32f29c490e)
2000-01-07 12:40:34 +00:00
Andrew Tridgell
171da4d787 this looks like a big commit, but it isn't really :)
This fixes our netbios scope handling. We now have a 'netbios scope' option
in smb.conf and the scope option is removed from make_nmb_name()

this was prompted by a bug in our PDC finding code where it didn't append
the scope to the query of the '*' name.
(This used to be commit b563be824b)
2000-01-07 06:55:36 +00:00
Andrew Tridgell
632b4f806e added suppport for unexpected udp/138 packets
I also fixed up the lookup_pdc_name() code so that it now works, even
with a NT server that insists on replying to udp/138.

The method I used to match packets was to use the mailslot string as a
datagram ID. The true dgm_id doesn't work as NT doesn't set it
correctly. uggh.

PS: Jeremy, I had to change your code quite a bit, are you sure this
worked with a Samba PDC?? The code looked broken, it got the offsets
wrong in the SMB portion of the packet and filled in the IP
incorrectly.
(This used to be commit 32f66f4ea6)
2000-01-03 06:30:50 +00:00
Andrew Tridgell
574788039f added the unexpected packet database (unexpected.tdb)
this means "nmblookup -S" now always works, even with broken servers
the database stores all unexpected replies and these can be accessed
by any client.
while doing this I cleaned up a couple of functions, and put in place
a better trn_id generator. in most places the code got quite a bit
simpler due to the addition of simple helper functions.

I haven't yet put the code in to take advantage of this for pdc
replies - that will be next. Jeremys pdc finding code will then work :)
(This used to be commit 280e6359d3)
2000-01-03 03:17:16 +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 453a822a76)
1999-12-13 13:27:58 +00:00
Luke Leighton
ddda7722a6 argh! how horrible! spent ages working out why packets weren't being
received properly when a UDP "retry" occurs.  it's because reads and
writes must be interleaved / matched.

scenario:

nmblookup connects to agent, sends request.

agent receives request, broadcasts it on 137.

agent RECEIVES 137 broadcast, sends it to nmblookup

agent receives RESPONSE to 137 broadcast, sends it to nmblookup.

if reads are not equally interspersed with writes, then second send
will fail.

if you think this is odd behaviour and that the agent should be filtering
its own UDP traffic, think again.

agent will be, potentially, redirecting nmbd traffic (including WINS
server) not just client programs.
(This used to be commit 43e158c426)
1999-12-04 23:40:21 +00:00
Luke Leighton
f521205cb3 jeremy is going to hate me for this.
created an "nmb-agent" utility that, yes: it connects to the 137 socket
and accepts unix socket connections which it redirects onto port 137.

it uses the name_trn_id field to filter requests to the correct
location.

name_query() and name_status() are the first victims to use this
feature (by specifying a file descriptor of -1).
(This used to be commit d923bc8da2)
1999-12-04 19:14:37 +00:00
Luke Leighton
6ddfc68e04 sys_select added one more argument (read, write selectors).
(This used to be commit e4d92ff9df)
1999-12-01 02:15:14 +00:00