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

419 Commits

Author SHA1 Message Date
Tim Potter
ce236d1dbf Stomped on some header file version numbers that have crept back in.
(This used to be commit e66bdf1229)
2002-03-22 06:24:38 +00:00
Gerald Carter
9529a4827c merge from APPLIANCE_HEAD
(This used to be commit 9282aa02d4)
2002-03-20 23:09:34 +00:00
Gerald Carter
826f3fb86b resetprinter merge from SAMBA_2_2
(This used to be commit 88d8897e21)
2002-03-20 03:37:27 +00:00
Tim Potter
0cd5dd67ce Merge from app-head:
> Don't put two copies of the server name in construct_printer_info_1()
(This used to be commit 47b1003bc5)
2002-03-20 00:24:35 +00:00
Jeremy Allison
72eb7dbd40 Merge in JohnR's page count fixes.
Jeremy.
(This used to be commit 2e3133fbe5)
2002-03-19 02:35:12 +00:00
Tim Potter
a4cce223d6 Added dos_errstr() function. Not all errors in list yet.
(This used to be commit ddb5753e36)
2002-03-17 06:04:15 +00:00
Tim Potter
ab13654dc9 Renamed get_nt_error_msg() to nt_errstr().
(This used to be commit 1f007d3ed4)
2002-03-17 04:36:35 +00:00
Gerald Carter
65c007b583 syncing up printing code with SAMBA_2_2 (already done some merges
in the reverse).

  * add in new printer change notify code from SAMBA_2_2

  * add in se_map_standard() from 2.2 in _spoolss_open_printer_ex()

  * sync up the _print_queue_struct in smb.h (why did someone change the
    user/file names in fs_user/fs_file (or vice-versa) ? )

  * sync up some cli_spoolss_XXX functions
(This used to be commit 5760315c1d)
2002-03-15 08:14:10 +00:00
Tim Potter
8975d3ef70 Backed out enumprinters stuff - leave it for another day.
(This used to be commit d7efc5dd3d)
2002-03-14 01:48:59 +00:00
Tim Potter
92e59edc41 Merge of enumprinters vs getprinter naming patch from 2.2
(This used to be commit dfd51bc8d0)
2002-03-12 00:16:03 +00:00
Gerald Carter
8fa6b34e08 merge from 2.2
(This used to be commit 66eb969ade)
2002-03-08 22:07:18 +00:00
Gerald Carter
c3e813945c merge from 2.2
(This used to be commit 4960692e95)
2002-03-08 21:57:53 +00:00
Jeremy Allison
194e39b179 Turns out an Admin user shouldn't always have access on a handle.
Jeremy.
(This used to be commit d31d2dcd22)
2002-03-08 00:26:18 +00:00
Jeremy Allison
43ca6e3ef8 Merge in the change to do per-handle access checks on setdata/setform etc.
Should allow the buggy spoolss code on NT to work against us.
Jeremy.
(This used to be commit 2b3609a7dd)
2002-03-07 01:02:48 +00:00
Jeremy Allison
2ff9390245 Fixup the sending of printer change messages from job changes.
Jeremy.
(This used to be commit 28d4e7a3e2)
2002-02-26 03:12:09 +00:00
Tim Potter
2f8452fd49 Merge of printing performance fixes from appliance.
(This used to be commit c8dc59dfe8)
2002-02-25 23:18:05 +00:00
Gerald Carter
5dbe33e3ee merge from 2.2
(This used to be commit 505119f0a7)
2002-02-21 17:30:58 +00:00
Gerald Carter
84b18178a9 merge from 2.2
(This used to be commit 63ab947fd9)
2002-02-21 00:55:01 +00:00
Gerald Carter
cef4f9215f merge from 2.2
(This used to be commit 25fb4a8d11)
2002-02-20 23:36:23 +00:00
Gerald Carter
83bc6cdd55 merge from APPLIANCE_HEAD
(This used to be commit 696d439515)
2002-02-15 18:59:34 +00:00
Gerald Carter
1f6df6c9ce merge from 2.2
(This used to be commit e18a7c2647)
2002-02-12 22:31:18 +00:00
Gerald Carter
51e205c92a merge from 2.2
(This used to be commit 09fc979172)
2002-02-12 19:16:14 +00:00
Jeremy Allison
03cfb31ad9 Bring printing in HEAD inline with 2.2.x and app-head.
Jeremy.
(This used to be commit 771ef92fc6)
2002-02-09 04:10:24 +00:00
Tim Potter
8fff9a4b9e Added administrator access check for server side add, delete and setform
rpcs.  The only one I have been able to verify is addform - can't get the
client side routines working properly yet.  )-:
(This used to be commit 3cd97d65de)
2002-01-31 11:44:00 +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
Gerald Carter
485b4ff5ec merge from APPLIANCE_HEAD
(This used to be commit e3b87ffc8c)
2002-01-26 22:27:12 +00:00
Jeremy Allison
5b0dca4998 Fixed ADDPRINTEREX to take a devmode and a security descriptor...
Jeremy.
(This used to be commit 27f65b3aad)
2002-01-26 01:20:38 +00:00
Jeremy Allison
b3e5d34171 Make systemtime work for spooling on bigendian systems. Fix from
Benjamin (Bj) Kuit bj@it.uts.edu.au.
Jeremy.
(This used to be commit 5f4de275a3)
2002-01-25 18:27:40 +00:00
Tim Potter
f0fe8ff18a Sync up startpageprinter with appliance.
(This used to be commit 6025ab201a)
2002-01-23 11:47:19 +00:00
Jeremy Allison
1182b7cd8c Merge of fixes from 2.2.
Jeremy.
(This used to be commit 6406a42d01)
2002-01-22 19:45:17 +00:00
Andrew Bartlett
bb6af711b8 This is the current patch from Luke Leighton <lckl@samba-tng.org> to add a
degree of seperation betwen reading/writing the raw NamedPipe SMB packets
and the matching operations inside smbd's RPC components.

This patch is designed for no change in behaviour, and my tests hold that to be
true.  This patch does however allow for the future loadable modules interface
to specify function pointers in replacement of the fixed state.

The pipes_struct has been split into two peices, with smb_np_struct taking the
information that should be generic to where the data ends up.

Some other minor changes are made: we get another small helper function in
util_sock.c and some of the original code has better failure debugs and
variable use. (As per on-list comments).

Andrew Bartlett
(This used to be commit 8ef13cabdd)
2002-01-20 02:40:05 +00:00
Jeremy Allison
5fa0da0ba5 Missing assign fix from Bernt Nilsson bkn@ida.liu.se.
Jeremy.
(This used to be commit adf24a90e8)
2002-01-15 16:20:25 +00:00
Jeremy Allison
c9d350a736 Added PRINTER_INFO_4/PRINTER_INFO_5, we're seeing level 5 requested on the wire... so.
Jeremy.
(This used to be commit b63b762978)
2002-01-12 02:37:54 +00:00
Jeremy Allison
1d40138232 Round and round we go....
Jeremy.
(This used to be commit 2603ab3c68)
2002-01-11 23:33:12 +00:00
Jeremy Allison
4702494dce Added get_called_name() function, which replaces global_myname in printing
code (one less global, hurrah !) - to allow NetBIOS aliasing to be used
with point and print.
Jeremy.
(This used to be commit 10d72f0b01)
2002-01-08 00:46:56 +00:00
Martin Pool
bf65820af2 Add an output parameter to message_send_all that says how many
messages were sent, so you know how many replies to expect.

Const and doc religion.
(This used to be commit 22e510ea0d)
2001-12-21 00:37:49 +00:00
Gerald Carter
abcd1cad3a ChangeID fixe from APPLIANCE_HEAD
(This used to be commit 096d06a961)
2001-12-14 20:38:04 +00:00
Tim Potter
14d7f43590 FALSE -> False
(This used to be commit dbdbf7cd07)
2001-12-14 04:43:31 +00:00
Gerald Carter
4ad930ad5e merge from appliance_head
(This used to be commit 423554fd71)
2001-12-13 16:35:43 +00:00
Tim Potter
4f53486d78 Added client and server code for the GetPrintProcessorDirectory SPOOLSS
rpc.  This was supposed to fix a printer driver download bug but it didn't
but it seemed a shame to trash all this code so I'm commiting it #ifdef'ed
out in case someone needs it one day.
(This used to be commit bef4365647)
2001-12-10 05:03:17 +00:00
Jeremy Allison
105f8a1a0f Use print_queue_length() by preference if we don't need a queue
as it doesn't do a traversal.
Jeremy.
(This used to be commit 4bf4ee3f14)
2001-12-05 02:11:03 +00:00
Jeremy Allison
5472638730 Improved efficiency of enumerating print queue's under a particular
extreme condition...
Jeremy.
(This used to be commit 425bb0f405)
2001-12-05 00:54:33 +00:00
Gerald Carter
9cc8cb5134 merge from APPLIANCE_HEAD
(This used to be commit f8b18b2594)
2001-11-30 20:33:35 +00:00
Jeremy Allison
605248abd9 Check error returns.
Jeremy.
(This used to be commit fc8638e89e)
2001-11-30 03:45:21 +00:00
Jeremy Allison
445ab75ec3 Gerald's fix.
Jeremy
(This used to be commit b0c1fcfc8b)
2001-11-30 03:38:59 +00:00
Tim Potter
6d9adfe73c Renamed sid field in SEC_ACE to trustee to be more in line with MS's
definitions.
(This used to be commit 9712d3f15a)
2001-11-30 01:04:15 +00:00
Gerald Carter
bd8e916cb5 merge from APPLIANCE_HEAD
(This used to be commit c60aa6c06f)
2001-11-28 21:51:11 +00:00
Jeremy Allison
d919314390 Added PRINTER_ALREADY_EXISTS error check from Gerry.
Jeremy
(This used to be commit c7f1d3d6f7)
2001-11-27 20:01:23 +00:00
Gerald Carter
59b2e772e2 remove unused variables
(This used to be commit 90ed3d47e1)
2001-11-22 06:44:05 +00:00
Gerald Carter
116740a5df merge from 2.2
(This used to be commit 96b3a65a73)
2001-11-22 05:56:09 +00:00
Tim Potter
06ff349e21 FALSE -> False
(This used to be commit 7c6529c081)
2001-11-15 05:26:22 +00:00
Tim Potter
7623cec4ad Wrote some stubs for new win2k only spoolss rpc commands:
GetPrinterDataEx() and SetPrinterDataEx().  Not sure what the command
number is for the latter is - I haven't seen it on the wire yet.
(This used to be commit 87614c74b3)
2001-11-05 06:15:02 +00:00
Jean-François Micouleau
375dcb9a8b Fix some unicode string error.
I'm wondering if I have to audit *all* the rpc code for that kind of
trouble ;-) Oh well I've done it twice already, I can do it a third time
;-)

	J.F.
(This used to be commit 6be8ea28f9)
2001-10-16 22:42:24 +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
87945989c0 move to SAFE_FREE()
(This used to be commit 5ceecc7bef)
2001-09-17 10:26:23 +00:00
Gerald Carter
bd7595ec37 merge from appliance_head
(This used to be commit f70b1707e4)
2001-09-14 15:22:49 +00:00
Gerald Carter
cae476a1a2 cut-n-paste error
(This used to be commit b2ed211df0)
2001-09-10 19:30:34 +00:00
Gerald Carter
c113b5196f merge from APPLIANCE_HEAD
(This used to be commit 55bd514c45)
2001-09-10 19:29:00 +00:00
Andrew Tridgell
b04933dfbb a fix for fussy compilers
(This used to be commit 78f437b507)
2001-09-04 11:18:50 +00:00
Andrew Tridgell
19fea3242c the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but the client code still needs some work
(This used to be commit dcd6e735f7)
2001-09-04 07:13:01 +00:00
Andrew Tridgell
fbc1f326f4 more NTSTATUS/WERROR conversion
(This used to be commit ad648c5cd8)
2001-09-03 10:38:13 +00:00
Andrew Tridgell
fd6ea43161 the next step in our error code handling change
- added WERROR for win32 error codes
- added a configure test for immediate structures

still lots to do, so its not enabled by default, but the main
structure is there
(This used to be commit 24f9ab683d)
2001-09-03 08:50:59 +00:00
Andrew Tridgell
b031af348c converted another bunch of stuff to NTSTATUS
(This used to be commit 1d36250e33)
2001-08-27 19:46:22 +00:00
Gerald Carter
26ceb74063 merge from 2.2
(This used to be commit 7049217eb4)
2001-08-13 21:30:27 +00:00
Simo Sorce
2e783a4707 this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.

someone should port this fix to 2.2 also.
(This used to be commit fa8e55b8b4)
2001-08-12 17:30:01 +00:00
Jeremy Allison
4b2016305b Merge in the NT drivers changes from 2.2.
Jeremy.
(This used to be commit a3781ad38f)
2001-08-10 19:38:53 +00:00
Tim Potter
047a7c88d7 Replaced the duplicate DOS constants with appropriate ones from doserr.h to
emphasise the fact that the spoolss pipe returns DOS error codes instead of
32-bit nt status codes.
(This used to be commit 5f5ed41ee8)
2001-08-10 05:41:53 +00:00
Tim Potter
648528196c Held a shoot-out between NT_STATUS_NO_PROBLEMO and NT_STATUS_NOPROBLEMO.
According to the incorruptible judges find and grep, the latter won.

Mmm - procrastination.  (-:
(This used to be commit 2e33940360)
2001-07-25 06:42:05 +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
Andrew Tridgell
87fbb7092b The big character set handling changeover!
This commit gets rid of all our old codepage handling and replaces it with
iconv. All internal strings in Samba are now in "unix" charset, which may
be multi-byte. See internals.doc and my posting to samba-technical for
a more complete explanation.
(This used to be commit debb471267)
2001-07-04 07:15:53 +00:00
Herb Lewis
c2cfcb34e1 SGI compiler fixes.
Jeremy
(This used to be commit 45bf995bf6)
2001-06-26 20:23:45 +00:00
Jeremy Allison
8209eda774 Make message receive fn static.
Jeremy.
(This used to be commit d8807b1922)
2001-06-13 01:08:27 +00:00
Tim Potter
2eef56f9fa i18n bugfix merge from appliance.
(This used to be commit 73eb539da6)
2001-06-02 03:03:28 +00:00
Gerald Carter
43000d8d06 merge from 2.2 (deleteprinterdriver RPC)
(This used to be commit 515caaf7b4)
2001-05-18 04:11:17 +00:00
Jeremy Allison
9b78339875 More acl -> the_acl, %d with uid_t issues.
Jeremy.
(This used to be commit 30edd7fdf1)
2001-04-27 21:49:22 +00:00
Jean-François Micouleau
30c0777c1f fix a bug in printer name handling that jerry reported.
names can be \\server -> print server
\\server\printer -> printer
printer -> printer

	J.F.
(This used to be commit ec576722b7)
2001-04-27 17:08:33 +00:00
Tim Potter
af08cd21eb Getting medieval with compiler warnings as Jeremy puts it.
(This used to be commit d05c3cf0f4)
2001-04-16 02:35:35 +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
09a5daf032 Changed lp_add/delete/enum scripts to use lockdir if spool dir doesn't
exist for printer. Rather than using pid for suffix, use a 16 byte random
string. Created generate_random_str() function in genrand.c. Still needs
more testing but this is the way to go.
Jeremy.
(This used to be commit 71a330987f)
2001-04-12 07:00:08 +00:00
Jeremy Allison
950f1d9605 Added 3 params to manipulate shares. "add share command/change share command/
delete share command". Implemented "delete" - more work to come on add and
change.
Jeremy.
(This used to be commit 2e6b1759e1)
2001-04-07 00:36:38 +00:00
Jeremy Allison
5948fa9fe1 Missed forms update - my CVS mistake.
Jeremy.
(This used to be commit 06dee89860)
2001-04-03 23:09:04 +00:00
Andrew Tridgell
24a4483a9c test commit for jeremy
(This used to be commit d747ab8ab3)
2001-04-03 22:52:38 +00:00
Gerald Carter
738a83a14f rename of 16 new_smb_io functions to smb_io_* for consistency sake
(merge from 2.2)
(This used to be commit ea963a648b)
2001-03-28 16:08:00 +00:00
Gerald Carter
25d975e550 merge from 2.2.
(This used to be commit 817258f117)
2001-03-27 18:19:01 +00:00
Jeremy Allison
e532d96a26 Move to a handle database per pipe name, not per pipe.
Jeremy.
(This used to be commit a24b248a77)
2001-03-13 20:18:45 +00:00
Jeremy Allison
da3053048c Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMR
RPC code to merge with new passdb code.
Currently rpcclient doesn't compile. I'm working on it...
Jeremy.
(This used to be commit 0be41d5158)
2001-03-11 00:32:10 +00:00
Jeremy Allison
393bede7db Sync up handle creation with 2.2 branch. We can now join AS/U domains and
authenticate against them. Big/little endian issues fixed.
Jeremy.
(This used to be commit 0e6a34510e)
2001-03-07 23:59:13 +00:00
Jeremy Allison
e2e56e84f0 Fixed up overrun read when marshelling SYSTEMTIME struct. This was a subtle one...
Jeremy.
(This used to be commit 65275e73ee)
2001-03-03 06:47:37 +00:00
Jeremy Allison
93169a1f34 Roll back to using malloc/realloc on some of spoolss in head.
I'm having problems with talloc_realloc in the 2.2 branch and I
want a stable reference.

The only problem is this breaks the clean auto-generated code
in *one* call in srv_spoolss.c (the rfnpcnex call).

Jeremy.
(This used to be commit 57a9340cba)
2001-03-03 05:27:26 +00:00
Jeremy Allison
28c43a3cd5 Arrgggh. Returning the SPOOL_INFO stuff requires that the realloced
data be realloced between different functions. This took a *long*
time to track down (even with insure :-).
Jeremy.
(This used to be commit e61899f490)
2001-03-02 02:59:17 +00:00
Jeremy Allison
74294f5a96 Move to talloc controlled NT forms.
Jeremy.
(This used to be commit 3e190e6933)
2001-03-02 00:20:43 +00:00
Jeremy Allison
fe4d6cd3bb Fix memory leaks introduced in restructure.
Jeremy.
(This used to be commit a355e11201)
2001-03-01 04:00:45 +00:00
Jeremy Allison
5fa70d7747 When opening a printserver use a global snum of -1.
Jeremy
(This used to be commit 3f44cb6103)
2001-03-01 03:36:02 +00:00
Jeremy Allison
7d85361533 rpc_parse/parse_spoolss.c: Fixed memory leak introduced by restructuring.
rpc_server/srv_spoolss_nt.c: Fixed problem with printer snum being read uninitialised.
Jeremy.
(This used to be commit 1552db715d)
2001-03-01 03:04:13 +00:00
Jeremy Allison
c014d3b709 Remove unused code.
Jeremy.
(This used to be commit 3495d5cc3b)
2001-03-01 00:40:25 +00:00
Jeremy Allison
011422ab5a Ensure that SPOOL_NOTIFY_OPTION structs are safely copied out of the talloc
area into the Printer_entry struct - these are used for changenotification.
Jeremy.
(This used to be commit 4c2a49168e)
2001-03-01 00:14:45 +00:00
Jeremy Allison
30d74f54e6 Finished converion of spoolss code to canonical format. Now to work on the
PRINT_XX struct alloc/free issues.
Jeremy.
(This used to be commit db98d4b020)
2001-02-28 21:19:31 +00:00
Jeremy Allison
acc06fc7a8 More converted to canonical format. Home now - do the rest tomorrow...
Jeremy.
(This used to be commit 9d5979f51e)
2001-02-28 02:38:09 +00:00
Jeremy Allison
2a258f7a64 Converted more to canonical format... save as I go.,
Jeremy.
(This used to be commit 1d4ff7a81b)
2001-02-28 02:03:02 +00:00
Jeremy Allison
6ed9b52862 Ooops - forgot to check the rpcclient and smbcacls compile with the new
code :-(.
Jeremy.
(This used to be commit 70beabf73b)
2001-02-28 01:38:12 +00:00
Jeremy Allison
403562cb94 Partial conversion of SPOOLSS code to canonical format. More to follow.
Once complete then the PRINTER_XX functions and structures will be converted
to talloc control.
Jeremy.
(This used to be commit 8171cc5642)
2001-02-28 01:24:55 +00:00
Jeremy Allison
0f2799aaf1 Move to talloc control of SPOOL_XXX structs. Move to talloc control of
security descriptors and pointers. Syncup with 2.2 tree.
Jeremy.
(This used to be commit 14d5997dc8)
2001-02-28 00:51:02 +00:00
Jeremy Allison
ed77fca199 include/rpc_spoolss.h: Added JOB_STATUS_XXX defines.
include/smb.h: Added LPQ_xx enums to correspond with the NT JOB_STATUS_XXX. We
                need these to be different as we're storing LPQ_xx enums in the tdb
                already.
rpc_server/srv_spoolss_nt.c: Don't need to return status strings as we're now
                            returning status codes.
smbd/lanman.c: Change the RAP status codes to have "RAP" in the name.
printing/printing.c: Keep track of the status of a job. Allow a job to be
                deleted from one smbd when being submitted by another.
                Made logic in mutex clearer.
Jeremy.
(This used to be commit 71029da7dd)
2001-02-23 03:59:37 +00:00
Jeremy Allison
fd46817f0b Excise snprintf -> slprintf.
srv_samr.c: duplicate gid fix.
srv_spoolss_nt.c: Merge of JF's work.
uid.c: Fix for returning names when a PDC.
Jeremy.
(This used to be commit d938ad6963)
2001-02-16 19:21:18 +00:00
Gerald Carter
deb638a7ac merge from APPLIANCE_HEAD (mapping access_required 0x0 to
PRINTER_ACCESS_USE)
(This used to be commit 0c57b05de4)
2001-02-03 23:45:59 +00:00
David O'Neill
4a9fb6b6b7 Changes from SAMBA_2_2:
source/rpc_server/srv_spoolss_nt.c
    source/rpc_server/srv_spoolss.c
    source/include/proto.h
        - correct checking of access_required in openprinterex as talked
          with John R. and Jerry.
          You can only do server stuff (adding printers, changing forms,
          ..) if you're root or if user is in printer admin list.
          Printers options are grayed if you don't have the
          PRINTER_ADMINISTER flag in the secdesc.
(This used to be commit f449d871bf)
2001-01-31 18:34:49 +00:00
David O'Neill
2506c61ab3 Changes from APPLIANCE_HEAD:
source/include/proto.h
        - make proto

    source/printing/nt_printing.c
    source/rpc_server/srv_spoolss_nt.c
        - Fix for the overwriting of printerdata entries when WinNT and
          Win2k are modifying printer parameters on PCL printers. Turns out
          that Win2k creates a printer with a NULL devmode entry and then
          expects to set it on *OPEN* (yes this is insane). So we cannot
          return a "default" devmode for a printer - and we must allow an
          open to set it.

    source/tdb/tdb.c
        - Show freelist in an easier format. Show total free.
        - When storing a new record, allocate memory for the key + data
          before the tdb_allocate() as if the malloc fails a (sparse) hole
          is left in the tdb.

    source/tdb/tdbtool.c
        - Show freelist in an easier format. Show total free.

    source/tdb/Makefile
        - cleaned up Makefile dependancies

    source/smbd/lanman.c
        -  Fix for Win9x corrupting it's own parameter string.

    source/printing/printfsp.c
    source/printing/printing.c
    source/rpc_server/srv_spoolss_nt.c
    source/smbd/close.c
        - Added normal close parameter into print_fsp_end() which treats an
          abnormal close as error condition and deletes the spool file.
(This used to be commit 025f7a092a)
2001-01-29 21:34:08 +00:00
David O'Neill
c7a7dea333 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - Changed the se_access_check() call in _spoolss_open_printer_ex()
          to a print_access_check().  This allows the 'printer admins'
          smb.conf and other permission override parameters to affect the
          result of a printer open.
        - Don't perform access check when opening a handle on a print
          server as it breaks browsing the Printers folder.
(This used to be commit bbe51d4b5f)
2001-01-25 20:15:32 +00:00
David O'Neill
eee29958f5 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - add an access check to _spoolss_deleteprinter() to stop random
          users and passers by from deleting printers.

    source/lib/messages.c
        - converted global msg_all struct to a local in message_send_all()
          function.

    source/include/smb.h
        - added a success error code to the spoolss return codes.

    source/include/proto.h
    source/param/loadparm.c
    source/printing/printing.c
        - Added new parameter "total print jobs" to limit the total number
          of print jobs across all queues. Currently individual queues are
          limited by "max print jobs".
(This used to be commit 02f154e729)
2001-01-23 20:25:25 +00:00
David O'Neill
b9c5be4d79 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - remove redundant srv_spoolss_sendnotify() calls from
          _spoolss_startdocprinter() and _spoolss_enddocprinter(), as its
          functionality is already covered in print_job_start() and
          print_job_end()

    source/printing/printing.c
        - force a print_queue_update() prior to print queue purge so that
          all jobs are purged.
(This used to be commit 0ccc552203)
2001-01-23 17:39:03 +00:00
David O'Neill
c4e0cb72bc Changes from APPLIANCE_HEAD:
source/include/proto.h
		- make proto

	source/rpc_server/srv_spoolss_nt.c
		- clean up incorrect debug statement
(This used to be commit f07f4e9c7b)
2001-01-19 16:58:23 +00:00
David O'Neill
1a0d64a425 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - Fixed dereference of NULL pointer in security descriptor
          notification used by Win2K printers.
(This used to be commit 1b6efd1894)
2001-01-18 16:13:03 +00:00
David O'Neill
22363b9d78 Changes from APPLIANCE_HEAD:
source/include/proto.h
    source/include/rpc_spoolss.h
    source/rpc_parse/parse_spoolss.c
    source/rpc_server/srv_spoolss.c
    source/rpc_server/srv_spoolss_nt.c
        - speedups in printer queue enumeration  - still room for
          improvement.  The construct_dev_mode() still creates and destroys
          a printer info_2 structure every time it is called.
        - fixed job->devmode memory leak
        - converted printer job notification routines to use tallocated
          memory rather than a fixed 2K buffer.   This reduces the memory
          requirements of a 4500 job queue enumeration from 90MB to about
          16MB.
(This used to be commit 7853b27bc1)
2001-01-17 22:55:02 +00:00
David O'Neill
792ca5d989 Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - Unrolled construct_notify_jobs_info() loop to only fetch
          printer info_2 structure once rather than num_print_jobs times.
        - convert command to unix codepage.
        - remove lp_remove_service() call as it prevents lp_killservice()
          from working.
        - Modified some DEBUG and DEBUGADD statements.

    source/param/loadparm.c
    source/param/params.c
        - change printer, preload, auto services to FLAG_DOS_STRING,
          reverted earlier changes to szPrintername et al, add comments.

    source/printing/load.c
        - fix bug with lp_auto_services() and strtok()

    source/printing/nt_printing.c
    source/printing/printing.c
        - remove redundant test that used SERVICE(snum)

    source/printing/pcap.c
        - add unix_to_dos() calls, add notes wrt FIXMEs for
          xxx_printer_fn() functions.

    source/web/swat.c
        - added FIXME comment.

    source/smbd/service.c
        - added comment re: dos codepage
(This used to be commit 7b774b72c2)
2001-01-17 18:47:46 +00:00
David O'Neill
27922c0430 Changes from APPLIANCE_HEAD:
source/rpc_parse/parse_lsa.c
        - off by one unistr length bug in init_lsa_trans_name()

    source/lib/util_sid.c
        - resolve more BUILTIN sid values to names.

    source/nsswitch/wb_client.c
        - fix typo in debug message
        - set errno on error so we don't get bogus value from last failure.

    source/rpc_server/srv_spoolss_nt.c
        - add debug to track number of open printer handles for ease of
          tracking handle leaks in the future.

    source/rpc_server/srv_lsa.c
        - fix off-by-one string bug.  This was preventing NT from
          displaying names for well-know SIDs in printer permissions
          dialog.
(This used to be commit 59229b9025)
2001-01-15 18:36:50 +00:00
David O'Neill
3380ffae9c Changes from APPLIANCE_HEAD:
testsuite/printing/psec.c
        - Use lock directory from smb.conf parameter when peeking at the
          ntdrivers.tdb file.
    source/rpc_parse/parse_sec.c
        - fix typo in debug message
    source/script/installbin.sh
        - create private directory as part of 'make install'.
    source/nsswitch/winbindd_cache.c
    source/nsswitch/winbindd_idmap.c
    source/passdb/secrets.c
    source/smbd/connection.c
        - always convert tdb key to unix code-page when generating.
    source/printing/nt_printing.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend path to a filename that is NULL in
          add_a_printer_driver_3().
    source/rpc_server/srv_spoolss_nt.c
        - always convert tdb key to unix code-page when generating.
        - don't prepend server name to a path/filename that is NULL in the
          fill_printer_driver_info functions.
    source/printing/printing.c
        - always convert tdb key to unix code-page when generating.
        - move access check for print_queue_purge() outside of job delete
          loop.
    source/smbd/unix_acls.c
        - fix for setting ACLs (this got missed earlier)
    source/lib/messages.c
        - trivial sync with appliance_head
(This used to be commit 376601d17d)
2001-01-11 20:41:19 +00:00
David O'Neill
ab60974082 Changes merged from APPLIANCE_HEAD:
source/printing/printing.c
    source/rpc_server/srv_spoolss_nt.c
        - convert args for print command to unix codepage.
(This used to be commit 1c0ae957f8)
2001-01-08 19:58:30 +00:00
David O'Neill
85b1953f6d Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c
        - fixed printer policy handle leak in the allow MS printer wizard
          stuff.
        - mimic behaviour of NT on open_printer_ex() calls by not allowing
          call to succeed if connecting user doesn't have at least print
          permissions to the printer.  Unfortunately, this seems to trigger
          a anonymous connection re-using bug so subsequent connects to the
          printer by a different user from the same machine always fail.
          Blame Tim. =^)
(This used to be commit 33fc7f4527)
2001-01-05 19:01:11 +00:00
Gerald Carter
21f0dc985a merge from appliance head
(This used to be commit 4671a31377)
2000-12-21 23:23:34 +00:00
Jeremy Allison
452102deb4 Merged Tim's fixes from appliance-head.
Jeremy.
(This used to be commit 26f873540c)
2000-12-18 06:02:31 +00:00
Jean-François Micouleau
89af6fd745 lib/util_unistr.c:
rewrote unistr2_to_ascii() to correct a bug seen on SGI boxes.

rpc_parse/parse_misc.c:
rpc_parse/parse_prs.c:
        rewrote of BUFFER5 handling to NOT byteswap when it was already in
        network byte order.

rpc_parse/parse_samr.c:
        cleanup of samr_io_q_lookup_domain(), remove the over-parsing by 2
        bytes.

rpc_server/srv_lsa.c:
        UNISTR2 strings need to be NULL terminated to pleased W2K.

rpc_server/srv_spoolss_nt.c:
        use snprintf instead of safe_strcpy as we want the string
        truncated at 32 chars.


That should fix SUN and SGI box not able to act as printserver and the
problem with joining from a W2K wks.

        J.F.
(This used to be commit 69fe739303)
2000-12-15 09:31:56 +00:00
Jeremy Allison
a18ade3fe0 Fixed memory leak in JOB_INFO_2 code.
Jeremy.
(This used to be commit d0d31eead3)
2000-12-15 01:47:37 +00:00
Jeremy Allison
369f5fd1d7 Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. Merged
in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open
problem.
Jeremy.
(This used to be commit 0a40bc83e1)
2000-12-15 01:02:11 +00:00
Jeremy Allison
57779c6f3b Updates from appliance-head.
Jeremy.
(This used to be commit 15ae2c335b)
2000-12-14 18:37:01 +00:00
Jeremy Allison
a95ccc2779 Adding in debug for SD's.
Jeremy.
(This used to be commit a19f936b64)
2000-12-11 19:24:59 +00:00
Jeremy Allison
cf5b71994d file_lines_load/file_lines_pload can now optionally convert unix_to_dos()
on read.
Jeremy.
(This used to be commit 76b8dd376d)
2000-12-07 19:26:04 +00:00
David O'Neill
a69a1a87d8 Changes from APPLIANCE_HEAD:
- Add code to test equivalence of private data in NT_DEVICEMODE
(This used to be commit 684981851f)
2000-11-22 16:19:07 +00:00
Jeremy Allison
ac4d277561 Fix from John Reilly for equivalence tests.
Jeremy.
(This used to be commit b456274a7b)
2000-11-17 23:10:56 +00:00
Jeremy Allison
475fb713a9 Fix for memory leak when adding driver.
Jeremy.
(This used to be commit eeab4e0290)
2000-11-17 02:22:35 +00:00
Jeremy Allison
cdac09614e Fix for a problem with the new messaging system. If a sender is using the
messaging system as a notification mechanism, and the speed of notification
greatly exceeds the speed of message recovery, then you get a massively (>75Mb)
growing tdb. If the message is a simple notification, then the message is
static, and you only need one of them in transit to a target process at
any one time.
This patch adds a BOOL "allow_duplicates" to the message_send_XX primitives.
If set to False, then before sending a message the sender checks the existing
message queue for a target pid for a duplicate of this message, and doesn't
add to it if one already exists.
Also added code into msgtest.c to test this.
Jeremy.
(This used to be commit 3aa7995660)
2000-11-16 21:38:24 +00:00
Jeremy Allison
4bce271e4f Merge from appliance head of JR's changes for driver versioning.
Jeremy.
(This used to be commit cdbd2e9977)
2000-11-14 21:56:32 +00:00
Jeremy Allison
e0bcc7ff54 printing/nt_printing.c: After long soul searching and making both Andrew and my
life a misery, here is the only possible null driver fix we have found.
		This *SUCKS*.
rpc_server/srv_spoolss_nt.c: Correct printername search. Correct portname reply
						Correct attributes reply. Removal of unused temp variable.
Jeremy.
(This used to be commit 06e71c9f8b)
2000-11-14 02:14:58 +00:00
Jeremy Allison
c1900772ce printing/nt_printing.c: use getpwuid not smbgetpwuid. Canonicalize printernames.
printing/printing.c: Insure fix for malloc of zero.
rpc_parse/parse_misc.c: Enusre UNISTR's are zero filled.
rpc_parse/parse_spoolss.c: Correct INFO_6 - differs between pre-releases of W2K and shipping build.
rpc_server/srv_spoolss_nt.c: Canonicalize printernames.
Jeremy.
(This used to be commit b17e23a8ff)
2000-11-10 19:36:34 +00:00
Andrew Tridgell
3adc0e7a4e an attempt to get the handling of fields in printer info structures
consistent. Still working with Jeremy on this, there is probably more
to be done
(This used to be commit c4bb9c598c)
2000-11-08 03:12:16 +00:00
Tim Potter
1d3747e7f2 Merge fest!!!
(This used to be commit 87775074b2)
2000-11-08 00:20:26 +00:00
Tim Potter
8a190a9e46 Merge of printer security descriptor, info level and printerdata
comparison changes from appliance branch.
(This used to be commit ae087bdf31)
2000-11-07 02:54:50 +00:00
Tim Potter
cd8525a767 Merge of comment repair.
(This used to be commit 7712421910)
2000-10-30 21:55:30 +00:00
Jeremy Allison
c33d0e466d Patches from John Reilly @ HP for print job time bugs.
Jeremy.
(This used to be commit 0eb7f2d514)
2000-10-29 17:27:41 +00:00
Jeremy Allison
9a8749d33a Added John Reillys patch for error code returns from clean_up_printer_driver_strunct()
calls.
Jeremy.
(This used to be commit f81a2a03bf)
2000-10-26 22:09:22 +00:00
Jeremy Allison
b5ac72cc64 Sorry JF - no billable hours :-). I fixed the "stream of events" problem
with PCL drivers. The problem was we were updating the changeid on every
SETPRINTERDATA/DELETEPRINTERDATA call. We should not do this, we should
just update the 'setprinter' called count. We update the changeid on calls
to SETPRINTER/ADDPRINTER/ADDPRINTEREX etc. Also fixed the correct returning
of the create time on printers.
Jeremy.
(This used to be commit 521f09829f)
2000-10-26 21:43:13 +00:00
Tim Potter
4e1d306945 Merge from appliance-head
(This used to be commit 6d39df7cf8)
2000-10-20 03:23:36 +00:00
Jeremy Allison
e8912baf02 Fix found by Andrew to stop local/remote printers being
confused. check_printer_ok was causing SETPRINTER calls to fail.
Jeremy.
(This used to be commit b41cc5fea7)
2000-10-10 19:09:48 +00:00
Jeremy Allison
1126775808 Proto update. Also fix from John Reilly @ HP for not showing APW with W2K.
Jeremy.
(This used to be commit 698288cb9d)
2000-10-06 20:03:17 +00:00
Jeremy Allison
ba00796e6d Herb's warning fixes. Also the POSIX locking fix.
We now use our own vfs layer to do get/set acl calls (hurrah!).
Jeremy.
(This used to be commit dfe77c7046)
2000-10-06 18:13:52 +00:00
Jeremy Allison
23f78fd7b9 Adding Herb's compile warning fixes to HEAD.
Jeremy.
(This used to be commit d131ad1ce3)
2000-10-04 01:03:23 +00:00
Jeremy Allison
c5ca95aeb1 Fixes from Herb - compiler warnings.
Jeremy.
(This used to be commit d9d3668fa3)
2000-10-03 18:29:12 +00:00
Jeremy Allison
e26d09685c Added debug so if zero length messages get sent we successfully remove
them (this can happen if smbd processes are shut down at the wrong time).
Jeremy.
(This used to be commit c1de97f96b)
2000-10-02 19:28:26 +00:00
Jeremy Allison
7de0b5588e Missing null termination on printer changenotify message caused insure
error.
Jeremy.
(This used to be commit 3733d29ce6)
2000-09-29 21:15:45 +00:00
Jeremy Allison
efe9922b43 Fixed stupid introduced bug found by "Jim McDonough/Boulder/IBM" <jmcd@us.ibm.com>.
Jeremy.
(This used to be commit 563f8b09a8)
2000-09-27 21:57:38 +00:00
Jean-François Micouleau
56917236a0 broadcast printer notify message to all clients. We now have printer
notification as on NT.

Andrew, your message passing code is cool :-)

	J.F.
(This used to be commit 0374bc4b5f)
2000-09-26 10:15:12 +00:00
Jeremy Allison
5be845af6b Changes from John Reilly to add a parameter "show add printer wizard" that
allows Samba to turn off the display of APW (hmmm. This should probably
be a share specific parameter, I'll fix that in another commit).
Also a few small changes to JF's code to fix compiler warnings about
missing return statements and also change '//' comments (C++) to /* .. */
comments (C).
Jeremy.
(This used to be commit 0a9ccc99b3)
2000-09-26 00:54:18 +00:00
Jean-François Micouleau
233bc00020 printer notify code.
It only sends notifies to one client. The broadcasting notify code will
code soon.

	J.F.
(This used to be commit 4c63c91858)
2000-09-25 21:05:18 +00:00
Jeremy Allison
b774aa4b89 Adding fix from Jim Vopni <jimv@metrics.com> to ensure jobs are
closed before a printer is closed/deleted.
Jeremy.
(This used to be commit f0c16f7228)
2000-09-21 21:44:15 +00:00
Jean-François Micouleau
a2c82976b8 in a printer_info_6, driver version is 64 bits long and there is a 32 bit
padding before.

	J.F.
(This used to be commit cd41d7a354)
2000-09-16 10:07:46 +00:00
Jeremy Allison
ccddd111c6 Move towards getting W2k p&p to upload NT4.x drivers. Still doesn't work -
not sure why (JF - a glance at this would be appreciated). Removed code
that JF objected to with enumprinterdata. Added translations to/from
level 6 - but Win2k still not happy... hmmm...
Jeremy.
(This used to be commit e5d98ba9e9)
2000-09-15 00:15:10 +00:00
Jeremy Allison
ed6530800c Added SIGHUP when printer deleted as well as added.
Jeremy.
(This used to be commit 79c94f37d0)
2000-09-13 18:50:38 +00:00
Jeremy Allison
3e675875a4 Fix for enumjobs infor level 2 which caused smbd to coredump.
Uninitialized element in struct.
Jeremy.
(This used to be commit 9e1fbb0c2f)
2000-09-12 22:33:41 +00:00
Jeremy Allison
043860d8b7 Fixed error return when printer is PAUSED - should be returning "Pause".
Jeremy.
(This used to be commit 41d03a118c)
2000-09-12 21:45:42 +00:00
Jeremy Allison
d836024b28 Fixed memory leaks found in enumprinterdrivers code.
Jeremy.
(This used to be commit e08b521559)
2000-09-11 23:43:44 +00:00
Jeremy Allison
692fe0cabf Fix for malloc of zero bytes found by insure.
Jeremy.
(This used to be commit 2916790859)
2000-09-11 23:21:16 +00:00
Jeremy Allison
e0f9de0c49 Implemented DELETEPRINTERDATA (tested with Gerald's Win32 progs).
Jeremy.
(This used to be commit fb48efaf83)
2000-09-09 00:19:35 +00:00
Jeremy Allison
912ecf7fb9 Fixed typo where docname was being checked for datatype - was causing
STARTDOCPRINTER call to fail. I *love* Gerald's test code :-).
Jeremy.
(This used to be commit 43192370f3)
2000-09-08 02:20:48 +00:00
Jeremy Allison
f4ae5a6e38 Win32 API is explicit that EnumPrinterData returns ERROR_MORE_DATA not
ERROR_INSUFICIENT_BUFFER when working out what space is needed. This fix
gives us the same return that WinNT does.
Jeremy.
(This used to be commit a87f6277b1)
2000-09-08 00:28:07 +00:00
Jeremy Allison
8808c4e6c8 Fixed the printerdata code to return NO_MORE_ITEMS if a size is requested
and the parameter index doesn't exist. I think this code can be simplified
considerably, but JF needs to check to be sure.
Jeremy.
(This used to be commit 4d792e6bcb)
2000-09-07 20:56:24 +00:00
Jeremy Allison
6ef7bf0eac Added code to return NO_MORE_ENTRIES when trying to determine
size using "NT mega hack". I think this is the correct thing to
do but JF should also examine the.
Jeremy.
(This used to be commit 29ba3a2cdf)
2000-09-07 19:12:59 +00:00
Jeremy Allison
061fc961cd Fix from John Reilly for double free of printer struct.
Jeremy.
(This used to be commit c15b7e41e1)
2000-09-06 01:55:36 +00:00
Jeremy Allison
d644d4438c Implemented GETFORM tested and working using Gerald's Win32 test progs....
Jeremy.
(This used to be commit 55ed0a9b0c)
2000-09-05 20:56:09 +00:00
David O'Neill
a3a28675fa Changes from APPLIANCE_HEAD (per Tim Potter):
- make proto
	- addition of function to convert from errno values to NT status codes
	  (source/lib/error.c)
	- purge queue done without full access permission will purge only the
	  jobs owned by that user, rather than failing.
	- unlock job database tdb before sending job to printer
	- in print_job_start(), ensure that we don't pick a jobid with an existing
	  temporary file that may be owned by another user, as it causes silent
	  failures.
	- fixes for printer permission checking for NT5 clients
	  (source/include/rpc_spoolss.h, source/printing/nt_printing.c,
	   source/printing/printing.c, source/rpc_server/srv_spoolss_nt.c)
	- change from uint8 to 'enum SID_NAME_USE' (source/rpc_server/srv_lsa.c)
	- fixed memory leaks for win95 driver download process
	  (source/smbd/lanman.c)
	- properly free prs_structs and dacl in testsuite/printing/psec.c
(This used to be commit 74af3e2cae)
2000-09-01 18:49:26 +00:00
Jeremy Allison
fa810d4c80 Implemented DELETEFORM tested using Gerald's Win32 test code :-).
Jeremy.
(This used to be commit 596c21a2af)
2000-08-31 19:04:51 +00:00
Jeremy Allison
c77bf3d9e2 Fixed error returns for moving printer driver files around so generic
"Access denied" isn't always returned. More fixes found using Gerald's
wonderful Win32 test progs :-).
Jeremy.
(This used to be commit 67b9d40e3d)
2000-08-30 21:09:21 +00:00
Jeremy Allison
d407579b94 Implemented AbortPrinter() from Gerald's Win32 test code. Just purge all
possible printjobs from that printer (I think this is correct).
Added error code returns for print_queue_XXX() functions.
Jeremy.
(This used to be commit 6d081a9017)
2000-08-30 00:45:59 +00:00
Andrew Tridgell
9e1f9a5719 yipee!
The spoolss AddJob function has an [in,out] buffer not an [in] buffer
(despite the comment in the code to the contrary). Also, we must fail
this function - not just blindly reply "no problem" as AddJob should
always fail on non-local printers.

This fixes a bug where the "print test page" failed about half the
time. I suspect it will also fix a bunch of other intermittent spoolss
bugs where the client (incorrectly) tries to use the AddJob printing
interface.
(This used to be commit 14e534a890)
2000-08-28 04:42:31 +00:00
Jeremy Allison
f03879e0b3 Tidied up some error returns from printing calls. Still need to map UNIX
errors to NT error for print job failure returns. Patch from John Reilly at HP.
Jeremy.
(This used to be commit 3514b5bb8f)
2000-08-23 23:05:49 +00:00
Jeremy Allison
137b7f873a Added "add_printer_hook" call to update printer for Win9x clients.
Patch from John Reilly <jreilly@hp.com>.
Jeremy.
(This used to be commit 76a5713bd3)
2000-08-10 23:41:16 +00:00
Andrew Tridgell
fadb15da71 got error code right for printer update/add failure
(This used to be commit 0d00d2ec25)
2000-08-09 07:34:35 +00:00
Andrew Tridgell
db24453581 added printer admin option
any user in that list can do anything to a printer
(This used to be commit 7b5912be15)
2000-08-09 04:19:18 +00:00
Jeremy Allison
d95777ac34 Added print job substitutions for %{printername}, %{sharename} and %{portname}
from the NT printer tdb.
Also added checks for time restrictions before allowing a job to print.
Jeremy.
(This used to be commit 8cfb55e81a)
2000-08-01 00:41:19 +00:00
Jeremy Allison
55ff9cb38b Save & restore the port name correctly.
Jeremy.
(This used to be commit c0648c981e)
2000-07-31 21:41:03 +00:00
Jeremy Allison
49fcb300de Added John Reilly's enumports/addprinter/delprinter scripting code plus the
fix for the Win9x printer drivers.
Changed command names to add "command" string on the end for some consistancy
with the other scripting commands.
Added '%P' option to tdbpack/unpack to store long comment string.
Made port name be "Samba Printer Port" if no enum port script given.
Fixed prs_uint32_pre code to cope with null args.
Jeremy.
(This used to be commit 902ada6379)
2000-07-31 20:41:51 +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
Tim Potter
c89cf814cc Fixed memory leaks in _spoolss_addprinterdriver()
(This used to be commit 1f49788442)
2000-07-26 03:38:30 +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
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
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
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
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
Tim Potter
9665d3fc7b Missing var.
(This used to be commit 5c1c562226)
2000-07-17 06:04:23 +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
53c91652c6 Renamed arguments to se_access_check()
(This used to be commit 714b50b47d)
2000-07-17 02:38:43 +00:00
Jean-François Micouleau
5813ecff99 - The printers are indexed by the sharename in both get_a_printer() and
add_a_printer() now.

- correctly unpack the private part of a devmode and remove a memleak

- correctly retrieve the pair(value,data) for getprinterdata

- handle null devicemode in printer_info_2

I still have some bugs but I'm not crashing anymore NT4SP6 d/c build :-)


        J.F.
(This used to be commit 493f7d11ac)
2000-07-12 14:10:40 +00:00
Jeremy Allison
445e92eb01 Ensure correct driver paths are returned in INFO_2 struct.
Jeremy.
(This used to be commit 7a95c289cd)
2000-07-10 22:30:13 +00:00
Tim Potter
b561c18597 Fixes for various compile warnings on Solaris 8.
(This used to be commit 898a483cda)
2000-07-10 06:41:04 +00:00
Tim Potter
78a4848e8d Re-instated lanman printing security checks (oops).
A user can now pause, resume or delete their own job even if they don't
have the Manage Documents privilege.

Added call to se_access_check() for changing printer properties.  The Full
Access privilege is required for the user to perform this.

Several uninitialised variables and memory leaks plugged.

Modified default ACL created on new printers to be Everyone / Print instead
of Everyone / Full Access.  This required some random stuffing around with
the value of the revision field to correspond with the ACL that NT produces
when setting the same permission on the printer.

Fixed dodgy function call in printing/printfsp.c
(This used to be commit 2abce4dcfa)
2000-07-10 05:08:21 +00:00
Jeremy Allison
89eafd3cef printing/nt_printing.c: (From JF) use the driver name - already given to us.
printing/printing.c: priority needs to be 1 not zero (found by checked build).
rpc_server/srv_spoolss_nt.c: Log invalid handle access, also print out if this is a different
							pid handle. This will help track down client access after a connection
							is closed.
Jeremy.
(This used to be commit 4ff949228c)
2000-07-06 23:31:46 +00:00
Tim Potter
d01839e49e Pass either an authenticated pipe or SMB user in a current_user struct down
to the printing back end functions.
(This used to be commit a2751a269e)
2000-07-06 06:53:47 +00:00
Jean-François Micouleau
2d2b6a46f7 reverting Jeremy's changes to enumprinterdata.
Jeremy, the out_max_value_len and out_max_data_len were good. Your change
is breaking NT4SP6 checked version.

        J.F.
(This used to be commit 5f2be8ba7d)
2000-07-01 16:40:10 +00:00
Jean-François Micouleau
104217f3b0 Found that the minimum priority is 1 and not 0 on NT.
Changed back the devicemode's devicename to "\\server\printer".

I'm 100% sure it is correct, it's what NT sends on the wire. And that's
the printer's name and NOT the port's name as it has to be unique. It must
also be a UNC because it's a remote printer (remote for the client).

        J.F.
(This used to be commit a7098c47b6)
2000-07-01 09:34:37 +00:00