summaryrefslogtreecommitdiff
path: root/source/libsmb/nmblib.c
Commit message (Collapse)AuthorAgeFilesLines
* working on creating the 3.0 release treeGerald Carter2003-06-061-1/+1
|
* BIG patch...Andrew Bartlett2003-01-021-4/+4
| | | | | | | | | | | | | | | | This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett
* Ensure global_scope() returns "", not the NULL string. Froma tpot fix.Jeremy Allison2002-12-061-1/+1
| | | | Jeremy.
* 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.
* sort name query responses by how far they are from our interfaceAndrew Tridgell2002-07-011-2/+2
| | | | | broadcast addresses. This makes it far more likely that we will try to talk to an interface that is routable from one of our interfaces.
* My seven-year-old daughter calls me 'Captain Pedantic'. I don't know whichChristopher R. Hertel2002-04-221-2/+13
| | | | | | | | | | | | | | | 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.
* 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.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* prevent a bogus insure wild ptr messageAndrew Tridgell2001-11-271-1/+2
|
* 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.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-4/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-30/+10
|
* allow for the NULL in make_nmb_name()Andrew Tridgell2001-08-201-1/+1
|
* strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell2001-07-041-1/+1
| | | | can't redefine them. damn.
* The big character set handling changeover!Andrew Tridgell2001-07-041-3/+1
| | | | | | | 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.
* Merge of Andrew's changes in 2.2.Jeremy Allison2001-04-131-1/+1
| | | | Jeremy.
* Convert netbios name to dos codepage in make_nmb_name(). This allowsTim Potter2001-02-021-0/+1
| | | | nmblookup and smbclient to work with i18n netbios names.
* Fix from RFritz@lbl.gov for Linux ECONREFUSED async errors on Linux.Jeremy Allison2000-10-061-2/+10
| | | | Jeremy.
* Linux kernel oplocks now seem to work, but need a _lot_ of testingAndrew Tridgell2000-06-111-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.
* Ho hum - forgot timeout case.Jeremy Allison2000-05-101-1/+5
| | | | Jeremy.
* Fix from David Collier-Brown - sys_select return was not being checked.Jeremy Allison2000-05-101-1/+5
| | | | Jeremy.
* moved nmblib-specific code from util.c to nmblib.c.Luke Leighton2000-03-271-9/+203
|
* Multiple-dot scope handling fix from Greg Bowering gb@pobox.comJeremy Allison2000-02-231-2/+2
| | | | Jeremy.
* fixed a commentAndrew Tridgell2000-01-071-1/+1
|
* this looks like a big commit, but it isn't really :)Andrew Tridgell2000-01-071-2/+3
| | | | | | | | 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.
* added suppport for unexpected udp/138 packetsAndrew Tridgell2000-01-031-2/+43
| | | | | | | | | | | | | | 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.
* added the unexpected packet database (unexpected.tdb)Andrew Tridgell2000-01-031-64/+110
| | | | | | | | | | | | 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 :)
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-211/+77
|
* argh! how horrible! spent ages working out why packets weren't beingLuke Leighton1999-12-041-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* jeremy is going to hate me for this.Luke Leighton1999-12-041-3/+148
| | | | | | | | | | | 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).
* sys_select added one more argument (read, write selectors).Luke Leighton1999-12-011-1/+1
|
* added regqueryval command (experimental) to get reg_io_q_info() andLuke Leighton1999-11-181-1/+1
| | | | | | | | 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.
* safe string version of nmb_namestr.Luke Leighton1999-06-241-4/+13
|
* Changes to make the default prefix /usr/local/samba - as it was in 1.9.18p10.Jeremy Allison1998-11-191-1/+2
| | | | | | acconfig.h configure configure.in include/config.h.in: Fixes to DEC OSF1. libsmb/nmblib.c: Fixes to nmbd jumps in scope names. Jeremy.
* automatically uppercase server and share names (win95 won't handleAndrew Tridgell1998-11-141-6/+6
| | | | lowercase share names!)
* Removed acconfig.h configure configure.in include/config.h.in: Made ↵Jeremy Allison1998-11-141-3/+3
| | | | | | | | | smbwrapper not made by default. nmbd*: Changed all calls to namestr() to nmbd_namestr() to fix broken FreeBSD include file problem...sigh. Jeremy.
* largely rewrote smbpasswd so that the code is understandable. ThisAndrew Tridgell1998-11-121-1/+1
| | | | | | | | | | | | | should allow us to call a function in swat rather than piping to smbpasswd. while doing this I also fixed quite a few "const char *" versus "char *" issues that cropped up while using const to track down bugs in the code. This led to changes in several generic functions. The smbpasswd changes should be correct but they have not been extensively tested. At least if I have introduced bugs then we should be able to fix them more easily than before.
* use *SMBSERVER convention in smbwrapper to allow us to connect toAndrew Tridgell1998-10-041-1/+1
| | | | servers that we don't know the netbios name of.
* tridge the destroyer returns!Andrew Tridgell1998-09-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | 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?
* cast the qsort to prevent warningsAndrew Tridgell1998-08-311-1/+1
|
* changed the way that name query records are sorted in replies. TheyAndrew Tridgell1998-08-301-0/+44
| | | | | are now sorted by the number of common leading bits in the IP address with the address of the querying host.
* This checking fixes the statcache bug that stopped NetBench from runningJeremy Allison1998-08-281-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.
* much cleaner chain pointer handling for both files and pipes.Andrew Tridgell1998-08-171-2/+0
| | | | | | the chain pointer is now stored as a static and is set whenever a handle is created or extracted. This also makes the code less error prone.
* this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell1998-08-141-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.
* I finished removing timestring() calls from DEBUG() messages. Also wentChristopher R. Hertel1998-08-031-36/+41
| | | | | | | | | | 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 -)-----
* As per a Andrew's message, I went through and removed the timestring()Christopher R. Hertel1998-07-311-4/+4
| | | | | | | | | timestamps from several DEBUG messages. The timestamps are redundant now that DEBUG() provides them automatically. There are still a few more files to do, but I've got to get home for dinner. Chris -)-----
* Added strupper() function call to up-case the scope field in theChristopher R. Hertel1998-07-141-6/+7
| | | | | | | | make_nmb_name() function. Database lookups (eg. gdbm) will often use byte-by-byte comparisons, so it is important that the case and padding are correct. Chris -)-----
* nisppass.c: Fixed incorrect parameter usage.Jeremy Allison1998-06-271-0/+1
| | | | | | | | | | | | | | | | | | | | nmbd_become_lmb.c: Add 'force_new_election' parameter to some functions. This allows the start of the election to be done *after* the demotion from local master browser is done. Also changed code so release of 1d name is done immediately to allow other local master to gain it. nmbd_elections.c: Ensured no elections are run until we have registered the WORKGROUP<1e> name that we must listen on to participate in elections. nmbd_incomingdgrams.c: Use force_new_election code. nmbd_namelistdb.c: Make update_name_in_namelist static. nmbd_subnetdb.c: Fix bug in comparison function. We cannot use memcmp as structure packing may make this fail. nmbd_packets.c: Ensure that we only send one release packet when sending a broadcast packet. nmbd_workgroupdb.c: Ensure we put the correct value in the ElectionCriterion field. nmblib.c: Ensure make_nmb_name zero's the struct nmb_name. Jeremy.
* test for overflow in nmb name parsing codeAndrew Tridgell1998-05-131-1/+1
|
* This is a security audit change of the main source.Jeremy Allison1998-05-121-2/+2
| | | | | | | | | | | | | | | | | | 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.