summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-11-10 19:34:36 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-11-17 00:34:09 +0100
commiteb4fa13fd967a2604284de357ee8e8bfbee0a507 (patch)
tree185bbc626c402928fd07faf8549102eb6bffe933
parente743fbc26ef64f8f3e4164f809140a12b304c90f (diff)
downloadsamba-eb4fa13fd967a2604284de357ee8e8bfbee0a507.tar.gz
samba-eb4fa13fd967a2604284de357ee8e8bfbee0a507.tar.bz2
samba-eb4fa13fd967a2604284de357ee8e8bfbee0a507.zip
param: use lp_is_security_and_server_role_valid()
This also permits a few more valid combinations, due to the layer at which this is being used. Andrew Bartlett
-rw-r--r--lib/param/loadparm_server_role.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/param/loadparm_server_role.c b/lib/param/loadparm_server_role.c
index a39d5fa214..06c4421723 100644
--- a/lib/param/loadparm_server_role.c
+++ b/lib/param/loadparm_server_role.c
@@ -63,10 +63,13 @@ int lp_find_server_role(int server_role, int security, bool domain_logons, bool
int role;
if (server_role != ROLE_AUTO) {
- return server_role;
+ if (lp_is_security_and_server_role_valid(server_role, security)) {
+ return server_role;
+ }
}
- /* If server_role is set to ROLE_AUTO, figure out the correct role */
+ /* If server_role is set to ROLE_AUTO, or conflicted with the
+ * chosen security setting, figure out the correct role */
role = ROLE_STANDALONE;
switch (security) {
@@ -150,11 +153,14 @@ bool lp_is_security_and_server_role_valid(int server_role, int security)
{
bool valid = false;
- if (server_role == ROLE_AUTO || security == SEC_AUTO) {
- return false;
+ if (security == SEC_AUTO) {
+ return true;
}
switch (server_role) {
+ case ROLE_AUTO:
+ valid = true;
+ break;
case ROLE_STANDALONE:
if (security == SEC_SHARE || security == SEC_SERVER || security == SEC_USER) {
valid = true;
@@ -169,7 +175,7 @@ bool lp_is_security_and_server_role_valid(int server_role, int security)
case ROLE_DOMAIN_PDC:
case ROLE_DOMAIN_BDC:
- if (security == SEC_USER) {
+ if (security == SEC_USER || security == SEC_ADS || security == SEC_DOMAIN) {
valid = true;
}
break;