1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

288 Commits

Author SHA1 Message Date
Stefan Metzmacher
da53434391 s3:spoolss: make use of cli_state_protocol()
metze
2011-08-02 04:54:29 +02:00
Andreas Schneider
a97fef36bc s3-spoolss: Use existing handle in printer_driver_files_in_use().
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Jul 28 16:20:11 CEST 2011 on sn-devel-104
2011-07-28 16:20:11 +02:00
Andreas Schneider
5fa9fe39ea s3-spoolss: Use existing handle in printer_driver_in_use(). 2011-07-28 15:08:42 +02:00
Andreas Schneider
133fb0ebcc s3-spoolss: Use get_session_info_system().
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Wed Jul 27 10:38:34 CEST 2011 on sn-devel-104
2011-07-27 10:38:34 +02:00
Andreas Schneider
b77f626def s3-spoolss: Free the info2 structure in _spoolss_GetPrinter. 2011-07-27 08:50:01 +02:00
Andreas Schneider
f26441d8ba s3-spoolss: Use tmp_ctx everywhere in _spoolss_DeletePrinterDriverEx. 2011-07-27 08:50:01 +02:00
Andreas Schneider
fea4a3111b s3-spoolss: Use tmp_ctx in winreg_enum_printer_key_internal. 2011-07-27 08:50:01 +02:00
Andreas Schneider
c58c0ba0bd s3-spoolss: Use tmp_ctx in winreg_printer_deleteform1_internal. 2011-07-27 08:50:01 +02:00
Andreas Schneider
80c1a8e04e s3-spoolss: Use tmp_ctx in winreg_printer_setform1_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
baccb06658 s3-spoolss: Use tmp_ctx in winreg_printer_addform1_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
a6ea1542c5 s3-spoolss: Use tmp_ctx in winreg_printer_getform1_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
f49917ade0 s3-spoolss: Use tmp_ctx in winreg_printer_enumforms1_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
81eae6ebd4 s3-spoolss: Use tmp_ctx in winreg_set_printer_secdesc_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
41c2e711bd s3-spoolss: Use tmp_ctx in winreg_get_printer_secdesc_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
022a13f1e0 s3-spoolss: Use tmp_ctx in winreg_add_driver_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
ff6294ef0f s3-spoolss: Use tmp_ctx in winreg_del_driver_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
72ac68e746 s3-spoolss: Use tmp_ctx in winreg_get_driver_list_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
2e2631f554 s3-spoolss: Use tmp_ctx in winreg_get_driver_internal. 2011-07-27 08:50:00 +02:00
Andreas Schneider
106829545c s3-spoolss: Use tmp_ctx in winreg_delete_printer_dataex_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
e6e80ea137 s3-spoolss: Use tmp_ctx in winreg_get_printer_dataex_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
7aef2f6308 s3-spoolss: Use tmp_ctx in winreg_enum_printer_dataex_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
311d6dbeb7 s3-spoolss: Use tmp_ctx in winreg_set_printer_dataex_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
2b0adab76e s3-spoolss: Use tmp_ctx in winreg_update_printer_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
34dc5a57f9 s3-spoolss: Use tmp_ctx in winreg_create_printer_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
f9359a2dc9 s3-spoolss: Use tmp_ctx in winreg_get_printer_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
20afdeec3c s3-spoolss: Use tmp_ctx in winreg_printer_get_changeid_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
ba74c5df2d s3-spoolss: Use tmp_ctx in winreg_printer_update_changeid_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
43604dd321 s3-spoolss: Use tmp_ctx in winreg_delete_printer_key_internal. 2011-07-27 08:49:59 +02:00
Andreas Schneider
bed0672b03 s3-spoolss: Free local in winreg_printer_binding_handle. 2011-07-27 08:49:58 +02:00
Simo Sorce
99e03bee7a s3-spoolss: Improve memory efficiency.
p->mem_ctx is a relatively long lived context as it will not be freed until
a full request is served. In spoolss we do a lot of operations including
opening new pipes to connect to winreg.
Use more shortlived temporary contexts to avoid leaking a lot of memory on
p->mem_ctx and carrying it around untill all the operations in the current call
are done.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-07-27 08:49:58 +02:00
Andrew Bartlett
9fcc617ff5 s3-auth Use the common auth_session_info
This patch finally has the same structure being used to describe the
authorization data of a user across the whole codebase.

This will allow of our session handling to be accomplished with common code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
128ae06a61 s3-auth use auth_user_info not netr_SamInfo3 in auth3_session_info
This makes auth3_session_info identical to auth_session_info

The logic to convert the info3 to a struct auth_user_info is
essentially moved up the stack from the named pipe proxy in
source3/rpc_server to create_local_token().

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:13 +10:00
Andrew Bartlett
6d741e918f s3-auth Use *unix_token rather than utok in struct auth3_session_info
This brings this structure one step closer to the struct auth_session_info.

A few SMB_ASSERT calls are added in some key places to ensure that
this pointer is initialised, to make tracing any bugs here easier in
future.

NOTE: Many of the users of this structure should be reviewed, as unix
and NT access checks are mixed in a way that should just be done using
the NT ACL.  This patch has not changed this behaviour however.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
Andrew Bartlett
f16d8f4eb8 s3-auth Use struct auth3_session_info outside the auth subsystem
This seperation between the structure used inside the auth modules and
in the wider codebase allows for a gradual migration from struct
auth_serversupplied_info -> struct auth_session_info (from auth.idl)

The idea here is that we keep a clear seperation between the structure
before and after the local groups, local user lookup and the session
key modifications have been processed, as the lack of this seperation
has caused issues in the past.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:10 +10:00
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
a762eda519 s3-printing: add winreg_printer_binding_handle and remove most of srv_spoolss_util.c.
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
Andreas Schneider
784035fd53 s3-spoolss: Replace client_id in the spoolss server.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-07-04 18:28:12 +10: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
Andreas Schneider
c173e6e80d s3-spoolss: Fix some valgrind warnings.
These are in/out values and need to be initialized.

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

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Jun 21 18:58:30 CEST 2011 on sn-devel-104
2011-06-21 18:58:29 +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
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
Andrew Bartlett
73b377432c s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett
2011-06-09 12:40:08 +02:00
Günther Deschner
47ea009e86 s3-spoolss: fix -Wunused-but-set-variable build warning in _spoolss_EnumPrintProcDataTypes().
We were in fact ignoring the error code here.

Guenther
2011-06-08 12:00:54 +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
Andrew Bartlett
8524924a46 s3-smbd provide struct smbd_server_connection * to conn_snum_used
This provides the 'sconn' parameter to this key functions, that
is currently duplicated in dummysmbd.c, which causes duplicate symbol
issues in the waf build.

This has natrually caused a number of consequential changes across the
codebase, includning not passing a messaging context into initial
reload_services():

This causes problems because the global smbd_server_connection isn't
yet set up, as there isn't a connection here, just the initial
process.

Andrew Bartlett
2011-05-31 00:32:07 +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
Andreas Schneider
da1fa20104 s3-spoolss: Get the printer location from cups.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-05-16 12:54:33 +02:00
Günther Deschner
27022587e3 s3-libsmb: move protos to libsmb/proto.h
Guenther
2011-05-06 16:37:18 +02:00
Günther Deschner
ab8219a6f3 s3-spoolss: remove unused struct in construct_notify_printer_info().
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri May  6 12:07:17 CEST 2011 on sn-devel-104
2011-05-06 12:07:17 +02:00
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Jeremy Allison
7d6ebe0de7 More const fixes. Remove CONST_DISCARD. 2011-05-06 01:44:07 +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
1a561dedb9 s3-spoolss: remove another unused header.
Guenther
2011-05-02 15:03:44 +02: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
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
0cf9b47725 s3-spoolss: fix debug statement in spoolss_addprinterex_level_2().
Guenther
2011-04-20 17:19:15 +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
146c1aac99 s3-auth: rpc_server needs auth.h
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
20d8ae49b7 s3: rpc_server needs parts of smbd.
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
Volker Lendecke
261d6b0e9b s3: Fix Coverity ID 2195: NO_EFFECT
level is unsigned
2011-03-27 22:22:12 +02:00
Volker Lendecke
cfa8b36632 s3: Fix Coverity ID 2201, NULL_RETURNS
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar 23 13:06:20 CET 2011 on sn-devel-104
2011-03-23 13:06:20 +01:00
Volker Lendecke
4b347a1b17 s3: Add "print notify backchannel" parameter to prevent us doing the reverse print notify connection.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Mar 18 21:34:30 CET 2011 on sn-devel-104
2011-03-18 21:34:30 +01:00
Volker Lendecke
3835d77795 s3: Fix Coverity ID 1017, CHECKED_RETURN
Günther, please check!
2011-03-16 21:14:58 +01:00
Volker Lendecke
df79b3ba76 s3: Fix Coverity ID 2317: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_SetValue.
2011-03-16 18:08:51 +01:00
Volker Lendecke
329fcd4e34 s3: Fix Coverity ID 2318: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_SetValue.
2011-03-16 18:08:51 +01:00
Volker Lendecke
f0d491205c s3: Fix Coverity ID 2279: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_SetValue.
2011-03-15 11:10:46 +01:00
Volker Lendecke
6b584e0e9a s3: Fix Coverity ID 2281: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_SetValue.
2011-03-15 11:10:45 +01:00
Volker Lendecke
b753b0ab82 s3: Fix Coverity ID 2283: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_OpenKey.
2011-03-15 11:10:45 +01:00
Volker Lendecke
2992ccfe9c s3: Fix Coverity ID 2284: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_DeleteValue.
2011-03-15 11:10:45 +01:00
Volker Lendecke
2b26c86fe6 s3: Fix Coverity ID 2285: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_DeleteValue.
2011-03-15 11:10:45 +01:00
Volker Lendecke
c09877113d s3: Fix Coverity ID 2286: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_SetValue.
2011-03-15 11:10:44 +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
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
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
Andreas Schneider
bf18403c81 s3-rpc_client: Move client pipe functions to own header. 2011-02-28 18:15:04 +01:00
Volker Lendecke
fec0baacb6 s3: Make is_zero_addr take a sockaddr_storage
All callers had to cast this anyway

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Feb 27 11:02:53 CET 2011 on sn-devel-104
2011-02-27 11:02:53 +01:00
Günther Deschner
66e040ee0a s3-printing: isolate print notification prototypes better.
Guenther
2011-02-22 21:52:18 +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