summaryrefslogtreecommitdiff
path: root/source3/libsmb/nmblib.c
AgeCommit message (Collapse)AuthorFilesLines
2012-12-21s3-libsmb: Remove check if array is NULL.Andreas Schneider1-1/+2
rdata is an array with data. rdlength defines how big rdata is. So if rdlength is not set we have a big problem. Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-08-09Check error returns from strupper_m() (in all reasonable places).Jeremy Allison1-2/+4
2011-06-09s3-param Remove special case for global_scope()Andrew Bartlett1-5/+5
There is no reason this can't be a normal constant string in the loadparm system. (Past reasons were that we didn't have lp_set_cmdline()) Andrew Bartlett
2011-05-05More simple const fixes.Jeremy Allison1-1/+1
2011-05-04Add in bufflen limit when storing NetBIOS names. Remove safe_strcpy.Jeremy Allison1-16/+32
2011-03-30s3-libsmb: put namequery headers to nmblib.hGünther Deschner1-0/+1
We might find a better name for it and merge other namequery related things as well here... Guenther
2011-02-28s3: Remove unused receive_packetStefan Metzmacher1-33/+0
2011-01-07s3: Remove some unused codeVolker Lendecke1-40/+0
2011-01-07s3: Add packet_trn_id()Volker Lendecke1-0/+16
2010-12-22s3: Add some const to name_mangle()Volker Lendecke1-1/+1
2010-10-01samba: share select wrappers.Günther Deschner1-0/+1
Guenther
2010-09-26Fix bug #7698 - Assert causes smbd to panic on invalid NetBIOS session request.Jeremy Allison1-29/+57
Found by the CodeNomicon test suites at the SNIA plugfest. http://www.codenomicon.com/ If an invalid NetBIOS session request is received the code in name_len() in libsmb/nmblib.c can hit an assert. Re-write name_len() and name_extract() to use "buf/len" pairs and always limit reads. Jeremy.
2010-02-14s3-lib: use TYPESAFE_QSORT() in remaining s3 library codeAndrew Tridgell1-0/+4
the sort_query_replies() in nmblib.c is a TODO. It uses a hack that treats a char* as a structure. I've left that one alone for now.
2010-02-08s3:nmbd: also listen explicit on the subnet broadcast addressesStefan Metzmacher1-2/+7
And send replies always via the unicast address of the subnet. This behavior is off by default (as before) and can be enabled with "nmbd:bind explicit broadcast = yes". metze
2009-02-24Convert name_mangle() to use tallocVolker Lendecke1-4/+11
2008-12-19Remove two write-only variablesVolker Lendecke1-8/+0
If someone wants those stats, please don't use globals :-)
2008-03-08Pass specific packets to build_nmb and build_dgramVolker Lendecke1-6/+4
To me it was not clear what parts of struct packet_struct are actually used in build_packet(). This makes it a bit more clear that only the specific parts are used. (This used to be commit eb8b6f2404e49d6a837935c5b411d78fb6ff23ef)
2007-12-19packet_struct is used in several places as raw memoryVolker Lendecke1-0/+2
-> Fix more uninitialized variable warnings (This used to be commit 0af02db6f2f84a8ce5d614e5baec27f20b413c26)
2007-12-05remove some staticsVolker Lendecke1-42/+7
(This used to be commit 97c9a4042d36178a728b5e0f8923091c7069366d)
2007-10-24This is a large patch (sorry). Migrate from struct in_addrJeremy Allison1-7/+8
to struct sockaddr_storage in most places that matter (ie. not the nmbd and NetBIOS lookups). This passes make test on an IPv4 box, but I'll have to do more work/testing on IPv6 enabled boxes. This should now give us a framework for testing and finishing the IPv6 migration. It's at the state where someone with a working IPv6 setup should (theorecically) be able to type : smbclient //ipv6-address/share and have it work. Jeremy. (This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-12/+12
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r25510: Now we're returning the port instead of using a global,Jeremy Allison1-1/+1
remember to use ntohs. Hopefully will fix the build farm. Jeremy. (This used to be commit 5174acccb589edbfbe4ba633f4178f7200d7d6c4)
2007-10-10r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal withJeremy Allison1-190/+283
the ripple effects this causes. utmp has to change etc. Remove some global varables and store address/port in the unexpected db. Jeremy. (This used to be commit 18c6a2211d9e25233d01715b3f78977edcd6d869)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r15240: Correctly disallow unauthorized access when logging on with theGünther Deschner1-1/+1
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 8b2ba11508e2730aba074d7c095291fac2a62176)
2007-10-10r12107: Move to a tdb-based wins database. At the moment we stillJeremy Allison1-1/+1
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 a342681792724c1ae8561ba8d352c4ee6e2a5332)
2007-10-10r6225: get rid of warnings from my compiler about nested externsHerb Lewis1-2/+3
(This used to be commit efea76ac71412f8622cd233912309e91b9ea52da)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-10/+7
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 620f2e608f70ba92f032720c031283d295c5c06a)
2007-10-10r2224: Make nmbd more robust against bad netbios packets.Jeremy Allison1-0/+5
Jeremy. (This used to be commit dd9b17abd6b32c090840c1a0b797fd774711cb3a)
2007-10-10r776: I should have just cut and pasted from my build area and I wouldHerb Lewis1-1/+1
have gotten this right :-) (This used to be commit 548070274efa12f8c9a4404145d8a2a8c85387b3)
2007-10-10r775: merge trunk 774 to samba 3_0 - fix bad compare in for loopHerb Lewis1-5/+1
(This used to be commit 3cb8f1d53583dac0b77495cbcd017c366af59891)
2004-03-13Ensure we don't truncate strcmps to nstring anymore...Jeremy Allison1-1/+4
Jeremy. (This used to be commit d7cf64b1e4e501bcd01ddc8279babc65d894a4b3)
2004-03-13Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com ↵Jeremy Allison1-11/+17
(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)
2004-03-13First part of patch from moriyama@miraclelinux.com (MORIYAMA Masayuki) toJeremy Allison1-805/+854
fix up netbios names with mb strings. Includes reformat of libsmb/nmblib.c so it's readable. Jeremy. (This used to be commit 966e49a48c352563cdd7f75fe2768f2d6612ec7e)
2004-03-12if we are truncating to the . we need to start at the beginning in caseHerb Lewis1-1/+1
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 0375dace248eb3dc660fa2bca2808552e502b3f7)
2003-08-27Fix the character set handling properly in nmbd. Also fix bug whereJeremy Allison1-2/+1
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-08-22Use correct size (17 not 16) when doing a push_ascii(). Ensure thatJeremy Allison1-1/+1
wins hook is called with unix charset. Jeremy. (This used to be commit ecb80573870103de7b3f332fb53bf6b952f25ee7)
2003-08-22Ensure nmb_namestr() converts back from CH_DOS to CH_UNIX.Jeremy Allison1-13/+16
Jeremy. (This used to be commit eb792727437c74417f5ef7614b300ab84f06fdaf)
2003-07-27Try again to fix up 'session request' name exchange. This time we actualyAndrew Bartlett1-3/+3
get the names... Andrew Bartlett (This used to be commit 7c9e204f7eb15139532f2cc522ed87d0ac34d118)
2003-07-27Some small fixes to our charset conversion code:Andrew Bartlett1-4/+8
- 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 912035af1178424583d0bf887a391a0cac2acd87)
2003-07-03Removed strupper/strlower macros that automatically map to ↵Jeremy Allison1-1/+1
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-06-06fixed a pstrcpy() that is not on a pstringAndrew Tridgell1-1/+1
(This used to be commit f644b3d6d238e3c44d0358b44296a9360d16bb41)
2003-01-03Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett1-4/+4
warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
2002-12-06Ensure global_scope() returns "", not the NULL string. Froma tpot fix.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 0ff254264e6e43399404595bc87b5bd889e17952)
2002-11-12Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison1-16/+15
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-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-2/+2
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-04-22Copying commit from HEAD.Christopher R. Hertel1-2/+13
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 c06a2ece7545a9d9f8cde04745b603f7d6c6a716)
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)