1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

4257 Commits

Author SHA1 Message Date
Gerald Carter
8e5e929561 spoolss_addprinterex() was adding the printer and returning the
correct handle, but was deleting the connection to the server.
Doh!!



--jerry
-
Jeremy Allison
1f7300df67 Fixed up se_access_check() to use the token list from the user struct
as the SID list. Now to go through and tidy up the algorithm.
Jeremy.
-
Volker Lendecke
a40f22427a Added my course notes. Had asked Jeremy some weeks ago.
It's german language, feel free to remove it again.

Volker
-
Gerald Carter
6bdb7d5c97 make proto -
Gerald Carter
e15d9befd2 clunky support for calling AddPrinterEx(). The code currently reports
that the call failed, but the printer shows up on the remote NT client.
(note this is the client side call).  I've botched the return value
somewhere and will fix that today.




jerry
-
Gerald Carter
c8f9e54bea After talking with Jeremy and JF (and staring at packet traces between
NT <-> NT), I've come to realize that UNISTR2 strings should be NULL
terminated.




jerry
-
Tim Potter
a290107aee In cli_error() return ENOENT when an ERROR_INVALID_NAME is received instead
of the generic EINVAL.
-
Jeremy Allison
06a65972e8 Fixed up the user/group contexts when using authenticated pipes.
Added a become_root()/unbecome_root() (push/pop security context)
around the initgroups() call to ensure it would succeed. Hmmm - I
wonder if this call being done as non-root might explain any "group access"
bugs we've had in the past....
Jeremy.
-
Jeremy Allison
e28d01b744 Added an NT_USER_TOKEN structure that is copied/passed around associated
with the current user. This will allow se_access_check() to quickly do
a SD check without having to translate uid/gid's to SIDs.
Still needs work on pipe calls.
Jeremy.
-
Jeremy Allison
d6db29be98 Much though I hate to admit it - JF was completely correct. I cannot
now reproduce the bug I had with adding a printer driver, and PrintMig.exe
crashes if I use my SD code but works with his.
I stand completely corrected :-). - So I'm reverting to his code as it works :-).
Jeremy.
-
Jeremy Allison
5e5cc6efe2 Started to canonicalize our handling of uid -> sid code in order to
get ready and fix se_access_check().
Added cannonical lookup_name(), lookup_sid(), uid_to_sid(), gid_to_sid()
functions that look via winbind first the fall back on local lookup.

All Samba should use these rather than trying to call winbindd code
directly.

Added NT_USER_TOKEN struct in user_struct, contains list of NT sids
associated with this user.

se_access_check() should use this (cached) value rather than attempting
to do the same thing itself when given a uid/gid pair.

More work needs to be done to preserve these things accross security
context changes (especially with the tricky pipe problem) but I'm
beginning to see how this will be done..... probably by registering
a new vuid for an authenticated RPC pipe and not treating the
pipe calls specially.

More thoughts needed - but we're almost there...

Jeremy.
-
Jeremy Allison
c55bcec817 Tidyup removing many of the 0xC0000000 | NT_STATUS_XXX stuff (only need NT_STATUS_XXX).
Removed IS_BITS_xxx macros as they were just reproducing "C" syntax in a more
obscure way.
Jeremy.
-
Jeremy Allison
8cfb55e81a 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.
-
Jeremy Allison
c0648c981e Save & restore the port name correctly.
Jeremy.
-
Jeremy Allison
902ada6379 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.
-
Gerald Carter
38b0739556 make proto -
Gerald Carter
d321d0dddd More work on rpcclient...
* Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx




--jerry
-
Gerald Carter
45fbf31b69 More work on rpcclient...
* Fixed to work with Jeremy's recent changes re: dunamic
    memory allocation when unmarshalling unistr[2]
  * included EnumPorts level 1
  * more work on AddPrinterEx




--jerry
-
John Terpstra
7df53b8211 Adding pages oopsed. -
John Terpstra
9f5f8ad21d Adding Using_Samba book back to Samba-pre3. -
John Terpstra
25091dcf7c Adding missing man pages. -
John Terpstra
856a3773dc Adding missing smbsh.1 man page source. -
John Terpstra
183d55b2ae Updating for Samba-3. -
John Terpstra
ab6d01bdcc Adding files provided by Klaus Singvogel of Caldera -
Tim Potter
4ab75143c4 Fixed read overrun in init_string2() -
Jean-François Micouleau
9178d2a1aa remove warnings
J.F.
-
Jean-François Micouleau
0e9e048b6d fix the devmode.orientation being set to 0.
that bug was *subtle* :-(

	J.F.
-
Jeremy Allison
0ff2ce543e 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.
-
Jean-François Micouleau
c267b23620 if no comment in TDB, use comment from print share.
J.F.
-
Jean-François Micouleau
883f7402d4 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.
-
Tim Potter
f3a4f81a5e Fixed memory leaks in root and non-root password changing. -
Tim Potter
1f49788442 Fixed memory leaks in _spoolss_addprinterdriver() -
Tim Potter
7145689bf5 Fixed memory leak in modify_trust_password() -
Jeremy Allison
5130dd0f8b Fixed up error checking and move printer file code. Fixed a memory leak.
Jeremy.
-
Gerald Carter
1f65b13dd5 make proto
--jerry
-
Gerald Carter
2c0f6bcc8f some initial code for AddPrinterEx() project. Most is ifdef'd out
'cause it's not all written.


-jerry
-
Andrew Tridgell
9ccf3b1dc5 if the sids are not the same pointer and either of the sids are NULL
then the two sids are not equal
-
Jeremy Allison
0bd88d304c Added some error checking and returns to the new 'move' code.
Jeremy.
-
Jean-François Micouleau
ac0a145acc 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.
-
Tim Potter
dcf3249bb9 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!
-
Jeremy Allison
614bf56186 Tidy up code to add printer. Always index in tdb by sharename. This
is beginning to come together...
Jeremy.
-
Tim Potter
f026a897e9 Run main server loop with sys_select() instead of sys_select_intr(). The
main daemon was not catching sighup and reloading the service file.
-
Tim Potter
db54e72d2f Test for reloading smb.conf after SIGHUP. Needs to be run as root. -
Jeremy Allison
a0ee774fe9 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.
-
Gerald Carter
e4af400ed6 make proto -
Gerald Carter
a9522f560d * Added EnumPorts()
* Fixed an off-by-one bug noticed by JF in GetPrinterDriverDirectory()



jerry
-
Gerald Carter
a0e8a55c27 Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.


jerry
-
Gerald Carter
56ce247977 Added EnumPorts() and fixed up some problems
with the other spoolss client calls.

Also cleaned up output for 'help' command.



jerry
-
Gerald Carter
a2205c6646 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
-
Gerald Carter
1246728eb9 make proto -