1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-19 10:03:58 +03:00

352 Commits

Author SHA1 Message Date
Jelmer Vernooij
41a09c3c53 Revoke some of the popt patch from metze I applied earlier today. It added
some double options and broke some parameters.
(This used to be commit d5f9b0275c91512e1926504f22aaeec2d104430d)
2003-03-24 14:15:14 +00:00
Jelmer Vernooij
11e9de855c Patch from metze to generalise POPT_COMMON_SAMBA, with some minor changes
(This used to be commit 2ddfed298d7f0b6e690275725a39c3ef107077ae)
2003-03-24 11:25:34 +00:00
Jelmer Vernooij
89cd467415 Add nicer --help headers
(This used to be commit e56ab71f1237a71c6ad4f321ce1db4e9397efd73)
2003-03-22 23:50:11 +00:00
Jim McDonough
29d734a93c use pstrcpy_base()
(This used to be commit 9387caf3cebecd50de2b295560355b779135d8c3)
2003-03-20 14:39:46 +00:00
Jim McDonough
84627f7995 replace pstrcpy
(This used to be commit c6eb950b6879d7566ded33dd6a3853cf2d5310db)
2003-03-19 19:32:51 +00:00
Andrew Bartlett
7cf0003dd2 Fix nmbd under -DDEVELOPER (pstrcpy on not-pstring).
Make a new macro to help in this situation, and add memcpy() parinoia

Andrew Bartlett
(This used to be commit 4d00626b6e003952df6715fa80615ec028facdf4)
2003-03-16 03:21:58 +00:00
Andrew Bartlett
3b5bc93e9d String handling parinoia fixes.
This patch enables the compile-time checking of strings assable by means of
sizeof().  (Original code had the configure check reversed).

This is extended to all safe_strcpy() users, push_string and pull_string,
as well as the cli and srv derivitives.  There is an attempt to cap strings
at the end of the cli buffer, and clobber_region() of the speified length
(when not -1 :-).

Becouse of the way they are declared, the 'overmalloc a string' users of
safe_strcpy() have been changed to use overmalloc_safe_strcpy() (which skips
some of the checks).

This whole ball of mud worked fine, until I pulled out my 'fix' for our
statcache.  When jeremy fixes that, we should be able to get back to testing
this stuff.

This patch also includes a 'marker' of the last caller to clobber_region (ie,
the function that called pstrcpy() that called clobber_region) to assist in
debugging problems that may have smashed the stack.  This is printed at
smb_panic() time.  (Original idea and patch by metze).

It also removes some unsused functions, and #if 0's some others that are
unused but probably should be used in the near future.

For now, this patch gives us some confidence on one class of trivial parsing
error in our code.

Andrew Bartlett
(This used to be commit 31f4827acc2a2f00399a5528fc83a0dae5cebaf4)
2003-03-15 07:14:55 +00:00
Gerald Carter
683c17ac0d check a pointer before dereferencing it; not sure why userdata == NULL though
(This used to be commit 6fca29ddcdb111af24ee051b555ab4eec8cadd1d)
2003-03-10 15:05:06 +00:00
Andrew Bartlett
01289b14a7 Make sure that the 'remote' machine name can only be set once. For some weird
reason, during a Win2003 installation, when you select 'domain join' it sends
one machine name in the name exchange, and litraly 'machinename' during the
NTLMSSP login.

Also fix up winbindd's logfile handling, so that it matches smbd and nmbd.

(This helps me, by seperating the logs by pid).

Andrew Bartlett
(This used to be commit afe5a3832f79131fb74461577f1db0e5e8bf4b6d)
2003-03-08 10:22:50 +00:00
Andrew Bartlett
d5da58df9c A couple more fixes for fstrcpy() into a malloced region. In this case it's
all perfectly legit - the region is an fstring in length, but might not
always be, and it is the last peice of code to fail my automated test.

Andrew Bartlett
(This used to be commit 762d61b37d053568b6346e249ba7ef594320153a)
2003-03-05 09:36:41 +00:00
Andrew Bartlett
e11d91e201 Make this an fstrcat(), as this seems to fix some weird issue with the server
name being truncated...  (either way, it's the correct thing to do).

Andrew Bartlett
(This used to be commit a058960c15944ac5a415307f0b016553ef42e101)
2003-01-28 10:16:07 +00:00
Andrew Bartlett
1fdaca3342 The last of the fstring/pstring mixups, and an extra 'static'.
(This used to be commit b328b67fd8fd605636ed58ffd33cf5be3d480672)
2003-01-14 06:46:14 +00:00
Gerald Carter
df4af79c78 patch to include support for daemontools from Michael Handler
(This used to be commit 4c48c475a28450ad4fd8dcc8263e841c0c39a80e)
2003-01-03 17:32:11 +00:00
Andrew Bartlett
6d66fb308a BIG patch...
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
(This used to be commit 92a777d0eaa4fb3a1c7835816f93c6bdd456816d)
2003-01-02 09:07:17 +00:00
Jeremy Allison
7f23546730 Forward port the change to talloc_init() to make all talloc contexts
named. Ensure we can query them.
Jeremy.
(This used to be commit 842e08e52a665ae678eea239759bb2de1a0d7b33)
2002-12-20 20:23:06 +00:00
Jeremy Allison
574c676c94 Protect nmbd against malformed reply packets. Some reports on the lists showing
these.
Jeremy.
(This used to be commit 65d5bf65c439aee1450e330a9f2bd829d9b2c2d0)
2002-12-19 22:14:53 +00:00
Jim McDonough
fc67cd8bf3 Stop using hacks for dns host/domain names.
(This used to be commit 1d0086aadb4fa57b127e80e455835dd6eb387f71)
2002-12-03 19:37:42 +00:00
Andrew Bartlett
8f84d170af Remove extra headers, and ensure that we correctly bail out of winbindd if we
can't create the socket.

Andrew Bartlett
(This used to be commit 13b9af53bff8e42126a38f93c3bdd5b4d9b20aba)
2002-12-01 03:14:30 +00:00
Jeremy Allison
f023d6129b 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 19f86f1f72aca924e9e320e20a175b5d21de45ad)
2002-11-23 02:52:38 +00:00
Jeremy Allison
fdd3cf7afc Fix from "Stefan (metze) Metzmacher" <metze@metzemix.de> for nmbd 1c group
release.
Jeremy.
(This used to be commit 507ff510e7e7d63e02be5b11d974fc05839e6eaf)
2002-11-15 18:55:30 +00:00
Jeremy Allison
250c980119 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
2002-11-12 23:15:52 +00:00
Andrew Bartlett
c501ac2bfa Compleatly remove support for logfile truncation. All logs are opened for
append writes.

(blessed by jra)

Andrew Bartlett
(This used to be commit 81633064dd196c40541ecece8def51745f514646)
2002-11-08 23:05:34 +00:00
Jelmer Vernooij
7da7b4a464 Make IRIX happy
(This used to be commit aeb94bb0d7ad84b52a5f729a3e83f4fb00005771)
2002-11-04 14:08:11 +00:00
Jelmer Vernooij
8a6b05d36d Add more options to popt_common and use them. Current ones are:
-V Version information
 -n Set netbios name
 -l Set directory to store log files in
 -d Set debuglevel
 -s Load specified configuration file
 -O Set socket options
(This used to be commit 1602d5894947b59fd36c161053a66c0afe2c959c)
2002-11-02 16:16:15 +00:00
Jelmer Vernooij
6c589bfb76 Convert to popt
(This used to be commit 9ea7440ac4a3dbb98e34ccb8ee78e0bd782fa704)
2002-11-02 00:44:19 +00:00
Jeremy Allison
5bf57880e7 Ensure we register the 1c name on the unicast subnet.
Jeremy.
(This used to be commit ca6146c2d345902446665ebfa88f78a06eb58831)
2002-10-08 18:24:12 +00:00
Andrew Tridgell
c1346cdca9 fixed 3 bugs in the wins server code related to precedence of ! and &
in C

please note that:
 if (! a & b)
is not the same as:
 if (! (a & b))
(This used to be commit ec6a098c2edf6aa44f85b031459b737496080898)
2002-10-03 13:28:44 +00:00
Jeremy Allison
96cf2abf9d Patch from Andy Levine andyl@epicrealm.com who discovered that W2K DMB's
return empty NetServerEnum2 on port 445, but not on port 139.
Jeremy.
(This used to be commit a9112a1e4b24ccd94be4d0d055ddc9d1bdfef1be)
2002-09-10 17:24:17 +00:00
Herb Lewis
f5a4487df5 fix for difference in strsep and strtok semantics
(This used to be commit 51e0a4adc7c6cc09e53003726b31201a091e9f35)
2002-08-22 10:33:21 +00:00
Herb Lewis
2d05704d0e fix irix compile errors - cannot initialize array in declaration statement
with non-const values - strsep not defined
(This used to be commit a5c59b2cd10016ecbd931531602ad1cb3660bbf9)
2002-08-20 18:43:59 +00:00
Tim Potter
298f956eaf The unused variable was actually needed. The correct fix is to move
it inside an #ifdef HAVE_ADS to avoid the warning and breaking the
build.  (-:
(This used to be commit a8c4febdb760beb669048c2bf2bb0a0b1c5ed472)
2002-08-15 22:03:22 +00:00
Tim Potter
14c7250ab4 Removed unused variable.
(This used to be commit 23f1b839e6287089511cd51ceed298d6a6d65a89)
2002-08-15 19:34:57 +00:00
Andrew Bartlett
dd5615c042 Make 'remote_machine' private to lib/substitute.c, and fix all the user to use
the new accessor functions.

Andrew Bartlett
(This used to be commit f393de2310e997d05674eb7f1268655373e03647)
2002-08-11 02:30:35 +00:00
Jim McDonough
6cfff280d8 Add AD version of samlogon replies for getdc. ATM it will only function
if you have an ADS DC.
(This used to be commit 059a352ebb7c7286d205bc86a92f5fd26ab1ff8e)
2002-08-06 18:16:28 +00:00
Jim McDonough
60078160de Fix length on mailslots. Looks like it should have been 0x17, not decimal 17.
(This used to be commit 8e906a948196be7d630a9b20f3c3d2cbafd545f1)
2002-08-02 17:44:02 +00:00
Andrew Tridgell
c76ab193dc this is an interim fix for nmbd not registering DOMAIN#1b with WINS
when a PDC. The fix does not iterate over all WINS tags, which it
should do, but after having looked at doing that it gets *very* messy
to do with our current code base.
(This used to be commit 434e5124db28134ebfc9840cf0839d77987db65e)
2002-07-28 07:15:42 +00:00
Andrew Tridgell
4b68935a51 make sure async dns nmbd child dies
samba-patches 898
(This used to be commit a954f72fe315ec59bfeb4bd407179bc54689440f)
2002-07-28 06:26:41 +00:00
Andrew Tridgell
ed9a219c87 fix minor nits in nmbd from adtam@cup.hp.com
samba-patches 959
(This used to be commit ef04261e2510b658322336ce841b01f1c903eee2)
2002-07-28 06:19:14 +00:00
Andrew Bartlett
f9558e5819 I think this makes the debug statement clearer.
(but assumes that 'myip' is indeed our local IP...)

Andrew Bartlett
(This used to be commit bea31062a261a49b65800a15d47f8b011af632f6)
2002-07-26 10:25:08 +00:00
Andrew Tridgell
7f42c53971 the last WINS update broke self registration when we are a WINS
server. The real problem is all the special cases we had for when we
are a wins server as opposed to when we are using a 'real' wins
server.

This patch removes the special cases. We now accept non-broadcast
packets from ourselves and we use ourselves as a wins server when we
are one. This gets rid of the special cases and simplifies things
quite a bit.

It all seems to work, but there are bound to be problems found later.
(This used to be commit 3e843d30158d05cdfba716bac7e5c0a75ae7a79c)
2002-07-09 14:17:26 +00:00
Andrew Tridgell
d4c3fd3d0d fixed multi-homed re-registration of names when we are a WINS
server. We were rejecting them, leaving the name unregistered!
(This used to be commit 2dc539ed33f9893cbe9e16c386994933121b71e9)
2002-07-01 07:19:12 +00:00
Andrew Tridgell
cf634de37b don't start the async dns process unless we actually need it!
(ie. check for lp_dns_proxy())
(This used to be commit 84d3b09b8542518a4684d07e975bcc9eaa1f6b69)
2002-07-01 07:15:13 +00:00
Andrew Tridgell
223ddc3f2d The next phase in the WINS rewrite!
We now cope wiith multiple WINS groups and multiple failover servers
for release and refresh as well as registration. We also do the regitrations
in the same fashion as W2K does, where we don't try to register the next
IP in the list for a name until the WINS server has acked the previos IP.
This prevents us flooding the WINS server and also seems to make for much
more reliable multi-homed registration.

I also changed the dead WINS server code to mark pairs of IPs dead,
not individual IPs. The idea is that a WINS server might be dead from
the point of view of one of our interfaces, but not another, so we
need to keep talking to it on one while moving onto a failover WINS
server on the other interface. This copes much better with partial
LAN outages and weird routing tables.
(This used to be commit 313f2c9ff7a513802e4f893324865e70912d419e)
2002-06-27 14:37:17 +00:00
Andrew Tridgell
caeaa0acb0 This commit finally gives us multiple wins server groups. We now
accept an extended syntax for 'wins server' like this:

  wins server = group1:192.168.2.10 group2:192.168.3.99 group1:192.168.0.1

The tags before the IPs don't mean anything, they are just a way of
grouping IPs together. If you use the old syntax (ie. no ':') then
an implicit group name of '*' is used. In general I'd recommend people
use interface names for the group names, but it doesn't matter much.

When we register in nmbd we try to register all our IPs with each group
of WINS servers. We keep trying until all of them are registered with
every group, falling back to the failover WINS servers for each group
as we go.

When we do a WINS lookup we try each of the WINS servers for each group.
If a WINS server for a group gives a negative answer then we give up
on that group and move to the next group. If it times out then
we move to the next failover wins server in the group.

In either case, if a WINS server doesn't respond then we mark it dead
for 10 minutes, to prevent lengthy waits for dead servers.
(This used to be commit e125f06058b6b51382cf046b1dbb30728b8aeda5)
2002-06-26 12:17:11 +00:00
Andrew Tridgell
38bd5bf9eb we never pass any userdata when doing name registrations on the
unicast subnet, so remove that parameter. That frees up userdata so I
can start using it to indicate which wins server tag we are
registering (more about wins 'tags' later ...)
(This used to be commit 1324f0c185bb8cdb95fd497457223aff5e687bd6)
2002-06-26 08:58:03 +00:00
Andrew Tridgell
07f35f68e0 - completely rewrote the wins_srv.c code. It is now much simpler, and
gives us a good grounding to properly support multiple wins servers
for different interfaces (which will be coming soon ...)

- fixed our wins registration failover code to actually do failover!
We were not trying to register with a secondary wins server at all
when the primary was down. We now fallback correctly.

- fixed the multi-homed name registration packets so that they work
even in a non-connected network (ie. when one of our interfaces is not
routable from the wins server. Yes, this really happens in the real
world).
(This used to be commit a049360d5b0d95a935b06aad43efc17d34de46dc)
2002-06-26 06:44:37 +00:00
Andrew Tridgell
31cac044a3 when nmbd starts up it is possible that dhcp hasn't started the local
interfaces yet. Instead of giving up, nmbd will now wait for some
interfaces to appear
(This used to be commit 612ae5313250aec80c94782d55cbf755dd4a9a4f)
2002-06-19 00:21:38 +00:00
Gerald Carter
7b60e23040 compile warngin fixes merged from 2.2
(This used to be commit 29874f4b8fecdc7cbd84d656dafce54cca49e0b1)
2002-06-17 15:33:13 +00:00
Gerald Carter
2bba2d15c6 merge from 2.2
(This used to be commit e671b7fe9d6c963e20770944f29ea532293d2692)
2002-05-28 14:49:00 +00:00
Jean-François Micouleau
3e0c6ded65 nmbd handle shutdown message.
J.F.
(This used to be commit c33459f7018a2522158b20261ab8c100fdde9034)
2002-03-29 13:58:32 +00:00