summaryrefslogtreecommitdiffstats
path: root/source/param
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-01-24 03:54:33 +0000
committerGerald Carter <jerry@samba.org>2006-01-24 03:54:33 +0000
commit4b9ea8812ef3f7612c41bf3aaab1371c981279cc (patch)
tree12df5cd6251aa0dbeb06f309ccf25b3096a08a14 /source/param
parent6de6cd120873b7879ec314299de1bcd5bf82c73d (diff)
downloadsamba-4b9ea8812ef3f7612c41bf3aaab1371c981279cc.tar.gz
samba-4b9ea8812ef3f7612c41bf3aaab1371c981279cc.tar.xz
samba-4b9ea8812ef3f7612c41bf3aaab1371c981279cc.zip
r13105: pulling some code over for the 3.0.21b release....first take at it
Diffstat (limited to 'source/param')
-rw-r--r--source/param/loadparm.c41
1 files changed, 24 insertions, 17 deletions
diff --git a/source/param/loadparm.c b/source/param/loadparm.c
index cdef0340618..526bce9b60e 100644
--- a/source/param/loadparm.c
+++ b/source/param/loadparm.c
@@ -2532,7 +2532,7 @@ BOOL lp_add_home(const char *pszHomename, int iDefaultService,
string_set(&ServicePtrs[i]->comment, comment);
}
- /* set the browseable flag from the gloabl default */
+ /* set the browseable flag from the global default */
ServicePtrs[i]->bBrowseable = sDefault.bBrowseable;
@@ -4098,6 +4098,28 @@ static void lp_save_defaults(void)
Set the server type we will announce as via nmbd.
********************************************************************/
+static const struct srv_role_tab {
+ uint32 role;
+ const char *role_str;
+} srv_role_tab [] = {
+ { ROLE_STANDALONE, "ROLE_STANDALONE" },
+ { ROLE_DOMAIN_MEMBER, "ROLE_DOMAIN_MEMBER" },
+ { ROLE_DOMAIN_BDC, "ROLE_DOMAIN_BDC" },
+ { ROLE_DOMAIN_PDC, "ROLE_DOMAIN_PDC" },
+ { 0, NULL }
+};
+
+const char* server_role_str(uint32 role)
+{
+ int i = 0;
+ for (i=0; srv_role_tab[i].role_str; i++) {
+ if (role == srv_role_tab[i].role) {
+ return srv_role_tab[i].role_str;
+ }
+ }
+ return NULL;
+}
+
static void set_server_role(void)
{
server_role = ROLE_STANDALONE;
@@ -4141,22 +4163,7 @@ static void set_server_role(void)
break;
}
- DEBUG(10, ("set_server_role: role = "));
-
- switch(server_role) {
- case ROLE_STANDALONE:
- DEBUGADD(10, ("ROLE_STANDALONE\n"));
- break;
- case ROLE_DOMAIN_MEMBER:
- DEBUGADD(10, ("ROLE_DOMAIN_MEMBER\n"));
- break;
- case ROLE_DOMAIN_BDC:
- DEBUGADD(10, ("ROLE_DOMAIN_BDC\n"));
- break;
- case ROLE_DOMAIN_PDC:
- DEBUGADD(10, ("ROLE_DOMAIN_PDC\n"));
- break;
- }
+ DEBUG(10, ("set_server_role: role = %s\n", server_role_str(server_role)));
}
/***********************************************************