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

1380 Commits

Author SHA1 Message Date
Günther Deschner
72b1f8be56 s3-printing: safe a ton of roundtrips by reusing existing winreg binding_handles.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:02 +02:00
Günther Deschner
0a1ec73b96 s3-printing: use winreg_internal functions.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
ada5380d20 s3-printing: add winreg_internal functions.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
43cf3a28dc s3-printing: move spoolss_create_default_devmode/secdesc to init_spoolss.h
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
74e416031b s3-printing: move driver_info_ctr_to_info8 to init_spoolss.h
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
dd5375b4a1 s3-printing: move os2 related functions to printing/nt_printing_os2.c.
Guenther

Pair-Programmed-With: David Disseldorp <ddiss@suse.de>
2011-07-07 18:06:01 +02:00
Günther Deschner
ff94539f27 s3-printing: open up a winreg pipe handle for the migration code.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon Jul  4 15:06:41 CEST 2011 on sn-devel-104
2011-07-04 15:06:41 +02:00
Andreas Schneider
541f3cf639 s3-rpc_server: Migrate rpc function to tsocket_address.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:27:58 +10:00
Günther Deschner
e02abd6c83 s3-printing: split out printing migration code into a smaller library.
Guenther
2011-07-01 16:46:26 +02:00
David Disseldorp
c9e3f6ab02 s3-printing: skip migration of non-existent printers
Skip tdb migration of printer and security descriptor entries which
refer to non-existent printers.

Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Jun 30 10:54:23 CEST 2011 on sn-devel-104
2011-06-30 10:54:23 +02:00
David Disseldorp
a36ce0735f s3-printing: fill devicemode size in migrate_printer()
Signed-off-by: Günther Deschner <gd@samba.org>
2011-06-30 09:40:50 +02:00
Andrew Bartlett
489f528857 param: Merge param headers into lib/param/loadparm.h
This defines a common table format, so we can in future define a
common table.

Andrew Bartlett
2011-06-29 15:44:09 +10:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
a4993f647c ldb: replace 'struct TDB_DATA' with 'TDB_DATA'
The typedef is TDB2 compatible, the struct isn't.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
58f7cda1bc tdb_compat: use tdb_errorstr_compat()
Since TDB2 functions return the error directly, tdb_errorstr() taken an
error code, not the tdb as it does in TDB1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
3a8faefd66 tdb_compat: use tdb_firstkey_compat/tdb_nextkey_compat everywhere.
Note that tdb_nextkey_compat frees the old key for us.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
5a7874e119 tdb_traverse/tdb_traverse_read: check returns for negative, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for < 0 instead of == -1.

Also, there's no tdb_traverse_read in TDB2: we don't try to make
traverse reliable any more, so there are no write locks anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
868d77bc5b tdb_chainlock: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
058c4f8492 tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Günther Deschner
ef5bcb6e23 source3/printing/pcap.h: fix licence/copyright
Guenther
2011-06-10 15:12:36 +02:00
Günther Deschner
942b2d5baf source3/printing/load.h: fix licence/copyright
Guenther
2011-06-10 15:12:34 +02:00
Andrew Bartlett
74eed8f3ed s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
8d4a8389bb s3-talloc Change TALLOC_MEMDUP() to talloc_memdup()
Using the standard macro makes it easier to move code into common, as
TALLOC_MEMDUP isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
d5e6a47f06 s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
3d15137653 s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as
TALLOC_ARRAY isn't standard talloc.
2011-06-09 12:40:08 +02:00
Jeremy Allison
1cee71713f Change sys_getcd() to take no arguments and always return malloc'ed memory (or NULL).
Part of the efforts to remove PATH_MAX on modern systems.
2011-06-01 02:54:51 +02:00
Günther Deschner
f103e0c39f s3: fix more -Wunused-but-set-variable build warnings.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Jun  1 00:29:30 CEST 2011 on sn-devel-104
2011-06-01 00:29:30 +02:00
Günther Deschner
508e160776 s3: fix some -Wunused-but-set-variable build warnings.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon May 30 17:41:18 CEST 2011 on sn-devel-104
2011-05-30 17:41:18 +02:00
Jeremy Allison
9f14d10366 Fix bug #8157 - std_pcap_cache_reload() fails to parse a cups printcap file correctly.
The parsing code made some strange assumptions about what is a printer
name, and what is a comment.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri May 20 22:52:23 CEST 2011 on sn-devel-104
2011-05-20 22:52:23 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
David Disseldorp
6bfe488f29 s3-printing: remove cups_pull_comment_location from header file
Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon May 16 16:03:57 CEST 2011 on sn-devel-104
2011-05-16 16:03:57 +02:00
Andreas Schneider
01bc556d03 s3-printing: Remove obsolete and unused cups_pull_comment_location().
Signed-off-by: Günther Deschner <gd@samba.org>
2011-05-16 12:54:33 +02:00
Günther Deschner
854467851d s3-printing: Get the location info from cups.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-05-16 12:54:33 +02:00
Simo Sorce
d31181214c rpc_server: Always use rpc_pipe_open_interface()
This way we can configure which rpc service we actually want to connect to.
By default it uses an "embedded" interface and calls rpc_pipe_open_internal()

Signed-off-by: Günther Deschner <gd@samba.org>

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri May 13 14:40:26 CEST 2011 on sn-devel-104
2011-05-13 14:40:26 +02:00
Günther Deschner
f99d6f079a s3-printing: make cups_pull_comment_location() work again.
we deal with lp_cups_server in cups_connect() already, inside the URI all our
other cups functions we use ipp://localhost, do the same here.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed May 11 11:36:07 CEST 2011 on sn-devel-104
2011-05-11 11:36:07 +02:00
Günther Deschner
019f11dd5b s3-printing: Fix double free of cups request.
We never free the request in our cups api usage except for here. The reason is
probably htis (from the cupsDoConnect API docs):

"This function sends the IPP request to the specified server, retrying and
authenticating as necessary. The request is freed with ippDelete() after
receiving a valid IPP response."

Revert "Fix a memory leak in cups_pull_comment_location"

This reverts commit fee2664dad.

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue May 10 17:32:58 CEST 2011 on sn-devel-104
2011-05-10 17:32:58 +02:00
Günther Deschner
3ba3f68e03 s3-printing: very obvious fix for cups_pull_comment_location().
This has been in there since 2008...

Guenther
2011-05-10 16:30:28 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Jeremy Allison
02af307585 More simple const fixes. 2011-05-05 23:56:07 +02:00
Günther Deschner
c9f3a2c83e s3-printing: run minimal_includes.pl.
Guenther
2011-05-05 02:05:27 +02:00
Jeremy Allison
8380835fc6 Fix warning messages caused by addition of null check in fstrcpy macro. 2011-05-04 12:12:15 -07:00
Günther Deschner
0e76eddcc8 s3: include ntdomain.h before including generated srv_ headers.
Guenther
2011-05-02 15:03:44 +02:00
Günther Deschner
f7d6a0a112 s3-printing: include ../librpc/ndr/libndr.h in ads printing.
Guenther
2011-05-02 15:03:43 +02:00
Günther Deschner
cd5b2b242b s3-printing: avoid using pipes_struct when only session_info is needed.
Guenther
2011-05-02 15:03:43 +02:00
Günther Deschner
c233c21425 s3-proto: move remaining spoolss protos to own header file.
Guenther
2011-05-02 15:03:43 +02:00
Günther Deschner
49d5f62b42 s3-proto: move rpc_srv_register protos and structs to town headerfile.
Guenther
2011-05-02 15:03:43 +02:00
Jeremy Allison
644046f064 Fix compiler warning in debug message. 2011-04-21 17:22:44 -07:00
Günther Deschner
ae61a5c3d0 s3-smbd: fix the AIX 5.3 build.
(AIX defines open to be open64)

Guenther
2011-04-20 18:16:28 +02:00
Günther Deschner
9824e2e5ee s3-rpc_client: add and use rpc_client/rpc_client.h.
Guenther
2011-04-13 22:23:59 +02:00
Andreas Schneider
e3c3b4daa4 s3-printing: Use become_user_by_session() function.
We create a fake connection here and don't have an vuid. So work with
the session_info directly here.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Apr 11 22:56:12 CEST 2011 on sn-devel-104
2011-04-11 22:56:12 +02:00
Volker Lendecke
0f08e9d922 s3: Fix print_spool_end
We have to use the spoolss pipe instance opened in print_spool_open, otherwise
the spoolss server won't be able to find the right printer and job.
2011-04-05 12:26:29 +02:00
Günther Deschner
6e3f0d28a4 s3-includes: only include ntdomain.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
ab36d597e7 s3-messages: make ndr_messaging.h part of messages.h.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
3061f44fc9 s3-auth: printing needs auth.h
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
2377039738 s3-locking: move locking prototypes out of proto.h.
Will later become part of locking.h

Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
84815d38d2 s3: printing needs parts of smbd.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
235f148590 s3-passdb: use passdb headers where needed.
Guenther
2011-03-30 01:13:08 +02:00
Günther Deschner
0a250f4946 registry: create and use shared libcli/registry/util_reg.h header.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
49fcf653b1 s3-includes: only include system/passwd.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Günther Deschner
89ca4875cd s3-includes: only include system/syslog.h when needed.
Guenther
2011-03-30 01:13:06 +02:00
Andreas Schneider
28b2046015 s3-spoolssd: Register spoolssd endpoints.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:53 +02:00
Andreas Schneider
80fe8fa8d0 s3-spoolssd: Fixed logfile creation.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:52 +02:00
Andreas Schneider
a956c57cf9 s3-spoolssd: Added missing include.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:52 +02:00
Andreas Schneider
c1b7c0c2b7 s3-spoolssd: Pass down event and messanging context.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:52 +02:00
Andreas Schneider
851f95b121 s3-spoolssd: Fixed reopening of logs.
Everytime the log was reopened a .spoolssd has been appended which
resulted in long file names.

Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:51 +02:00
Simo Sorce
043942720c s3:spoolssd Initialize the spoolss rpc interfaces
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:51 +02:00
Simo Sorce
0c130105f5 s3:spoolssd Add spoolss own signal handlers
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:50 +02:00
Simo Sorce
0b7b8414dd s3:spoolssd handle smb.conf reloads directly
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:50 +02:00
Simo Sorce
2d333ae8bc s3:spoolssd Create our own log file
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:50 +02:00
Simo Sorce
99941eb92b s3:spoolssd Add skeleton for spoolss daemon
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:50 +02:00
Simo Sorce
1d33474dad s3:printing Make print_queue_receive public
Signed-off-by: Günther Deschner <gd@samba.org>
2011-03-29 16:03:49 +02:00
David Disseldorp
97cdf15f09 s3-printing: fix memory leak in print_cups.c
As found by valgrind, tmp_pcap_cache is not freed following printer list
tdb update.

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Wed Mar 16 16:37:58 CET 2011 on sn-devel-104
2011-03-16 16:37:58 +01:00
David Disseldorp
52845c1054 s3-printing: remove duplicate cups response processing code
There is currently a lot of duplicate code included for processing
responses to CUPS_GET_PRINTERS and CUPS_GET_CLASSES requests. This
change splits this code into a separate function.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-16 15:52:21 +01:00
David Disseldorp
d6cb4feae1 s3-printing: use printcap IDL for IPC
Use printcap IDL for marshalling and unmarshalling messages between cups
child and parent smbd processes. This simplifies the IPC and ensures
the parent is notified of cups errors encountered by the child.

https://bugzilla.samba.org/show_bug.cgi?id=7994
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-16 15:52:21 +01:00
David Disseldorp
2b635949a2 s3-printing: fix cups pcap reload with no printers
cups_async_callback() is called to receive new printcap data from a
child process which requests the information from cupsd.
Newly received printcap information is stored in a temporary printcap
cache (tmp_pcap_cache). Once the child process closes the printcap IPC
file descriptor, the system printcap cache is replaced with the newly
populated tmp_pcap_cache, however this only occurs if tmp_pcap_cache is
non null (has at least one printer).

If the printcap cache is empty, which is the case when cups is not
exporting any printers, the printcap cache is not replaced resulting in
stale data.

https://bugzilla.samba.org/show_bug.cgi?id=7915
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-04 15:46:23 +01:00
David Disseldorp
624e33f869 s3-printing: remove unneeded local_pcap_copy global
The cups local_pcap_copy global served as a temporary buffer during
asynchronous cups printcap cache updates, as well as indicating when
the printcap cache had not yet been filled and printcap cache update
should block.

As smbd printcap reads are now triggered by the parent smbd following
printcap cache update, the variable and blocking mechanism are no longer
needed.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-04 15:46:20 +01:00
David Disseldorp
61bf4699f0 s3-printing: follow force user/group for driver IO
Configuring force user/group settings for the print$ share currently has
unexpected results, this is explained by how the driver upload/add
process takes place. Consider the following example:

[print$]
        path = /print-drv
        write list = $DRIVER_UPLOAD_USER
        force group = ntadmin

- the client connects to the [print$] share and uploads all driver
  files to the /print-drv/W32X86 directory.

- This is permitted, as /print-drv/W32X86 is owned by group ntadmin, and
  the "force group = ntadmin" takes effect for the [print$] session.

- Once all files are uploaded, the client connects to the [ipc$]
  share and issues an AddPrinterDriverEx spoolss request.

- In handling this request move_driver_to_download_area() is called,
  which attempts to create the directory /print-drv/W32X86/3

- The create directory fails, as it is done as the user connected to
  the [ipc$] share which does not have permission to write to the driver
  directory. The [print$] "force group = ntadmin" has no effect.

This is a regression from previous behaviour prior to the commit:
783ab04 Convert move_driver_to_download_area to use create_conn_struct.

https://bugzilla.samba.org/show_bug.cgi?id=7921
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-03-04 15:46:14 +01:00
Günther Deschner
8643683dd8 s3-server_id: only include server_id where needed.
Guenther
2011-03-02 12:12:31 +01:00
David Disseldorp
016a8d214a s3-printing: vfs_connect prior to driver/dfs IO
samba3.posix_s3.rpc.spoolss.driver fails with the xattr_tdb vfs module
loaded as a part of make test. The (now checked) create_directory() call
in move_driver_to_download_area() fails, uncovering another bug in the
printer driver upload code path.

move_driver_to_download_area() creates a new conn_struct for
manipulating files in [print$]. The VFS layer is plumbed through with
the call to create_conn_struct(), however SMB_VFS_CONNECT() is never
called. Many vfs modules expect state stored at connect time with
SMB_VFS_HANDLE_SET_DATA() to be available on any IO operation and fail
if this is not the case.

This fix adds a call to SMB_VFS_CONNECT() in create_conn_struct() prior
to IO.

https://bugzilla.samba.org/show_bug.cgi?id=7976

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Mar  2 01:16:30 CET 2011 on sn-devel-104
2011-03-02 01:16:30 +01:00
David Disseldorp
09b4acfd81 s3-printing: clean up get_correct_cversion error paths
Remove an unneeded variable and simplify error paths.
2011-03-02 00:31:22 +01:00
David Disseldorp
14446b5280 s3-printing: fix move_driver_to_download_area() error paths
WERR_ACCESS_DENIED errors are mapped to WERR_UNKNOWN_PRINTER_DRIVER,
resulting in incorrect error messages on Windows clients.

move_driver_to_download_area() returns the same error status values
to the caller via the *perr argument as well as the return value.

The create_directory() call is not checked for error.
2011-03-02 00:31:22 +01:00
Jeremy Allison
87c4ceaf7c Fix compiler warning on casting -1 to uint32. 2011-02-28 14:56:03 -08:00
Jelmer Vernooij
59a077d8f5 Fix some types
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon Feb 28 23:30:06 CET 2011 on sn-devel-104
2011-02-28 23:30:06 +01:00
Günther Deschner
823f8b9030 s3-printing: move more printing structs to printing.h
Guenther
2011-02-22 21:52:18 +01:00
Günther Deschner
8225c0ad6c s3-printing: only include printing where really needed.
Guenther
2011-02-22 21:52:18 +01:00
Günther Deschner
5a0cf0c77e s3-printing: fix pcacp prototypes and includes.
Guenther
2011-02-22 21:52:18 +01:00
Günther Deschner
66e040ee0a s3-printing: isolate print notification prototypes better.
Guenther
2011-02-22 21:52:18 +01:00
Volker Lendecke
c85607d8ec s3: Fix a typo 2011-02-22 19:18:50 +01:00
Andrew Bartlett
2e69e89456 s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_info
These variables, of type struct auth_serversupplied_info were poorly
named when added into 2001, and in good consistant practice, this has
extended all over the codebase in the years since.

The structure is also not ideal for it's current purpose.  Originally
intended to convey the results of the authentication modules, it
really describes all the essential attributes of a session.  This
rename will reduce the volume of a future patch to replaced these with
a struct auth_session_info, with auth_serversupplied_info confined to
the lower levels of the auth subsystem, and then eliminated.

(The new structure will be the output of create_local_token(), and the
change in struct definition will ensure that this is always run, populating
local groups and privileges).

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-02-22 16:20:10 +11:00
Günther Deschner
4063bde3ed s3-rpc_server: move services into individual directories.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Feb 10 22:13:17 CET 2011 on sn-devel-104
2011-02-10 22:13:17 +01:00
Andrew Bartlett
2b05ba77b4 s3-auth Rename cryptic 'ptok' to security_token
This will allow the auth_serversupplied_info struct to be migrated
to auth_session_info easier.

Adnrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-10 06:51:06 +01:00
Stefan Metzmacher
7a2fa9fc1c s3:printing: use dcerpc_spoolss_X() functions
metze

Signed-off-by: Andreas Schneider <asn@samba.org>

Autobuild-User: Andreas Schneider <asn@samba.org>
Autobuild-Date: Fri Jan 21 13:14:49 CET 2011 on sn-devel-104
2011-01-21 13:14:49 +01:00
David Disseldorp
3e61c97a7e s3-printing: remove printer_list_need_refresh
printer_list_need_refresh() was used previously to ensure one smbd
process did not attempt to update the printer_list tdb during or soon
after update by another smbd.

It is no longer needed, as pcap updates are now only performed by the
parent smbd process following startup, SIGHUP, config update or printcap
cache time expiry.
2011-01-07 15:37:39 -08:00
David Disseldorp
ff577762b9 s3-printing: remove old entries in pcap_cache_replace
Callers of pcap_cache_replace() assume the existing printcap cache is
replaced by the new values provided. This is not currently the case,
old entries should be removed.
2011-01-07 15:37:39 -08:00
David Disseldorp
04248c2cfa s3-printing: reload shares after pcap cache fill
Since commit eada8f8a, updates to the cups pcap cache are performed
asynchronously - cups_cache_reload() forks a child process to request
cups printer information and notify the parent smbd on completion.

Currently printer shares are reloaded immediately following the call to
cups_cache_reload(), this occurs prior to smbd receiving new cups pcap
information from the child process. Such behaviour can result in stale
print shares as outlined in bug 7836.

This fix ensures print shares are only reloaded after new pcap data has
been received.

Pair-Programmed-With: Lars Müller <lars@samba.org>
2011-01-07 15:37:39 -08:00
Günther Deschner
94e83e385e s3-printing: fix crash bug in print_spool_open().
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Dec 22 14:21:58 CET 2010 on sn-devel-104
2010-12-22 14:21:58 +01:00
David Disseldorp
139e2cbb13 s3-printing: fix printer_list_traverse()
The tdb traverse function returns the number of elements traversed, or
less than zero on error, printer_list_traverse() is incorrectly checking
for non-zero return.

Autobuild-User: Andreas Schneider <asn@samba.org>
Autobuild-Date: Mon Dec 20 18:44:41 CET 2010 on sn-devel-104
2010-12-20 18:44:41 +01:00
Günther Deschner
c62509c8f2 s3-spoolss: Fix Bug #7641: handle win9x adddriver calls w/o config file.
This turned cupsaddsmb to run into an infinite loop.

Guenther
2010-11-29 17:56:40 +01:00
Jeremy Allison
f0dcc90f72 Fix bug 7781 - Samba transforms ShareName to lowercase (sharename) when adding new share via MMC
Change the find_service() interface to not depend on fstring, and
create a useable talloc-based interface.

Jeremy.
2010-11-10 01:14:17 +00:00
Jeremy Allison
272feb7bd1 Revert "Wrap security_token_has_privilege() with a check for lp_enable_privileges(). Needed"
Not needed - privileges code prevents "enable privileges = no" from adding privileges
anyway.

This reverts commit a8b95686a7.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Oct 22 23:41:36 UTC 2010 on sn-devel-104
2010-10-22 23:41:36 +00:00
Jeremy Allison
a8b95686a7 Wrap security_token_has_privilege() with a check for lp_enable_privileges(). Needed
to maintain compatibility with smb.conf manpage.

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Oct 22 18:15:48 UTC 2010 on sn-devel-104
2010-10-22 18:15:48 +00:00
Volker Lendecke
7a194c6e5e s3: Make "unpack_pjob" static
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Oct 20 16:51:04 UTC 2010 on sn-devel-104
2010-10-20 16:51:04 +00:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Volker Lendecke
812580736a s3: Remove talloc_autofree_context() from get_printer_list_db()
Another db that does not need explicit closing
2010-10-08 21:11:45 +02:00
Volker Lendecke
515c8f0289 s3: Fix a pointer error
It is not universally guaranteed that an enum is represented as a uint32_t.

This starts to be THE BUG (tm) in Samba. What can I do to explain this
to people a bit better? It seems that the verbose explanations I put into
the recent checkins fixing similar bugs are not clear enough.

Anybody who does is not 100% clear about what this patch fixes please
contact me directly so that we can talk it through on the phone to agree
on a wording that everybody can understand.

Thanks,

Volker
2010-10-04 11:43:47 +02:00
Volker Lendecke
24f1893b5d s3: Attempt to fix the non-ads build 2010-10-03 00:17:44 +02:00
Andreas Schneider
b3fd5e11e5 s3-spoolss: Fixed print_access_check server_info. 2010-10-02 00:04:45 +02:00
Günther Deschner
48fca54a29 s3-spoolss: dont overwrite location change notify.
Guenther
2010-10-01 08:33:46 +02:00
Günther Deschner
3797d48b76 s3-spoolss: Fix servername/printername handling which turns out to be very important to get right.
Guenther
2010-09-30 02:59:35 +02:00
Günther Deschner
ec33a87d58 s3-printing: skip metadata entry when traversing printerlist.
We were creating a new printer (with a very broken name) out of the
lasttimestamp entry all the time.

Simo, please check.

Guenther
2010-09-29 01:23:54 +02:00
Jeremy Allison
f98d217514 Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on all
TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open
without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt
this is still safe to use as if opening an existing tdb the new
hash will be ignored - it's only used on creating a new tdb not
opening an old one.

Jeremy.
2010-09-27 17:18:54 -07:00
Andrew Bartlett
03011bf118 s3-libads call common GUID_from_ndr_blob()
This does a length-limited check, and so avoids reading beyond the
allocated memory if the server sends less than 16 bytes.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-09-20 16:15:11 -07:00
Björn Jacke
cd56e40117 s3/printing: avoid a possible race condition in the cache timeout 2010-09-16 01:00:54 +02:00
Björn Jacke
aa7df7b737 s3/printing: make clock jump save and use monotonic time for cache timeout 2010-09-15 22:43:24 +02:00
Günther Deschner
480c97b5b1 s3-printing: fix print_spool_terminate().
Simo, Andreas, please check.

Guenther
2010-09-15 13:18:27 +02:00
Simo Sorce
8ec7aaef48 s3-rpc_server: Moved ncacn_np declarations in common header file.
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-09-15 12:53:42 +02:00
Simo Sorce
5685914344 s3-rpc_server: Convert rpc_connect_spoolss_pipe into a generic interface.
This way we have one common way to open internal pipes whether they
are shortcircuited or piped to an external process.
2010-09-15 12:53:42 +02:00
Andreas Schneider
65bd8f881d s3-printing: Document the printer list functions. 2010-09-15 12:53:40 +02:00
Simo Sorce
25a2d94974 s3-printing: Add method to skip refresh if just happned.
This way if multiple process try to refresh at the same time we don't do it
over and over again.

Signed-off-by: Andreas Schneider <asn@cynapses.org>
2010-09-15 12:53:40 +02:00
Simo Sorce
7022554915 s3-printing: Use printer list tdb in pcap.
Signed-off-by: Andreas Schneider <asn@cynapses.org>
2010-09-15 12:53:40 +02:00
Simo Sorce
d2a027ea94 s3-printing: Added a printer list database.
Signed-off-by: Andreas Schneider <asn@cynapses.org>
2010-09-15 12:53:40 +02:00
Andrew Bartlett
3bb77516b8 s3-privs Convert from user_has_privileges() -> security_token_has_privilege()
This new call is available in the merged privileges code, and
takes an enum as the parameter, rather than a bitmask.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:09 +10:00
Andrew Bartlett
fcaa86f402 s3-privs Further changes to remove SE_PRIV
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:04 +10:00
Günther Deschner
68c9877796 s3-printing: fix non-ads build after prototype changes.
Guenther
2010-09-10 22:41:56 +02:00
Andreas Schneider
81e97c09c3 s3-printing: Make missing auth_serversupplied_info const. 2010-09-09 16:39:33 +02:00
Andreas Schneider
bbf2cd50b0 s3-printing: Make auth_serversupplied_info const. 2010-09-09 16:00:08 +02:00
Günther Deschner
cf728f890f s3-spoolss: fix some debug statements.
Guenther
2010-09-03 12:19:26 +02:00
Günther Deschner
16c2d9182d s3-printing: add debug to get_correct_cversion().
Guenther
2010-08-31 23:17:40 +02:00
Günther Deschner
ca765d2f50 s3-build: only include krb5 environment variables where required.
Guenther
2010-08-26 00:20:29 +02:00
Andreas Schneider
555b175212 s3-printing: Added function to update the queue. 2010-08-18 11:43:18 +02:00
Andreas Schneider
7e9d6021c9 s3-printing: Rename jobs_changed functions to jobs_added. 2010-08-18 11:43:17 +02:00
Volker Lendecke
a847f13d7b s3: Use pipe_struct->client_id->name for pjob.clientmachine 2010-08-18 11:18:24 +02:00
Volker Lendecke
29093bc000 s3: Move initializing pjob.clientname to print_job_start() 2010-08-18 11:18:23 +02:00
Volker Lendecke
4b5e252354 s3: Add "client_id" to pipes_struct 2010-08-18 11:18:23 +02:00
Volker Lendecke
c360822226 s3: Directly call write_data from print_job_write() 2010-08-17 15:31:49 +02:00
Volker Lendecke
3aba8e9b7e s3: Remove unused "pos" arg from print_job_write 2010-08-17 15:31:49 +02:00
Jim McDonough
efd822982e s3-printing: fix BUG 7280 - auto printers not loading with registry
config
2010-08-16 14:07:44 -04:00
Volker Lendecke
d418f9f11a s3-printing: Lift the use of smbd_server_fd from job_submit.
Signed-off-by: Andreas Schneider <asn@samba.org>
2010-08-16 14:02:19 +02:00
Volker Lendecke
96ae457023 s3: Remove get_client_fd() 2010-08-16 13:13:10 +02:00
Volker Lendecke
016418d6c2 s3: Remove the smbd_messaging_context from load_printers 2010-08-08 23:37:47 +02:00
Volker Lendecke
1c1d83a532 s3: Remove the smbd_messaging_context from pcap_cache_reload 2010-08-08 23:37:47 +02:00
Volker Lendecke
795589b4f8 s3: Remove the smbd_messaging_context from cups_cache_reload 2010-08-08 23:37:47 +02:00
Volker Lendecke
83045b1ba9 s3: Remove the smbd_messaging_context from cups_pcap_load_async 2010-08-08 23:37:47 +02:00
Volker Lendecke
ef208c5571 s3: Lift the server_messaging_context from print_job_endpage 2010-08-08 18:09:38 +02:00
Volker Lendecke
d1f3a2efb7 s3: Lift the server_messaging_context from print_job_write 2010-08-08 18:09:37 +02:00
Volker Lendecke
ae1600b995 s3: Lift the server_messaging_context from print_job_delete1 2010-08-08 18:09:37 +02:00
Volker Lendecke
de10824872 s3: Lift the server_messaging_context from print_job_set_name 2010-08-08 18:09:37 +02:00
Volker Lendecke
3b5b74c7dd s3: Lift the server_messaging_context from print_queue_update_with_lock 2010-08-08 18:09:37 +02:00
Volker Lendecke
c2894503d1 s3: Lift the server_messaging_context from print_queue_update_internal 2010-08-08 18:09:37 +02:00
Volker Lendecke
2b13864569 s3: Lift the server_messaging_context from traverse_fn_delete 2010-08-08 18:09:37 +02:00
Volker Lendecke
8b6d88854c s3: Lift the server_messaging_context from print_unix_job 2010-08-08 18:09:37 +02:00
Volker Lendecke
0b423493c3 s3: Lift the server_messaging_context from pjob_delete 2010-08-08 18:09:37 +02:00
Volker Lendecke
6806ae7290 s3: Lift the server_messaging_context from pjob_store 2010-08-08 18:09:36 +02:00
Volker Lendecke
9ff35d0690 s3: Lift the server_messaging_context from pjob_store_notify 2010-08-08 18:09:36 +02:00
Volker Lendecke
128976e011 s3: Lift the server_messaging_context from notify_printer_byname 2010-08-08 18:09:36 +02:00
Volker Lendecke
d62c73b799 s3: Lift the server_messaging_context from notify_printer_location 2010-08-08 18:09:36 +02:00
Volker Lendecke
83c4c04121 s3: Lift the server_messaging_context from notify_printer_port 2010-08-08 18:09:36 +02:00
Volker Lendecke
f3313c5307 s3: Lift the server_messaging_context from notify_printer_printername 2010-08-08 18:09:36 +02:00
Volker Lendecke
c427423aee s3: Lift the server_messaging_context from notify_printer_sharename 2010-08-08 18:09:36 +02:00
Volker Lendecke
7285e0d5dd s3: Lift the server_messaging_context from notify_printer_comment 2010-08-08 18:09:36 +02:00
Volker Lendecke
4e4bf13e70 s3: Lift the server_messaging_context from notify_printer_driver 2010-08-08 18:09:35 +02:00
Volker Lendecke
b71debcca0 s3: Lift the server_messaging_context from notify_job_submitted 2010-08-08 18:09:35 +02:00
Volker Lendecke
aa5fd419b2 s3: Lift the server_messaging_context from notify_job_name 2010-08-08 18:09:35 +02:00
Volker Lendecke
06cf2ae6ea s3: Lift the server_messaging_context from notify_job_username 2010-08-08 18:09:35 +02:00
Volker Lendecke
7a9f94dae8 s3: Lift the server_messaging_context from notify_job_total_pages 2010-08-08 18:09:35 +02:00
Volker Lendecke
bd6626c40c s3: Lift the server_messaging_context from notify_job_total_bytes 2010-08-08 18:09:35 +02:00
Volker Lendecke
edbed43119 s3: Lift the server_messaging_context from notify_job_status 2010-08-08 18:09:35 +02:00
Volker Lendecke
9b3a53a7a7 s3: Lift the server_messaging_context from notify_job_status_byname 2010-08-08 18:09:35 +02:00
Volker Lendecke
21811fe72d s3: Lift the server_messaging_context from notify_printer_status 2010-08-08 18:09:35 +02:00
Volker Lendecke
49d18478fd s3: Lift the server_messaging_context from notify_printer_status_byname 2010-08-08 18:09:34 +02:00
Volker Lendecke
30de2f735b s3: Lift the server_messaging_context from send_notify_field_buffer 2010-08-08 18:09:34 +02:00
Volker Lendecke
dddb5a8795 s3: Lift the server_messaging_context from send_notify_field_values 2010-08-08 18:09:34 +02:00
Volker Lendecke
6720c6e071 s3: Lift the server_messaging_context from send_spoolss_notify2_msg 2010-08-08 18:09:34 +02:00
Volker Lendecke
fc6e7bdc9e s3: Lift the server_messaging_context from print_notify_event_send_messages 2010-08-08 18:09:34 +02:00
Volker Lendecke
c6e6aee0a0 s3: Lift the server_messaging_context from print_queue_status 2010-08-08 18:09:34 +02:00
Volker Lendecke
a36103ca05 s3: Lift the server_messaging_context from get_stored_queue_info 2010-08-08 18:09:34 +02:00
Volker Lendecke
c50c973036 s3: Lift the server_messaging_context from print_job_end 2010-08-08 18:09:34 +02:00
Volker Lendecke
a4c27786ff s3: Lift the server_messaging_context from print_queue_length 2010-08-08 18:09:33 +02:00
Volker Lendecke
31d23c83fe s3: Lift the server_messaging_context from print_queue_update 2010-08-08 18:09:33 +02:00
Volker Lendecke
bc760e79c8 s3: Lift the smbd_messaging_context from start_background_queue 2010-08-08 18:09:33 +02:00
Volker Lendecke
75b4dfd14d s3: Lift the smbd_messaging_context from smbd_setup_sig_hup_handler 2010-08-08 18:09:33 +02:00
Volker Lendecke
9a4ac5b2d3 s3: Fix the build without ADS 2010-08-08 16:47:19 +02:00
Volker Lendecke
cc280f0cd1 s3: Lift the smbd_messaging_context from print_queue_purge 2010-08-08 16:03:27 +02:00
Volker Lendecke
9723f33ef5 s3: Lift the smbd_messaging_context from print_queue_resume 2010-08-08 16:03:27 +02:00
Volker Lendecke
5f9165a7ea s3: Lift the smbd_messaging_context from print_queue_pause 2010-08-08 16:03:26 +02:00
Volker Lendecke
9441e8c52c s3: Lift the smbd_messaging_context from print_job_start 2010-08-08 16:03:26 +02:00
Volker Lendecke
bff871384a s3: Lift the smbd_messaging_context from print_job_checks 2010-08-08 16:03:26 +02:00
Volker Lendecke
7df0e672f2 s3: Lift the smbd_messaging_context from print_job_resume 2010-08-08 16:03:26 +02:00
Volker Lendecke
2811c258f6 s3: Lift the smbd_messaging_context from print_job_pause 2010-08-08 16:03:26 +02:00
Volker Lendecke
8dcbeecd6d s3: Lift the smbd_messaging_context from print_job_delete 2010-08-08 16:03:26 +02:00
Volker Lendecke
99b2da4504 s3: Lift the smbd_messaging_context from is_printer_published 2010-08-08 16:03:26 +02:00
Volker Lendecke
bccb7c87cc s3: Lift the smbd_messaging_context from check_published_printers 2010-08-08 16:03:25 +02:00
Volker Lendecke
7d08c25f98 s3: Lift the smbd_messaging_context from nt_printer_publish 2010-08-08 16:03:25 +02:00
Volker Lendecke
61837197d8 s3: Lift the smbd_messaging_context from nt_printer_publish_ads 2010-08-08 16:03:25 +02:00