summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2021-08-07 10:52:28 +0000
committerJule Anger <janger@samba.org>2021-09-06 19:17:11 +0000
commit16306431a242b87a91d0c4b7ff874e51091d2bd9 (patch)
tree805d694256a264b717984d2cef64a66ca749a954 /source3
parent189bb79ac74f79b3a3de4a3577341de63206f752 (diff)
downloadsamba-16306431a242b87a91d0c4b7ff874e51091d2bd9.tar.gz
registry: check for running as root in clustering mode
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14787 RN: net conf list crashes when run as normal user Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Aug 17 11:23:15 UTC 2021 on sn-devel-184 (cherry picked from commit 4809f4a6ee971bcd9767839c729b636b7582fc02)
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_backend_db.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index c870dc57ed6..423b310fe8a 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -733,6 +733,15 @@ WERROR regdb_init(void)
return WERR_OK;
}
+ /*
+ * Clustered Samba can only work as root because we need messaging to
+ * talk to ctdb which only works as root.
+ */
+ if (lp_clustering() && geteuid() != 0) {
+ DBG_ERR("Cluster mode requires running as root.\n");
+ return WERR_ACCESS_DENIED;
+ }
+
db_path = state_path(talloc_tos(), "registry.tdb");
if (db_path == NULL) {
return WERR_NOT_ENOUGH_MEMORY;