chiark
/
gitweb
/
~mdw
/
become
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Major overhaul. Now uses DSA signatures rather than the bogus symmetric
[become]
/
src
/
netg.c
diff --git
a/src/netg.c
b/src/netg.c
index c198219a6bf24f79ad6411d14f08f583e21aa214..f21138914c2a85e86665b9f06595ce78e1e42602 100644
(file)
--- a/
src/netg.c
+++ b/
src/netg.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: netg.c,v 1.
4 1998/04/23 13:24:49
mdw Exp $
+ * $Id: netg.c,v 1.
5 2003/10/12 00:14:55
mdw Exp $
*
* A local database of netgroups
*
*
* A local database of netgroups
*
@@
-29,6
+29,10
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: netg.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: netg.c,v $
+ * Revision 1.5 2003/10/12 00:14:55 mdw
+ * Major overhaul. Now uses DSA signatures rather than the bogus symmetric
+ * encrypt-and-hope thing. Integrated with mLib and Catacomb.
+ *
* Revision 1.4 1998/04/23 13:24:49 mdw
* Switch to using the ypstuff interface to YP server.
*
* Revision 1.4 1998/04/23 13:24:49 mdw
* Switch to using the ypstuff interface to YP server.
*
@@
-67,14
+71,19
@@
#include <netdb.h>
#include <unistd.h>
#include <netdb.h>
#include <unistd.h>
+/* --- mLib headers --- */
+
+#include <mLib/alloc.h>
+#include <mLib/report.h>
+#include <mLib/sym.h>
+#include <mLib/trace.h>
+
/* --- Local headers --- */
#include "become.h"
#include "config.h"
#include "netg.h"
/* --- Local headers --- */
#include "become.h"
#include "config.h"
#include "netg.h"
-#include "sym.h"
#include "userdb.h"
#include "userdb.h"
-#include "utils.h"
#include "ypstuff.h"
/*----- Type definitions --------------------------------------------------*/
#include "ypstuff.h"
/*----- Type definitions --------------------------------------------------*/
@@
-360,7
+369,7
@@
static int netg__foreach(int st, char *k, int ksz,
* Use: Dumps the netgroup given.
*/
* Use: Dumps the netgroup given.
*/
-#if
def TRACING
+#if
ndef NTRACE
static void netg__dumpGroup(netg__cons *c, int lev)
{
static void netg__dumpGroup(netg__cons *c, int lev)
{
@@
-409,7
+418,7
@@
static void netg__dumpGroup(netg__cons *c, int lev)
* Use: Dumps the netgroups table.
*/
* Use: Dumps the netgroups table.
*/
-#if
def TRACING
+#if
ndef NTRACE
static void netg__dump(void)
{
static void netg__dump(void)
{
@@
-417,7
+426,7
@@
static void netg__dump(void)
netg__sym *sng;
trace(TRACE_DEBUG, "debug: dumping netgroups file");
netg__sym *sng;
trace(TRACE_DEBUG, "debug: dumping netgroups file");
- for (sym_
createI
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; ) {
+ for (sym_
mki
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; ) {
trace(TRACE_DEBUG, "debug: netgroup `%s'...", sng->_base.name);
sng->cons->f &= ~f_visit;
netg__dumpGroup(sng->cons, 1);
trace(TRACE_DEBUG, "debug: netgroup `%s'...", sng->_base.name);
sng->cons->f &= ~f_visit;
netg__dumpGroup(sng->cons, 1);
@@
-436,7
+445,7
@@
static void netg__dump(void)
*/
void netg_iterate(void) { netg_iterate_r(&netg__iter); }
*/
void netg_iterate(void) { netg_iterate_r(&netg__iter); }
-void netg_iterate_r(netg_iter *i) { sym_
createI
ter(i, &netg__table); }
+void netg_iterate_r(netg_iter *i) { sym_
mki
ter(i, &netg__table); }
/* --- @netg_next@, @netg_next_r@ --- *
*
/* --- @netg_next@, @netg_next_r@ --- *
*
@@
-557,7
+566,7
@@
void netg_init(void)
{
/* --- Initialise my symbol table --- */
{
/* --- Initialise my symbol table --- */
- sym_create
Table
(&netg__table);
+ sym_create(&netg__table);
/* --- Bind myself unto a YP server --- */
/* --- Bind myself unto a YP server --- */
@@
-584,7
+593,7
@@
void netg_init(void)
netg__cons *c;
netg__atom *a;
netg__cons *c;
netg__atom *a;
- for (sym_
createI
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; ) {
+ for (sym_
mki
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; ) {
for (c = sng->cons; c; c = c->cdr) {
if ((c->f & f_cons) == 0 && c->car.atom->n) {
a = c->car.atom;
for (c = sng->cons; c; c = c->cdr) {
if ((c->f & f_cons) == 0 && c->car.atom->n) {
a = c->car.atom;
@@
-609,9
+618,9
@@
void netg_init(void)
sym_iter i;
netg__sym *sng;
sym_iter i;
netg__sym *sng;
- for (sym_
createI
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; )
+ for (sym_
mki
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; )
sng->cons->f &= ~f_uncycled;
sng->cons->f &= ~f_uncycled;
- for (sym_
createI
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; )
+ for (sym_
mki
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; )
netg__breakCycle(sng->cons);
}
netg__breakCycle(sng->cons);
}
@@
-637,7
+646,7
@@
void netg_end(void)
/* --- Remove all the old netgroups rubbish --- */
/* --- Remove all the old netgroups rubbish --- */
- for (sym_
createI
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; ) {
+ for (sym_
mki
ter(&i, &netg__table); (sng = sym_next(&i)) != 0; ) {
c = sng->cons;
while (c) {
cc = c->cdr;
c = sng->cons;
while (c) {
cc = c->cdr;
@@
-654,7
+663,7
@@
void netg_end(void)
sym_remove(&netg__table, sng);
}
sym_remove(&netg__table, sng);
}
- sym_destroy
Table
(&netg__table);
+ sym_destroy(&netg__table);
}
/*----- Test driver -------------------------------------------------------*/
}
/*----- Test driver -------------------------------------------------------*/