~mdw
/
become
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(class__wildMatch) Fixed bug which overran pattern string, spotted by
[become]
/
src
/
userdb.c
diff --git
a/src/userdb.c
b/src/userdb.c
index
eb963d0
..
05ace82
100644
(file)
--- a/
src/userdb.c
+++ b/
src/userdb.c
@@
-1,10
+1,10
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: userdb.c,v 1.
5 1997/09/17 10:24:08
mdw Exp $
+ * $Id: userdb.c,v 1.
7 1998/04/23 13:27:46
mdw Exp $
*
* User database management
*
*
* User database management
*
- * (c) 199
7
EBI
+ * (c) 199
8
EBI
*/
/*----- Licensing notice --------------------------------------------------*
*/
/*----- Licensing notice --------------------------------------------------*
@@
-29,7
+29,13
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: userdb.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: userdb.c,v $
- * Revision 1.5 1997/09/17 10:24:08 mdw
+ * Revision 1.7 1998/04/23 13:27:46 mdw
+ * Switch to using the ypstuff interface to YP server.
+ *
+ * Revision 1.6 1998/01/12 16:46:33 mdw
+ * Fix copyright date.
+ *
+ * Revision 1.5 1997/09/17 10:24:08 mdw
* Use `uid_t' instead of `int' for uids and gids. Not quite sure why I
* didn't do this before.
*
* Use `uid_t' instead of `int' for uids and gids. Not quite sure why I
* didn't do this before.
*
@@
-65,12
+71,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 <grp.h>
#include <pwd.h>
#include <unistd.h>
#include <grp.h>
#include <pwd.h>
#include <unistd.h>
@@
-81,6
+81,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 --------------------------------------------------*/
@@
-680,12
+681,10
@@
static int userdb__foreachGroup(int st, char *k, int ksz,
void userdb_yp(void)
{
void userdb_yp(void)
{
- char *ypdom;
-
/* --- Bind to a server --- */
/* --- Bind to a server --- */
- if (yp_get_default_domain(&ypdom) ||
-
yp_bind(ypdom)
)
+ ypstuff_bind();
+
if (!yp_domain
)
return;
T( trace(TRACE_DEBUG, "debug: adding NIS users"); )
return;
T( trace(TRACE_DEBUG, "debug: adding NIS users"); )
@@
-694,17
+693,15
@@
void userdb_yp(void)
{
static struct ypall_callback ucb = { userdb__foreachUser, 0 };
{
static struct ypall_callback ucb = { userdb__foreachUser, 0 };
- yp_all(yp
dom
, "passwd.byuid", &ucb);
+ yp_all(yp
_domain
, "passwd.byuid", &ucb);
}
/* --- Fetch the groups map --- */
{
static struct ypall_callback gcb = { userdb__foreachGroup, 0 };
}
/* --- Fetch the groups map --- */
{
static struct ypall_callback gcb = { userdb__foreachGroup, 0 };
- yp_all(yp
dom
, "group.bygid", &gcb);
+ yp_all(yp
_domain
, "group.bygid", &gcb);
}
}
-
- yp_unbind(ypdom);
}
#else
}
#else
@@
-813,20
+810,21
@@
void dumpit(const char *msg)
int main(void)
{
ego("userdb-test");
int main(void)
{
ego("userdb-test");
-/* traceon(stdout, TRACE_ALL); */
+ traceon(stdout, TRACE_ALL);
userdb_init();
userdb_local();
userdb_yp();
userdb_init();
userdb_local();
userdb_yp();
- printf("loaded (%lu)\n", track_memused());
+ dumpit("spong");
+/* printf("loaded (%lu)\n", track_memused()); */
getchar();
for (;;) {
userdb_end();
getchar();
for (;;) {
userdb_end();
- printf("cleared (%lu)\n", track_memused());
+/* printf("cleared (%lu)\n", track_memused()); */
/* track_memlist(); */
userdb_init();
userdb_local();
userdb_yp();
/* track_memlist(); */
userdb_init();
userdb_local();
userdb_yp();
- printf("reloaded (%lu)\n", track_memused());
+/* printf("reloaded (%lu)\n", track_memused()); */
getchar();
}
return (0);
getchar();
}
return (0);