mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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
This commit is contained in:
parent
fd19cae8d2
commit
4809f4a6ee
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user