1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

115 Commits

Author SHA1 Message Date
Volker Lendecke
a60c7b4ff2 s3:services: Disable rcinit-based service control code
This is a become_root user callout that I have never seen in use in
more than 20 years of Samba. Why disable now? In the next commit I
need to make a change to initializing the registry values for
services, the svcctl service won't be able to do registry transactions
anymore. I'm not sure that going without transactions is 100% safe in
all failure cases, so I decided to propose disabling the problematic
code that might lead to security issues.

One fix might be to add a lot more validation code to
_svcctl_OpenServiceW() to see whether the registry values underlying
the service are sane.

Yes, this is technical debt, but I would question that starting unix
daemons via DCERPC used at all out there.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-12-10 14:02:30 +00:00
Volker Lendecke
a63aafb05d srcctl3: Improve debug messages
A customer's syslog was filled with

_svcctl_OpenServiceW: Failed to get a valid security descriptor

messages. This improves the messages to give info about which service failed
with which error code. Also, it makes OpenServiceW fail with the same error
message Windows fails with for unknown services.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Jan 16 02:43:03 CET 2018 on sn-devel-144
2018-01-16 02:43:03 +01:00
Trever L. Adams
7accec7f78 Update smbrun to allow for settings environment variables.
Signed-off-by: Trever L. Adams <trever.adams@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct 13 04:26:26 CEST 2016 on sn-devel-144
2016-10-13 04:26:26 +02:00
Günther Deschner
8f39b2fd24 werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source3/services/
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:19 +02:00
Günther Deschner
5ad6e8f7de werror: replace WERR_BADFILE with WERR_FILE_NOT_FOUND in source3/services/svc_winreg_glue.c
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-28 00:04:17 +02:00
Richard Sharpe
bc62dfa493 Convert all uint32/16/8 to _t in a couple of include files.
Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May 12 04:22:55 CEST 2015 on sn-devel-104
2015-05-12 04:22:55 +02:00
Andrew Bartlett
0eacc47622 param: Change from _lp to lp__ as the prefix for internal parameter wrappers
This will make a merge with the lib/param param code easier, as we can then paste lp_ to the front of
all parameters unconditionally.

Andrew Bartlett
2012-04-16 14:32:38 +10: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
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
Andrew Bartlett
d4ef70a764 param: Finish conversion from lp_wins_support() -> lp_we_are_a_wins_server()
Jermey started this in 1997 with 0aa493cc03

(avoiding the duplicate function makes it easier to generate the
struct loadparm_globals).

Andrew Bartlett
2011-07-02 12:31:34 +10:00
Günther Deschner
146c1aac99 s3-auth: rpc_server needs auth.h
Guenther
2011-03-30 01:13:09 +02:00
Volker Lendecke
288fb9d612 s3: Fix an uninitialized variable read
The "is_valid_policy_handle" in the exit path reads uninitialized data

Lets see if this fixes Coverity ID 2172 which complains about h being
dereferenced in the dcerpc_winreg_CloseKey.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Mar 26 14:24:28 CET 2011 on sn-devel-104
2011-03-26 14:24:28 +01:00
Volker Lendecke
31ff8f38e7 s3: Fix Coverity ID 2287: Uninitialized read
We passed the structure including the uninitialized elements to
dcerpc_winreg_CreateKey.
2011-03-15 11:10:43 +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
Andreas Schneider
c6255adc6f s3-services: Remove obsolete services_db.c.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-02-07 12:32:01 +01:00
Andreas Schneider
09dafc4a25 s3-rpc_server: Added a svcctl shutdown function.
Signed-off-by: Günther Deschner <gd@samba.org>
2011-02-07 12:32:01 +01:00
Andreas Schneider
96565db5f6 s3-services: Migrated svcctl registry functions to winreg.
This is a bigger commit. It moves the relevant function to
svc_winreg_glue. We need to use them in the same commit else we have
problems with prototypes in proto.h.

Signed-off-by: Günther Deschner <gd@samba.org>
2011-02-07 12:32:01 +01:00
Volker Lendecke
61b2ac9121 s3: Avoid a ton of registry writes at startup
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Jan  8 12:39:09 CET 2011 on sn-devel-104
2011-01-08 12:39:09 +01: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
Michael Adam
b11cc30508 s3:registry: move the reg_api prototypes to their own header. 2010-09-21 08:52:06 +02:00
Michael Adam
d86d2256b9 s3:services_db: convert get_common_service_dispname() to talloc 2010-09-21 07:41:23 +02:00
Michael Adam
7f1efa6ea2 s3:services_db: does not need legacy registry code any more. 2010-09-21 06:53:32 +02:00
Michael Adam
8df2ab9746 s3:services_db: rewrite svcctl_init_keys() to use reg_api calls instead of legacy 2010-09-21 06:53:32 +02:00
Michael Adam
a6f0f912cc s3:services_db: extract core of svcctl_set_secdesc to _internal version
The internal version operates on an already opened key.
2010-09-21 06:53:32 +02:00
Michael Adam
f2a4d5536b s3:services_db: create the "Security" subkey if it does not exist in svcctl_set_secdesc()
Windows behaves like this. - Tests will follow.
2010-09-21 06:53:32 +02:00
Michael Adam
8be007dbb0 s3:services_db: remove bogus comments
(from copy and paste probably...)
2010-09-21 06:53:32 +02:00
Michael Adam
5fe2abb2f8 s3:services_db: remove unused legacy function svcctl_fetch_regvalues(). 2010-09-21 06:53:32 +02:00
Michael Adam
3c85a9fcbe s3:services_db: publish svcctl_get_string_value() 2010-09-21 06:53:31 +02:00
Michael Adam
e28bc8d763 s3:services_db: factor out common code of lookup_dispname and lookup_description
into a new function svcctl_get_string_value()
2010-09-21 06:53:31 +02:00
Michael Adam
53dcbc2dd2 s3:services_db: change svcctl_lookup_description() to use reg_api functions 2010-09-21 06:53:31 +02:00
Michael Adam
9fee033656 s3:services_db: rewrite svcctl_lookup_description() to use a tmp talloc ctx
Also remove a possible memory by tallocing the result string
also in a default case, where a string constant was returned before.
2010-09-21 06:53:31 +02:00
Michael Adam
464515cd61 s3:services_db: change svcctl_lookup_dispname() to use reg_api functions 2010-09-21 06:53:31 +02:00
Michael Adam
e464ca9f31 s3:services_db: make svcctl_lookup_dispname() use a temp talloc ctx 2010-09-21 06:53:31 +02:00
Michael Adam
a4b1042f33 s3:services_db: change svcctl_get_secdesc() to use reg_api functions 2010-09-21 06:53:31 +02:00
Michael Adam
4fc2b5c40e s3:services_db: use temp talloc ctx in svcctl_get_secdesc() 2010-09-21 06:53:30 +02:00
Michael Adam
9bfd587358 s3:services_db: remove the TALLOC_CTX argument from svcctl_set_secdesc 2010-09-21 06:53:30 +02:00
Michael Adam
91d5446390 s3:services_db: fix a debug message 2010-09-21 06:53:30 +02:00
Michael Adam
d2794b05a6 s3:services_db: rewrite svcctl_set_secdesc to use tmp talloc ctx
and add a common exit point
2010-09-21 06:53:30 +02:00
Michael Adam
7cefb89872 s3:services_db: rewrite svcctl_set_secdesc() using reg_api calls instead of legacy 2010-09-21 06:53:30 +02:00
Michael Adam
f53c17b4ff s3:services_db: untanlge assignments from check in read_init_file(). 2010-09-21 06:53:30 +02:00
Michael Adam
a67a553f40 s3:services_db: untangle assignments from check in construct_service_sd(). 2010-09-21 06:53:29 +02:00
Andrew Bartlett
d1bb21b0d5 s3:auth Remove NT_USER_TOKEN
The all UPPER case typedef is no longer the preferred Samba style
and this makes it easier to see that this is the IDL-derivied structure

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:06 +10:00
Günther Deschner
441d607589 s3-services: include svcctl.h where needed.
Guenther
2010-08-06 15:43:37 +02:00
Michael Adam
0fe1ff99a1 s3:registry: move reg_objects.h to registry/ and use it only where needed
Every place outside of registry/ where this is used, should probably
be changed to use pure reg_api.c code.
2010-05-25 10:35:31 +02:00
Michael Adam
1be8f5fba4 s3:services_db: use regval_ctr_init() instead of direct allocation 2010-05-25 10:35:29 +02:00
Michael Adam
b94267aa3f s3:registry: extraxt the reg_dispatcher prototypes into their own header.
And use them only where needed.
2010-05-25 10:35:26 +02:00
Michael Adam
9ccf66379a s3:registry: adapt callers of regval_ctr_addvalue to uint8 * instead of char * 2010-05-25 10:35:25 +02:00
Michael Adam
a4efda959a s3:registry: extract the reg_util_legacy prototypes into their own header.
And use them only where necessary.
2010-05-25 10:35:24 +02:00
Günther Deschner
ba1befd365 s3-services: move services.h closer to services implementation.
Guenther
2010-05-20 13:39:46 +02:00
Günther Deschner
7f6bb48bdf s3-secdesc: remove "typedef struct security_descriptor SEC_DESC".
Guenther
2010-05-18 12:30:12 +02:00