1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

4281 Commits

Author SHA1 Message Date
Jean-François Micouleau
642ae91256 fix the devmode.orientation being set to 0.
that bug was *subtle* :-(

	J.F.
(This used to be commit 0e9e048b6d)
2000-07-27 07:59:39 +00:00
Jeremy Allison
5ec1642809 Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
(This used to be commit 0ff2ce543e)
2000-07-27 00:47:19 +00:00
Jean-François Micouleau
134a4b8654 if no comment in TDB, use comment from print share.
J.F.
(This used to be commit c267b23620)
2000-07-26 10:31:05 +00:00
Jean-François Micouleau
1e3a5503cd Found out that we are crashing spoolss in enumprinterdata.
So fixed enumprinterdatas in rpcclient to debug the server code,
and found that the parsing code was missing 2 prs_align().

We are not crashing NT anymore. :-)

        J.F.
(This used to be commit 883f7402d4)
2000-07-26 09:40:49 +00:00
Tim Potter
18db0514fd Fixed memory leaks in root and non-root password changing.
(This used to be commit f3a4f81a5e)
2000-07-26 03:55:17 +00:00
Tim Potter
c89cf814cc Fixed memory leaks in _spoolss_addprinterdriver()
(This used to be commit 1f49788442)
2000-07-26 03:38:30 +00:00
Tim Potter
a4243b3d99 Fixed memory leak in modify_trust_password()
(This used to be commit 7145689bf5)
2000-07-26 03:04:01 +00:00
Jeremy Allison
bc22ae0b47 Fixed up error checking and move printer file code. Fixed a memory leak.
Jeremy.
(This used to be commit 5130dd0f8b)
2000-07-25 22:35:57 +00:00
Gerald Carter
904a24a012 make proto
--jerry
(This used to be commit 1f65b13dd5)
2000-07-25 21:14:49 +00:00
Gerald Carter
48a3e00224 some initial code for AddPrinterEx() project. Most is ifdef'd out
'cause it's not all written.


-jerry
(This used to be commit 2c0f6bcc8f)
2000-07-25 21:07:46 +00:00
Andrew Tridgell
5a98f9cb35 if the sids are not the same pointer and either of the sids are NULL
then the two sids are not equal
(This used to be commit 9ccf3b1dc5)
2000-07-25 20:26:50 +00:00
Jeremy Allison
fcbf694957 Added some error checking and returns to the new 'move' code.
Jeremy.
(This used to be commit 0bd88d304c)
2000-07-25 17:09:29 +00:00
Jean-François Micouleau
5a5ef18379 A rather big change set ! (listed in no particular order)
- changed the default forms flag to 2
- all short architecture name are uppercased
- get_short_archi() is now case unsensitive
- the drivers TDB is indexed by archi/version/name
- implemented code to move drivers from the upload area to the download
area. Someone else need to look at that code.
- don't return anymore a default driver if it doesn't exist in the TDB.
Instead return an error.
- cleaned prs_unistr.
- #ifdef out jeremy's new SD parsing in printer_info_2
- removed the unused MANGLE_CODE

- #ifdef out the security checking in update_printer() as it doesn't work
for me.

Zap your ntdrivers.tdb, it won't work anymore.

	J.F.
(This used to be commit ac0a145acc)
2000-07-25 13:15:16 +00:00
Tim Potter
b40175936a Fix for mounting a printer as a share. Not that there's anything
specifically wrong with this, but Samba is fooled by the client into
thinking the printer is a file share.  Files copied to the share gather
dust in the spool directory and aren't printed.

This patch has the effect of not allowing printers to be mounted as file
shares.  Not sure whether this is the correct solution or not.
{Jeremy,JF,Tridge} please check!
(This used to be commit dcf3249bb9)
2000-07-25 06:10:59 +00:00
Jeremy Allison
ac70155b25 Tidy up code to add printer. Always index in tdb by sharename. This
is beginning to come together...
Jeremy.
(This used to be commit 614bf56186)
2000-07-25 01:50:53 +00:00
Tim Potter
47f8f8e522 Run main server loop with sys_select() instead of sys_select_intr(). The
main daemon was not catching sighup and reloading the service file.
(This used to be commit f026a897e9)
2000-07-24 06:20:13 +00:00
Tim Potter
affabf1909 Test for reloading smb.conf after SIGHUP. Needs to be run as root.
(This used to be commit db54e72d2f)
2000-07-24 06:18:21 +00:00
Jeremy Allison
78bbcec21b Fixed open handle code in printers - 3 functions were always being done
in order - moved them into open_printer_hnd().
Added saving of comment field.
Jeremy.
(This used to be commit a0ee774fe9)
2000-07-22 00:48:29 +00:00
Gerald Carter
9f5e9acf77 make proto
(This used to be commit e4af400ed6)
2000-07-21 20:10:52 +00:00
Gerald Carter
74a9323bad * Added EnumPorts()
* Fixed an off-by-one bug noticed by JF in GetPrinterDriverDirectory()



jerry
(This used to be commit a9522f560d)
2000-07-21 20:03:18 +00:00
Gerald Carter
fe245e2a92 Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.


jerry
(This used to be commit a0e8a55c27)
2000-07-21 20:01:20 +00:00
Gerald Carter
92708e3945 Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.



jerry
(This used to be commit 56ce247977)
2000-07-21 19:59:51 +00:00
Gerald Carter
e5c5b2723f Added functions for enumerating ports on remote print server.
Tim,  You should also look at new_smb_io_printer_info_2()
and see if the change from NULL to &i regarding the secdesc is ok.




jerry
(This used to be commit a2205c6646)
2000-07-21 19:58:24 +00:00
Gerald Carter
c0dcf94457 make proto
(This used to be commit 1246728eb9)
2000-07-20 13:52:02 +00:00
Gerald Carter
fca31d804e readded util_list.c (just to the RPCCLIENT_OBJ). I need to split
the file up i think.  Later.



--jerry
(This used to be commit ed54a9f4d1)
2000-07-20 13:39:51 +00:00
Gerald Carter
58221bfcf7 Fixed unitilized secdesc pointer which was causing spoolgetprinter
rpcclient command to fail on shared printers.




jerry
(This used to be commit c8abc31187)
2000-07-20 13:38:48 +00:00
Jeremy Allison
9f040cc17e Modified the patch to look in the tdb *first* - thus allowing legacy text
filed to be ignored when an upload is done.
Modified to code to goto err on problems, simplifies it.
Jeremy.
(This used to be commit 9157a6ab26)
2000-07-19 23:47:10 +00:00
Jeremy Allison
5c162bbe5b Code from John Reilly <jreilly@hp.com> to add tdb lookups into the Win95
printer driver download if looking for the default driver files fail.
Jeremy.
(This used to be commit 1192d867c4)
2000-07-19 20:11:11 +00:00
Christopher R. Hertel
3c9e410c34 Instead of handing back a string (which might be a DNS name or an IP
string), the wins_srv module now hands back a struct in_addr when it's
called.  It caches the IP address once it has been looked up.  The IP
is cleared (and must be looked up again) if the 'wins server' parameter
is reread, or if the node is marked 'dead'.  A dead node will not be
re-tried for 10 minutes (per a #define in wins_srv.c).

As it was, the code was reading the WINS server name or IP directly from
lp_wins_server.  That's okay, except that if the value was expressed as
a name, then a DNS lookup would be done every time the client wanted to
talk to the server.

I still need to work out the implications of failover regarding the
'unicast subnet' list.

Chris -)-----
(This used to be commit 73aa188320)
2000-07-19 05:32:43 +00:00
Christopher R. Hertel
b35f21fb3a First cut toward adding WINS server failover.
*Note: failover doesn't actually work yet!*  It's just that the code I'm
adding provides all of the pieces necessary.

I do have one big question.  Something that I'll have to ask Jeremy, I'm
thinkin'.  In nmbd/nmbd_subnetdb.c the IP of the WINS server is used to
set up the Unicast subnet.

...so what happens if the WINS server changes?

My guess is either:
  a) nothing.
  b) I'd have to change the unicast subnet entry whenever the WINS server
     changes.

Urq.

BTW, the lp_wins_server() function no longer returns the WINS server name
or IP.  It returns the list of WINS servers entered in smb.conf.  To get
the currently 'live' WINS server, use the wins_srv() function.

Fun, eh?

Chris -)-----
(This used to be commit cc08bdc74f)
2000-07-19 01:21:30 +00:00
Christopher R. Hertel
ac56d8f848 Removed the sanity check on the WINS SERVER parameter because it simply
checked to see that only one server was listed.  As I am working on an
enhancement that allows multiple servers to be listed...this was a bit
contrary.  ;)
(This used to be commit 1b718f6767)
2000-07-18 20:15:15 +00:00
Jeremy Allison
2637bfee06 rpc_parse/parse_prs.c: Removed extraneous ()'s.
rpc_parse/parse_spoolss.c: Fixed the security descriptor marshalling in a INFO_2 struct.
							for some reason SD's should be done inline after the info2, not
							as the last buffer marshall.
rpc_server/srv_spoolss_nt.c: Removed extraneous ()'s.
Jeremy.
(This used to be commit f038a24e9f)
2000-07-18 19:25:32 +00:00
Gerald Carter
6f9afd1766 remove util_list from LIB_OBJS since it broke smbd build
(undefined references in link).  This is a quick fix.
I'll resolve things later.

Sorry everyone.




jerry
(This used to be commit ea64f2525d)
2000-07-18 19:05:50 +00:00
Gerald Carter
2a922bd09a Added lib/util_list.[c|o] to Makefile.in
--jerry
(This used to be commit 94967b31bb)
2000-07-18 05:19:29 +00:00
Gerald Carter
a1bd676617 Fixed some more client SPOOLSS functions. The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs

All part of the ongoing rpcclient work.

Also included a new generic list ADT.  Cleaner and simplier
than the stuff in util_array.c i think (but then that's why I wrote it).





--jerry
(This used to be commit 381aba2c9a)
2000-07-18 05:16:30 +00:00
Gerald Carter
2de59a3bea fixed a bug (my own) in create_ntc_from_cli_state()
--jerry
(This used to be commit f7bc6df3be)
2000-07-18 05:13:44 +00:00
Gerald Carter
695e596446 I really didn't like the way generic arrays (lists) were
implemented in util_array.c so I wrote a smaller (and simplier
package).

I would like to replace the use of util_array.c functions
in the rest of the source tree if no one objects.
This will be an interface change, but not really a difference
in the functionality provided.


--jerry
(This used to be commit 0863ce3a31)
2000-07-18 05:12:49 +00:00
Gerald Carter
05fdec749d grab functions that return RPC_HND_NODE (declared
in include/util_list.h)



-- jerry
(This used to be commit ccebd70df2)
2000-07-18 05:10:26 +00:00
Gerald Carter
17dba7ef05 Fixed some more client SPOOLSS functions. The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs

All part of the rpcclient work.

Jeremy, this check includes emthods for associating
POLICY_HNDs and client states.  See the RpcHndList_...()
function calls (implemented in lib/util_list.c)



--jerry
(This used to be commit 84349394a9)
2000-07-18 05:07:28 +00:00
Gerald Carter
2089176e34 Fixed some more SPOOLSS functions. The following
functions work now:

  - spoolenum
  - spoolopen
  - spoolgetprinter
  - spoolgetprinterdriver

Items todo:

  - track down memory bug with spoolenumdata
  - fix spoolgetprinterdriverdir
  - fix spoolgetdata
  - fix display_job_info_ctr in spooljobs


--jerry
(This used to be commit 15b3591271)
2000-07-18 05:02:16 +00:00
Tim Potter
9665d3fc7b Missing var.
(This used to be commit 5c1c562226)
2000-07-17 06:04:23 +00:00
Tim Potter
d39eaf1776 Reverted changes from rpcclient merge - contains memory leak!
(This used to be commit dea06ad7a5)
2000-07-17 05:40:48 +00:00
Tim Potter
873c0366d9 Free security descriptor after access check in update_printer_sec()
(This used to be commit bc5f9c00be)
2000-07-17 05:38:26 +00:00
Tim Potter
8453b27983 Initialise current time to time(NULL) in add_a_printer_2()
Added get and free security old descriptor in nt_printing_setsec() after
access checking was moved up to rpc level.
(This used to be commit a5b7cafc87)
2000-07-17 05:37:16 +00:00
Tim Potter
2bf08232cd make proto
(This used to be commit df0ef98d7e)
2000-07-17 03:13:06 +00:00
Tim Potter
de71b956da make proto
(This used to be commit 4443a8b6e6)
2000-07-17 02:43:12 +00:00
Tim Potter
3733229faf Allow job owner to delete own print job.
(This used to be commit 90b1857c81)
2000-07-17 02:42:25 +00:00
Tim Potter
ba7b78f291 Moved access check for nt_printing_setsec() up into rpc function.
Use sid + rid instead of lp_workgroup()/Administrator for printer owner sid
as per JF's advice.

Default printer owner is either the administrator of the pdc workgroup or
Everyone depending on whether winbindd is running.  Still the subject of
some debate...

Renamed se_access_check() parameters.
(This used to be commit e92e161a81)
2000-07-17 02:41:38 +00:00
Tim Potter
53c91652c6 Renamed arguments to se_access_check()
(This used to be commit 714b50b47d)
2000-07-17 02:38:43 +00:00
Tim Potter
da1f8dc23b Renamed a parameter in init_request() function.
Initialise response structure correctly.
(This used to be commit 587c8e58fd)
2000-07-17 02:37:11 +00:00