summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_packets.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r3877: Final (I hope :-) fix for #2050 from Lars Müller for select maxfd's.Jeremy Allison1-16/+6
Jeremy. (This used to be commit 65fc39fc388244923d1e36076b5a4116aa434be5)
2007-10-10r3864: Fix from Lars Müller <lmuelle@suse.de> for bug #2050.Jeremy Allison1-3/+19
Make nmbd use maxfd+1 in select also. Jeremy. (This used to be commit e3ca22b80dc1c22f0e5c829d11724c79e317641f)
2007-10-10r2224: Make nmbd more robust against bad netbios packets.Jeremy Allison1-6/+38
Jeremy. (This used to be commit dd9b17abd6b32c090840c1a0b797fd774711cb3a)
2004-03-15Use "unix netbios name" type unstring - 64 bytes long to manipulate netbiosJeremy Allison1-2/+2
names in nmbd. Allows conversion from dos codepage mb strings (ie. SJIS) to expand to utf8 size on read. Jeremy. (This used to be commit 834d816caf9cd6318da00febde50d9233469dac2)
2004-03-13Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com ↵Jeremy Allison1-4/+4
(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 b4ea493599ab414f7828b83f40a5a8b43479ff64)
2003-11-05Fix for bug #771. Fix packet length for browse list reply.Jeremy Allison1-1/+1
Jeremy. (This used to be commit d085c94dacffbe8199e83315340e4f60d1f0b9a5)
2003-08-27Fix the character set handling properly in nmbd. Also fix bug whereJeremy Allison1-1316/+1183
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 84ae44678a6c59c999bc1023fdd9b7ad87f4ec18)
2003-03-18NMBD string parinoia and memcpy() parinoia fixes from HEAD.Andrew Bartlett1-5/+10
Andrew Bartlett (This used to be commit fb29caddd987f94989f852584b912eeee45b50da)
2003-01-03Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett1-2/+2
warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
2002-11-12Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison1-8/+6
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit f755711df8f74f9b8e8c1a2b0d07d02a931eeb89)
2002-08-17sync 3.0 branch with headJelmer Vernooij1-3/+22
(This used to be commit 3928578b52cfc949be5e0ef444fce1558d75f290)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-158/+176
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-01-31Fix from Michael Steffens <michael_steffens@hp.com> to make signalJeremy Allison1-1/+1
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 3af16ade173cac24c1ac5eff4a36b439f16ac036)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-11Same fix as went into 2.2 (I'm waiting for jerry to finish some code).Jeremy Allison1-1/+1
Jeremy. (This used to be commit 01ff6ce4963e1daff019f2b936cef218e1c93f67)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-2/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-17move to SAFE_FREE()Simo Sorce1-2/+2
(This used to be commit 1446a1562b1c618c023b056f476e26da7ee3d532)
2001-04-27Mismatched format and args.Jeremy Allison1-1/+1
Jeremy. (This used to be commit d57feb2c85f973ad22098054b8d6d049869e2a69)
2001-04-25More paranioa fixes against nmbd lengths.Jeremy Allison1-7/+7
Jeremy. (This used to be commit 53f35a71c6fc46814eca914573506622d7db4e08)
2001-04-24Fix bad length in dgram.Jeremy Allison1-0/+7
Jeremy. (This used to be commit 8bd27845f0d8b19409ba79c028ce54732d7276e1)
2001-04-24Patch for nmbd core dump in printing debug packets. No length check.Jeremy Allison1-3/+5
Jeremy. (This used to be commit eacb96396d57d6b622b750d64b3686e6fbeaf68c)
2001-01-03We only want to mark mailslot packets as loopback packets if they are toRichard Sharpe1-1/+1
the DGRAM_PORT, since we want to actually send those to other ports. They might be for the client library running on the Samba server! (This used to be commit 05e2dd5e85d4aca1ccb9f6991e1415f85cbbdc1a)
2001-01-02Make the use of generate_name_trn_id conform to the usage elsewhere ...Richard Sharpe1-1/+1
(This used to be commit 46a3a56ecf411eb885aee2892e12d3846ce32ad6)
2001-01-02Comment out unused generate_name_trn_id ...Richard Sharpe1-1/+1
(This used to be commit fb5798e1d9eb518f85e30680883c0460141b245d)
2000-09-12- changed the msg_type to be an int instead of an enum so that it isAndrew Tridgell1-11/+0
easier to add new message types to messages.h without breaking old binaries - added a MSG_FORCE_ELECTION message to force nmbd to hold an election (This used to be commit f1c49ca7ce56bc39259041a71479e84ebf53eeca)
2000-09-11debug messages now work for nmbdAndrew Tridgell1-82/+75
(This used to be commit 6a503f95b10f6661b089f30f2b5ffebead32685c)
2000-09-11the first cut of the internal messaging system.Andrew Tridgell1-12/+0
The motivation for this system is to replace the UDP message for oplocks, but this commit only does the "set debug level" message. (This used to be commit 2a34ee95f3929cff131db6c5a2b4820194c05b2d)
2000-08-30Fix for bind interfaces only sometimes picking the wrong IP addressJeremy Allison1-2/+24
for a name query. From Steve Langasek <vorlon@netexpress.net>. Jeremy. (This used to be commit 9890740121ae7bd7a0196bbf946c6f8c82aa7f6e)
2000-06-11Linux kernel oplocks now seem to work, but need a _lot_ of testingAndrew Tridgell1-1/+1
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 b28cc4163bc2faaa80c5782fc02c8f03c410cdeb)
2000-05-02Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison1-1/+1
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
2000-03-27the final part of the nmbd merge between head and tng - this gets theAndrew Tridgell1-5/+4
GETDC stuff sorted out (This used to be commit f6b56ae93e47a54317f2711533ec8208d5cbc8a9)
2000-03-27fixed the hanlding of recursion desired when sending packets fromAndrew Tridgell1-23/+22
nmbd. It does NOT follow the rule that packets to the wins server have rec_des set (I know that we have postulated this in the past). Please don't screw with this unless you do careful testing from WinXX clients. Luke and I spent a couple of hours today getting this right (it was wrong in both TNG and HEAD) (This used to be commit 9eda2e27b74d95975e481d92930ef87de7006919)
2000-01-07this looks like a big commit, but it isn't really :)Andrew Tridgell1-7/+8
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 b563be824b8c3141c49558eced7829b48d4ab26f)
2000-01-03added suppport for unexpected udp/138 packetsAndrew Tridgell1-9/+12
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 32f66f4ea63038cb4b3785bdf1762abdde076f5d)
2000-01-03added the unexpected packet database (unexpected.tdb)Andrew Tridgell1-1/+2
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 280e6359d36c9bc8dcded302f15c3a1db8e3feeb)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-39/+80
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-01sys_select added one more argument (read, write selectors).Luke Leighton1-1/+1
(This used to be commit e4d92ff9dfc51735e6932748f66a7c20b2c1cb6a)
1999-11-19- bug in nmbd registering DOMAIN_NAME<1c> to WINS server; recursionLuke Leighton1-8/+17
desired flag MUST be set in any NBT UDP packets sent to a WINS server, else they will go to the WINS client side of the NT NetBIOS kernel instead, and will get trashed. - added \PIPE\browser server-side code. (This used to be commit 8e406c1fa296c3f97b1cd7ddde7b5aeb9232b26e)
1999-11-18responses to UDP samquery go back to SERVER<00> not DOMAIN<1c>, theLuke Leighton1-1/+1
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. (This used to be commit 4aea261cb0e5f34255ff83271eb5cadb0eb78bc9)
1999-03-09mods to allow inter-domain trust accounts to be added to SAM databaseLuke Leighton1-51/+4
using smbpasswd command. (This used to be commit 62d499f83256c6e8b3308dc4bd8e9f5df873b14b)
1998-12-17Fix bug with nmbd running wild due to recursion in ↵Jeremy Allison1-9/+24
retransmit_or_expire_response_records(). Jeremy. (This used to be commit d5f05b4faef50e7cfc0ed05a87d92e14102106c6)
1998-11-14Removed acconfig.h configure configure.in include/config.h.in: Made ↵Jeremy Allison1-23/+23
smbwrapper not made by default. nmbd*: Changed all calls to namestr() to nmbd_namestr() to fix broken FreeBSD include file problem...sigh. Jeremy. (This used to be commit 9ee8f39aed8772a05c203161b4ae6b7d90d67481)
1998-10-22Okay, this is really silly but removing one space from one debug statementChristopher R. Hertel1-1/+1
meant that one hex dump would fit within 80 characters in lynx after HTML conversion. (This used to be commit c391f076f29cff917fd51d58598e1ad11048e824)
1998-10-22Minor change.Christopher R. Hertel1-1/+1
The debug_browse_data() function does a hex dump of a browser packet. The last line is often not a full 16 bytes, which would miss-align the hex output. I've added the padding needed to align the hex output. Chris -)----- (This used to be commit 9f9b30abab118f0a2e007beddd79de38a2d5ea29)
1998-09-28Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1-1/+1
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. (This used to be commit e0567433bd72aec17bf5a54cc292701095d25f09)
1998-09-05tridge the destroyer returns!Andrew Tridgell1-8/+7
prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static? (This used to be commit 2204475c87f3024ea8fd1fbd7385b2def617a46f)
1998-08-30added a dest_port parameter to send_mailslot() so we send replies toAndrew Tridgell1-4/+3
the correct port in environments like ip masq. (This used to be commit 7d455ee637b6ff70c95845f89d71573ca07b83f3)
1998-08-28This checking fixes the statcache bug that stopped NetBench from runningJeremy Allison1-1/+1
correctly. Added new parameter "stat cache size" - set to 50 by default. I now declare the statcache code officially "open" for business :-). It gets a hit rate of 97% with a NetBench run and seems to make using a case insensitive run as efficient as a case sensitive run. Also tidied up our sys_select usage - added a maxfd parameter and also added an implementation of select in terms of poll(), for systems where poll() is much faster. This is disabled by default. Jeremy. (This used to be commit 779b924ec1f6c81ff578d22295b20fece698d1fc)
1998-08-14this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell1-1/+1
Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep. (This used to be commit c7ee025ead4a85b6fa44a832047b878451845fb6)
1998-08-03I finished removing timestring() calls from DEBUG() messages. Also wentChristopher R. Hertel1-5/+7
through and changed some DEBUG() calls to DEBUGADD() to combine output under a single timestamp. There were too many timestamps. Note that Jeremy has told me that he's working on adding a config parameter to turn timestamps off. Cool. Chris -)----- (This used to be commit 247dbc9a24987035a47f1ba4fa143b1e2c050e92)