1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

66 Commits

Author SHA1 Message Date
Jeremy Allison
ce0c99312c Use "unix netbios name" type unstring - 64 bytes long to manipulate netbios
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 834d816caf)
2004-03-15 21:45:45 +00:00
Jeremy Allison
6b9dbbcd24 Modified fix for bugid #784. Based on a patch from moriyama@miraclelinux.com (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 b4ea493599)
2004-03-13 02:16:21 +00:00
Tim Potter
ecd8cc4ef2 Apply some NULL pointer paranoia to previous wins hook fix.
(This used to be commit 0281c5b764)
2003-09-29 04:57:20 +00:00
Tim Potter
1148875a15 Fix broken wins hook functionality. A i18n fixe caused the name type
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 92b37b3ef0)
2003-09-29 04:41:45 +00:00
Gerald Carter
4561b811df fix segfault on empty wins server name registration reply
(This used to be commit 743560284c)
2003-08-27 15:07:46 +00:00
Jeremy Allison
9fdc1363be Fix the character set handling properly in nmbd. Also fix bug where
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 84ae44678a)
2003-08-27 01:25:01 +00:00
Jeremy Allison
5dfeda0002 Use correct size (17 not 16) when doing a push_ascii(). Ensure that
wins hook is called with unix charset.
Jeremy.
(This used to be commit ecb8057387)
2003-08-22 21:41:50 +00:00
Jeremy Allison
647a048ad0 Ensure nmb_namestr() converts back from CH_DOS to CH_UNIX.
Jeremy.
(This used to be commit eb79272743)
2003-08-22 00:26:37 +00:00
Volker Lendecke
53f0ebc82b This puts back wins.dat into nmbd for easy editing. It leaves most of
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 eb82daa84a)
2003-05-08 07:33:39 +00:00
Volker Lendecke
8be1c3a0e4 Fix a confusing error message
Volker
(This used to be commit 69df898afb)
2003-04-28 12:27:18 +00:00
Andrew Bartlett
27b7e51a3c Merge from HEAD:
- fstring/pstring mixups
 - the detection code that found them (disabled)
 - a bit of whitespace
 - a static

Andrew Bartlett
(This used to be commit 9b70fa868e)
2003-01-14 08:53:59 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jeremy Allison
de474974ea Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>.
Jeremy.
(This used to be commit 5d5762d178)
2002-11-23 02:52:36 +00:00
Jeremy Allison
392e2b2a0a Fix from "Stefan (metze) Metzmacher" <metze@metzemix.de> for nmbd 1c group
release.
Jeremy.
(This used to be commit 7d9552e9c5)
2002-11-15 18:55:18 +00:00
Jeremy Allison
a287517c7e Merging tridge's wins fixes. Tridge - we're supposed to be keeping 3.0 up
to date :-).
Jeremy.
(This used to be commit 5959f35db6)
2002-10-03 17:30:57 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Jeremy Allison
67d21b5a4b Make winbindd_idmap tdb endian independent. This is very important for
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 1c4a00dcc1)
2002-03-21 23:39:17 +00:00
Tim Potter
db4dd16d8d Removed unused static function.
(This used to be commit 472acd89b2)
2002-03-05 00:46:41 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Jean-François Micouleau
558e4cf0b8 rewrote nmbd's wins backend to use a tdb instead of a flat text file.
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 b902e087d0)
2002-01-25 22:50:15 +00:00
Tim Potter
585d0efbc6 Got medieval on another pointless extern. Removed extern struct ipzero
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 778f5f77a6)
2001-11-26 03:11:44 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Simo Sorce
1f312492ec move to SAFE_FREE()
(This used to be commit 1446a1562b)
2001-09-17 04:35:51 +00:00
Andrew Tridgell
4d65bc0949 convert more code to use XFILE
(This used to be commit fd24265c06)
2001-09-10 13:09:54 +00:00
Andrew Tridgell
79139fe8d8 convert more code to use XFILE
(This used to be commit fe6679dffb)
2001-09-10 12:46:42 +00:00
Andrew Tridgell
527e824293 strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376)
2001-07-04 07:36:09 +00:00
Jeremy Allison
2ef68c7e92 Merge of Andrew's changes in 2.2.
Jeremy.
(This used to be commit fc76681812)
2001-04-13 19:12:06 +00:00
Jeremy Allison
50e78a9ac8 As Andrew suggested, make smbrun return a fd for a deleted file which can then
be read.
Jeremy.
(This used to be commit e7d59d6de8)
2001-04-13 00:37:00 +00:00
Jeremy Allison
f9a15ce1a6 Got "medieval on our ass" about adding the -1 to slprintf.
Jeremy.
(This used to be commit 94747b4639)
2001-04-08 20:22:39 +00:00
Jeremy Allison
693ffb8466 Added sys_fork() and sys_getpid() functions to stop the overhead
of doing a system call every time we want to just get our pid.
Jeremy.
(This used to be commit 148628b616)
2000-05-02 02:23:41 +00:00
Andrew Tridgell
4e7af2b3b5 when doing a "secure nbns" wack response and check with owner for a
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 94ca1d1250)
2000-03-26 23:16:07 +00:00
Jeremy Allison
40122f6e32 Modified auto alignment of ud[] struct on stack to be declared as an
array of pointers. This should cause alignment on a correct boundary..
Spotted by Darren Reed <darrenr@telnetmedia.com>.
Jeremy.
(This used to be commit 91f4d06753)
2000-01-28 23:47:31 +00:00
Andrew Tridgell
9a781a8c6d - added tdb_flags option to tdb_open()
- 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 00e9da3ca5)
2000-01-02 23:00:27 +00:00
Andrew Tridgell
3db52feb1f first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
(This used to be commit 453a822a76)
1999-12-13 13:27:58 +00:00
Jeremy Allison
768761820e Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.
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 18ff93a9ab)
1998-11-17 20:50:07 +00:00
Jeremy Allison
24ca89bfb0 Removed acconfig.h configure configure.in include/config.h.in: Made 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 9ee8f39aed)
1998-11-14 01:04:13 +00:00
Christopher R. Hertel
2356f467d1 Another cosmetic change.
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 57295113fe)
1998-10-22 00:30:41 +00:00
Jeremy Allison
cf3a9741dc Changes to test in configure if capabilities are enabled on a system.
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 e0567433bd)
1998-09-28 21:43:48 +00:00
Andrew Tridgell
2e6f6bc7f8 oops ... I got the filenames wrong in my cleanup of the wins database
save, so it started saving weird filenames (from an unitialised
fstring).

chaos reigns!
(This used to be commit 20a550d61e)
1998-09-18 13:52:30 +00:00
Jeremy Allison
1e17cbd2a3 nmbd/nmbd_winsserver.c: Fixed printf style warning.
script/mkproto.awk: Added SMB_BIG_UINT.
Jeremy.
(This used to be commit c22c40f0ca)
1998-09-18 00:12:15 +00:00
Andrew Tridgell
c8e6aa6dc1 fixed another potential fork bomb where the wins file becomes
non-writeable for some reason.
(This used to be commit 9edd43dcd6)
1998-09-17 08:35:07 +00:00
Andrew Tridgell
d66a657f90 fixed the nmbd fork bomb. It was a silly mistake, as
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 5e6488d483)
1998-09-17 08:27:46 +00:00
Andrew Tridgell
1eef953aca fixed a typo in my last commit
(This used to be commit 31b4048362)
1998-09-17 08:23:00 +00:00
Andrew Tridgell
e959f2e232 fixed a potential problem with wins_write_database() child processes.
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 1e1a512e3f)
1998-09-17 06:36:08 +00:00
Andrew Tridgell
42edee90bf fixed a bug in the wins database writer that caused the database to be
written continuously rather than once every 5 seconds (at most).

also changed it to 20 seconds :)
(This used to be commit 1b07de7079)
1998-09-10 04:00:09 +00:00
Andrew Tridgell
a2450e6fb3 I looked at the refresh issue a bit more and discovered that Samba
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 07f825fc94)
1998-08-31 09:38:50 +00:00
Andrew Tridgell
61b5fd6f32 bounds check next_token() to prevent possible buffer overflows
(This used to be commit 3eade55dc7)
1998-08-31 03:11:42 +00:00
Andrew Tridgell
179e8c66f1 changed the way that name query records are sorted in replies. They
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 4460a1bc6a)
1998-08-30 08:45:23 +00:00
Andrew Tridgell
3debe642bd include our netbios names list and our workgroup in the wins.dat hash
(This used to be commit f555a76df6)
1998-08-30 06:49:14 +00:00
Andrew Tridgell
5a44ce9caa changed the format of the wins.dat file slightly.
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 c4a8cdc60a)
1998-08-30 05:43:59 +00:00