mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
ptserver: Remove PR_REMEMBER_TIMES
The #define PR_REMEMBER_TIMES is always true, so remove the #define, and all of the #ifdefs that it triggers Change-Id: I445a2cd8f5e5b2570e6ef1311cc6bb3d66592fdc Reviewed-on: http://gerrit.openafs.org/7264 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
parent
5c9be9a2f8
commit
25a5c423a0
@ -16,8 +16,6 @@
|
||||
#include "ptserver.h"
|
||||
#include "display.h"
|
||||
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
|
||||
static char *
|
||||
pr_TimeToString(time_t clock)
|
||||
{
|
||||
@ -39,7 +37,6 @@ pr_TimeToString(time_t clock)
|
||||
strftime(buffer, 32, "%m/%d %H:%M:%S", tm);
|
||||
return buffer;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define host(a) (hostOrder ? (a) : ntohl(a))
|
||||
|
||||
@ -89,13 +86,11 @@ pr_PrintEntry(FILE *f, int hostOrder, afs_int32 ea, struct prentry *e, int inden
|
||||
fprintf(f, "%*s", indent, "");
|
||||
fprintf(f, "Entry at %d: flags 0x%x, id %di, next %d.\n", ea,
|
||||
host(e->flags), host(e->id), host(e->next));
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
fprintf(f, "%*s", indent, "");
|
||||
fprintf(f, "c:%s ", pr_TimeToString(host(e->createTime)));
|
||||
fprintf(f, "a:%s ", pr_TimeToString(host(e->addTime)));
|
||||
fprintf(f, "r:%s ", pr_TimeToString(host(e->removeTime)));
|
||||
fprintf(f, "n:%s\n", pr_TimeToString(host(e->changeTime)));
|
||||
#endif
|
||||
if (host(e->flags) & PRCONT)
|
||||
PrintEntries(f, hostOrder, indent, e, COSIZE);
|
||||
else { /* regular entry */
|
||||
|
@ -89,19 +89,13 @@ extern struct prheader cheader;
|
||||
#define PRP_GROUP_DEFAULT (PRP_STATUS_ANY | PRP_MEMBER_ANY)
|
||||
#define PRP_USER_DEFAULT (PRP_STATUS_ANY)
|
||||
|
||||
#define PR_REMEMBER_TIMES 1
|
||||
|
||||
struct prentry {
|
||||
afs_int32 flags; /* random flags */
|
||||
afs_int32 id; /* user or group id */
|
||||
afs_int32 cellid; /* A foreign users's repsenting group */
|
||||
afs_int32 next; /* next block same entry (or freelist) */
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
afs_uint32 createTime, addTime, removeTime, changeTime;
|
||||
afs_int32 reserved[1];
|
||||
#else
|
||||
afs_int32 reserved[5];
|
||||
#endif
|
||||
afs_int32 entries[PRSIZE]; /* groups a user is a member of (or list of members */
|
||||
afs_int32 nextID; /* id hash table next pointer */
|
||||
afs_int32 nextName; /* name has table next ptr */
|
||||
@ -128,12 +122,8 @@ struct prentryg {
|
||||
afs_int32 id; /* user or group id */
|
||||
afs_int32 cellid; /* reserved for cellID */
|
||||
afs_int32 next; /* next block same entry (or freelist) */
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
afs_uint32 createTime, addTime, removeTime, changeTime;
|
||||
afs_int32 reserved[1];
|
||||
#else
|
||||
afs_int32 reserved[5];
|
||||
#endif
|
||||
afs_int32 entries[PRSIZE]; /* groups a user is a member of (or list of members */
|
||||
afs_int32 nextID; /* id hash table next pointer */
|
||||
afs_int32 nextName; /* name has table next ptr */
|
||||
|
@ -353,9 +353,7 @@ CreateEntry(struct ubik_trans *at, char aname[PR_MAXNAMELEN], afs_int32 *aid, af
|
||||
newEntry = AllocBlock(at);
|
||||
if (!newEntry)
|
||||
return PRDBFAIL;
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
tentry.createTime = time(0);
|
||||
#endif
|
||||
|
||||
if (flag & PRGRP) {
|
||||
tentry.flags = PRGRP;
|
||||
@ -608,9 +606,7 @@ RemoveFromEntry(struct ubik_trans *at, afs_int32 aid, afs_int32 bid)
|
||||
code = pr_ReadEntry(at, 0, temp, &tentry);
|
||||
if (code != 0)
|
||||
return code;
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
tentry.removeTime = time(0);
|
||||
#endif
|
||||
for (i = 0; i < PRSIZE; i++) {
|
||||
if (tentry.entries[i] == aid) {
|
||||
tentry.entries[i] = PRBADID;
|
||||
@ -766,9 +762,7 @@ RemoveFromSGEntry(struct ubik_trans *at, afs_int32 aid, afs_int32 bid)
|
||||
code = pr_ReadEntry(at, 0, temp, &tentry);
|
||||
if (code != 0)
|
||||
return code;
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
tentry.removeTime = time(NULL);
|
||||
#endif
|
||||
tentryg = (struct prentryg *)&tentry;
|
||||
for (i = 0; i < SGSIZE; i++) {
|
||||
if (tentryg->supergroup[i] == aid) {
|
||||
@ -1007,9 +1001,7 @@ AddToEntry(struct ubik_trans *tt, struct prentry *entry, afs_int32 loc, afs_int3
|
||||
|
||||
if (entry->id == aid)
|
||||
return PRINCONSISTENT;
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
entry->addTime = time(0);
|
||||
#endif
|
||||
for (i = 0; i < PRSIZE; i++) {
|
||||
if (entry->entries[i] == aid)
|
||||
return PRIDEXIST;
|
||||
@ -1121,9 +1113,7 @@ AddToSGEntry(struct ubik_trans *tt, struct prentry *entry, afs_int32 loc, afs_in
|
||||
|
||||
if (entry->id == aid)
|
||||
return PRINCONSISTENT;
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
entry->addTime = time(NULL);
|
||||
#endif
|
||||
entryg = (struct prentryg *)entry;
|
||||
for (i = 0; i < SGSIZE; i++) {
|
||||
if (entryg->supergroup[i] == aid)
|
||||
@ -1898,9 +1888,7 @@ ChangeEntry(struct ubik_trans *at, afs_int32 aid, afs_int32 cid, char *name, afs
|
||||
if (tentry.owner != cid && !IsAMemberOf(at, cid, SYSADMINID)
|
||||
&& !IsAMemberOf(at, cid, tentry.owner) && !pr_noAuth)
|
||||
return PRPERM;
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
tentry.changeTime = time(0);
|
||||
#endif
|
||||
|
||||
/* we're actually trying to change the id */
|
||||
if (newid && (newid != aid)) {
|
||||
|
@ -100,12 +100,10 @@ pr_WriteEntry(struct ubik_trans *tt, afs_int32 afd, afs_int32 pos, struct prentr
|
||||
nentry.sibling = htonl(tentry->sibling);
|
||||
nentry.child = htonl(tentry->child);
|
||||
strncpy(nentry.name, tentry->name, PR_MAXNAMELEN);
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
nentry.createTime = htonl(tentry->createTime);
|
||||
nentry.addTime = htonl(tentry->addTime);
|
||||
nentry.removeTime = htonl(tentry->removeTime);
|
||||
nentry.changeTime = htonl(tentry->changeTime);
|
||||
#endif
|
||||
for (i = 0; i < PRSIZE; i++)
|
||||
nentry.entries[i] = htonl(tentry->entries[i]);
|
||||
tentry = &nentry;
|
||||
@ -149,12 +147,10 @@ pr_ReadEntry(struct ubik_trans *tt, afs_int32 afd, afs_int32 pos, struct prentry
|
||||
tentry->sibling = ntohl(nentry.sibling);
|
||||
tentry->child = ntohl(nentry.child);
|
||||
strncpy(tentry->name, nentry.name, PR_MAXNAMELEN);
|
||||
#ifdef PR_REMEMBER_TIMES
|
||||
tentry->createTime = ntohl(nentry.createTime);
|
||||
tentry->addTime = ntohl(nentry.addTime);
|
||||
tentry->removeTime = ntohl(nentry.removeTime);
|
||||
tentry->changeTime = ntohl(nentry.changeTime);
|
||||
#endif
|
||||
for (i = 0; i < PRSIZE; i++)
|
||||
tentry->entries[i] = ntohl(nentry.entries[i]);
|
||||
return (code);
|
||||
|
Loading…
Reference in New Issue
Block a user