1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

4165 Commits

Author SHA1 Message Date
Gerald Carter
1e00ac19cd cleanup in init_unistr2_from_unistr()
--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
3bf9a29f34 All changes related to rpcclient...
- cleaned up some code
- Fixed a few memory leaks of my own making
- Add AddPrinterDriver(); I'm missing some of the semantics
  here as the call is done correctly, but I'm not getting all
  the information right in the DRIVER_INFO_3 struct I think.
  Will work on it tomorrow some more...



--jerry
0001-01-01 00:00:00 +00:00
Gerald Carter
7b69cbbde3 it is not my day it seems. :-(
Fixed missing )


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
34d4fb54c3 removed the for() loop to copy the buffer in init_unistr2_from_unistr()
Replaced with a memcpy()



Forgot to commit this a few moments ago


j-
0001-01-01 00:00:00 +00:00
Gerald Carter
4ecd15cd58 Fixed bug in init_unistr2_from_unistr() found by Elrond.
Thanks :-)





j-
0001-01-01 00:00:00 +00:00
John Terpstra
b87c47cc86 Adding build file. 0001-01-01 00:00:00 +00:00
John Terpstra
8de3786f5a Adding build system files for Caldera OpenLinux. 0001-01-01 00:00:00 +00:00
Gerald Carter
dfd6b51bc7 make proto 0001-01-01 00:00:00 +00:00
Gerald Carter
8e5e929561 spoolss_addprinterex() was adding the printer and returning the
correct handle, but was deleting the connection to the server.
Doh!!



--jerry
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Volker Lendecke
a40f22427a Added my course notes. Had asked Jeremy some weeks ago.
It's german language, feel free to remove it again.

Volker
0001-01-01 00:00:00 +00:00
Gerald Carter
6bdb7d5c97 make proto 0001-01-01 00:00:00 +00:00
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
0001-01-01 00:00:00 +00:00
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
0001-01-01 00:00:00 +00:00
Tim Potter
a290107aee In cli_error() return ENOENT when an ERROR_INVALID_NAME is received instead
of the generic EINVAL.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
c0648c981e Save & restore the port name correctly.
Jeremy.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Gerald Carter
38b0739556 make proto 0001-01-01 00:00:00 +00:00
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
0001-01-01 00:00:00 +00:00
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
0001-01-01 00:00:00 +00:00
John Terpstra
7df53b8211 Adding pages oopsed. 0001-01-01 00:00:00 +00:00
John Terpstra
9f5f8ad21d Adding Using_Samba book back to Samba-pre3. 0001-01-01 00:00:00 +00:00
John Terpstra
25091dcf7c Adding missing man pages. 0001-01-01 00:00:00 +00:00
John Terpstra
856a3773dc Adding missing smbsh.1 man page source. 0001-01-01 00:00:00 +00:00
John Terpstra
183d55b2ae Updating for Samba-3. 0001-01-01 00:00:00 +00:00
John Terpstra
ab6d01bdcc Adding files provided by Klaus Singvogel of Caldera 0001-01-01 00:00:00 +00:00
Tim Potter
4ab75143c4 Fixed read overrun in init_string2() 0001-01-01 00:00:00 +00:00
Jean-François Micouleau
9178d2a1aa remove warnings
J.F.
0001-01-01 00:00:00 +00:00
Jean-François Micouleau
0e9e048b6d fix the devmode.orientation being set to 0.
that bug was *subtle* :-(

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


-jerry
0001-01-01 00:00:00 +00:00
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
0001-01-01 00:00:00 +00:00
Jeremy Allison
0bd88d304c Added some error checking and returns to the new 'move' code.
Jeremy.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
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!
0001-01-01 00:00:00 +00:00
Jeremy Allison
614bf56186 Tidy up code to add printer. Always index in tdb by sharename. This
is beginning to come together...
Jeremy.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00