chiark
/
gitweb
/
~mdw
/
become
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in password and group file reading: strtok doesn't handle
[become]
/
src
/
netg.c
diff --git
a/src/netg.c
b/src/netg.c
index ab46385279274d257c8f64ad6a0d8f49bdf99ad6..c198219a6bf24f79ad6411d14f08f583e21aa214 100644
(file)
--- a/
src/netg.c
+++ b/
src/netg.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: netg.c,v 1.
3 1998/01/12 16:46:17
mdw Exp $
+ * $Id: netg.c,v 1.
4 1998/04/23 13:24:49
mdw Exp $
*
* A local database of netgroups
*
*
* A local database of netgroups
*
@@
-29,6
+29,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: netg.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: netg.c,v $
+ * Revision 1.4 1998/04/23 13:24:49 mdw
+ * Switch to using the ypstuff interface to YP server.
+ *
* Revision 1.3 1998/01/12 16:46:17 mdw
* Fix copyright date.
*
* Revision 1.3 1998/01/12 16:46:17 mdw
* Fix copyright date.
*
@@
-56,12
+59,6
@@
#include <sys/types.h>
#include <sys/types.h>
-#ifdef HAVE_YP
-# include <rpc/rpc.h>
-# include <rpcsvc/ypclnt.h>
-# include <rpcsvc/yp_prot.h>
-#endif
-
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@
-78,6
+75,7
@@
#include "sym.h"
#include "userdb.h"
#include "utils.h"
#include "sym.h"
#include "userdb.h"
#include "utils.h"
+#include "ypstuff.h"
/*----- Type definitions --------------------------------------------------*/
/*----- Type definitions --------------------------------------------------*/
@@
-557,29
+555,23
@@
static void netg__breakCycle(netg__cons *c)
void netg_init(void)
{
void netg_init(void)
{
- char *ypdom;
-
/* --- Initialise my symbol table --- */
sym_createTable(&netg__table);
/* --- Bind myself unto a YP server --- */
/* --- Initialise my symbol table --- */
sym_createTable(&netg__table);
/* --- Bind myself unto a YP server --- */
- if (yp_get_default_domain(&ypdom) ||
-
yp_bind(ypdom)
)
+ ypstuff_bind();
+
if (!yp_domain
)
return;
/* --- Now try to read all the netgroup entries --- */
{
static struct ypall_callback ncb = { netg__foreach, 0 };
return;
/* --- Now try to read all the netgroup entries --- */
{
static struct ypall_callback ncb = { netg__foreach, 0 };
- yp_all(yp
dom
, "netgroup", &ncb);
+ yp_all(yp
_domain
, "netgroup", &ncb);
}
}
- /* --- Unbind from the server --- */
-
- yp_unbind(ypdom);
-
/* --- Dump the table --- */
IF_TRACING(TRACE_DEBUG, netg__dump(); )
/* --- Dump the table --- */
IF_TRACING(TRACE_DEBUG, netg__dump(); )