ptserver-prototypes-20090316
[openafs.git] / src / ptserver / ptutils.c
index 61e07e9..27c8476 100644 (file)
@@ -42,6 +42,7 @@ RCSID
 #include <afs/cellconfig.h>
 #include "ptserver.h"
 #include "pterror.h"
+#include "ptprototypes.h"
 #include <stdlib.h>
 
 /* Foreign cells are represented by the group system:authuser@cell*/
@@ -51,9 +52,11 @@ extern int restricted;
 extern struct ubik_dbase *dbase;
 extern struct afsconf_dir *prdir;
 extern int pr_noAuth;
-extern int IDCmp();
 
-extern afs_int32 AddToEntry();
+static int inRange(struct prentry *cellEntry, afs_int32 aid);
+static afs_int32 allocNextId(struct ubik_trans *, struct prentry *);
+static int AddAuthGroup(struct prentry *tentry, prlist *alist, afs_int32 *size);
+
 static char *whoami = "ptserver";
 
 int prp_user_default = PRP_USER_DEFAULT;
@@ -64,10 +67,8 @@ int prp_group_default = PRP_GROUP_DEFAULT;
 #include "map.h"
 
 afs_int32 depthsg = 5;         /* Maximum iterations used during IsAMemberOF */
-extern int IDCmp();
 afs_int32 GetListSG2(struct ubik_trans *at, afs_int32 gid, prlist * alist,
                     afs_int32 * sizeP, afs_int32 depth);
-afs_int32 allocNextId(struct ubik_trans *, struct prentry *);
 
 struct map *sg_flagged;
 struct map *sg_found;
@@ -1713,7 +1714,7 @@ int pr_noAuth;
 afs_int32 initd = 0;
 
 afs_int32
-Initdb()
+Initdb(void)
 {
     afs_int32 code;
     struct ubik_trans *tt;
@@ -2045,7 +2046,7 @@ ChangeEntry(struct ubik_trans *at, afs_int32 aid, afs_int32 cid, char *name, afs
        tentry.owner = oid;
        /* The entry must be written through first so Remove and Add routines
         * can operate on disk data */
-       code = pr_WriteEntry(at, 0, loc, (char *)&tentry);
+       code = pr_WriteEntry(at, 0, loc, &tentry);
        if (code)
            return PRDBFAIL;
 
@@ -2112,7 +2113,7 @@ ChangeEntry(struct ubik_trans *at, afs_int32 aid, afs_int32 cid, char *name, afs
        if (code != PRSUCCESS)
            return code;
        strncpy(tentry.name, name, PR_MAXNAMELEN);
-       code = pr_WriteEntry(at, 0, loc, (char *)&tentry);
+       code = pr_WriteEntry(at, 0, loc, &tentry);
        if (code)
            return PRDBFAIL;
        code = AddToNameHash(at, tentry.name, loc);
@@ -2124,7 +2125,7 @@ ChangeEntry(struct ubik_trans *at, afs_int32 aid, afs_int32 cid, char *name, afs
 }
 
 
-afs_int32
+static afs_int32
 allocNextId(struct ubik_trans * at, struct prentry * cellEntry)
 {
     /* Id's for foreign cell entries are constructed as follows:
@@ -2155,7 +2156,7 @@ allocNextId(struct ubik_trans * at, struct prentry * cellEntry)
     return id;
 }
 
-int
+static int
 inRange(struct prentry *cellEntry, afs_int32 aid)
 {
     afs_uint32 id, cellid, groupid;
@@ -2186,7 +2187,7 @@ inRange(struct prentry *cellEntry, afs_int32 aid)
 
 }
 
-int
+static int
 AddAuthGroup(struct prentry *tentry, prlist *alist, afs_int32 *size)
 {
     if (!(strchr(tentry->name, '@')))