make bozo honor -rxbind correctly

Bozo needs to call rxInitHost() rather than rxInit() when -rxbind is
present. This patch causes it to read NetInfo/NetRestrict earlier in
the startup process so it can make that decision.

FIXES 57286

Change-Id: I17058f4e8e5c23fdfcfe56178d5edc5dcceafb7a
Reviewed-on: http://gerrit.openafs.org/4729
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Adam Megacz 2007-03-23 12:14:41 -07:00 committed by Derrick Brashear
parent 7270cf5607
commit 6260c4ae51

View File

@ -963,8 +963,28 @@ main(int argc, char **argv, char **envp)
/* Write current state of directory permissions to log file */
DirAccessOK();
if (rxBind) {
afs_int32 ccode;
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
ccode = parseNetFiles(SHostAddrs, NULL, NULL,
ADDRSPERSITE, reason,
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else {
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
if (ccode == 1)
host = SHostAddrs[0];
}
for (i = 0; i < 10; i++) {
code = rx_Init(htons(AFSCONF_NANNYPORT));
if (rxBind) {
code = rx_InitHost(host, htons(AFSCONF_NANNYPORT));
} else {
code = rx_Init(htons(AFSCONF_NANNYPORT));
}
if (code) {
bozo_Log("can't initialize rx: code=%d\n", code);
sleep(3);
@ -1039,23 +1059,6 @@ main(int argc, char **argv, char **envp)
rx_SetMaxMTU(rxMaxMTU);
}
if (rxBind) {
afs_int32 ccode;
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
ccode = parseNetFiles(SHostAddrs, NULL, NULL,
ADDRSPERSITE, reason,
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
if (ccode == 1)
host = SHostAddrs[0];
}
tservice = rx_NewServiceHost(host, 0, /* service id */ 1,
"bozo", securityClasses, numClasses,
BOZO_ExecuteRequest);