summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_winsserver.c
AgeCommit message (Collapse)AuthorFilesLines
2004-03-13Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com ↵Jeremy Allison1-11/+11
(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-09-29Apply some NULL pointer paranoia to previous wins hook fix.Tim Potter1-2/+2
(This used to be commit 0281c5b764971c5300b99b82d89c812ded5a1335)
2003-09-29Fix broken wins hook functionality. A i18n fixe caused the name typeTim Potter1-2/+8
to be appended to the netbios name between angle brackets. This interfered the 'sh -c' used to implement smbrun(). Closes bug #528. (This used to be commit 92b37b3ef097e84adace1295af42853c07ddbec2)
2003-08-27fix segfault on empty wins server name registration replyGerald Carter1-2/+4
(This used to be commit 743560284cebd686be1094ce1d657e6d06c291b0)
2003-08-27Fix the character set handling properly in nmbd. Also fix bug whereJeremy Allison1-1367/+1282
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-8/+0
Jeremy. (This used to be commit eb792727437c74417f5ef7614b300ab84f06fdaf)
2003-05-08This puts back wins.dat into nmbd for easy editing. It leaves most ofVolker Lendecke1-194/+222
the other infrastructure with name owners etc in place. If anybody is really going to tackle winsrepld, it will probably not be hard to put the additional info back. Volker (This used to be commit eb82daa84a5339f28ebf431ee1044b7e1e4a4300)
2003-04-28Fix a confusing error messageVolker Lendecke1-1/+1
Volker (This used to be commit 69df898afb45e2e577a10649f66f5352887044a2)
2003-01-14Merge from HEAD:Andrew Bartlett1-1/+2
- fstring/pstring mixups - the detection code that found them (disabled) - a bit of whitespace - a static Andrew Bartlett (This used to be commit 9b70fa868e7d9481f584c83fc4046174e1dedfd9)
2003-01-03Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett1-1/+1
warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
2002-11-23Lots of fixes for error paths where tdb_fetch() data need freeing.Jeremy Allison1-3/+10
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>. Jeremy. (This used to be commit 5d5762d1787db4392d2dff16024097c638b2d494)
2002-11-15Fix from "Stefan (metze) Metzmacher" <metze@metzemix.de> for nmbd 1c groupJeremy Allison1-0/+16
release. Jeremy. (This used to be commit 7d9552e9c58e533f451a720c9c9c54b8abf3a454)
2002-10-03Merging tridge's wins fixes. Tridge - we're supposed to be keeping 3.0 upJeremy Allison1-2/+2
to date :-). Jeremy. (This used to be commit 5959f35db6b4b23c591799dad7587e6616e5a998)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-1/+11
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-03-21Make winbindd_idmap tdb endian independent. This is very important forJeremy Allison1-5/+5
sharing between machines with rsync. Finally removed tdb_store_int/tdb_fetch_int. Now only tdb_store_int32/tdb_fetch_int32 which are endian independent are allowed. Jeremy. (This used to be commit 1c4a00dcc13f4a7c5876a5cf63ca730190d1132e)
2002-03-05Removed unused static function.Tim Potter1-18/+0
(This used to be commit 472acd89b2bf5ec2a471957aaff42e560053f60e)
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-25rewrote nmbd's wins backend to use a tdb instead of a flat text file.Jean-François Micouleau1-267/+625
Changed the way the wins record are handled in memory. Now they are living much longer with the different states: active, released and tombstone. Also added a version ID, some wins flags and the wins owner ip address to the namrec->data struct, and a function to process messages sent by the wins replication daemon. the initiate_wins_processing() function is not correct, I'll fix it later. J.F. (This used to be commit b902e087d06c32797af19021a7f56895d86d7364)
2001-11-26Got medieval on another pointless extern. Removed extern struct ipzeroTim Potter1-2/+0
and replaced with two functions: void zero_ip(struct in_adder *ip); BOOL is_zero_ip(struct in_addr ip); (This used to be commit 778f5f77a66cda76348a7c6f64cd63afe2bfe077)
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-5/+5
(This used to be commit 1446a1562b1c618c023b056f476e26da7ee3d532)
2001-09-10convert more code to use XFILEAndrew Tridgell1-8/+7
(This used to be commit fd24265c06f6d2b636c1863941a33029dd9f3828)
2001-09-10convert more code to use XFILEAndrew Tridgell1-5/+5
(This used to be commit fe6679dffba9a92bb35933ad52172c9be0e9ef90)
2001-07-04strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell1-4/+4
can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-04-13Merge of Andrew's changes in 2.2.Jeremy Allison1-1/+1
Jeremy. (This used to be commit fc76681812b1469208ad6c8847afdfc68bc6db49)
2001-04-13As Andrew suggested, make smbrun return a fd for a deleted file which can thenJeremy Allison1-1/+1
be read. Jeremy. (This used to be commit e7d59d6de89a5fdd201e4b5c6072dab08b1519db)
2001-04-08Got "medieval on our ass" about adding the -1 to slprintf.Jeremy Allison1-4/+4
Jeremy. (This used to be commit 94747b4639ed9b19f7d0fb896e43aa392a84989a)
2000-05-02Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison1-2/+2
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
2000-03-26when doing a "secure nbns" wack response and check with owner for aAndrew Tridgell1-1/+4
multihomed registration we were sending the packet to the wrong host! We sent it to the person trying to register rather than to the person who currently holds the name. That means we were not secure and we could allow two people to register the same name. Jeremy, you may wish to merge this change into 2.0.X (This used to be commit 94ca1d1250d12918311a402cc689050ba1d06e24)
2000-01-28Modified auto alignment of ud[] struct on stack to be declared as anJeremy Allison1-2/+2
array of pointers. This should cause alignment on a correct boundary.. Spotted by Darren Reed <darrenr@telnetmedia.com>. Jeremy. (This used to be commit 91f4d0675333d7c5d7bb5ff077faaf83e1fd9bfe)
2000-01-02- added tdb_flags option to tdb_open()Andrew Tridgell1-8/+2
- added TDB_CLEAR_IF_FIRST flag to clear the database if this is the first attached process. Useful for non-persistent databases like our locking area (this will also make upgrades to new database layouts easier) - use lock_path() in a couple of places - leave connections database open while smbd running - cleaned up some tdb code a little, using macros for constants (This used to be commit 00e9da3ca577527db392aced62f02c69cfee8f4f)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-14/+63
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1998-11-17Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1-2/+2
Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac)
1998-11-14Removed acconfig.h configure configure.in include/config.h.in: Made ↵Jeremy Allison1-35/+35
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-22Another cosmetic change.Christopher R. Hertel1-2/+8
When dumping the wins.dat, this module will also write the database contents to the log file (don't do this if you have a large wins.dat!). The output was in a sort of tabular format, except that the asctime() function was used and it always terminates its output with a newline. I did a bit of fussing, removed the '\n' character, and did my best to line up the other columns. If the output format of asctime() is different on different systems, then the columns won't line up, but the output will still look better than it did before. Chris -)----- (This used to be commit 57295113feefcde77b429c661878444cd078b21f)
1998-09-28Changes to test in configure if capabilities are enabled on a system.Jeremy Allison1-13/+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-18oops ... I got the filenames wrong in my cleanup of the wins databaseAndrew Tridgell1-1/+2
save, so it started saving weird filenames (from an unitialised fstring). chaos reigns! (This used to be commit 20a550d61e322cc9a0acfdf8fb974dafe0cd9603)
1998-09-18nmbd/nmbd_winsserver.c: Fixed printf style warning.Jeremy Allison1-1/+1
script/mkproto.awk: Added SMB_BIG_UINT. Jeremy. (This used to be commit c22c40f0caa7d6a9e8120e6415fa728db708db3e)
1998-09-17fixed another potential fork bomb where the wins file becomesAndrew Tridgell1-0/+3
non-writeable for some reason. (This used to be commit 9edd43dcd6cc040416f11e00320c53682558fd8a)
1998-09-17fixed the nmbd fork bomb. It was a silly mistake, asAndrew Tridgell1-0/+3
expected. wins_write_database() didn't exit after doing its stuff, so when it returned you had two copies of nmbd :) (This used to be commit 5e6488d4830016ea720a644c1b1ae25b336d3b8b)
1998-09-17fixed a typo in my last commitAndrew Tridgell1-1/+1
(This used to be commit 31b4048362c63ab19e9ef35453c3763eec8b8f2b)
1998-09-17fixed a potential problem with wins_write_database() child processes.Andrew Tridgell1-11/+10
In sig_term() we were calling wins_write_database(0) which would fork a child. This child might then get killed by the same process killing off the parent. That process would then fork another child etc. The solution is to pass a "background" flag to wins_write_database(0) and only fork if this is set. (This used to be commit 1e1a512e3ff59f962fb3de382f671618bed60839)
1998-09-10fixed a bug in the wins database writer that caused the database to beAndrew Tridgell1-3/+11
written continuously rather than once every 5 seconds (at most). also changed it to 20 seconds :) (This used to be commit 1b07de7079e81da9c0b930bdc30ae0451b57d53a)
1998-08-31I looked at the refresh issue a bit more and discovered that SambaAndrew Tridgell1-3/+4
also doesn't switch to a registration if a refresh fails, instead the name is removed! This makes it even more imortant that a Samba WINS server accepts refresh requests as registration requests if the name is not registered. I've gone ahead and implemented this. (This used to be commit 07f825fc9491bb5adac047854e67c63f7757143b)
1998-08-31bounds check next_token() to prevent possible buffer overflowsAndrew Tridgell1-7/+7
(This used to be commit 3eade55dc7c842bdc50205c330802d211fae54d3)
1998-08-30changed the way that name query records are sorted in replies. TheyAndrew Tridgell1-36/+6
are now sorted by the number of common leading bits in the IP address with the address of the querying host. (This used to be commit 4460a1bc6aa7666d1c71d32ba73855d6ed32320a)
1998-08-30include our netbios names list and our workgroup in the wins.dat hashAndrew Tridgell1-2/+22
(This used to be commit f555a76df696a0625acc16fa365dc048e0c2447d)
1998-08-30changed the format of the wins.dat file slightly.Andrew Tridgell1-0/+16
It now has a line like this: VERSION 1 251152 the first number is a version #define in nmbd_winsserver.c and will be used if we ever have to change the format again. The second number is a hash of the current interfaces setting. It is used to detect the case where nmbd is restarted on a machine after the IP of the machine has changed (or the interfaces list has changed in any way). When that happens we need to discard the old wins.dat cache or you end up with chaos. This has bitten quite a few people, they find that when they move a machine it continues using the old IP for some things for the next week until the wins entries time out! I've checked, and the old nmbd can handle the new format, although it does spit out a spurious error message about the VERSION line. So users can safely run 2.0alpha then switch back to 1.9.18 without problems. (This used to be commit c4a8cdc60a5b01894ab2456e77b6d89d4c16a088)
1998-08-03More formatting changes. Mostly converted some DEBUG() calls to DEBUGADD()Christopher R. Hertel1-5/+5
so that we wouldn't get too many timestamps. Chris -)----- (This used to be commit 3e7e5fad378cf144927d9f2ffc82f80e150d44ab)