~mdw
/
become
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix (scary) overrun bug in group allocation stuff.
[become]
/
src
/
become.c
diff --git
a/src/become.c
b/src/become.c
index
2154e4b
..
e73f5da
100644
(file)
--- a/
src/become.c
+++ b/
src/become.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: become.c,v 1.
9 1997/09/10 10:28:0
5 mdw Exp $
+ * $Id: become.c,v 1.
11 1997/09/24 09:48:4
5 mdw Exp $
*
* Main code for `become'
*
*
* Main code for `become'
*
@@
-29,6
+29,12
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: become.c,v $
/*----- 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).
* 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).
@@
-301,8
+307,8
@@
static int bc__addGroups(gid_t *g, int *png, const gid_t *a, int na)
/* --- See if there's room for more --- */
/* --- 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);
}
*png = ng;
return (-1);
}
@@
-437,7
+443,7
@@
int main(int argc, char *argv[])
/* --- Become server setup parameters --- */
char *conffile = file_RULES; /* Default config file for daemon */
/* --- 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 --- */
/* --- Miscellanous shared variables --- */
@@
-752,7
+758,7
@@
int main(int argc, char *argv[])
}
bc__write(stdout,
"\n"
}
bc__write(stdout,
"\n"
-"Also, `+' and `-' options are recognised to turn on and off va
v
rious\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"
"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"
@@
-805,9
+811,10
@@
int main(int argc, char *argv[])
/* --- None of the above --- */
if (optarg[sz] == 0 || (optarg[sz] != '=' && optarg[sz + 1] != 0)) {
/* --- None of the above --- */
if (optarg[sz] == 0 || (optarg[sz] != '=' && optarg[sz + 1] != 0)) {
- if (
who == 0)
+ if (
!who) {
who = optarg;
who = optarg;
- else {
+ break;
+ } else {
optind--;
goto done_options;
}
optind--;
goto done_options;
}