1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-14 20:23:54 +03:00
Commit Graph

203 Commits

Author SHA1 Message Date
Gerald Carter
21ec2b6ba3 add #define for the max device name length in a DEVICEMODE -
Gerald Carter
7377d671e8 * CR1868: only send a change notify message if we have something
that changed that the client is monitoring.

* couple of comments abnout how we need to validate driver names
  on SetPrinter() and AddPrinter()

* up the debug level on some overly verbose dev mode parsing messages
-
Tim Potter
018733eedd More const fixes and flow on fixes from yesterday's const-fest. -
Gerald Carter
33c7b75225 Progress on CR 601
cache the printer_info_2 with the open printer handle.
cache is invalidated on a mod_a_printer() call **on that smbd**.

Yes, this means that the window for admins to step on each other
from different clients just got larger, but since handles a generally
short lived this is probably ok.
-
Gerald Carter
fde6ef7cc6 couple of merges from APP_HEAD
* performance optimization in enumprinterdataex() when keyname is empty
  * fix a few typos in comments
  * reload services after addprinter_command()

dump registry data in ascii when the key is REG_SZ or REG_MULTI_SZ
-
Andrew Tridgell
e3d00fa47d reverted this patch till I sort out the craziness with UNIHDR -
Andrew Tridgell
b9eff31b14 This removes the 3rd argument from init_unistr2(). There were 240
calls to init_unistr2() in the code and every one of them got the 3rd
argument incorrect, so I thought it best just to remove the argument.

The incorrect usage was caused by callers using strlen() to determine
the length of the string. The 3rd argument to init_unistr2() was
supposed to be the character length, not the byte length of the
string, so for non-english this could come out wrong.

I also removed the bogus 'always allocate at least 256 bytes'
hack. There may be some code that relies on this, but if there is then
the code is broken and needs fixing.
-
Andrew Bartlett
92a777d0ea 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
-
Tim Potter
bbb0b2ee40 Guy Harris points out that the level and ptr fields in a
SPOOL_USER_CTR look like they should be transposed.  We don't make use
of the user level information (what is it used for??) so I haven't
changed any code, just added a comment.
-
Jim McDonough
3c9726454e Support printer info 7, used for publishing -
Jeremy Allison
10024ed06e Merge of scalable printing code fix... Needs testing.
Also tidied up some of Richard's code (I don't think he uses the compiler
flags -g -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual like
I do :-) :-).
Jeremy.
-
Tim Potter
f56ce473b6 Client side functions for enumprinterkey. -
Tim Potter
e62c6bf066 When unmarshalling a relstr, don't unmarshall the string data if the
offset is zero.  Previously we were jumping to the start of the
parse buffer (i.e offset zero) and reading string data until we hit
a terminating NULL.

Test case: in a PRINTER_INFO_0 structure, the servername field may be
NULL when doing an enumprinters with flags = PRINTER_ENUM_LOCAL.
-
Jeremy Allison
e42b76337b HEAD and APP-HEAD spoolss parsing was out of sync. This MUST NOT HAPPEN !
Jeremy.
-
Simo Sorce
eda0e7589f wrong alignment size calculation
spot by Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>
-
Tim Potter
47b8ec632e Fix typo in comment. -
Tim Potter
6d792c683d Implemented client function for deleteprinterdataex. -
Tim Potter
6a1953f243 Implemented some more client side spoolss functions:
- getprinterdataex(), setprinterdataex(), enumprinterdataex()

Pass data type down to setprinterdata() fn instead of hardcoding REG_SZ.

Did some trickyness to get enumprinterdataex replies unmarshalled
properly.  The code seems to have been written to require the number
of entries returned before unpacking said entries.  Skip to the end of
the response and read the number of entries then jump back and process
the printer data.
-
Gerald Carter
901769acc3 fix 2 byte alignment/offset bug that prevented Win2k/XP clients
from receiving all the printer data in EnumPrinterDataEx().
-
Gerald Carter
d59b0eb123 * the printing code should now be back to the working state it was
before the swap from NT_PRINTER_PARAM to REGISTRY_VALUE.

* XxxPrinterDataEx() functions have not been expanded to support
  keys other than SPOOL_PRINTERDATA_KEY yet

* fixed apparent long standing bug regarding the dependentfiles
  list in the DRIVER_INFO struct
-
Gerald Carter
7ba7c04c0e Fairly large change to printing code.
* removed support for PHANTOM_DEVMODE printer data

* s/NT_PRINTER_PARAM/REGISTRY_VALUE/g - This was a good bit
  of work.  Everything seems stable, but is not complete.

* support for printer data keys other than PrinterDriverData
  in the store and fetch routines.  Still needs to be plugged
  into the XxxPrinterDataEx() calls.

Tested against NT4.0 & 2k.  Like I said, it's not done, but doesn't
crash so it shouldn't upset anyone (unless you're trying to build
a Samba printer server off of HEAD).  More work to come.  Should
settle by Monday.


jerry
-
Gerald Carter
fb822e97cb added comment about a new specversion seen from client.
Device mode size is still the same though.




jerry
-
Gerald Carter
11ddfd9cfa printing change notification merge from APPLIANCE_HEAD -
Tim Potter
fe43c2ac2d Merge of incomplete rffpcnex testing code from APPLIANCE_HEAD. -
Gerald Carter
0793612cca passing -1 for the src length in rpcstr_pull results in only
converting the first character of the unicode string.,  See convert_string()
for why.  uniarray_2_dosarray() passes 0 for the src length now which works.
-
Gerald Carter
7207662504 all that is left to do is to actually perform the
file deletion now.  I have the file list.
One more commit should do it.
-
Gerald Carter
f57640720e 8-byte alignment needed for beginning driver_info_level_6.
Verified by looking at NT4 and 2k servers.  First time
for everything I guess.
-
Gerald Carter
b0f178f452 fixup ADDPRINTERDRIVEREX some more. unknown uint32 for now. -
Gerald Carter
55fbfd02ba 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
d675974d0c * basic implementation of SPOOLSS_DELETEPRINTERDATAEX and
SPOOLSS_DELETEPRINTERKEY
* stub funnctions for SPOOLSS_ADDPRINTERDRIVEREX and
  SPOOLSS_DELETEPRINTERDRIVEREX
-
Tim Potter
daf4c6a013 Merge of constant renames from APPLIANCE_HEAD. -
Jeremy Allison
3603cd4947 Proper merge of all the working printing stuff from APPLIANCE_HEAD.
Now let's keep this in sync !
Jeremy.
-
Gerald Carter
fc3770f281 a null grp_sid should have a 0 offset. Also removed a few more unnecessary
prs_align() for sec_desc.
-
Gerald Carter
f753676286 printing merge from SAMBA_2_2. Ther server code looks to be in sync now.
Mostly formatting and s/free/SAFE_FREE/g changes with the two exceptions
being

  * John driver init changes
  * Tim's printer enumeration bug fix
-
Simo Sorce
897e64d2e0 more debug classess activated -
Gerald Carter
83f109c940 merge from SAMBA_2_2.
Tim, please check the prs_align() removed from sec_io_desc()
and make sure it doesn't break anything else.  I know it is
right for the printing needs and I have tested some other
general things like viewing acls on directories, but I would
feel more comfortable if you would have a look as well.


jerry
-
Tim Potter
bbad6c6678 OK that last commit was incorrect - this call is parsed properly. I only
imagined it wasn't!
-
Tim Potter
2429c4cc79 There's probably a pointer to a buffer at the end of a enumprinterdrivers()
rpc call which we currently don't parse - just added a comment about it for
the moment as not parsing it is harmless.
-
Tim Potter
1fb8e2b3a0 No need to pass a fstring in make_spoolss_q_enumprinters() -
Tim Potter
217ae50acd Added deleteprinterdata client rpc. -
Tim Potter
a1934a7a8e Added writeprinter rpc command. -
Tim Potter
89633a1d87 Change make_spoolss_q_{get,set}printerdata() take a char* and length rather
than a unistr2.  Printer data isn't necessarily in unistr format.

Tallocate memory to hold returned data when unmarshalling getprinterdata
and enumprinterdata replies.
-
Gerald Carter
2676be4e41 compile fix merge from SAMBA_2_2 -
Tim Potter
8e09e94546 Support for client side startdocprinter.
Set useless_ptr = 1 for marshalling smb_io_doc_info() so it actually works.
-
Gerald Carter
0420098c47 misc merge from SAMBA_2_2 -
Gerald Carter
59e49a79b4 devmode parsing merge from SAMBA_2_2 -
Tim Potter
d091a9d300 Added client side spoolss rpc commands for startpageprinter,
endpageprinter, setjob and getjob.
-
Gerald Carter
5e381abbbf merge from SAMBA_2_2 -
Jeremy Allison
4369a58765 HP2500C driver writes devmode with private data that ends
on a 2 byte boundary. We then miss-parse the desired_access. Also added
other fixes to ensure we align after private data (discussed with Gerry).
Jeremy.
-
Gerald Carter
d87aa35d48 specversion merge from SAMBA_2_2 -