/* -*-c-*-
*
- * $Id: become.c,v 1.9 1997/09/10 10:28:05 mdw Exp $
+ * $Id: become.c,v 1.11 1997/09/24 09:48:45 mdw Exp $
*
* Main code for `become'
*
/*----- Revision history --------------------------------------------------*
*
* $Log: become.c,v $
+ * Revision 1.11 1997/09/24 09:48:45 mdw
+ * Fix (scary) overrun bug in group allocation stuff.
+ *
+ * Revision 1.10 1997/09/17 10:14:10 mdw
+ * Fix a typo. Support service names in `--port' option.
+ *
* Revision 1.9 1997/09/10 10:28:05 mdw
* Allow default port to be given as a service name or port number. Handle
* groups properly (lots of options here).
/* --- See if there's room for more --- */
- if (ng > NGROUPS_MAX) {
- moan("too many groups (system limit exceeded -- some have been lost");
+ if (ng >= NGROUPS_MAX) {
+ moan("too many groups (system limit exceeded) -- some have been lost");
*png = ng;
return (-1);
}
/* --- Become server setup parameters --- */
char *conffile = file_RULES; /* Default config file for daemon */
- int port = -1; /* Default port for daemon */
+ int port = 0; /* Default port for daemon */
/* --- Miscellanous shared variables --- */
}
bc__write(stdout,
"\n"
-"Also, `+' and `-' options are recognised to turn on and off vavrious\n"
+"Also, `+' and `-' options are recognised to turn on and off various\n"
"tracing options. For example, `A-r' enables everything except ruleset\n"
"tracing, and `A-D+c' is everything except the defaults, but with request\n"
"check tracing.\n"
/* --- None of the above --- */
if (optarg[sz] == 0 || (optarg[sz] != '=' && optarg[sz + 1] != 0)) {
- if (who == 0)
+ if (!who) {
who = optarg;
- else {
+ break;
+ } else {
optind--;
goto done_options;
}