summaryrefslogtreecommitdiffstats
path: root/source3/libsmb/nmblib.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-param Remove special case for global_scope()Andrew Bartlett2011-06-091-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
* More simple const fixes.Jeremy Allison2011-05-051-1/+1
|
* Add in bufflen limit when storing NetBIOS names. Remove safe_strcpy.Jeremy Allison2011-05-041-16/+32
|
* s3-libsmb: put namequery headers to nmblib.hGünther Deschner2011-03-301-0/+1
| | | | | | | We might find a better name for it and merge other namequery related things as well here... Guenther
* s3: Remove unused receive_packetStefan Metzmacher2011-02-281-33/+0
|
* s3: Remove some unused codeVolker Lendecke2011-01-071-40/+0
|
* s3: Add packet_trn_id()Volker Lendecke2011-01-071-0/+16
|
* s3: Add some const to name_mangle()Volker Lendecke2010-12-221-1/+1
|
* samba: share select wrappers.Günther Deschner2010-10-011-0/+1
| | | | Guenther
* Fix bug #7698 - Assert causes smbd to panic on invalid NetBIOS session request.Jeremy Allison2010-09-261-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.
* s3-lib: use TYPESAFE_QSORT() in remaining s3 library codeAndrew Tridgell2010-02-141-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.
* s3:nmbd: also listen explicit on the subnet broadcast addressesStefan Metzmacher2010-02-081-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
* Convert name_mangle() to use tallocVolker Lendecke2009-02-241-4/+11
|
* Remove two write-only variablesVolker Lendecke2008-12-191-8/+0
| | | | If someone wants those stats, please don't use globals :-)
* Pass specific packets to build_nmb and build_dgramVolker Lendecke2008-03-081-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)
* packet_struct is used in several places as raw memoryVolker Lendecke2007-12-191-0/+2
| | | | | -> Fix more uninitialized variable warnings (This used to be commit 0af02db6f2f84a8ce5d614e5baec27f20b413c26)
* remove some staticsVolker Lendecke2007-12-051-42/+7
| | | | (This used to be commit 97c9a4042d36178a728b5e0f8923091c7069366d)
* This is a large patch (sorry). Migrate from struct in_addrJeremy Allison2007-10-241-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)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-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)
* r25510: Now we're returning the port instead of using a global,Jeremy Allison2007-10-101-1/+1
| | | | | | remember to use ntohs. Hopefully will fix the build farm. Jeremy. (This used to be commit 5174acccb589edbfbe4ba633f4178f7200d7d6c4)
* r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal withJeremy Allison2007-10-101-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)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r15240: Correctly disallow unauthorized access when logging on with theGünther Deschner2007-10-101-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)
* r12107: Move to a tdb-based wins database. At the moment we stillJeremy Allison2007-10-101-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)
* r6225: get rid of warnings from my compiler about nested externsHerb Lewis2007-10-101-2/+3
| | | | (This used to be commit efea76ac71412f8622cd233912309e91b9ea52da)
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-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)
* r2224: Make nmbd more robust against bad netbios packets.Jeremy Allison2007-10-101-0/+5
| | | | | Jeremy. (This used to be commit dd9b17abd6b32c090840c1a0b797fd774711cb3a)
* r776: I should have just cut and pasted from my build area and I wouldHerb Lewis2007-10-101-1/+1
| | | | | have gotten this right :-) (This used to be commit 548070274efa12f8c9a4404145d8a2a8c85387b3)
* r775: merge trunk 774 to samba 3_0 - fix bad compare in for loopHerb Lewis2007-10-101-5/+1
| | | | (This used to be commit 3cb8f1d53583dac0b77495cbcd017c366af59891)
* Ensure we don't truncate strcmps to nstring anymore...Jeremy Allison2004-03-131-1/+4
| | | | | Jeremy. (This used to be commit d7cf64b1e4e501bcd01ddc8279babc65d894a4b3)
* Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com ↵Jeremy Allison2004-03-131-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)
* First part of patch from moriyama@miraclelinux.com (MORIYAMA Masayuki) toJeremy Allison2004-03-131-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)
* if we are truncating to the . we need to start at the beginning in caseHerb Lewis2004-03-121-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)
* Fix the character set handling properly in nmbd. Also fix bug whereJeremy Allison2003-08-271-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)
* Use correct size (17 not 16) when doing a push_ascii(). Ensure thatJeremy Allison2003-08-221-1/+1
| | | | | | wins hook is called with unix charset. Jeremy. (This used to be commit ecb80573870103de7b3f332fb53bf6b952f25ee7)
* Ensure nmb_namestr() converts back from CH_DOS to CH_UNIX.Jeremy Allison2003-08-221-13/+16
| | | | | Jeremy. (This used to be commit eb792727437c74417f5ef7614b300ab84f06fdaf)
* Try again to fix up 'session request' name exchange. This time we actualyAndrew Bartlett2003-07-271-3/+3
| | | | | | | get the names... Andrew Bartlett (This used to be commit 7c9e204f7eb15139532f2cc522ed87d0ac34d118)
* Some small fixes to our charset conversion code:Andrew Bartlett2003-07-271-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)
* Removed strupper/strlower macros that automatically map to ↵Jeremy Allison2003-07-031-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)
* fixed a pstrcpy() that is not on a pstringAndrew Tridgell2003-06-061-1/+1
| | | | (This used to be commit f644b3d6d238e3c44d0358b44296a9360d16bb41)
* Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett2003-01-031-4/+4
| | | | | | | warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
* Ensure global_scope() returns "", not the NULL string. Froma tpot fix.Jeremy Allison2002-12-061-1/+1
| | | | | Jeremy. (This used to be commit 0ff254264e6e43399404595bc87b5bd889e17952)
* Removed global_myworkgroup, global_myname, global_myscope. Added liberalJeremy Allison2002-11-121-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)
* updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell2002-07-151-2/+2
| | | | (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
* Copying commit from HEAD.Christopher R. Hertel2002-04-221-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)
* Fix from Michael Steffens <michael_steffens@hp.com> to make signalJeremy Allison2002-01-311-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)
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
* prevent a bogus insure wild ptr messageAndrew Tridgell2001-11-271-1/+2
| | | | (This used to be commit 1976a8f87544140363449a361f7c7347ef2c44f5)
* This patch applied, except without the structure changes to nmblib.cAndrew Bartlett2001-10-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 cb84485a2b0e1fdcb6fa90e0bfb97e125ae1b3dd)