Jeremy Allison [Thu, 11 Jul 2002 00:06:29 +0000 (00:06 +0000)]
*Experimental* new large-scaling printer code. Splits printing.tdb into
a separate tdb per printer, but only keeps (currently one) tdb open at
a time (although this is easily changed by changing a #define). Needs
scalability testing with large numbers of printers now....
Jeremy.
Andrew Tridgell [Tue, 9 Jul 2002 14:17:26 +0000 (14:17 +0000)]
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.
Jim McDonough [Mon, 8 Jul 2002 20:46:54 +0000 (20:46 +0000)]
Fix length in snprintf invocation to account for "dn:" in sasl gssapi bind.
Also remove unused line which incremented pointer by the wrong length anyway.
Provided by Anthony Liguori (aliguori@us.ibm.com).
Gerald Carter [Mon, 8 Jul 2002 20:15:47 +0000 (20:15 +0000)]
added parsing routines for SPOOLSS_ADDPRINTERDRIVEREX and
SPOOLSS_DELETEPRINTERDRIVEREX. Ran them through some testing.
I know I'm off by 2 x uint32's in the former RPC.
Gerald Carter [Mon, 8 Jul 2002 18:34:55 +0000 (18:34 +0000)]
* basic implementation of SPOOLSS_DELETEPRINTERDATAEX and
SPOOLSS_DELETEPRINTERKEY
* stub funnctions for SPOOLSS_ADDPRINTERDRIVEREX and
SPOOLSS_DELETEPRINTERDRIVEREX
Andrew Bartlett [Mon, 8 Jul 2002 01:06:38 +0000 (01:06 +0000)]
Jerry: Sorry if I am stepping on toes here, but this should fix the compile on
solaris CC (void* arithmatic) and fixes the other warnings (global variable
shadows) that gcc has with this file.
Andrew Bartlett [Thu, 4 Jul 2002 13:11:54 +0000 (13:11 +0000)]
More code from "Kai Krueger" <kai@kruegernetz.de>, this time starting to make
the 'user cannot change password' button work. Needs help from a future SAM
backend, but at least this parses the data, and returns an error.
Andrew Bartlett [Thu, 4 Jul 2002 08:45:45 +0000 (08:45 +0000)]
Patch to add security descriptors to the SAMR pipe.
This is not the final solution, I think this will probably changed with the
move to the new SAM subsystem, but it allows some research and gives us
somthing to start with.
It should also help with getting proper NT_TOKEN passing set-up.
Original patch by "Kai Krueger" <kai@kruegernetz.de>, which I have modified to
pass back NTSTATUS returns in more places and to use a little more common code.
Gerald Carter [Wed, 3 Jul 2002 19:15:26 +0000 (19:15 +0000)]
first cut at implementing support for browsing printer and driver driver
via regedt32.exe. The regsitry.tdb is only a framework. It is not
intended to store values, only key/subkey structure. The data
will be retrieved from nt*tdb (for printers) creating a virtual view
of the data.
You can currently connect to a Samba box using regedt32.exe (haven't
tried regedit.exe). Some basic keys are created in registry.tdb
for use.
There are two problems....
* something is getting freed in the winreg code that causes heap
corruption later on. As long as you don't play with the winreg
server functionality, I don't think you'll be bitten by this.
* no access controls are currently implemented
* I can't browse HKLM because regedt32 greys out the SYSTEM subkey.
Andrew Bartlett [Wed, 3 Jul 2002 07:37:54 +0000 (07:37 +0000)]
Break up the passdb objects (to allow RPC clients to link without brining in
*.o) and implment new enum_dom_users code in the SAMR RPC subsystem.
Incresingly, we are using the pdb_get_{user,group}_sid() functions, in the
eventual hope that we might one day support muliple domains off a single
passdb. To extract the RID, we use sid_peek_check_rid(), and supply an
'expected' domain SID.
The id21 -> SAM_ACCOUNT and id23 -> SAM_ACCOUNT code has been moved to
srv_samr_util.c, to ease linking in passdb users.
Compatiblity code that uses 'get_global_sam_sid()' for the 'expected' sid is in
pdb_compat.c
Jeremy Allison [Tue, 2 Jul 2002 06:34:27 +0000 (06:34 +0000)]
Address the string_sub problem by changing len = 0 to mean "no expand".
Went through and checked all string_subs I could to ensure they're being
used correctly.
Jeremy.
Andrew Tridgell [Mon, 1 Jul 2002 05:09:29 +0000 (05:09 +0000)]
sort name query responses by how far they are from our interface
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.
The 17-bit length field in the header contains the number of
bytes which follow the header, not the full packet size.
[Yes, the length field is either 17-bits, or (per the RFCs) it is a
16-bit length field preceeded by an 8-bit flags field of which only
the low-order bit may be used. If that bit is set, then add 65536 to
the 16-bit length field. (In other words, it's a 17-bit unsigned
length field.)
...unless, of course, the transport is native TCP [port 445] in which
case the length field *might* be 24-bits wide.]
Anyway, the change is a very minor one. We were including the four bytes
of the header in the length count and, as a result, sending four bytes of
garbage at the end of the SESSION REQUEST packet.
Gerald Carter [Thu, 27 Jun 2002 18:10:56 +0000 (18:10 +0000)]
It's fairly obvious that no one has tried to upload a driver
to a Samba print server running HEAD in a while. This has been broken
since tridge's changes to make_connection() to not do the chdir()
to the connect_path. Sorry it took me so long to get around to fixing it.
The problem occured with our internal use of make_connection().
Andrew Tridgell [Thu, 27 Jun 2002 14:37:17 +0000 (14:37 +0000)]
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.
Andrew Tridgell [Wed, 26 Jun 2002 12:17:11 +0000 (12:17 +0000)]
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.
Andrew Tridgell [Wed, 26 Jun 2002 08:58:03 +0000 (08:58 +0000)]
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 ...)
Andrew Tridgell [Wed, 26 Jun 2002 08:09:28 +0000 (08:09 +0000)]
removed the wins name registration code from libsmbclient
it is *completely* bogus for our client code to be doing wins
registrations. Not only is it slow as hell (think about when a wins
server is down) but how the heck is going to answer the queries that
will later come in for our name? And what happens when libsmbclient
sends registrations and nmbd then gets the WACK response from the wins
server? we end up losing our name!
Name registration is a job for nmbd, not for clients.
Andrew Tridgell [Wed, 26 Jun 2002 06:44:37 +0000 (06:44 +0000)]
- 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).
Andrew Bartlett [Tue, 25 Jun 2002 02:29:09 +0000 (02:29 +0000)]
Break up samba's object dependencies, and its prototype includes.
Now smbclient, net, and swat use their own proto files - now the global
proto.h
The change to libads/kerberos.c was to break up the dependency on secrets.c -
we want to be able to write an ADS client that doesn't need local secrets.
I have other breakups in the works - I will remove the dependency of
rpc_parse on passdb (and therefore secrets.c) shortly.
(NOTE: This patch does *not* break up includes.h, or other such forbidden
actions).