From 5caf637d0b24ff30c2c88c5b804c479d99fbcf83 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Sat, 11 May 2002 00:04:10 +0000 Subject: [PATCH] This commit was generated by cvs2svn to compensate for changes in r467, which included commits to RCS files with non-trunk default branches. --- src/afsweb/Makefile.in | 5 + src/bozo/bosserver.c | 7 +- src/bubasics/butc.xg | 2 +- src/budb/server.c | 7 +- src/config/param.alpha_dux50.h | 6 + src/config/param.ppc_darwin_14.h | 1 + src/dir/buffer.c | 7 +- src/fsprobe/fsprobe_callback.c | 4 +- src/kauth/client.c | 6 +- src/kauth/kaprocs.c | 38 +-- src/kauth/kaserver.c | 7 +- src/kauth/kauth.rg | 5 +- src/libadmin/bos/afs_bosAdmin.c | 6 +- src/libadmin/pts/afs_ptsAdmin.c | 520 ++++++++++++++++++++++++++++++- src/libadmin/pts/afs_ptsAdmin.h | 34 ++ src/pam/Makefile.in | 2 - src/ptserver/ptint.xg | 1 + src/ptserver/ptprocs.c | 53 ++-- src/rx/SOLARIS/rx_knet.c | 19 +- src/rx/rx_event.c | 4 +- src/rx/rx_kcommon.c | 24 +- src/rxkad/.cvsignore | 1 + src/rxkad/Makefile.in | 19 +- src/rxkad/rxkad_common.c | 4 +- src/tests/Makefile.in | 8 +- src/tests/boslistkeys.pl | 4 +- src/tests/build-openafs | 4 +- src/tests/fs_lib.c | 58 ++-- src/tests/fsx.c | 13 +- src/tests/make-page.c | 2 +- src/tests/run-suite.pl | 56 +++- src/tests/run-tests.in | 6 +- src/tests/write-rand.c | 4 +- src/ubik/ubik.p.h | 12 - src/ubik/ubik_int.xg | 56 ++-- src/ubik/utst_server.c | 22 +- src/venus/.cvsignore | 1 + src/vfsck/pass1.c | 22 +- src/viced/callback.c | 3 +- src/viced/host.c | 63 ++-- src/viced/physio.c | 14 +- src/vlserver/vldbint.xg | 1 + src/vlserver/vlprocs.c | 60 ++-- src/vlserver/vlserver.c | 5 +- src/vol/ihandle.c | 35 ++- src/vol/vol-salvage.c | 3 +- src/xstat/xstat_fs_callback.c | 4 +- 47 files changed, 945 insertions(+), 293 deletions(-) diff --git a/src/afsweb/Makefile.in b/src/afsweb/Makefile.in index 494806c94..d6936dafc 100644 --- a/src/afsweb/Makefile.in +++ b/src/afsweb/Makefile.in @@ -130,6 +130,11 @@ system apache_afs_web_secure: chmod a+w ${DEST}/root.afsweb/install/${APACHE_INSTALL_SCRIPT} ${INSTALL} $(BINARIES) ${DEST}/root.afsweb/bin +netscape_afs_web_secure: + ${INSTALL} ${NETSCAPE_INSTALL_SCRIPT} ${DEST}/root.afsweb/install + chmod a+x ${DEST}/root.afsweb/install/${NETSCAPE_INSTALL_SCRIPT} + chmod a+w ${DEST}/root.afsweb/install/${NETSCAPE_INSTALL_SCRIPT} + all: kinstall ukinstall install: diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 1e0ae548d..c20b028a6 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.11 2002/01/22 19:52:32 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosserver.c,v 1.1.1.12 2002/05/10 23:57:25 hartmans Exp $"); #include #include @@ -910,9 +910,8 @@ char **envp; bozo_rxsc[2] = (struct rx_securityClass *) rxkad_NewServerSecurityObject( 0, tdir, afsconf_GetKey, (char *) 0); - /* These two lines disallow jumbograms */ - rx_maxReceiveSize = OLD_MAX_PACKET_SIZE; - rxi_nSendFrags = rxi_nRecvFrags = 1; + /* Disable jumbograms */ + rx_SetNoJumbo(); tservice = rx_NewService(/* port */ 0, /* service id */ 1, /*service name */ "bozo", /* security classes */ bozo_rxsc, diff --git a/src/bubasics/butc.xg b/src/bubasics/butc.xg index f7982026d..d5c54ec2d 100644 --- a/src/bubasics/butc.xg +++ b/src/bubasics/butc.xg @@ -253,7 +253,7 @@ proc ScanStatus ); proc DeleteDump - ( IN afs_uint32 dumpId, + ( IN afs_uint32 aDumpId, OUT afs_uint32 *taskId ); diff --git a/src/budb/server.c b/src/budb/server.c index 2c4501d67..181fc2b5e 100644 --- a/src/budb/server.c +++ b/src/budb/server.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.7 2001/10/14 18:04:15 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/budb/server.c,v 1.1.1.8 2002/05/10 23:57:52 hartmans Exp $"); #ifdef AFS_NT40_ENV #include @@ -472,9 +472,8 @@ main(argc, argv) afsconf_GetKey, (char *) 0); - /* These two lines disallow jumbograms */ - rx_maxReceiveSize = OLD_MAX_PACKET_SIZE; - rxi_nSendFrags = rxi_nRecvFrags = 1; + /* Disable jumbograms */ + rx_SetNoJumbo(); tservice = rx_NewService(0, BUDB_SERVICE, "BackupDatabase", sca, 3, BUDB_ExecuteRequest); diff --git a/src/config/param.alpha_dux50.h b/src/config/param.alpha_dux50.h index 651fadbdf..c44909593 100644 --- a/src/config/param.alpha_dux50.h +++ b/src/config/param.alpha_dux50.h @@ -44,7 +44,13 @@ #define AFS_HAVE_STATVFS 1 /* System supports statvfs */ #define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */ + +#ifdef AFS_NAMEI_ENV +#define AFS_64BIT_IOPS_ENV 1 /* needed for NAMEI... */ +#else #define AFS_3DISPARES 1 /* Utilize the 3 available disk inode spares */ +#endif + #define AFS_USE_GETTIMEOFDAY 1 /* use gettimeofday to implement rx clock */ #if !defined(ASSEMBLER) && !defined(__LANGUAGE_ASSEMBLY__) diff --git a/src/config/param.ppc_darwin_14.h b/src/config/param.ppc_darwin_14.h index aff945749..8a6ed1779 100644 --- a/src/config/param.ppc_darwin_14.h +++ b/src/config/param.ppc_darwin_14.h @@ -13,6 +13,7 @@ #define AFS_DARWIN14_ENV #define AFS_NONFSTRANS #define AFS_SYSCALL 230 +#define AFS_NAMEI_ENV 1 /* File system entry (used if mount.h doesn't define MOUNT_AFS */ #define AFS_MOUNT_AFS "afs" diff --git a/src/dir/buffer.c b/src/dir/buffer.c index 80e187856..1ad93832c 100644 --- a/src/dir/buffer.c +++ b/src/dir/buffer.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/dir/buffer.c,v 1.1.1.7 2001/10/14 18:04:51 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/dir/buffer.c,v 1.1.1.8 2002/05/10 23:58:41 hartmans Exp $"); #include #include @@ -394,10 +394,7 @@ char *DNew (fid,page) */ register struct buffer *tb; ObtainWriteLock(&afs_bufferLock); - if ((tb = newslot(fid,page,0)) == 0) { - ReleaseWriteLock(&afs_bufferLock); - return 0; - } + tb = newslot(fid,page,0); ObtainWriteLock(&tb->lock); ReleaseWriteLock(&afs_bufferLock); tb->lockers++; diff --git a/src/fsprobe/fsprobe_callback.c b/src/fsprobe/fsprobe_callback.c index 99f195a00..4230c3b81 100644 --- a/src/fsprobe/fsprobe_callback.c +++ b/src/fsprobe/fsprobe_callback.c @@ -24,7 +24,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/fsprobe/fsprobe_callback.c,v 1.1.1.4 2001/07/14 22:21:56 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/fsprobe/fsprobe_callback.c,v 1.1.1.5 2002/05/10 23:58:47 hartmans Exp $"); #include #include /*Standard I/O stuff*/ @@ -641,7 +641,7 @@ int SRXAFSCB_GetCellServDB( struct rx_call *a_call, afs_int32 a_index, char **a_name, - afs_int32 *a_hosts) + serverList *a_hosts) { return RXGEN_OPCODE; } diff --git a/src/kauth/client.c b/src/kauth/client.c index 6bc68eb23..936e1027b 100644 --- a/src/kauth/client.c +++ b/src/kauth/client.c @@ -14,7 +14,7 @@ #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.8 2001/10/14 18:05:03 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.9 2002/05/10 23:59:01 hartmans Exp $"); #if defined(UKERNEL) #include "../afs/sysincludes.h" @@ -44,6 +44,10 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/client.c,v 1.1.1.8 2001/10/14 18: #include #endif #endif +#ifdef HAVE_UNISTD_H +#define __USE_XOPEN +#include +#endif #include #include #include diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index 1434f5614..ffd91a67a 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaprocs.c,v 1.1.1.9 2001/10/14 18:05:06 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaprocs.c,v 1.1.1.10 2002/05/10 23:59:04 hartmans Exp $"); #include #include @@ -542,7 +542,7 @@ static int create_user (tt, name, instance, key, caller, flags) /* Put actual stub routines here */ -afs_int32 KAM_CreateUser (call, aname, ainstance, ainitpw) +afs_int32 SKAM_CreateUser (call, aname, ainstance, ainitpw) struct rx_call *call; char *aname; char *ainstance; @@ -587,7 +587,7 @@ afs_int32 kamCreateUser (call, aname, ainstance, ainitpw) return code; } -afs_int32 KAA_ChangePassword (call, aname, ainstance, arequest, oanswer) +afs_int32 SKAA_ChangePassword (call, aname, ainstance, arequest, oanswer) struct rx_call *call; char *aname; char *ainstance; @@ -802,7 +802,7 @@ set_password (tt, name, instance, password, kvno, caller) return(0); } -afs_int32 KAM_SetPassword (call, aname, ainstance, akvno, apassword) +afs_int32 SKAM_SetPassword (call, aname, ainstance, akvno, apassword) struct rx_call *call; char *aname; char *ainstance; @@ -1180,7 +1180,7 @@ abort: return code; } -afs_int32 KAA_Authenticate_old (call, aname, ainstance, start, end, +afs_int32 SKAA_Authenticate_old (call, aname, ainstance, start, end, arequest, oanswer) struct rx_call *call; char *aname; @@ -1199,7 +1199,7 @@ afs_int32 KAA_Authenticate_old (call, aname, ainstance, start, end, return code; } -afs_int32 KAA_Authenticate (call, aname, ainstance, start, end, arequest, oanswer) +afs_int32 SKAA_Authenticate (call, aname, ainstance, start, end, arequest, oanswer) struct rx_call *call; char *aname; char *ainstance; @@ -1216,7 +1216,7 @@ afs_int32 KAA_Authenticate (call, aname, ainstance, start, end, arequest, oanswe return code; } -afs_int32 KAA_AuthenticateV2 (call, aname, ainstance, start, end, arequest, oanswer) +afs_int32 SKAA_AuthenticateV2 (call, aname, ainstance, start, end, arequest, oanswer) struct rx_call *call; char *aname; char *ainstance; @@ -1233,7 +1233,7 @@ afs_int32 KAA_AuthenticateV2 (call, aname, ainstance, start, end, arequest, oans return code; } -afs_int32 KAM_SetFields (call, aname, ainstance, aflags, +afs_int32 SKAM_SetFields (call, aname, ainstance, aflags, aexpiration, alifetime, amaxAssociates, misc_auth_bytes, spare2) struct rx_call *call; char *aname; @@ -1387,7 +1387,7 @@ abort: /* delete a user */ -afs_int32 KAM_DeleteUser(call, aname, ainstance) +afs_int32 SKAM_DeleteUser(call, aname, ainstance) struct rx_call *call; char *aname; char *ainstance; @@ -1457,7 +1457,7 @@ afs_int32 kamDeleteUser(call, aname, ainstance) * report that the ID is not locked, or else to find out when the ID * will be unlocked. */ -afs_int32 KAM_GetEntry (call, aname, ainstance, aversion, aentry) +afs_int32 SKAM_GetEntry (call, aname, ainstance, aversion, aentry) struct rx_call *call; char *aname; char *ainstance; @@ -1579,7 +1579,7 @@ abort: return code; } -afs_int32 KAM_ListEntry (call, previous_index, index, count, name) +afs_int32 SKAM_ListEntry (call, previous_index, index, count, name) struct rx_call *call; afs_int32 previous_index; /* last entry ret'd or 0 for first */ afs_int32 *index; /* index of this entry */ @@ -1812,7 +1812,7 @@ abort: return code; } -afs_int32 KAT_GetTicket_old (call, kvno, authDomain, aticket, +afs_int32 SKAT_GetTicket_old (call, kvno, authDomain, aticket, sname, sinstance, atimes, oanswer) struct rx_call *call; afs_int32 kvno; @@ -1833,7 +1833,7 @@ int code; return code; } -afs_int32 KAT_GetTicket (call, kvno, authDomain, aticket, +afs_int32 SKAT_GetTicket (call, kvno, authDomain, aticket, sname, sinstance, atimes, oanswer) struct rx_call *call; afs_int32 kvno; @@ -1852,7 +1852,7 @@ int code; return code; } -afs_int32 KAM_GetStats (call, version, admin_accounts, statics, dynamics) +afs_int32 SKAM_GetStats (call, version, admin_accounts, statics, dynamics) struct rx_call *call; afs_int32 version; afs_int32 *admin_accounts; @@ -1935,7 +1935,7 @@ afs_int32 kamGetStats (call, version, admin_accounts, statics, dynamics) return code; } -afs_int32 KAM_GetPassword (call, name, password) +afs_int32 SKAM_GetPassword (call, name, password) struct rx_call *call; char *name; EncryptionKey *password; @@ -1993,7 +1993,7 @@ afs_int32 kamGetPassword (call, name, password) return code; } -afs_int32 KAM_GetRandomKey (call, key) +afs_int32 SKAM_GetRandomKey (call, key) struct rx_call *call; EncryptionKey *key; { @@ -2016,7 +2016,7 @@ afs_int32 kamGetRandomKey (call, key) return 0; } -afs_int32 KAM_Debug (call, version, checkDB, info) +afs_int32 SKAM_Debug (call, version, checkDB, info) struct rx_call *call; afs_int32 version; int checkDB; /* start a transaction to examine DB */ @@ -2091,7 +2091,7 @@ afs_int32 kamDebug (call, version, checkDB, info) * prob'ly ought to check the noauth flag. */ #define ABORTIF(A) {if(code= A){goto abort;}} -afs_int32 KAM_Unlock (call, aname, ainstance, spare1, spare2, spare3, spare4) +afs_int32 SKAM_Unlock (call, aname, ainstance, spare1, spare2, spare3, spare4) struct rx_call *call; char *aname; char *ainstance; @@ -2130,7 +2130,7 @@ exit: return code; } -afs_int32 KAM_LockStatus (call, aname, ainstance, lockeduntil, spare1, spare2, spare3, spare4) +afs_int32 SKAM_LockStatus (call, aname, ainstance, lockeduntil, spare1, spare2, spare3, spare4) struct rx_call *call; char *aname; char *ainstance; diff --git a/src/kauth/kaserver.c b/src/kauth/kaserver.c index d5416cc0f..00b12a577 100644 --- a/src/kauth/kaserver.c +++ b/src/kauth/kaserver.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaserver.c,v 1.1.1.9 2001/10/14 18:05:07 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/kauth/kaserver.c,v 1.1.1.10 2002/05/10 23:59:05 hartmans Exp $"); #include #include @@ -335,9 +335,8 @@ main (argc, argv) sca[RX_SCINDEX_NULL] = rxnull_NewServerSecurityObject(); - /* These two lines disallow jumbograms */ - rx_maxReceiveSize = OLD_MAX_PACKET_SIZE; - rxi_nSendFrags = rxi_nRecvFrags = 1; + /* Disable jumbograms */ + rx_SetNoJumbo(); tservice = rx_NewService (0, KA_AUTHENTICATION_SERVICE, "AuthenticationService", diff --git a/src/kauth/kauth.rg b/src/kauth/kauth.rg index 6373c6374..640af4cc7 100644 --- a/src/kauth/kauth.rg +++ b/src/kauth/kauth.rg @@ -221,6 +221,7 @@ struct ka_debugInfo { /* finally the procedural definitions */ package KAA_ +prefix S statindex 18 proc Authenticate_old( @@ -258,6 +259,7 @@ proc ChangePassword( ) = 2; package KAT_ +prefix S statindex 19 proc GetTicket_old( @@ -281,6 +283,7 @@ proc GetTicket( ) = 23; package KAM_ +prefix S statindex 20 proc SetPassword( @@ -297,7 +300,7 @@ proc SetFields( IN Date user_expiration, IN afs_int32 max_ticket_lifetime, IN afs_int32 maxAssociates, - IN afs_int32 spare1, + IN afs_uint32 misc_auth_bytes, IN afs_int32 spare2 ) = 5; diff --git a/src/libadmin/bos/afs_bosAdmin.c b/src/libadmin/bos/afs_bosAdmin.c index dd33f4151..36eaad146 100644 --- a/src/libadmin/bos/afs_bosAdmin.c +++ b/src/libadmin/bos/afs_bosAdmin.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/bos/afs_bosAdmin.c,v 1.1.1.7 2001/09/11 14:33:08 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/bos/afs_bosAdmin.c,v 1.1.1.8 2002/05/10 23:59:18 hartmans Exp $"); #include #include @@ -64,8 +64,8 @@ extern int BOZO_RestartAll(); extern int BOZO_SetCellName(); extern int BOZO_SetNoAuthFlag(); extern int BOZO_SetRestartTime(); -extern int BOZO_SetStatus(struct rx_connection *, const char *, long); -extern int BOZO_SetTStatus(struct rx_connection *, const char *, long); +extern int BOZO_SetStatus(struct rx_connection *, char *, afs_int32); +extern int BOZO_SetTStatus(struct rx_connection *, char *, afs_int32); extern int BOZO_ShutdownAll(); extern int BOZO_StartupAll(); extern int BOZO_UnInstall(); diff --git a/src/libadmin/pts/afs_ptsAdmin.c b/src/libadmin/pts/afs_ptsAdmin.c index 54b6c76e0..3728f235e 100644 --- a/src/libadmin/pts/afs_ptsAdmin.c +++ b/src/libadmin/pts/afs_ptsAdmin.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/pts/afs_ptsAdmin.c,v 1.1.1.4 2001/07/14 22:22:33 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/libadmin/pts/afs_ptsAdmin.c,v 1.1.1.5 2002/05/10 23:59:34 hartmans Exp $"); #include #include @@ -40,6 +40,7 @@ extern int PR_SetFieldsEntry(); extern int PR_IsAMemberOf(); extern int PR_ListMax(); extern int PR_ListOwned(); +extern int PR_ListEntries(); /* * IsValidCellHandle - validate the cell handle for making pts @@ -2938,3 +2939,520 @@ fail_pts_OwnedGroupListDone: } return rc; } + +typedef struct pts_list { + prlistentries *names; /* the current list of pts names in this cell */ + prlistentries *currName; /* the current pts entry */ + afs_int32 index; /* the index into names for the next pts entry */ + afs_int32 nextstartindex; /* the next start index for the RPC */ + afs_int32 nentries; /* the number of entries in names */ + afs_int32 flag; /* the type of the list */ + int finished_retrieving; /* set when we've processed the last owned_names */ + afs_cell_handle_p c_handle; /* ubik client to pts server's from c_handle */ + char entries[CACHED_ITEMS][PTS_MAX_NAME_LEN]; /* cache of pts names */ +} pts_list_t, *pts_list_p; + +static int DeletePTSSpecificData( + void *rpc_specific, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + pts_list_p list = (pts_list_p) rpc_specific; + + if (list->names) { + free(list->names); + } + + rc = 1; + + if (st != NULL) { + *st = tst; + } + return rc; +} + +static int GetPTSRPC( + void *rpc_specific, + int slot, + int *last_item, + int *last_item_contains_data, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + pts_list_p list = (pts_list_p) rpc_specific; + + /* + * We really don't make an rpc for every entry we return here + * since the pts interface allows several members to be returned + * with one rpc, but we fake it to make the iterator happy. + */ + + /* + * Check to see if we are done retrieving data + */ + + if (list->finished_retrieving) { + *last_item = 1; + *last_item_contains_data = 0; + goto fail_GetPTSRPC; + } + + /* + * Check to see if we really need to make an rpc + */ + + if ((!list->finished_retrieving) && (list->index >= list->nentries) ) { + afs_int32 start = list->nextstartindex; + prentries bulkentries; + list->nextstartindex = -1; + bulkentries.prentries_val = 0; + bulkentries.prentries_len = 0; + + tst = ubik_Call(PR_ListEntries, list->c_handle->pts, 0, list->flag, start, + &bulkentries, &(list->nextstartindex) ); + + if (tst != 0) { + goto fail_GetPTSRPC; + } + + list->nentries = bulkentries.prentries_len; + list->names = bulkentries.prentries_val; + + list->index = 0; + list->currName = list->names; + + } + + /* + * We can retrieve the next entry from data we already received + */ + + strcpy(&list->entries[slot], list->currName->name); + list->index++; + list->currName++; + + + /* + * Check to see if there is more data to be retrieved + * We need to free up the previously retrieved data here + * and then check to see if the last rpc indicated that there + * were more items to retrieve. + */ + + if (list->index >= list->nentries) { + if( list->names ) { + free(list->names); + } + list->names = NULL; + + if (list->nextstartindex == -1) { + list->finished_retrieving = 1; + } + } + rc = 1; + +fail_GetPTSRPC: + + if (st != NULL) { + *st = tst; + } + + return rc; +} + +static int GetPTSFromCache( + void *rpc_specific, + int slot, + void *dest, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + pts_list_p list = (pts_list_p) rpc_specific; + + strcpy((char *) dest, &list->entries[slot]); + rc = 1; + + if (st != NULL) { + *st = tst; + } + + return rc; +} + +/* + * pts_UserListBegin - begin iterating over the list of users + * in a particular cell + * + * PARAMETERS + * + * IN cellHandle - a previously opened cellHandle that corresponds + * to the cell where the users exist. + * + * OUT iterationIdP - upon successful completion contains a iterator that + * can be passed to pts_UserListNext. + * + * LOCKS + * + * No locks are held by this function + * + * RETURN CODES + * + * Returns != 0 upon successful completion. + * + */ + +int ADMINAPI pts_UserListBegin( + const void *cellHandle, + void **iterationIdP, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle; + afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t)); + pts_list_p list = (pts_list_p) malloc(sizeof(pts_list_t)); + + /* + * Validate arguments + */ + + if (!IsValidCellHandle(c_handle, &tst)) { + goto fail_pts_UserListBegin; + } + + if (iterationIdP == NULL) { + tst = ADMITERATORNULL; + goto fail_pts_UserListBegin; + } + + if ((iter == NULL) || (list == NULL)) { + tst = ADMNOMEM; + goto fail_pts_UserListBegin; + } + + /* + * Initialize the iterator specific data + */ + + list->index = 0; + list->finished_retrieving = 0; + list->c_handle = c_handle; + list->names = NULL; + list->nextstartindex = 0; + list->nentries = 0; + list->flag = PRUSERS; + + if (IteratorInit(iter, (void *) list, GetPTSRPC, + GetPTSFromCache, NULL, + DeletePTSSpecificData, &tst)) { + *iterationIdP = (void *) iter; + rc = 1; + } + +fail_pts_UserListBegin: + + if (rc == 0) { + if (iter != NULL) { + free(iter); + } + if (list != NULL) { + free(list); + } + } + + if (st != NULL) { + *st = tst; + } + return rc; +} + +/* + * pts_UserListNext - get the next user in the cell. + * + * PARAMETERS + * + * IN iterationId - an iterator previously returned by pts_UserListBegin + * + * OUT groupName - upon successful completion contains the next user + * + * LOCKS + * + * The iterator mutex is held during the retrieval of the next member. + * + * RETURN CODES + * + * Returns != 0 upon successful completion. + * + */ + +int ADMINAPI pts_UserListNext( + const void *iterationId, + char *userName, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId; + + /* + * Validate arguments + */ + + if (iterationId == NULL) { + tst = ADMITERATORNULL; + goto fail_pts_UserListNext; + } + + if (userName == NULL) { + tst = ADMPTSUSERNAMENULL; + goto fail_pts_UserListNext; + } + + rc = IteratorNext(iter, (void *) userName, &tst); + +fail_pts_UserListNext: + + if (st != NULL) { + *st = tst; + } + return rc; +} + +/* + * pts_UserListDone - finish using a user list iterator + * + * PARAMETERS + * + * IN iterationId - an iterator previously returned by pts_UserListBegin + * + * LOCKS + * + * The iterator is locked and then destroyed + * + * RETURN CODES + * + * Returns != 0 upon successful completion. + * + * ASSUMPTIONS + * + * It is the user's responsibility to make sure pts_UserListDone + * is called only once for each iterator. + */ + +int ADMINAPI pts_UserListDone( + const void *iterationId, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId; + + /* + * Validate arguments + */ + + if (iterationId == NULL) { + tst = ADMITERATORNULL; + goto fail_pts_UserListDone; + } + + rc = IteratorDone(iter, &tst); + +fail_pts_UserListDone: + + if (st != NULL) { + *st = tst; + } + return rc; +} + +/* + * pts_GroupListBegin - begin iterating over the list of groups + * in a particular cell. + * + * PARAMETERS + * + * IN cellHandle - a previously opened cellHandle that corresponds + * to the cell where the groups exist. + * + * OUT iterationIdP - upon successful completion contains a iterator that + * can be passed to pts_GroupListNext. + * + * LOCKS + * + * No locks are held by this function + * + * RETURN CODES + * + * Returns != 0 upon successful completion. + * + */ + +int ADMINAPI pts_GroupListBegin( + const void *cellHandle, + void **iterationIdP, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle; + afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t)); + pts_list_p list = (pts_list_p) malloc(sizeof(pts_list_t)); + + /* + * Validate arguments + */ + + if (!IsValidCellHandle(c_handle, &tst)) { + goto fail_pts_GroupListBegin; + } + + if (iterationIdP == NULL) { + tst = ADMITERATORNULL; + goto fail_pts_GroupListBegin; + } + + if ((iter == NULL) || (list == NULL)) { + tst = ADMNOMEM; + goto fail_pts_GroupListBegin; + } + + /* + * Initialize the iterator specific data + */ + + list->index = 0; + list->finished_retrieving = 0; + list->c_handle = c_handle; + list->names = NULL; + list->nextstartindex = 0; + list->nentries = 0; + list->flag = PRGROUPS; + + if (IteratorInit(iter, (void *) list, GetPTSRPC, + GetPTSFromCache, NULL, + DeletePTSSpecificData, &tst)) { + *iterationIdP = (void *) iter; + rc = 1; + } + +fail_pts_GroupListBegin: + + if (rc == 0) { + if (iter != NULL) { + free(iter); + } + if (list != NULL) { + free(list); + } + } + + if (st != NULL) { + *st = tst; + } + return rc; +} + +/* + * pts_UserListNext - get the next group in a cell. + * + * PARAMETERS + * + * IN iterationId - an iterator previously returned by pts_GroupListBegin + * + * OUT groupName - upon successful completion contains the next group + * + * LOCKS + * + * The iterator mutex is held during the retrieval of the next member. + * + * RETURN CODES + * + * Returns != 0 upon successful completion. + * + */ + +int ADMINAPI pts_GroupListNext( + const void *iterationId, + char *groupName, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId; + + /* + * Validate arguments + */ + + if (iterationId == NULL) { + tst = ADMITERATORNULL; + goto fail_pts_GroupListNext; + } + + if (groupName == NULL) { + tst = ADMPTSGROUPNAMENULL; + goto fail_pts_GroupListNext; + } + + rc = IteratorNext(iter, (void *) groupName, &tst); + +fail_pts_GroupListNext: + + if (st != NULL) { + *st = tst; + } + return rc; +} + +/* + * pts_GroupListDone - finish using a group list iterator + * + * PARAMETERS + * + * IN iterationId - an iterator previously returned by pts_GroupListBegin + * + * LOCKS + * + * The iterator is locked and then destroyed + * + * RETURN CODES + * + * Returns != 0 upon successful completion. + * + * ASSUMPTIONS + * + * It is the user's responsibility to make sure pts_GroupListDone + * is called only once for each iterator. + */ + +int ADMINAPI pts_GroupListDone( + const void *iterationId, + afs_status_p st) +{ + int rc = 0; + afs_status_t tst = 0; + afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId; + + /* + * Validate arguments + */ + + if (iterationId == NULL) { + tst = ADMITERATORNULL; + goto fail_pts_GroupListDone; + } + + rc = IteratorDone(iter, &tst); + +fail_pts_GroupListDone: + + if (st != NULL) { + *st = tst; + } + return rc; +} + diff --git a/src/libadmin/pts/afs_ptsAdmin.h b/src/libadmin/pts/afs_ptsAdmin.h index d3a262488..bec524996 100644 --- a/src/libadmin/pts/afs_ptsAdmin.h +++ b/src/libadmin/pts/afs_ptsAdmin.h @@ -245,4 +245,38 @@ extern int ADMINAPI pts_OwnedGroupListDone( afs_status_p st ); +extern int ADMINAPI pts_UserListBegin( + const void *cellHandle, + void **iterationIdP, + afs_status_p st +); + +extern int ADMINAPI pts_UserListNext( + const void *iterationId, + char *userName, + afs_status_p st +); + +extern int ADMINAPI pts_UserListDone( + const void *iterationId, + afs_status_p st +); + +extern int ADMINAPI pts_GroupListBegin( + const void *cellHandle, + void **iterationIdP, + afs_status_p st +); + +extern int ADMINAPI pts_GroupListNext( + const void *iterationId, + char *groupName, + afs_status_p st +); + +extern int ADMINAPI pts_GroupListDone( + const void *iterationId, + afs_status_p st +); + #endif /* TRANSARC_AFS_PTS_ADMIN_H */ diff --git a/src/pam/Makefile.in b/src/pam/Makefile.in index 929115c58..f840d9d4d 100644 --- a/src/pam/Makefile.in +++ b/src/pam/Makefile.in @@ -112,10 +112,8 @@ ${DEST}/lib/pam_afs.so.1: pam_afs.so.1 ${DEST}/lib/pam_afs.krb.so.1: pam_afs.krb.so.1 ${INSTALL} $? $@ -afs_auth.o: afs_auth.c afs_pam_msg.h afs_message.h afs_util.h afs_pam_msg.o: afs_pam_msg.c afs_pam_msg.h afs_message.h afs_message.o: afs_message.c afs_message.h -afs_util.o: afs_util.c afs_util.h # # Misc. targets diff --git a/src/ptserver/ptint.xg b/src/ptserver/ptint.xg index 88702f95b..4f453ee8c 100644 --- a/src/ptserver/ptint.xg +++ b/src/ptserver/ptint.xg @@ -8,6 +8,7 @@ */ package PR_ +prefix S statindex 8 #include "ptopcodes.h" diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index 398f5d5c7..9132a33c5 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.8 2001/10/14 18:06:11 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/ptserver/ptprocs.c,v 1.1.1.9 2002/05/11 00:00:47 hartmans Exp $"); #include #include @@ -161,7 +161,7 @@ afs_int32 WhoIsThis (acall, at, aid) return 0; } -afs_int32 PR_INewEntry (call,aname,aid,oid) +afs_int32 SPR_INewEntry (call,aname,aid,oid) struct rx_call *call; char aname[PR_MAXNAMELEN]; afs_int32 aid; @@ -225,7 +225,7 @@ afs_int32 iNewEntry (call,aname,aid,oid) } -afs_int32 PR_NewEntry (call, aname, flag, oid, aid) +afs_int32 SPR_NewEntry (call, aname, flag, oid, aid) struct rx_call *call; char aname[PR_MAXNAMELEN]; afs_int32 flag; @@ -263,7 +263,7 @@ afs_int32 newEntry (call, aname, flag, oid, aid) if (code) ABORT_WITH(tt,code); /* this is for cross-cell self registration. It is not added in the - * PR_INewEntry because we want self-registration to only do + * SPR_INewEntry because we want self-registration to only do * automatic id assignment. */ code = WhoIsThisWithName(call,tt,&cid,cname); @@ -286,7 +286,7 @@ afs_int32 newEntry (call, aname, flag, oid, aid) -afs_int32 PR_WhereIsIt (call,aid,apos) +afs_int32 SPR_WhereIsIt (call,aid,apos) struct rx_call *call; afs_int32 aid; afs_int32 *apos; @@ -325,7 +325,7 @@ afs_int32 *apos; } -afs_int32 PR_DumpEntry (call,apos, aentry) +afs_int32 SPR_DumpEntry (call,apos, aentry) struct rx_call *call; afs_int32 apos; struct prdebugentry *aentry; @@ -376,7 +376,7 @@ struct prdebugentry *aentry; return PRSUCCESS; } -afs_int32 PR_AddToGroup (call,aid,gid) +afs_int32 SPR_AddToGroup (call,aid,gid) struct rx_call *call; afs_int32 aid; afs_int32 gid; @@ -439,7 +439,7 @@ afs_int32 gid; return PRSUCCESS; } -afs_int32 PR_NameToID (call, aname, aid) +afs_int32 SPR_NameToID (call, aname, aid) struct rx_call *call; namelist *aname; idlist *aid; @@ -495,11 +495,11 @@ afs_int32 nameToID (call, aname, aid) } /* - * PR_IDToName + * SPR_IDToName * Given an array of ids, find the name for each of them. * The array of ids and names is unlimited. */ -afs_int32 PR_IDToName (call, aid, aname) +afs_int32 SPR_IDToName (call, aid, aname) struct rx_call *call; idlist *aid; namelist *aname; @@ -527,6 +527,7 @@ afs_int32 idToName (call, aid, aname) if (size <= 0) size = 0; aname->namelist_val = (prname *)malloc(size*PR_MAXNAMELEN); aname->namelist_len = 0; + if (aname->namelist_val == 0) return PRNOMEM; if (aid->idlist_len == 0) return 0; if (size == 0) return PRTOOMANY; /* rxgen will probably handle this */ @@ -552,7 +553,7 @@ afs_int32 idToName (call, aid, aname) return PRSUCCESS; } -afs_int32 PR_Delete (call, aid) +afs_int32 SPR_Delete (call, aid) struct rx_call *call; afs_int32 aid; { @@ -691,7 +692,7 @@ afs_int32 Delete (call, aid) return PRSUCCESS; } -afs_int32 PR_UpdateEntry (call, aid, name, uentry) +afs_int32 SPR_UpdateEntry (call, aid, name, uentry) struct rx_call *call; afs_int32 aid; char *name; @@ -756,7 +757,7 @@ afs_int32 PR_UpdateEntry (call, aid, name, uentry) return PRSUCCESS; } -afs_int32 PR_RemoveFromGroup (call,aid,gid) +afs_int32 SPR_RemoveFromGroup (call,aid,gid) struct rx_call *call; afs_int32 aid; afs_int32 gid; @@ -816,7 +817,7 @@ afs_int32 gid; } -afs_int32 PR_GetCPS (call, aid, alist, over) +afs_int32 SPR_GetCPS (call, aid, alist, over) struct rx_call *call; afs_int32 aid; prlist *alist; @@ -887,7 +888,7 @@ int inCPS (CPS,id) #endif /* IP_WILDCARDS */ -afs_int32 PR_GetCPS2 (call, aid, ahost, alist, over) +afs_int32 SPR_GetCPS2 (call, aid, ahost, alist, over) struct rx_call *call; afs_int32 aid; afs_int32 ahost; @@ -972,7 +973,7 @@ afs_int32 getCPS2 (call, aid, ahost, alist, over) } -afs_int32 PR_GetHostCPS (call, ahost, alist, over) +afs_int32 SPR_GetHostCPS (call, ahost, alist, over) struct rx_call *call; afs_int32 ahost; prlist *alist; @@ -1037,7 +1038,7 @@ bad: } -afs_int32 PR_ListMax (call,uid,gid) +afs_int32 SPR_ListMax (call,uid,gid) struct rx_call *call; afs_int32 *uid; afs_int32 *gid; @@ -1074,7 +1075,7 @@ afs_int32 *gid; return PRSUCCESS; } -afs_int32 PR_SetMax (call,aid,gflag) +afs_int32 SPR_SetMax (call,aid,gflag) struct rx_call *call; afs_int32 aid; afs_int32 gflag; @@ -1117,7 +1118,7 @@ afs_int32 gflag; return PRSUCCESS; } -afs_int32 PR_ListEntry (call,aid,aentry) +afs_int32 SPR_ListEntry (call,aid,aentry) struct rx_call *call; afs_int32 aid; struct prcheckentry *aentry; @@ -1177,7 +1178,7 @@ struct prcheckentry *aentry; return PRSUCCESS; } -afs_int32 PR_ListEntries(call, flag, startindex, bulkentries, nextstartindex) +afs_int32 SPR_ListEntries(call, flag, startindex, bulkentries, nextstartindex) struct rx_call *call; afs_int32 flag; afs_int32 startindex; @@ -1304,7 +1305,7 @@ afs_int32 put_prentries(tentry, bulkentries) return 0; } -afs_int32 PR_ChangeEntry (call,aid,name,oid,newid) +afs_int32 SPR_ChangeEntry (call,aid,name,oid,newid) struct rx_call *call; afs_int32 aid; char *name; @@ -1359,7 +1360,7 @@ afs_int32 newid; return code; } -afs_int32 PR_SetFieldsEntry (call, id, mask, flags, ngroups, nusers, spare1, spare2) +afs_int32 SPR_SetFieldsEntry (call, id, mask, flags, ngroups, nusers, spare1, spare2) struct rx_call *call; afs_int32 id; afs_int32 mask; /* specify which fields to update */ @@ -1444,7 +1445,7 @@ afs_int32 setFieldsEntry (call, id, mask, flags, ngroups, nusers, spare1, spare2 return code; } -afs_int32 PR_ListElements (call, aid, alist, over) +afs_int32 SPR_ListElements (call, aid, alist, over) struct rx_call *call; afs_int32 aid; prlist *alist; @@ -1500,13 +1501,13 @@ afs_int32 listElements (call, aid, alist, over) } /* - * PR_istOwned + * SPR_ListOwned * List the entries owned by this id. If the id is zero, * return the orphans list. This will return up to PR_MAXGROUPS * at a time with the lastP available to get the rest. The * maximum value is enforced in GetOwnedChain(). */ -afs_int32 PR_ListOwned (call, aid, alist, lastP) +afs_int32 SPR_ListOwned (call, aid, alist, lastP) struct rx_call *call; afs_int32 aid; prlist *alist; @@ -1583,7 +1584,7 @@ afs_int32 listOwned (call, aid, alist, lastP) return code; } -afs_int32 PR_IsAMemberOf (call,uid,gid,flag) +afs_int32 SPR_IsAMemberOf (call,uid,gid,flag) struct rx_call *call; afs_int32 uid; afs_int32 gid; diff --git a/src/rx/SOLARIS/rx_knet.c b/src/rx/SOLARIS/rx_knet.c index 8919b9358..3c690af1e 100644 --- a/src/rx/SOLARIS/rx_knet.c +++ b/src/rx/SOLARIS/rx_knet.c @@ -10,7 +10,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/rx/SOLARIS/rx_knet.c,v 1.1.1.8 2002/01/28 00:30:31 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/SOLARIS/rx_knet.c,v 1.1.1.9 2002/05/11 00:01:39 hartmans Exp $"); #ifdef AFS_SUN5_ENV #include "../rx/rx_kcommon.h" @@ -51,6 +51,10 @@ int (*sockfs_sosendmsg) (struct sonode *, struct nmsghdr *, struct uio *) = NULL; int (*sockfs_sosetsockopt) (struct sonode *, int, int, void *, int) = NULL; +int (*sockfs_sounbind) + (struct sonode *, int); +void (*sockfs_sockfree) + (struct sonode *); static afs_uint32 myNetAddrs[ADDRSPERSITE]; static int myNetMTUs[ADDRSPERSITE]; @@ -238,6 +242,16 @@ struct osi_socket *rxk_NewSocket(short aport) return NULL; } } + if (sockfs_sounbind == NULL) { + sockfs_sounbind = (int (*)())modlookup("sockfs", "sounbind"); + if (sockfs_sounbind == NULL) + return NULL; + } + if (sockfs_sockfree == NULL) { + sockfs_sockfree = (void (*)())modlookup("sockfs", "sockfree"); + if (sockfs_sockfree == NULL) + return NULL; + } accessvp = sockfs_solookup(AF_INET, SOCK_DGRAM, 0, "/dev/udp", &error); if (accessvp == NULL) { @@ -285,6 +299,9 @@ int osi_FreeSocket(asocket) kill(rxk_ListenerPid, SIGUSR1); afs_osi_Sleep(&rxk_ListenerPid); } + + sockfs_sounbind(so, 0); + sockfs_sockfree(so); return 0; } diff --git a/src/rx/rx_event.c b/src/rx/rx_event.c index 5d42c3a8c..fe56489b8 100644 --- a/src/rx/rx_event.c +++ b/src/rx/rx_event.c @@ -14,7 +14,7 @@ #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_event.c,v 1.1.1.5 2001/09/11 14:34:16 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_event.c,v 1.1.1.6 2002/05/11 00:01:25 hartmans Exp $"); #ifdef KERNEL #ifndef UKERNEL @@ -350,7 +350,7 @@ int rxevent_RaiseEvents(next) { register struct rxepoch *ep; register struct rxevent *ev; - struct clock now; + volatile struct clock now; MUTEX_ENTER(&rxevent_lock); diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index e74da16a4..13cf96757 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -14,7 +14,7 @@ #include #include "../afs/param.h" -RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_kcommon.c,v 1.1.1.10 2002/01/28 00:30:24 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx_kcommon.c,v 1.1.1.11 2002/05/11 00:01:27 hartmans Exp $"); #include "../rx/rx_kcommon.h" @@ -998,22 +998,7 @@ int rxk_ReadPacket(osi_socket so, struct rx_packet *p, int *host, int *port) */ int rxk_ListenerPid; /* Used to signal process to wakeup at shutdown */ -#ifdef AFS_SUN5_ENV -/* - * Run the listener as a kernel process. - */ void rxk_Listener(void) -{ - extern id_t syscid; - void rxk_ListenerProc(void); - if (newproc(rxk_ListenerProc, syscid, 59)) - osi_Panic("rxk_Listener: failed to fork listener process!\n"); -} - -void rxk_ListenerProc(void) -#else /* AFS_SUN5_ENV */ -void rxk_Listener(void) -#endif /* AFS_SUN5_ENV */ { struct rx_packet *rxp = NULL; int code; @@ -1028,9 +1013,9 @@ void rxk_Listener(void) #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) rxk_ListenerPid = current_proc()->p_pid; #endif -#if defined(RX_ENABLE_LOCKS) && !defined(AFS_SUN5_ENV) +#if defined(RX_ENABLE_LOCKS) AFS_GUNLOCK(); -#endif /* RX_ENABLE_LOCKS && !AFS_SUN5_ENV */ +#endif /* RX_ENABLE_LOCKS */ while (afs_termState != AFSOP_STOP_RXK_LISTENER) { if (rxp) { @@ -1062,9 +1047,6 @@ void rxk_Listener(void) #if defined(AFS_LINUX22_ENV) || defined(AFS_SUN5_ENV) afs_osi_Wakeup(&rxk_ListenerPid); #endif -#ifdef AFS_SUN5_ENV - AFS_GUNLOCK(); -#endif /* AFS_SUN5_ENV */ } #if !defined(AFS_LINUX20_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV) diff --git a/src/rxkad/.cvsignore b/src/rxkad/.cvsignore index c6a8f73d8..555faf2b3 100644 --- a/src/rxkad/.cvsignore +++ b/src/rxkad/.cvsignore @@ -6,3 +6,4 @@ fcrypt.h rxkad.h rxkad_errs.c sboxes.h +fc_test \ No newline at end of file diff --git a/src/rxkad/Makefile.in b/src/rxkad/Makefile.in index f5e112ef2..c97851225 100644 --- a/src/rxkad/Makefile.in +++ b/src/rxkad/Makefile.in @@ -40,7 +40,16 @@ INCLS=${TOP_INCDIR}/rx/rx.h ${TOP_INCDIR}/rx/xdr.h \ OBJS=rxkad_client.o rxkad_server.o rxkad_common.o ticket.o rxkad_errs.o \ fcrypt.o crypt_conn.o -all: kinstall ukinstall ${TOP_LIBDIR}/librxkad.a ${TOP_INCDIR}/rx/rxkad.h +fc_test_OBJS=fc_test.o + +fc_test_LIBS=\ + ${TOP_LIBDIR}/librxkad.a \ + ${TOP_LIBDIR}/librx.a \ + ${TOP_LIBDIR}/liblwp.a \ + ${TOP_LIBDIR}/libsys.a + +all: kinstall ukinstall ${TOP_LIBDIR}/librxkad.a fc_test \ + ${TOP_INCDIR}/rx/rxkad.h # # Install targets @@ -183,6 +192,11 @@ tcrypt: tcrypt.o librxkad.a tcrypt.o: tcrypt.c AFS_component_version_number.o +fc_test: ${fc_test_OBJS} + ${CC} ${CFLAGS} -o fc_test ${fc_test_OBJS} ${fc_test_LIBS} ${XLIBS} + +fc_test.o: ${INCLS} + # # Misc. targets # @@ -190,7 +204,8 @@ tcrypt.o: tcrypt.c AFS_component_version_number.o clean: $(RM) -f *.o *.a tcrypt core rxkad_errs.c rxkad.h \ AFS_component_version_number.c \ - crypt_conn.c fcrypt.c fcrypt.h sboxes.h + crypt_conn.c fcrypt.c fcrypt.h sboxes.h \ + fc_test test: cd test; $(MAKE) diff --git a/src/rxkad/rxkad_common.c b/src/rxkad/rxkad_common.c index 4f1eb12fe..7261e0af7 100644 --- a/src/rxkad/rxkad_common.c +++ b/src/rxkad/rxkad_common.c @@ -16,7 +16,7 @@ #include #endif -RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.7 2001/10/14 18:06:36 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/rxkad/rxkad_common.c,v 1.1.1.8 2002/05/11 00:01:51 hartmans Exp $"); #ifdef KERNEL #ifndef UKERNEL @@ -73,7 +73,7 @@ char *rxi_Alloc(); #ifndef KERNEL #define osi_Time() time(0) #endif -struct rxkad_stats rxkad_stats; +struct rxkad_stats rxkad_stats = {0}; /* this call sets up an endpoint structure, leaving it in *network* byte * order so that it can be used quickly for encryption. diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index 452adf138..ce42d26c9 100644 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -168,11 +168,14 @@ TEST_SRCS = write-ro-file.c read-vs-mmap.c read-vs-mmap2.c \ blocks-new-file.c fsx.c afscp.c afscp_callback.c \ write-rand.c -EXTRA_OBJS = err.o errx.o warn.o warnx.o +EXTRA_OBJS = err.o errx.o warn.o warnx.o vwarn.o vwarnx.o verr.o verrx.o warnerr.o snprintf.o OpenAFS/OS.pm: OpenAFS/OS-$(MKAFS_OSTYPE).pm $(CP) OpenAFS/OS-$(MKAFS_OSTYPE).pm OpenAFS/OS.pm +fsx: fsx.o $(EXTRA_OBJS) + $(CC) $(LDFLAGS) -o $@ fsx.o $(EXTRA_OBJS) $(LIBS) + write-rand: write-rand.o $(EXTRA_OBJS) $(CC) $(LDFLAGS) -o $@ write-rand.o $(EXTRA_OBJS) $(LIBS) @@ -349,7 +352,7 @@ run-tests: run-tests.in # $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(REALCFLAGS) $< afscp: afscp.o afscp_callback.o $(EXTRA_OBJS) - $(CC) $(LDFLAGS) -o $@ afscp.o afscp_callback.o $(EXTRA_OBJS) $(INT_LIBS) + $(CC) $(LDFLAGS) -o $@ afscp.o afscp_callback.o $(EXTRA_OBJS) $(INT_LIBS) ${XLIBS} hello-world: hello-world.in sed -e "s!%CC%!$(CC)!" $(srcdir)/hello-world.in > $@ @@ -367,6 +370,7 @@ uninstall: all: run-tests OpenAFS/OS.pm libxfiles.a libdumpscan.a $(TEST_PROGRAMS)\ afsdump_scan afsdump_dirlist afsdump_extract dumptool + @chmod +x run-tests clean: -rm -f xf_errs.c xf_errs.h dumpscan_errs.c dumpscan_errs.h *.o \ diff --git a/src/tests/boslistkeys.pl b/src/tests/boslistkeys.pl index 77affa4bf..11555dd94 100755 --- a/src/tests/boslistkeys.pl +++ b/src/tests/boslistkeys.pl @@ -17,7 +17,9 @@ $cell = &AFS_fs_wscell(); foreach $this (keys %ret) { if ($this == 250) { if ($ret{250} ne 3288840443) { - exit(1); + if ($ret{250} ne 1530169307) { + exit(1); + } } } } diff --git a/src/tests/build-openafs b/src/tests/build-openafs index 5dfc85495..5c53f00c1 100755 --- a/src/tests/build-openafs +++ b/src/tests/build-openafs @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: build-openafs,v 1.1 2002/01/22 19:54:40 hartmans Exp $ +# $Id: build-openafs,v 1.1.1.2 2002/05/11 00:02:11 hartmans Exp $ FS=${FS:-${objdir}/../appl/fs/fs} ${FS} sq . 0 @@ -7,4 +7,4 @@ if test "X$FAST" != "X" ; then echo "Not running $0" ; exit 0 ; fi test -f /usr/tmp/openafs-1.2.2-src.tar.gz && cp /usr/tmp/openafs-1.2.2-src.tar.gz openafs-1.2.2-src.tar.gz test -f openafs-1.2.2-src.tar.gz || wget http://www.openafs.org/dl/1.2.2/openafs-1.2.2-src.tar.gz 2>&4 $SHELL $SHELLVERBOSE $srcdir/generic-build openafs-1.2.2-src.tar.gz openafs-1.2.2 -openafs-1.2.2/src/finale/translate_et 180480 >& /dev/null +openafs-1.2.2/src/finale/translate_et 180480 >& 4 diff --git a/src/tests/fs_lib.c b/src/tests/fs_lib.c index 04a56b374..f7c580bff 100644 --- a/src/tests/fs_lib.c +++ b/src/tests/fs_lib.c @@ -129,7 +129,7 @@ fs_getfilecellname(char *path, char *cell, size_t len) #ifdef VIOC_SETRXKCRYPT int -fs_setcrypt (u_int32_t n) +fs_setcrypt (afs_uint32 n) { struct ViceIoctl a_params; @@ -151,7 +151,7 @@ fs_setcrypt (u_int32_t n) #ifdef VIOC_GETRXKCRYPT int -fs_getcrypt (u_int32_t *level) +fs_getcrypt (afs_uint32 *level) { struct ViceIoctl a_params; @@ -173,12 +173,12 @@ fs_getcrypt (u_int32_t *level) #ifdef VIOCCONNECTMODE int -fs_connect(int32_t type, int32_t *flags) +fs_connect(afs_int32 type, afs_int32 *flags) { struct ViceIoctl a_params; a_params.in_size = sizeof(type); - a_params.out_size = sizeof (int32_t); + a_params.out_size = sizeof (afs_int32); a_params.in = (char *) &type; a_params.out = (char *) flags; @@ -293,12 +293,12 @@ fs_getmaxfprio(int16_t *maxprio) #ifdef VIOCGETCACHEPARAMS int -fs_getfilecachestats(u_int32_t *max_bytes, - u_int32_t *used_bytes, - u_int32_t *max_vnodes, - u_int32_t *used_vnodes) +fs_getfilecachestats(afs_uint32 *max_bytes, + afs_uint32 *used_bytes, + afs_uint32 *max_vnodes, + afs_uint32 *used_vnodes) { - u_int32_t parms[16]; + afs_uint32 parms[16]; struct ViceIoctl a_params; a_params.in_size = 0; @@ -332,10 +332,10 @@ fs_getfilecachestats(u_int32_t *max_bytes, #ifdef VIOC_AVIATOR int -fs_getaviatorstats(u_int32_t *max_workers, - u_int32_t *used_workers) +fs_getaviatorstats(afs_uint32 *max_workers, + afs_uint32 *used_workers) { - u_int32_t parms[16]; + afs_uint32 parms[16]; struct ViceIoctl a_params; a_params.in_size = 0; @@ -384,10 +384,10 @@ fs_gcpags(void) #ifdef VIOC_CALCULATE_CACHE int -fs_calculate_cache(u_int32_t *calculated, - u_int32_t *usedbytes) +fs_calculate_cache(afs_uint32 *calculated, + afs_uint32 *usedbytes) { - u_int32_t parms[16]; + afs_uint32 parms[16]; struct ViceIoctl a_params; a_params.in_size = 0; @@ -441,8 +441,8 @@ debug (int pioctl_cmd, int inflags, int *outflags, char *pathname) { struct ViceIoctl a_params; - int32_t rinflags = inflags; - int32_t routflags; + afs_int32 rinflags = inflags; + afs_int32 routflags; if (inflags != -1) { a_params.in_size = sizeof(rinflags); @@ -513,7 +513,7 @@ arla_debug (int inflags, int *outflags) */ int -fs_checkservers(char *cell, int32_t flags, u_int32_t *hosts, int numhosts) +fs_checkservers(char *cell, afs_int32 flags, afs_uint32 *hosts, int numhosts) { struct ViceIoctl a_params; char *in = NULL; @@ -521,15 +521,15 @@ fs_checkservers(char *cell, int32_t flags, u_int32_t *hosts, int numhosts) size_t insize; if (cell != NULL) { - insize = strlen(cell) + sizeof(int32_t) + 1; + insize = strlen(cell) + sizeof(afs_int32) + 1; in = malloc (insize); if (in == NULL) errx (1, "malloc"); memcpy (in, &flags, sizeof(flags)); - memcpy (in + sizeof(int32_t), cell, strlen(cell)); - in[sizeof(int32_t) + strlen(cell)] = '\0'; + memcpy (in + sizeof(afs_int32), cell, strlen(cell)); + in[sizeof(afs_int32) + strlen(cell)] = '\0'; a_params.in_size = insize; a_params.in = in; @@ -538,7 +538,7 @@ fs_checkservers(char *cell, int32_t flags, u_int32_t *hosts, int numhosts) a_params.in = (caddr_t )&flags; } - a_params.out_size = numhosts * sizeof(u_int32_t); + a_params.out_size = numhosts * sizeof(afs_uint32); a_params.out = (caddr_t)hosts; ret = 0; @@ -580,7 +580,7 @@ int fs_set_sysname (const char *sys) { struct ViceIoctl a_params; - int32_t set = 1; + afs_int32 set = 1; a_params.in_size = sizeof(set) + strlen(sys) + 1; a_params.in = malloc(a_params.in_size); @@ -605,14 +605,14 @@ int fs_setcache(int lv, int hv, int lb, int hb) { struct ViceIoctl a_params; - u_int32_t s[4]; + afs_uint32 s[4]; s[0] = lv; s[1] = hv; s[2] = lb; s[3] = hb; - a_params.in_size = ((hv == 0) ? 1 : 4) * sizeof(u_int32_t); + a_params.in_size = ((hv == 0) ? 1 : 4) * sizeof(afs_uint32); a_params.out_size = 0; a_params.in = (void *)s; a_params.out = NULL; @@ -690,9 +690,9 @@ int fs_venuslog (void) { struct ViceIoctl a_params; - int32_t status = 0; /* XXX not really right, but anyway */ + afs_int32 status = 0; /* XXX not really right, but anyway */ - a_params.in_size = sizeof(int32_t); + a_params.in_size = sizeof(afs_int32); a_params.out_size = 0; a_params.in = (caddr_t) &status; a_params.out = NULL; @@ -708,12 +708,12 @@ fs_venuslog (void) */ int -fs_getcellstatus (char *cellname, u_int32_t *flags) +fs_getcellstatus (char *cellname, afs_uint32 *flags) { struct ViceIoctl a_params; a_params.in_size = strlen (cellname) + 1; - a_params.out_size = sizeof (u_int32_t); + a_params.out_size = sizeof (afs_uint32); a_params.in = cellname; a_params.out = (caddr_t) flags; diff --git a/src/tests/fsx.c b/src/tests/fsx.c index 0b67ae8bc..7ec207589 100644 --- a/src/tests/fsx.c +++ b/src/tests/fsx.c @@ -11,7 +11,7 @@ #include #include -#if defined(_UWIN) || defined(__linux) +#if defined(sun) || defined(_UWIN) || defined(__linux) # include # include # include @@ -31,6 +31,17 @@ #include #include #include +#include + +#if !defined L_SET +# define L_SET SEEK_SET +#endif +#if !defined L_INCR +# define L_INCR SEEK_CUR +#endif +#if !defined L_XTND +# define L_XTND SEEK_END +#endif #define NUMPRINTCOLUMNS 32 /* # columns of data to print on each line */ diff --git a/src/tests/make-page.c b/src/tests/make-page.c index 9a042997d..907aa4d09 100644 --- a/src/tests/make-page.c +++ b/src/tests/make-page.c @@ -45,7 +45,7 @@ #include #include #include - +#include #include diff --git a/src/tests/run-suite.pl b/src/tests/run-suite.pl index d1559d630..0f93cef64 100755 --- a/src/tests/run-suite.pl +++ b/src/tests/run-suite.pl @@ -9,6 +9,7 @@ use OpenAFS::ConfigUtils; use OpenAFS::Dirpath; use OpenAFS::OS; use OpenAFS::Auth; +use File::Copy; use Getopt::Long; use vars qw($admin $server $cellname $cachesize $part $shutdown_needed $csdb); @@ -70,12 +71,6 @@ while() { } close MOUNT; -unless ( -f "$openafsdirpath->{'afsconfdir'}/KeyFile") { - print "You do not have an AFS keyfile. Please create this using asetkey from openafs-krb5 or -the bos addkey command"; - exit(1); -} - print "If the fileserver is not running, this may hang for 30 seconds.\n"; run("$openafsinitcmd->{'filesrv-stop'}"); $server = `hostname`; @@ -91,13 +86,32 @@ die "Please specify a cellname\n" unless $cellname; unlink "$openafsdirpath->{'viceetcdir'}/CellServDB"; unlink "$openafsdirpath->{'viceetcdir'}/ThisCell"; +if ($cellname eq "this.thirty.nine.character.name.for.sed") { + copy("kaserver.DB0","$openafsdirpath->{'afsdbdir'}/kaserver.DB0"); + copy("kaserver.DBSYS1","$openafsdirpath->{'afsdbdir'}/kaserver.DBSYS1"); + copy("KeyFile","$openafsdirpath->{'afsconfdir'}/KeyFile"); +} + +unless ( -f "$openafsdirpath->{'afsconfdir'}/KeyFile") { + print "You do not have an AFS keyfile. Please create this using asetkey from openafs-krb5 or the bos addkey command"; + exit(1); +} my $lcell = "${cellname}"; #let bosserver create symlinks run("$openafsinitcmd->{'filesrv-start'}"); unwind("$openafsinitcmd->{'filesrv-stop'}"); +unwind("/bin/rm -f $openafsdirpath->{'afslocaldir'}/BosConfig"); $shutdown_needed = 1; + +open(THISCELL, ">$openafsdirpath->{'afsconfdir'}/ThisCell"); +print THISCELL $cellname; +close THISCELL; +open(THISCELL, ">$openafsdirpath->{'afsconfdir'}/CellServDB"); +print THISCELL ">$cellname #test cell"; +close THISCELL; + run ("$openafsdirpath->{'afssrvbindir'}/bos setcellname $server $lcell -localauth ||true"); run ("$openafsdirpath->{'afssrvbindir'}/bos addhost $server $server -localauth ||true"); run("$openafsdirpath->{'afssrvbindir'}/bos adduser $server $admin -localauth"); @@ -111,16 +125,22 @@ print PRDB "$admin 128/20 1 -204 -204\n"; print PRDB "system:administrators 130/20 -204 -204 -204\n"; print PRDB" $admin 1\n"; close PRDB; -unwind( "rm $openafsdirpath->{'afsdbdir'}/prdb* "); +unwind( "rm $openafsdirpath->{'afsdbdir'}/prdb.DB* "); # Start up ptserver and vlserver run("$openafsdirpath->{'afssrvbindir'}/bos create $server ptserver simple $openafsdirpath->{'afssrvlibexecdir'}/ptserver -localauth"); unwind("$openafsdirpath->{'afssrvbindir'}/bos delete $server ptserver -localauth"); unwind("$openafsdirpath->{'afssrvbindir'}/bos stop $server ptserver -localauth -wait"); run("$openafsdirpath->{'afssrvbindir'}/bos create $server vlserver simple $openafsdirpath->{'afssrvlibexecdir'}/vlserver -localauth"); +unwind( "rm $openafsdirpath->{'afsdbdir'}/vldb.DB* "); unwind("$openafsdirpath->{'afssrvbindir'}/bos delete $server vlserver -localauth"); unwind("$openafsdirpath->{'afssrvbindir'}/bos stop $server vlserver -localauth -wait"); +run("$openafsdirpath->{'afssrvbindir'}/bos create $server kaserver simple $openafsdirpath->{'afssrvlibexecdir'}/kaserver -localauth"); +unwind( "rm $openafsdirpath->{'afsdbdir'}/kaserver.DB* "); +unwind("$openafsdirpath->{'afssrvbindir'}/bos delete $server kaserver -localauth"); +unwind("$openafsdirpath->{'afssrvbindir'}/bos stop $server kaserver -localauth -wait"); + run( "$openafsdirpath->{'afssrvbindir'}/bos create $server fs fs ". "-cmd $openafsdirpath->{'afssrvlibexecdir'}/fileserver ". "-cmd $openafsdirpath->{'afssrvlibexecdir'}/volserver ". @@ -134,8 +154,12 @@ sleep(90); print "done.\n"; # Past this point we want to control when bos shutdown happens $shutdown_needed = 0; +$part = "a" unless $part; + unwind( "$openafsdirpath->{'afssrvbindir'}/bos shutdown $server -localauth "); -run("$openafsdirpath->{'afssrvsbindir'}/vos create $server a root.afs -localauth"); +run("$openafsdirpath->{'afssrvsbindir'}/vos create $server $part root.afs -localauth"); +unwind("$openafsdirpath->{'afssrvsbindir'}/vos remove $server $part root.afs -localauth"); + # bring up client $cachesize = $rl->readline("What size cache (in 1k blocks)? ") unless $cachesize; @@ -148,11 +172,19 @@ run("echo /afs:/usr/vice/cache:${cachesize} >$openafsdirpath->{'viceetcdir'}/cac run("$openafsinitcmd->{'client-forcestart'}"); my $afs_running = 0; open(MOUNT, "mount |") or die "Failed to run mount: $!\n"; + if(m:^AFS:) { + print "The AFS client is currently running on this workstation.\n"; + print "Please restart this script after running $openafsinitcmd->{'client-stop'}\n"; + exit(1); + } while() { -if(m:^AFS:) { - $afs_running = 1; + if(m:^AFS:) { + $afs_running = 1; + } + if(m:^/afs on AFS:) { + $afs_running = 1; + } } - } unless ($afs_running) { print "*** The AFS client failed to start.\n"; print "Please fix whatever problem kept it from running.\n"; @@ -160,8 +192,6 @@ print "Please fix whatever problem kept it from running.\n"; } unwind("$openafsinitcmd->{'client-stop'}"); -$part = "a" unless $part; - &OpenAFS::Auth::authadmin(); run("$openafsdirpath->{'afssrvbindir'}/fs sa /afs system:anyuser rl"); diff --git a/src/tests/run-tests.in b/src/tests/run-tests.in index 464d6eda9..93abffa54 100644 --- a/src/tests/run-tests.in +++ b/src/tests/run-tests.in @@ -1,16 +1,18 @@ #!/bin/sh # -# $Id: run-tests.in,v 1.1 2002/01/22 19:54:42 hartmans Exp $ +# $Id: run-tests.in,v 1.1.1.2 2002/05/11 00:02:31 hartmans Exp $ # srcdir=@srcdir@ objdir=`pwd` SHELL=/bin/sh +SHELLVERBOSE= VERSION=@VERSION@ PACKAGE=@PACKAGE@ host=@host@ RUNAS=nobody FS=@afssrvbindir@/fs export FS +export SHELL AFSROOT=${AFSROOT-/afs} export AFSROOT @@ -302,7 +304,7 @@ do -help|--help) echo $usage; echo "tests available: $linebreak"; for a in "$ALL_TESTS"; do echo $a ; done; exit 0;; - -version|--version) echo "$0 $Id: run-tests.in,v 1.1 2002/01/22 19:54:42 hartmans Exp $"; exit 0;; + -version|--version) echo "$0 $Id: run-tests.in,v 1.1.1.2 2002/05/11 00:02:31 hartmans Exp $"; exit 0;; -*) echo "$0: Bad option $1"; echo $usage; exit 1;; *) break;; esac diff --git a/src/tests/write-rand.c b/src/tests/write-rand.c index ab173012c..c378384f5 100644 --- a/src/tests/write-rand.c +++ b/src/tests/write-rand.c @@ -47,7 +47,7 @@ #include #ifdef RCSID -RCSID("$Id: write-rand.c,v 1.1 2002/01/22 19:54:43 hartmans Exp $"); +RCSID("$Id: write-rand.c,v 1.1.1.2 2002/05/11 00:02:38 hartmans Exp $"); #endif static char * @@ -84,7 +84,7 @@ int main (int argc, char **argv) { const char *file; - const size_t sz; + size_t sz; char *random_buf; char *read_buf1; char *read_buf2; diff --git a/src/ubik/ubik.p.h b/src/ubik/ubik.p.h index 4553d5533..9f0d1a4fd 100644 --- a/src/ubik/ubik.p.h +++ b/src/ubik/ubik.p.h @@ -95,18 +95,6 @@ struct ubik_client { #define ubik_GetRPCConn(astr,aindex) ((aindex) >= MAXSERVERS? 0 : (astr)->conns[aindex]) #define ubik_GetRPCHost(astr,aindex) ((aindex) >= MAXSERVERS? 0 : (astr)->hosts[aindex]) -/* ubik transaction id representation */ -struct ubik_tid { - afs_int32 epoch; /* time this server started */ - afs_int32 counter; /* counter within epoch of transactions */ -}; - -/* ubik version representation */ -struct ubik_version { - afs_int32 epoch; /* time this server started */ - afs_int32 counter; /* counter within epoch of transactions */ -}; - /* ubik header file structure */ struct ubik_hdr { afs_int32 magic; /* magic number */ diff --git a/src/ubik/ubik_int.xg b/src/ubik/ubik_int.xg index df8e7f731..1d8c392c0 100644 --- a/src/ubik/ubik_int.xg +++ b/src/ubik/ubik_int.xg @@ -15,12 +15,12 @@ struct BDesc { afs_int32 session; }; -struct net_version { +struct ubik_version { afs_int32 epoch; afs_int32 counter; }; -struct net_tid { +struct ubik_tid { afs_int32 epoch; afs_int32 counter; }; @@ -38,8 +38,8 @@ struct ubik_debug { afs_int32 lowestTime; /* time we last chose lowestHost */ afs_int32 syncHost; /* sync site we've heard from last (even if we didn't vote) */ afs_int32 syncTime; /* time of above */ - struct net_version syncVersion; /* sync site's claimed db version */ - struct net_tid syncTid; /* sync site's claimed tid */ + struct ubik_version syncVersion; /* sync site's claimed db version */ + struct ubik_tid syncTid; /* sync site's claimed tid */ /* variables from beacon module */ afs_int32 amSyncSite; /* do I think I'm the sync site */ @@ -49,7 +49,7 @@ struct ubik_debug { /* variables from disk module */ afs_int32 lockedPages; /* count of read-locked pages */ afs_int32 writeLockedPages; /* count of write-locked pages */ - struct net_version localVersion; + struct ubik_version localVersion; afs_int32 activeWrite; /* is there an active write transaction with this as sync site */ afs_int32 tidCounter; /* tid counter field from dbase, or 0 if no write trans. */ @@ -76,7 +76,7 @@ struct ubik_sdebug { afs_int32 lastVoteTime; /* time last vote received */ afs_int32 lastBeaconSent; /* time last beacon sent */ afs_int32 lastVote; /* was last vote yes? */ - struct net_version remoteVersion; + struct ubik_version remoteVersion; afs_int32 currentDB; /* is current DB up to date? */ afs_int32 beaconSinceDown; /* beacon sent since last noticed up? */ afs_int32 up; /* is site up */ @@ -95,8 +95,8 @@ struct ubik_debug_old { afs_int32 lowestTime; /* time we last chose lowestHost */ afs_int32 syncHost; /* sync site we've heard from last (even if we didn't vote) */ afs_int32 syncTime; /* time of above */ - struct net_version syncVersion; /* sync site's claimed db version */ - struct net_tid syncTid; /* sync site's claimed tid */ + struct ubik_version syncVersion; /* sync site's claimed db version */ + struct ubik_tid syncTid; /* sync site's claimed tid */ /* variables from beacon module */ afs_int32 amSyncSite; /* do I think I'm the sync site */ @@ -106,7 +106,7 @@ struct ubik_debug_old { /* variables from disk module */ afs_int32 lockedPages; /* count of read-locked pages */ afs_int32 writeLockedPages; /* count of write-locked pages */ - struct net_version localVersion; + struct ubik_version localVersion; afs_int32 activeWrite; /* is there an active write transaction with this as sync site */ afs_int32 tidCounter; /* tid counter field from dbase, or 0 if no write trans. */ @@ -131,7 +131,7 @@ struct ubik_sdebug_old { afs_int32 lastVoteTime; /* time last vote received */ afs_int32 lastBeaconSent; /* time last beacon sent */ afs_int32 lastVote; /* was last vote yes? */ - struct net_version remoteVersion; + struct ubik_version remoteVersion; afs_int32 currentDB; /* is current DB up to date? */ afs_int32 beaconSinceDown; /* beacon sent since last noticed up? */ afs_int32 up; /* is site up */ @@ -173,8 +173,8 @@ statindex 11 /* Vote package interface calls */ Beacon (IN afs_int32 state, afs_int32 voteStart, - net_version *Version, - net_tid *tid) multi = VOTE_BEACON; + ubik_version *Version, + ubik_tid *tid) multi = VOTE_BEACON; DebugOld (OUT ubik_debug_old *db) = VOTE_DEBUG_OLD; @@ -204,12 +204,12 @@ statindex 12 #define DISK_COMMIT 20001 #define DISK_LOCK 20002 #define DISK_WRITE 20003 -#define DISK_GETVERSION 20004 +#define DISK_GETVERSION 20004 #define DISK_GETFILE 20005 #define DISK_SENDFILE 20006 #define DISK_ABORT 20007 #define DISK_RELEASELOCKS 20008 -#define DISK_TRUNCATE 20009 +#define DISK_TRUNCATE 20009 #define DISK_PROBE 20010 #define DISK_WRITEV 20011 #define DISK_INTERFACEADDR 20012 @@ -218,47 +218,47 @@ statindex 12 /* Disk package interface calls - the order of * these declarations is important. */ -Begin (IN net_tid *tid) = DISK_BEGIN; +Begin (IN ubik_tid *tid) = DISK_BEGIN; -Commit (IN net_tid *tid) = DISK_COMMIT; +Commit (IN ubik_tid *tid) = DISK_COMMIT; -Lock (IN net_tid *tid, +Lock (IN ubik_tid *tid, afs_int32 file, afs_int32 position, afs_int32 length, afs_int32 type) = DISK_LOCK; -Write (IN net_tid *tid, +Write (IN ubik_tid *tid, afs_int32 file, afs_int32 position, bulkdata *data) = DISK_WRITE; -GetVersion (OUT net_version *Version) = DISK_GETVERSION; +GetVersion (OUT ubik_version *Version) = DISK_GETVERSION; GetFile (IN afs_int32 file, - OUT net_version *Version) split = DISK_GETFILE; + OUT ubik_version *Version) split = DISK_GETFILE; SendFile (IN afs_int32 file, afs_int32 length, - net_version *Version) split = DISK_SENDFILE ; + ubik_version *Version) split = DISK_SENDFILE ; -Abort (IN net_tid *tid) = DISK_ABORT; +Abort (IN ubik_tid *tid) = DISK_ABORT; -ReleaseLocks (IN net_tid *tid) = DISK_RELEASELOCKS; +ReleaseLocks (IN ubik_tid *tid) = DISK_RELEASELOCKS; -Truncate (IN net_tid *tid, +Truncate (IN ubik_tid *tid, afs_int32 file, afs_int32 length) = DISK_TRUNCATE; Probe () multi = DISK_PROBE; -WriteV (IN net_tid *tid, +WriteV (IN ubik_tid *tid, iovec_wrt *io_vector, iovec_buf *io_buffer) = DISK_WRITEV; UpdateInterfaceAddr(IN UbikInterfaceAddr* inAddr, OUT UbikInterfaceAddr* outAddr) multi = DISK_INTERFACEADDR; -SetVersion (IN net_tid *tid, - IN net_version *OldVersion, - IN net_version *NewVersion) = DISK_SETVERSION; +SetVersion (IN ubik_tid *tid, + IN ubik_version *OldVersion, + IN ubik_version *NewVersion) = DISK_SETVERSION; diff --git a/src/ubik/utst_server.c b/src/ubik/utst_server.c index af075a634..5833c19f9 100644 --- a/src/ubik/utst_server.c +++ b/src/ubik/utst_server.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_server.c,v 1.1.1.5 2001/10/14 18:06:48 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_server.c,v 1.1.1.6 2002/05/11 00:02:50 hartmans Exp $"); #include #include @@ -42,8 +42,8 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/ubik/utst_server.c,v 1.1.1.5 2001/10/14 struct ubik_dbase *dbase; afs_int32 sleepTime; -SAMPLE_Inc(rxcall) -struct rx_call *rxcall; +SAMPLE_Inc(rxconn) +struct rx_connection *rxconn; { afs_int32 code, temp; struct ubik_trans *tt; @@ -99,8 +99,8 @@ this program's convention for locking the whole database */ } -SAMPLE_Get(rxcall, gnumber) -struct rx_call *rxcall; +SAMPLE_Get(rxconn, gnumber) +struct rx_connection *rxconn; afs_int32 *gnumber; { afs_int32 code, temp; @@ -143,8 +143,8 @@ afs_int32 *gnumber; } -SAMPLE_QGet(rxcall, gnumber) -struct rx_call *rxcall; +SAMPLE_QGet(rxconn, gnumber) +struct rx_connection *rxconn; afs_int32 *gnumber; { afs_int32 code, temp; @@ -187,8 +187,8 @@ afs_int32 *gnumber; } -SAMPLE_Trun(rxcall) -struct rx_call *rxcall; +SAMPLE_Trun(rxconn) +struct rx_connection *rxconn; { afs_int32 code; struct ubik_trans *tt; @@ -222,8 +222,8 @@ struct rx_call *rxcall; } -SAMPLE_Test(rxcall) -struct rx_call *rxcall; +SAMPLE_Test(rxconn) +struct rx_connection *rxconn; { afs_int32 code, temp; struct ubik_trans *tt; diff --git a/src/venus/.cvsignore b/src/venus/.cvsignore index 41aaea35b..947761a9b 100644 --- a/src/venus/.cvsignore +++ b/src/venus/.cvsignore @@ -1,4 +1,5 @@ AFS_component_version_number.c +livesys Makefile cmdebug fs diff --git a/src/vfsck/pass1.c b/src/vfsck/pass1.c index 0b0ddd679..33e1960c0 100644 --- a/src/vfsck/pass1.c +++ b/src/vfsck/pass1.c @@ -18,7 +18,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass1.c,v 1.1.1.4 2001/09/11 14:35:28 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/vfsck/pass1.c,v 1.1.1.5 2002/05/11 00:03:19 hartmans Exp $"); #define VICE #include @@ -70,7 +70,8 @@ extern int ge_danger; static daddr_t badblk; static daddr_t dupblk; int pass1check(); - +static int oldreported; + pass1() { register int c, i, j; @@ -306,10 +307,19 @@ ignore_direct_block_check: #if defined(AFS_SUN56_ENV) if ( OLDVICEINODE ) { - /* This looks like a sol 2.5 AFS inode */ - printf("This vicep partition seems to contain pre Sol2.6 AFS inodes\n"); - printf("You should run the AFS file conversion utility before installing Sol 2.6\n"); - exit(100); /* unique return code? */ + if (yflag) { + if (!oldreported) { + printf("This vicep partition seems to contain pre Sol2.6 AFS inodes\n"); + printf("You should run the AFS file conversion utility before installing Sol 2.6\n"); + printf("Continuing anyway.\n"); + oldreported++; + } + } else { + /* This looks like a sol 2.5 AFS inode */ + printf("This vicep partition seems to contain pre Sol2.6 AFS inodes\n"); + printf("You should run the AFS file conversion utility before installing Sol 2.6\n"); + exit(100); /* unique return code? */ + } } #endif statemap[inumber] = diff --git a/src/viced/callback.c b/src/viced/callback.c index 528c93343..0898c659e 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -82,7 +82,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/viced/callback.c,v 1.1.1.7 2001/10/14 18:07:13 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/viced/callback.c,v 1.1.1.8 2002/05/11 00:03:26 hartmans Exp $"); #include #include /* for malloc() */ @@ -1417,6 +1417,7 @@ static int GetSomeSpace_r(hostp, locked) cbstuff.GSS4++; if ( ! ClearHostCallbacks_r(hp, 0 /* not locked or held */) ) return; + hp1 = hp; } else { hp1 = hostp; cbstuff.GSS1++; diff --git a/src/viced/host.c b/src/viced/host.c index 0a0b37bf0..d6f97e895 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.8 2002/01/22 19:55:12 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/viced/host.c,v 1.1.1.9 2002/05/11 00:03:28 hartmans Exp $"); #include #include @@ -940,6 +940,7 @@ struct host *h_GetHost_r(tcon) afs_int32 haddr; afs_int32 hport; int i, j, count; + char hoststr[16], hoststr2[16]; haddr = rxr_HostOf(tcon); hport = rxr_PortOf(tcon); @@ -960,7 +961,8 @@ retry: /* Another thread is doing initialization */ h_Unlock_r(host); if ( !held) h_Release_r(host); - ViceLog(125, ("Host %x starting h_Lookup again\n", host)); + ViceLog(125, ("Host %s:%d starting h_Lookup again\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); goto retry; } host->hostFlags &= ~ALTADDR; @@ -977,8 +979,8 @@ retry: * that we maintain some extra callback state information */ if (host->interface) { ViceLog(0, - ("Host %x used to support WhoAreYou, deleting.\n", - host)); + ("Host %s:%d used to support WhoAreYou, deleting.\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); host->hostFlags |= HOSTDELETED; h_Unlock_r(host); if (!held) h_Release_r(host); @@ -997,8 +999,8 @@ retry: if ( !host->interface || !afs_uuid_equal(&interf.uuid, &host->interface->uuid) ) { ViceLog(25, - ("Host %x has changed its identity, deleting.\n", - host)); + ("Host %s:%d has changed its identity, deleting.\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); host->hostFlags |= HOSTDELETED; h_Unlock_r(host); if (!held) h_Release_r(host); @@ -1006,7 +1008,6 @@ retry: goto retry; } } else { - char hoststr[16]; afs_inet_ntoa_r(host->host, hoststr); ViceLog(0,("CB: WhoAreYou failed for %s:%d, error %d\n", hoststr, ntohs(host->port), code)); @@ -1020,12 +1021,13 @@ retry: if ( ! (host->hostFlags & ALTADDR) ) { /* another thread is doing the initialisation */ - ViceLog(125, ("Host %x waiting for host-init to complete\n", - host)); + ViceLog(125, ("Host %s:%d waiting for host-init to complete\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); h_Lock_r(host); h_Unlock_r(host); if ( !held) h_Release_r(host); - ViceLog(125, ("Host %x starting h_Lookup again\n", host)); + ViceLog(125, ("Host %s:%d starting h_Lookup again\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); goto retry; } /* We need to check whether the identity in the host structure @@ -1040,8 +1042,8 @@ retry: host->hostFlags |= HOSTDELETED; h_Unlock_r(host); if (!held) h_Release_r(host); - ViceLog(0,("CB: new identity for host %x, deleting\n", - host->host)); + ViceLog(0, ("CB: new identity for host %s:%d, deleting\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); goto retry; } } else { @@ -1059,8 +1061,8 @@ retry: identP->valid = 0; rx_SetSpecific(tcon, rxcon_ident_key, identP); ViceLog(25, - ("Host %x does not support WhoAreYou.\n", - host->host)); + ("Host %s:%d does not support WhoAreYou.\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); code = 0; } else if (code == 0) { interfValid = 1; @@ -1068,7 +1070,8 @@ retry: identP->valid = 1; identP->uuid = interf.uuid; rx_SetSpecific(tcon, rxcon_ident_key, identP); - ViceLog(25,("WhoAreYou success on %x\n", host->host)); + ViceLog(25, ("WhoAreYou success on %s:%d\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); } } if (code == 0 && !identP->valid) { @@ -1084,8 +1087,9 @@ retry: if (!(held = h_Held_r(oldHost))) h_Hold_r(oldHost); h_Lock_r(oldHost); - ViceLog(25,("CB: new addr %x for old host %x\n", - host->host, oldHost->host)); + ViceLog(25, ("CB: new addr %s:%d for old host %s:%d\n", + afs_inet_ntoa_r(host->host, hoststr), host->port, + afs_inet_ntoa_r(oldHost->host, hoststr2), oldHost->port)); host->hostFlags |= HOSTDELETED; h_Unlock_r(host); h_Release_r(host); @@ -1099,15 +1103,14 @@ retry: &FS_HostUUID); H_LOCK if (code == 0) { - ViceLog(25,("InitCallBackState3 success on %x\n", - host->host)); + ViceLog(25, ("InitCallBackState3 success on %s:%d\n", + afs_inet_ntoa_r(host->host, hoststr), host->port)); assert(interfValid == 1); initInterfaceAddr_r(host, &interf); } } } if (code) { - char hoststr[16]; afs_inet_ntoa_r(host->host, hoststr); ViceLog(0,("CB: RCallBackConnectBack failed for %s:%d\n", hoststr, ntohs(host->port))); @@ -1390,8 +1393,11 @@ ticket name length != 64 code = pr_GetCPS(viceid, &client->CPS); H_LOCK if (code) { - ViceLog(0, ("pr_GetCPS failed(%d) for user %d, host %x.%d\n", - code, viceid, client->host->host, ntohs(client->host->port))); + char hoststr[16]; + ViceLog(0, ("pr_GetCPS failed(%d) for user %d, host %s:%d\n", + code, viceid, + afs_inet_ntoa_r(client->host->host, hoststr), + client->host->port)); /* Although ubik_Call (called by pr_GetCPS) traverses thru * all protection servers and reevaluates things if no @@ -1464,8 +1470,11 @@ int GetClient(tcon, cp) assert(client && client->tcon && rxr_CidOf(client->tcon) == client->sid); if (client && client->LastCall > client->expTime && client->expTime) { - ViceLog(1, ("Token for %s at %x.%d expired %d\n", - h_UserName(client), client->host->host, client->host->port, client->expTime)); + char hoststr[16]; + ViceLog(1, ("Token for %s at %s:%d expired %d\n", + h_UserName(client), + afs_inet_ntoa_r(client->host->host, hoststr), + client->host->port, client->expTime)); H_UNLOCK return VICETOKENDEAD; } @@ -1522,14 +1531,16 @@ static int h_PrintClient(host, held, file) int i; char tmpStr[256]; char tbuffer[32]; + char hoststr[16]; H_LOCK if (host->hostFlags & HOSTDELETED) { H_UNLOCK return held; } - sprintf(tmpStr,"Host %x.%d down = %d, LastCall %s", host->host, - host->port, (host->hostFlags & VENUSDOWN), + sprintf(tmpStr,"Host %s:%d down = %d, LastCall %s", + afs_inet_ntoa_r(host->host, hoststr), host->port, + (host->hostFlags & VENUSDOWN), afs_ctime((time_t *)&host->LastCall, tbuffer, sizeof(tbuffer))); STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file); for (client = host->FirstClient; client; client=client->next) { diff --git a/src/viced/physio.c b/src/viced/physio.c index f878994fa..b849acedd 100644 --- a/src/viced/physio.c +++ b/src/viced/physio.c @@ -16,7 +16,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/viced/physio.c,v 1.1.1.5 2001/09/11 14:35:35 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/viced/physio.c,v 1.1.1.6 2002/05/11 00:03:29 hartmans Exp $"); #include #include @@ -59,7 +59,7 @@ char * data; if (fdP == NULL) { code = errno; ViceLog (0, - ("ReallyRead(): open failed device %X inode %X errno %d\n", + ("ReallyRead(): open failed device %X inode %s errno %d\n", file->dirh_handle->ih_dev, PrintInode(NULL, file->dirh_handle->ih_ino), code)); return code; @@ -67,7 +67,7 @@ char * data; if (FDH_SEEK(fdP, block * PAGESIZE, SEEK_SET) < 0) { code = errno; ViceLog (0, - ("ReallyRead(): lseek failed device %X inode %X errno %d\n", + ("ReallyRead(): lseek failed device %X inode %s errno %d\n", file->dirh_handle->ih_dev, PrintInode(NULL, file->dirh_handle->ih_ino), code)); FDH_REALLYCLOSE(fdP); @@ -80,7 +80,7 @@ char * data; else code = EIO; ViceLog (0, - ("ReallyRead(): read failed device %X inode %X errno %d\n", + ("ReallyRead(): read failed device %X inode %s errno %d\n", file->dirh_handle->ih_dev, PrintInode(NULL, file->dirh_handle->ih_ino), code)); FDH_REALLYCLOSE(fdP); @@ -103,7 +103,7 @@ char * data; fdP = IH_OPEN(file->dirh_handle); if (fdP == NULL) { ViceLog (0, - ("ReallyWrite(): open failed device %X inode %X errno %d\n", + ("ReallyWrite(): open failed device %X inode %s errno %d\n", file->dirh_handle->ih_dev, PrintInode(NULL, file->dirh_handle->ih_ino), errno)); lpErrno = errno; @@ -111,7 +111,7 @@ char * data; } if (FDH_SEEK(fdP, block * PAGESIZE, SEEK_SET) < 0) { ViceLog (0, - ("ReallyWrite(): lseek failed device %X inode %X errno %d\n", + ("ReallyWrite(): lseek failed device %X inode %s errno %d\n", file->dirh_handle->ih_dev, PrintInode(NULL, file->dirh_handle->ih_ino), errno)); lpErrno = errno; @@ -120,7 +120,7 @@ char * data; } if ((count = FDH_WRITE(fdP, data, PAGESIZE)) != PAGESIZE) { ViceLog (0, - ("ReallyWrite(): write failed device %X inode %X errno %d\n", + ("ReallyWrite(): write failed device %X inode %s errno %d\n", file->dirh_handle->ih_dev, PrintInode(NULL, file->dirh_handle->ih_ino), errno)); lpCount = count; diff --git a/src/vlserver/vldbint.xg b/src/vlserver/vldbint.xg index faa568c38..6b54cfbe6 100644 --- a/src/vlserver/vldbint.xg +++ b/src/vlserver/vldbint.xg @@ -8,6 +8,7 @@ */ package VL_ +prefix S statindex 15 #include "vl_opcodes.h" diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index edda9fdf0..1da0f7d14 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlprocs.c,v 1.1.1.7 2001/10/14 18:07:17 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlprocs.c,v 1.1.1.8 2002/05/11 00:03:34 hartmans Exp $"); #include #include @@ -148,7 +148,7 @@ int Init_VLdbase (trans, locktype, this_op) /* Create a new vldb entry; both new volume id and name must be unique (non-existant in vldb). */ -VL_CreateEntry(rxcall, newentry) +SVL_CreateEntry(rxcall, newentry) struct rx_call *rxcall; struct vldbentry *newentry; { struct ubik_trans *trans; @@ -221,7 +221,7 @@ VL_CreateEntry(rxcall, newentry) } -VL_CreateEntryN(rxcall, newentry) +SVL_CreateEntryN(rxcall, newentry) struct rx_call *rxcall; struct nvldbentry *newentry; { struct ubik_trans *trans; @@ -294,7 +294,7 @@ VL_CreateEntryN(rxcall, newentry) } -VL_ChangeAddr(rxcall, ip1, ip2) +SVL_ChangeAddr(rxcall, ip1, ip2) struct rx_call *rxcall; afs_int32 ip1, ip2; { struct ubik_trans *trans; @@ -328,7 +328,7 @@ VL_ChangeAddr(rxcall, ip1, ip2) } /* Delete a vldb entry given the volume id. */ -VL_DeleteEntry(rxcall, volid, voltype) +SVL_DeleteEntry(rxcall, volid, voltype) struct rx_call *rxcall; afs_int32 volid; afs_int32 voltype; @@ -410,7 +410,7 @@ GetEntryByID (rxcall, volid, voltype, aentry, new, this_op) return(ubik_EndTrans(trans)); } -VL_GetEntryByID (rxcall, volid, voltype, aentry) +SVL_GetEntryByID (rxcall, volid, voltype, aentry) struct rx_call *rxcall; afs_int32 volid, voltype; vldbentry *aentry; /* entry data copied here */ @@ -419,7 +419,7 @@ VL_GetEntryByID (rxcall, volid, voltype, aentry) return (GetEntryByID(rxcall, volid, voltype, (char *)aentry, 0, this_op)); } -VL_GetEntryByIDN (rxcall, volid, voltype, aentry) +SVL_GetEntryByIDN (rxcall, volid, voltype, aentry) struct rx_call *rxcall; afs_int32 volid, voltype; nvldbentry *aentry; /* entry data copied here */ @@ -428,7 +428,7 @@ VL_GetEntryByIDN (rxcall, volid, voltype, aentry) return (GetEntryByID(rxcall, volid, voltype, (char *)aentry, 1, this_op)); } -VL_GetEntryByIDU (rxcall, volid, voltype, aentry) +SVL_GetEntryByIDU (rxcall, volid, voltype, aentry) struct rx_call *rxcall; afs_int32 volid, voltype; uvldbentry *aentry; /* entry data copied here */ @@ -490,7 +490,7 @@ GetEntryByName (rxcall, volname, aentry, new, this_op) return(ubik_EndTrans(trans)); } -VL_GetEntryByNameO (rxcall, volname, aentry) +SVL_GetEntryByNameO (rxcall, volname, aentry) struct rx_call *rxcall; char *volname; struct vldbentry *aentry; /* entry data copied here */ @@ -500,7 +500,7 @@ VL_GetEntryByNameO (rxcall, volname, aentry) } -VL_GetEntryByNameN (rxcall, volname, aentry) +SVL_GetEntryByNameN (rxcall, volname, aentry) struct rx_call *rxcall; char *volname; struct nvldbentry *aentry; /* entry data copied here */ @@ -509,7 +509,7 @@ VL_GetEntryByNameN (rxcall, volname, aentry) return (GetEntryByName(rxcall, volname, (char *)aentry, 1, this_op)); } -VL_GetEntryByNameU (rxcall, volname, aentry) +SVL_GetEntryByNameU (rxcall, volname, aentry) struct rx_call *rxcall; char *volname; struct uvldbentry *aentry; /* entry data copied here */ @@ -521,7 +521,7 @@ VL_GetEntryByNameU (rxcall, volname, aentry) /* Get the current value of the maximum volume id and bump the volume id counter by Maxvolidbump. */ -VL_GetNewVolumeId (rxcall, Maxvolidbump, newvolumeid) +SVL_GetNewVolumeId (rxcall, Maxvolidbump, newvolumeid) struct rx_call *rxcall; afs_int32 Maxvolidbump; afs_int32 *newvolumeid; @@ -562,7 +562,7 @@ afs_int32 *newvolumeid; * newentry. No individual checking/updating per field (alike * VLUpdateEntry) is done. */ -VL_ReplaceEntry (rxcall, volid, voltype, newentry, releasetype) +SVL_ReplaceEntry (rxcall, volid, voltype, newentry, releasetype) struct rx_call *rxcall; afs_int32 volid; afs_int32 voltype; @@ -662,7 +662,7 @@ afs_int32 releasetype; return errorcode; } -VL_ReplaceEntryN (rxcall, volid, voltype, newentry, releasetype) +SVL_ReplaceEntryN (rxcall, volid, voltype, newentry, releasetype) struct rx_call *rxcall; afs_int32 volid; afs_int32 voltype; @@ -765,7 +765,7 @@ afs_int32 releasetype; /* Update a vldb entry (accessed thru its volume id). Almost all of the entry's fields can be modified in a single call by setting the appropriate bits in the Mask field in VldbUpdateentry. */ /* this routine may never have been tested; use replace entry instead unless you're brave */ -VL_UpdateEntry (rxcall, volid, voltype, updateentry, releasetype) +SVL_UpdateEntry (rxcall, volid, voltype, updateentry, releasetype) struct rx_call *rxcall; afs_int32 volid; afs_int32 voltype; @@ -813,7 +813,7 @@ VL_UpdateEntry (rxcall, volid, voltype, updateentry, releasetype) } -VL_UpdateEntryByName (rxcall, volname, updateentry, releasetype) +SVL_UpdateEntryByName (rxcall, volname, updateentry, releasetype) struct rx_call *rxcall; char *volname; afs_int32 releasetype; @@ -858,7 +858,7 @@ VL_UpdateEntryByName (rxcall, volname, updateentry, releasetype) /* Set a lock to the vldb entry for volid (of type voltype if not -1). */ -VL_SetLock (rxcall, volid, voltype, voloper) +SVL_SetLock (rxcall, volid, voltype, voloper) struct rx_call *rxcall; afs_int32 volid; afs_int32 voltype; @@ -924,7 +924,7 @@ afs_int32 voloper; * fields (afsid and/or volume operation) will be cleared along with * the lock time stamp. */ -VL_ReleaseLock (rxcall, volid, voltype, releasetype) +SVL_ReleaseLock (rxcall, volid, voltype, releasetype) struct rx_call *rxcall; afs_int32 volid; afs_int32 voltype; @@ -970,7 +970,7 @@ afs_int32 releasetype; /* ListEntry returns a single vldb entry, aentry, with offset previous_index; the remaining parameters (i.e. next_index) are used so that sequential calls to this routine will get the next (all) vldb entries. */ -VL_ListEntry (rxcall, previous_index, count, next_index, aentry) +SVL_ListEntry (rxcall, previous_index, count, next_index, aentry) struct rx_call *rxcall; afs_int32 previous_index; afs_int32 *count; @@ -991,7 +991,7 @@ struct vldbentry *aentry; } /* ListEntry returns a single vldb entry, aentry, with offset previous_index; the remaining parameters (i.e. next_index) are used so that sequential calls to this routine will get the next (all) vldb entries. */ -VL_ListEntryN (rxcall, previous_index, count, next_index, aentry) +SVL_ListEntryN (rxcall, previous_index, count, next_index, aentry) struct rx_call *rxcall; afs_int32 previous_index; afs_int32 *count; @@ -1013,7 +1013,7 @@ struct nvldbentry *aentry; /* Retrieves in vldbentries all vldb entries that match the specified attributes (by server number, partition, volume type, and flag); if volume id is specified then the associated list for that entry is returned. CAUTION: This could be a very expensive call since in most cases sequential search of all vldb entries is performed. */ -VL_ListAttributes(rxcall, attributes, nentries, vldbentries) +SVL_ListAttributes(rxcall, attributes, nentries, vldbentries) struct rx_call *rxcall; struct VldbListByAttributes *attributes; afs_int32 *nentries; @@ -1120,7 +1120,7 @@ bulkentries *vldbentries; return(ubik_EndTrans(trans)); } -VL_ListAttributesN(rxcall, attributes, nentries, vldbentries) +SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries) struct rx_call *rxcall; struct VldbListByAttributes *attributes; afs_int32 *nentries; @@ -1232,7 +1232,7 @@ nbulkentries *vldbentries; } -VL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, vldbentries, nextstartindex) +SVL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, vldbentries, nextstartindex) struct rx_call *rxcall; struct VldbListByAttributes *attributes; char * name; /* Wildcarded volume name */ @@ -1447,7 +1447,7 @@ VL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, vldbentries, * returned. CAUTION: This could be a very expensive call since in most * cases sequential search of all vldb entries is performed. */ -VL_LinkedList(rxcall, attributes, nentries, vldbentries) +SVL_LinkedList(rxcall, attributes, nentries, vldbentries) struct rx_call *rxcall; struct VldbListByAttributes *attributes; afs_int32 *nentries; @@ -1564,7 +1564,7 @@ VL_LinkedList(rxcall, attributes, nentries, vldbentries) return(ubik_EndTrans(trans)); } -VL_LinkedListN(rxcall, attributes, nentries, vldbentries) +SVL_LinkedListN(rxcall, attributes, nentries, vldbentries) struct rx_call *rxcall; struct VldbListByAttributes *attributes; afs_int32 *nentries; @@ -1682,7 +1682,7 @@ VL_LinkedListN(rxcall, attributes, nentries, vldbentries) } /* Get back vldb header statistics (allocs, frees, maxvolumeid, totalentries, etc) and dynamic statistics (number of requests and/or aborts per remote procedure call, etc) */ -VL_GetStats(rxcall, stats, vital_header) +SVL_GetStats(rxcall, stats, vital_header) struct rx_call *rxcall; vldstats *stats; vital_vlheader *vital_header; @@ -1707,7 +1707,7 @@ vital_vlheader *vital_header; * easy to do. In the future, it might require a little bit of grunging * through the VLDB, but that's life. */ -VL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp) +SVL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp) struct rx_call *rxcall; afs_int32 Handle, spare2; struct VLCallBack *spare3; @@ -1749,7 +1749,7 @@ bulkaddrs *addrsp; #define PADDR(addr) printf("%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8) &0xff, addr&0xff); -VL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) +SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) struct rx_call *rxcall; afsUUID *uuidp; afs_int32 spare1; @@ -2093,7 +2093,7 @@ VL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) return(ubik_EndTrans(trans)); } -VL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp) +SVL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp) struct rx_call *rxcall; struct ListAddrByAttributes *attributes; afsUUID *uuidpo; @@ -2908,7 +2908,7 @@ register afs_uint32 ipaddr1, ipaddr2; } /* see if the vlserver is back yet */ -VL_ProbeServer(rxcall) +SVL_ProbeServer(rxcall) struct rx_call *rxcall; { return 0; } diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index 79944f897..9caa6c701 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -10,7 +10,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlserver.c,v 1.1.1.9 2001/09/11 14:35:40 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/vlserver/vlserver.c,v 1.1.1.10 2002/05/11 00:03:35 hartmans Exp $"); #include #include @@ -262,8 +262,7 @@ char **argv; exit(2); } if (!rxJumbograms) { - rx_maxReceiveSize = OLD_MAX_PACKET_SIZE; - rxi_nSendFrags = rxi_nRecvFrags = 1; + rx_SetNoJumbo(); } rx_SetRxDeadTime(50); diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index a76f35c6c..69733637f 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -14,7 +14,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/vol/ihandle.c,v 1.1.1.5 2001/10/14 18:07:22 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/vol/ihandle.c,v 1.1.1.6 2002/05/11 00:03:40 hartmans Exp $"); #include #include @@ -25,7 +25,7 @@ RCSID("$Header: /tmp/cvstemp/openafs/src/vol/ihandle.c,v 1.1.1.5 2001/10/14 18:0 #include #include #include -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || defined(AFS_NBSD_ENV) #include #include #endif @@ -94,9 +94,6 @@ void ih_glock_init() /* Initialize the file descriptor cache */ void ih_Initialize() { int i; -#ifdef AFS_SUN5_ENV - struct rlimit rlim; -#endif /* AFS_SUN5_ENV */ assert(!ih_Inited); ih_Inited = 1; DLL_INIT_LIST(ihAvailHead, ihAvailTail); @@ -107,13 +104,27 @@ void ih_Initialize() { } #if defined(AFS_NT40_ENV) fdMaxCacheSize = FD_MAX_CACHESIZE; -#elif defined(AFS_SUN5_ENV) - assert(getrlimit(RLIMIT_NOFILE, &rlim) == 0); - rlim.rlim_cur = rlim.rlim_max; - assert(setrlimit(RLIMIT_NOFILE, &rlim) == 0); - fdMaxCacheSize = rlim.rlim_cur-FD_HANDLE_SETASIDE; - fdMaxCacheSize = MIN(fdMaxCacheSize, FD_MAX_CACHESIZE); - assert(fdMaxCacheSize > 0); +#elif defined(AFS_SUN5_ENV) || defined(AFS_NBSD_ENV) + { + struct rlimit rlim; + assert(getrlimit(RLIMIT_NOFILE, &rlim) == 0); + rlim.rlim_cur = rlim.rlim_max; + assert(setrlimit(RLIMIT_NOFILE, &rlim) == 0); + fdMaxCacheSize = rlim.rlim_cur-FD_HANDLE_SETASIDE; +#ifdef AFS_NBSD_ENV + /* XXX this is to avoid using up all system fd netbsd is + * somewhat broken and have set maximum fd for a root process + * to the same as system fd that is avaible, so if the + * fileserver uses all up process fds, all system fd will be + * used up too ! + * + * Check for this better + */ + fdMaxCacheSize /= 4; +#endif + fdMaxCacheSize = MIN(fdMaxCacheSize, FD_MAX_CACHESIZE); + assert(fdMaxCacheSize > 0); + } #elif defined(AFS_HPUX_ENV) /* Avoid problems with "UFSOpen: igetinode failed" panics on HPUX 11.0 */ fdMaxCacheSize = 0; diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 0ffb4b908..aedefa44f 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -91,7 +91,7 @@ Vnodes with 0 inode pointers in RW volumes are now deleted. #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.9 2001/10/14 18:07:25 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/vol/vol-salvage.c,v 1.1.1.10 2002/05/11 00:03:47 hartmans Exp $"); #include #include @@ -2451,6 +2451,7 @@ int SalvageIndex(Inode ino, VnodeClass class, int RW, if (check) { if (!Showmode) { Log("Vnode %d: inode number incorrect (is %s should be %s). FileSize=%d\n", + vnodeNumber, PrintInode(stmp1, VNDISK_GET_INO(vnode)), PrintInode(stmp2, ip->inodeNumber), ip->byteCount); diff --git a/src/xstat/xstat_fs_callback.c b/src/xstat/xstat_fs_callback.c index 4453b813e..76ab9fde9 100644 --- a/src/xstat/xstat_fs_callback.c +++ b/src/xstat/xstat_fs_callback.c @@ -25,7 +25,7 @@ #include #include -RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_fs_callback.c,v 1.1.1.4 2001/07/14 22:25:17 hartmans Exp $"); +RCSID("$Header: /tmp/cvstemp/openafs/src/xstat/xstat_fs_callback.c,v 1.1.1.5 2002/05/11 00:04:10 hartmans Exp $"); #include #include /*Standard I/O stuff*/ @@ -646,7 +646,7 @@ int SRXAFSCB_GetCellServDB( struct rx_call *a_call, afs_int32 a_index, char **a_name, - afs_int32 *a_hosts) + serverList *a_hosts) { return RXGEN_OPCODE; } -- 2.39.5