which included commits to RCS files with non-trunk default branches.
#ifndef AL_WIZARD_H
#define AL_WIZARD_H
+#include <windows.h>
+#include <prsht.h>
#include <WINNT/TaLocale.h>
#include <WINNT/subclass.h>
#define iswhite(_ch) ((_ch)==TEXT(' ') || (_ch)==TEXT('\t'))
-LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, SERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus)
+LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, AFSSERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus)
{
BOOL rc = TRUE;
ULONG status;
*
*/
-LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, SERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus = NULL);
+LPIDENT AfsClass_CreateService (LPIDENT lpiServer, LPTSTR pszService, LPTSTR pszCommand, LPTSTR pszParams, LPTSTR pszNotifier, AFSSERVICETYPE type, SYSTEMTIME *pstIfCron, ULONG *pStatus = NULL);
BOOL AfsClass_DeleteService (LPIDENT lpiService, ULONG *pStatus = NULL);
BOOL AfsClass_StartService (LPIDENT lpiStart, BOOL fTemporary, ULONG *pStatus = NULL);
struct {
PVOID hServer; // [in] token from BosServerOpen()
LPTSTR pszService; // [in] name of new service
- SERVICETYPE type; // [in] service type (stCRON, stFS, etc)
+ AFSSERVICETYPE type; // [in] service type (stCRON, stFS, etc)
LPTSTR pszCommand; // [in] full command-line to execute
LPTSTR pszTimeCron; // [in] date/time (CRON only)
LPTSTR pszNotifier; // [in] command executed on exit
TCHAR szParams[ cchNAME ];
TCHAR szNotifier[ cchNAME ];
TCHAR szLogFile[ cchNAME ];
- SERVICETYPE type;
+ AFSSERVICETYPE type;
BOOL fRunNow;
SYSTEMTIME stIfCron;
} SVC_CREATE_PARAMS, *LPSVC_CREATE_PARAMS;
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.\r
+; * All Rights Reserved.\r
+; *\r
+; * This software has been released under the terms of the IBM Public\r
+; * License. For details, see the LICENSE file in the top-level source\r
+; * directory or online at http://www.openafs.org/dl/license10.html\r
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h\r
; */\r
;\r
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.
+; * All Rights Reserved.
+; *
+; * This software has been released under the terms of the IBM Public
+; * License. For details, see the LICENSE file in the top-level source
+; * directory or online at http://www.openafs.org/dl/license10.html
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h
; */
;
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.\r
+; * All Rights Reserved.\r
+; *\r
+; * This software has been released under the terms of the IBM Public\r
+; * License. For details, see the LICENSE file in the top-level source\r
+; * directory or online at http://www.openafs.org/dl/license10.html\r
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h\r
; */\r
;\r
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.\r
+; * All Rights Reserved.\r
+; *\r
+; * This software has been released under the terms of the IBM Public\r
+; * License. For details, see the LICENSE file in the top-level source\r
+; * directory or online at http://www.openafs.org/dl/license10.html\r
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h\r
; */\r
;\r
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.\r
+; * All Rights Reserved.\r
+; *\r
+; * This software has been released under the terms of the IBM Public\r
+; * License. For details, see the LICENSE file in the top-level source\r
+; * directory or online at http://www.openafs.org/dl/license10.html\r
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h\r
; */\r
;\r
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.\r
+; * All Rights Reserved.\r
+; *\r
+; * This software has been released under the terms of the IBM Public\r
+; * License. For details, see the LICENSE file in the top-level source\r
+; * directory or online at http://www.openafs.org/dl/license10.html\r
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h\r
; */\r
;\r
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.\r
+; * All Rights Reserved.\r
+; *\r
+; * This software has been released under the terms of the IBM Public\r
+; * License. For details, see the LICENSE file in the top-level source\r
+; * directory or online at http://www.openafs.org/dl/license10.html\r
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h\r
; */\r
;\r
-; Copyright 2000, International Business Machines Corporation and others.
-; All Rights Reserved.
-;
-; This software has been released under the terms of the IBM Public
-; License. For details, see the LICENSE file in the top-level source
-; directory or online at http://www.openafs.org/dl/license10.html
-
+;/* Copyright 2000, International Business Machines Corporation and others.\r
+; * All Rights Reserved.\r
+; *\r
+; * This software has been released under the terms of the IBM Public\r
+; * License. For details, see the LICENSE file in the top-level source\r
+; * directory or online at http://www.openafs.org/dl/license10.html\r
; * event.mc --(mc)--> event.[h|rc] --(logevent.h + event.h)--> afsevent.h\r
; */\r
;\r
{
/* initiate our pool of osi_linux_mem structs */
al_mem_pool = afs_atomlist_create(sizeof(struct osi_linux_mem),
- sizeof(long)*1024, vmalloc, local_free);
+ sizeof(long)*1024, (void *)vmalloc,
+ local_free);
if (!al_mem_pool) {
printf("afs_osi_Alloc: Error in initialization(atomlist_create)\n");
return 0;
}
/* initialize the hash table to hold references to alloc'ed chunks */
- lh_mem_htab = afs_lhash_create(hash_equal, vmalloc, local_free);
+ lh_mem_htab = afs_lhash_create(hash_equal, (void *)vmalloc, local_free);
if (!lh_mem_htab) {
printf("afs_osi_Alloc: Error in initialization(lhash_create)\n");
return 0;
#ifdef AFS_SPARC64_LINUX20_ENV
asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist)
{
- gid_t gl[NGROUPS];
- int ret, i;
- mm_segment_t old_fs = get_fs ();
-
- if ((unsigned) gidsetsize > NGROUPS)
- return -EINVAL;
- for (i = 0; i < gidsetsize; i++, grouplist++)
- if (__get_user (gl[i], grouplist))
- return -EFAULT;
- set_fs (KERNEL_DS);
- ret = afs_xsetgroups(gidsetsize, gl);
- set_fs (old_fs);
- return ret;
+ gid_t gl[NGROUPS];
+ int ret, i;
+ mm_segment_t old_fs = get_fs ();
+
+ if ((unsigned) gidsetsize > NGROUPS)
+ return -EINVAL;
+ for (i = 0; i < gidsetsize; i++, grouplist++)
+ if (__get_user (gl[i], grouplist))
+ return -EFAULT;
+ set_fs (KERNEL_DS);
+ ret = afs_xsetgroups(gidsetsize, gl);
+ set_fs (old_fs);
+ return ret;
}
#endif
#if defined(AFS_GLOBAL_SUNLOCK)
static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
#endif
+
void afs_osi_Wakeup(char *event);
void afs_osi_Sleep(char *event);
struct list_head i_hash;
struct list_head i_list;
struct list_head i_dentry;
-
+#if defined(AFS_LINUX24_ENV)
+ struct list_head i_dirty_buffers;
+#endif
unsigned long i_ino;
unsigned int i_count;
kdev_t i_dev;
#if defined(AFS_LINUX24_ENV)
struct pipe_inode_info *i_pipe;
struct block_device *i_bdev;
+ unsigned long i_dnotify_mask;
+ struct dnotify_struct *i_dnotify;
#endif
unsigned long i_state;
* pages to disk. So it needs an inode syncing function to update metadata when it
* has synced some pages of a file to disk.
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+void afs_write_inode(struct inode *ip, int unused)
+#else
void afs_write_inode(struct inode *ip)
+#endif
{
/* and put it back on our dummy list. */
list_del(&ip->i_list);
if (!vfsp
#if !defined(AFS_SUN58_ENV)
&& !(vfsp = vfs_devsearch(dev))
+#else
+ && !(vfsp = vfs_dev2vfsp(dev))
#endif
) {
return (ENODEV);
#else
u_int *offp,
#endif
- u_int *lenp, int flags, struct AFS_UCRED *credp);
+#if defined(AFS_SUN58_ENV)
+ size_t *lenp,
+#else
+ u_int *lenp,
+#endif
+ int flags, struct AFS_UCRED *credp);
* As of 4/98, that shouldn't be possible, but we'll be defensive here
* in case someone tries to relax all the serialization of read and write
* operations with harmless things like stat. */
+#if defined(AFS_SUN58_ENV)
+ page = page_create_va(vp, toffset, PAGESIZE, PG_WAIT|PG_EXCL, seg, addr);
+#else
page = page_create_va(vp, toffset, PAGESIZE, PG_WAIT|PG_EXCL, seg->s_as, addr);
+#endif
#else
page = page_create(vp, toffset, PAGESIZE, PG_WAIT);
#endif
struct vcache *avc;
struct page *pages;
afs_int32 code = 0;
- afs_int32 tlen, endPos, NPages=0;
+#if defined(AFS_SUN58_ENV)
+ size_t tlen;
+#else
+ afs_int32 tlen;
+#endif
+ afs_int32 endPos, NPages=0;
#if defined(AFS_SUN56_ENV)
u_offset_t toff = off;
#else
#else
u_int *offp,
#endif
- u_int *lenp, int flags, struct AFS_UCRED *credp)
+#if defined(AFS_SUN58_ENV)
+ size_t *lenp,
+#else
+ u_int *lenp,
+#endif
+ int flags, struct AFS_UCRED *credp)
{
struct buf *tbuf;
struct vcache *avc = (struct vcache *)vp;
afs_globalVFS = afsp;
afsp->vfs_bsize = 8192;
afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
- afsp->vfs_fsid.val[1] = AFS_VFSFSID;
+ afsp->vfs_fsid.val[1] = (afs_int32) AFS_VFSFSID;
return 0;
}
abp->f_type = 0;
abp->f_bsize = afsp->vfs_bsize;
abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */
- abp->f_fsid.val[1] = AFS_VFSFSID;
+ abp->f_fsid.val[1] = (afs_int32) AFS_VFSFSID;
return 0;
}
afs_Trace2(afs_iclSetp, CM_TRACE_GETATTR, ICL_TYPE_POINTER, avc,
ICL_TYPE_INT32, avc->m.Length);
+#if defined(AFS_SUN5_ENV)
+ if (flags & ATTR_HINT) {
+ code = afs_CopyOutAttrs(avc, attrs);
+ return code;
+ }
+#endif
+
#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
afs_BozonLock(&avc->pvnLock, avc);
#endif
if (cryptall) {
level=rxkad_crypt;
- isec=3;
- }
- else {
+ } else {
level=rxkad_clear;
- isec=2;
}
- /* kerberos tickets on channel 2 */
- csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey,
- /* kvno */ tu->ct.AuthHandle, tu->stLen, tu->stp);
+ isec=2;
+ /* kerberos tickets on channel 2 */
+ csec = rxkad_NewClientSecurityObject(level, tu->ct.HandShakeKey,
+ /* kvno */
+ tu->ct.AuthHandle,
+ tu->stLen, tu->stp);
}
if (isec == 0)
csec = rxnull_NewClientSecurityObject();
clients. This is probably OK, but I don't want to see too much of it.
*/
-#define ranstage(x) (x)= (afs_uint32) (3141592621*((afs_uint32)x)+1)
+#define ranstage(x) (x)= (afs_uint32) (3141592621U*((afs_uint32)x)+1)
extern afs_int32 rxi_getaddr();
unsigned int afs_random()
sema_init(&ip->i_zombie, 1);
init_waitqueue_head(&ip->i_wait);
spin_lock_init(&ip->i_data.i_shared_lock);
- INIT_LIST_HEAD(&ip->i_data.pages);
+ INIT_LIST_HEAD(&ip->i_data.clean_pages);
+ INIT_LIST_HEAD(&ip->i_data.dirty_pages);
+ INIT_LIST_HEAD(&ip->i_data.locked_pages);
+ INIT_LIST_HEAD(&ip->i_dirty_buffers);
ip->i_data.host = (void*) ip;
ip->i_mapping = &ip->i_data;
#else
static ParseHostLine();
static ParseCellLine();
+static afsconf_OpenInternal();
+static afsconf_CloseInternal();
+static afsconf_Reopen();
static struct afsconf_servPair serviceTable [] = {
"afs", 7000,
#ifdef AFS_NT40_ENV
return _utime(tbuffer, NULL);
#else
- gettimeofday(&tvp[0], (char *) 0);
+ gettimeofday(&tvp[0], NULL);
tvp[1] = tvp[0];
return utimes(tbuffer, tvp);
#endif /* AFS_NT40_ENV */
/* A lexical scanner generated by flex */\r
\r
/* Scanner skeleton version:\r
- * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1 2000/11/04 04:23:01 hartmans Exp $\r
+ * $Header: /tmp/cvstemp/openafs/src/comerr/et_lex.lex_nt.c,v 1.1.1.2 2001/01/19 20:54:19 hartmans Exp $\r
*/\r
\r
#define FLEX_SCANNER\r
AR=ar
AS=as
CP=cp
-MT_CC=cc
+MT_CC=/usr/bin/cc
INSTALL=${SRCDIR}bin/install
-LD=ld
+LD=/usr/bin/ld
LEX=lex
MV=mv
RANLIB=/bin/true
#
# libraries
XLIBS=-lsocket -lnsl -lintl -ldl
-TXLIBS=-lcurses
+TXLIBS=-L/usr/ccs/lib -lcurses
MTLIBS=-lpthread -lsocket
XLIBELFA=-lelf
XLIBKVM=-lkvm
AFS_component_version_number.o: AFS_component_version_number.c
AFS_component_version_number.c:
- echo 'char cml_version_number[]="@(#)CML not accessible: No version Information";' >AFS_component_version_number.c;
- echo 'char* AFSVersion = "afs??"; ' >>AFS_component_version_number.c;
+ echo 'char cml_version_number[]="@(#) OpenAFS devel built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c;
+ echo 'char* AFSVersion = "openafs devel"; ' >>AFS_component_version_number.c;
noversion: install
#define SYS_NAME_ID_sparc64_linux2 1800
#define SYS_NAME_ID_sparc64_linux22 1801
+#define SYS_NAME_ID_s390_linux2 1900
+#define SYS_NAME_ID_s390_linux22 1901
+#define SYS_NAME_ID_s390_linux24 1902
+
/*
* Placeholder to keep system-wide standard flags since this file is included by all
#define VIOC_AFS_FLUSHMOUNT _VICEIOCTL(52) /* Flush mount symlink data */
#define VIOC_RXSTAT_PROC _VICEIOCTL(53) /* Control process RX stats */
#define VIOC_RXSTAT_PEER _VICEIOCTL(54) /* Control peer RX stats */
+#define VIOC_GETRXKCRYPT _VICEIOCTL(55) /* Set rxkad enc flag */
+#define VIOC_SETRXKCRYPT _VICEIOCTL(56) /* Set rxkad enc flag */
#endif /* AFS_VENUS_H */
#ifdef AFS_SPARC64_LINUX20_ENV
#include "conf-sparc64-linux.h"
#else
+#ifdef AFS_S390_LINUX20_ENV
+#include "conf-s390-linux.h"
+#else
#include "conf-i386-linux.h"
+#endif /* AFS_S390_LINUX20_ENV */
#endif /* AFS_SPARC64_LINUX20_ENV */
#endif /* AFS_SPARC_LINUX20_ENV */
#endif
#include <netdb.h>
#include <errno.h>
#include <string.h>
+#include <unistd.h>
#include <time.h>
#if defined(AIX)
#include <sys/syslog.h>
static char **shells, *strings;
static char **curshell = NULL;
-extern char **initshells();
+static char **initshells();
/*
* Get a list of shells from SHELLS, if it exists.
curshell = NULL;
}
-setusershell()
-{
-
- curshell = initshells();
-}
-
static char **
initshells()
{
(void)fclose(fp);
return (shells);
}
+
+setusershell()
+{
+
+ curshell = initshells();
+}
+
+
+
+
+
+
static char *strend(register char *);
int gethdir(char *);
+static addpath();
+static rscan();
#ifdef notdef
static addpath(char);
fprintf(stderr, "Unable to get time of day\n");
return (0L);
}
- return (htonl((afs_int32)tv.tv_sec + 2208988800));
+ return (htonl((afs_int32)tv.tv_sec + 2208988800U));
}
/* ARGSUSED */
if ((!ka_KeyIsZero((char *) &tentry.key, sizeof(tentry.key))) &&
(showkey)) {
printf (" key (%d):", tentry.key_version);
- ka_PrintBytes (&tentry.key, sizeof(tentry.key));
+ ka_PrintBytes ((char *)&tentry.key, sizeof(tentry.key));
}
else {
if (tentry.keyCheckSum == 0)
printf ("Converting %s in realm '%s' yields key='",
as->parms[0].items->data, realm);
- ka_PrintBytes (&key, sizeof(key));
+ ka_PrintBytes ((char *)&key, sizeof(key));
printf ("'.\n");
return 0;
ka_StringToKey (as->parms[1].items->data, realm, &key);
}
else if (as->parms[2].items) {
- if (ka_ReadBytes (as->parms[2].items->data, &key, sizeof(key)) != 8) {
+ if (ka_ReadBytes (as->parms[2].items->data, (char *)&key, sizeof(key))
+ != 8) {
printf ("Key must be 8 bytes: '%s' was too long\n",
- as->parms[2].items->data);
+ as->parms[2].items->data);
return KABADCMD;
}
}
}
if (verbose) {
printf ("SessionKey: ");
- ka_PrintBytes (&token.sessionKey, sizeof(token.sessionKey));
+ ka_PrintBytes ((char *)&token.sessionKey, sizeof(token.sessionKey));
printf ("\nTicket (kvno = %d, len = %d): ", token.kvno,
token.ticketLen);
- ka_PrintBytes (token.ticket, token.ticketLen);
+ ka_PrintBytes ((char *)token.ticket, token.ticketLen);
printf ("\n");
}
return 0;
ubik_ClientDestroy(lpbkConn);
if (code) goto abort;
printf ("Key: ");
- ka_PrintBytes (&key, sizeof(key));
+ ka_PrintBytes ((char *)&key, sizeof(key));
printf ("\n");
return code;
}
else {
int i;
printf ("Key: ");
- ka_PrintBytes (&key, sizeof(key));
+ ka_PrintBytes ((char *)&key, sizeof(key));
printf (" (");
for (i=0; i<sizeof(key); i++) {
printf ("%0.2x", ((char *)&key)[i] & 0xff);
return 0;
}
-void MyAfterProc(
+int MyAfterProc(
struct cmd_syndesc *as)
{
if (!strcmp(as->name,"help")) return;
conn = 0;
}
- return;
+ return 0;
}
int init = 0, noauth;
&key, 0, 0);
if (code == 0) {
des_init_random_number_generator (&key);
- ka_ConvertBytes (buf, sizeof(buf), &key, sizeof(key));
+ ka_ConvertBytes (buf, sizeof(buf), (char *)&key,
+ sizeof(key));
es_Report ("New Admin key is %s\n", buf);
} else {
es_Report ("in get_time: set_password failed because: %d\n", code);
des_fixup_key_parity (&key);
code = set_password (tt, KA_TGS_NAME, lrealm, &key, 0, 0);
if (code == 0) {
- ka_ConvertBytes (buf, sizeof(buf), &key, sizeof(key));
+ ka_ConvertBytes (buf, sizeof(buf), (char *)&key,
+ sizeof(key));
es_Report ("New TGS key is %s\n", buf);
} else {
es_Report ("in get_time: set_password failed because: %s\n", error_message (code));
if (!bcmp(password, &(tentry->key), sizeof(EncryptionKey)))
return KAREUSED;
- code = ka_KeyCheckSum (password, &newsum);
+ code = ka_KeyCheckSum ((char *)password, &newsum);
if (code)
return code;
/* do nothing, no limits */ ;
}
else {
- code = ka_KeyCheckSum (&(tentry.key), &newsum);
+ code = ka_KeyCheckSum ((char *)&(tentry.key), &newsum);
if (code)
return code;
for (i=npwSums-1; i ; i--)
(callerIsAdmin && enc_level == rxkad_crypt))
bcopy (&tentry.key, &aentry->key, sizeof(struct ktc_encryptionKey));
else bzero (&aentry->key, sizeof(aentry->key));
- code = ka_KeyCheckSum (&tentry.key, &aentry->keyCheckSum);
+ code = ka_KeyCheckSum ((char *)&tentry.key, &aentry->keyCheckSum);
if (!tentry.pwsums[0] && npwSums > 1 && !tentry.pwsums[1]) {
aentry->reserved3 = 0x12340000;
} else {
COUNT_REQ (UGetTicket);
if (code = InitAuthServ(&tt, LOCKREAD, this_op)) goto fail;
- code = ka_LookupKvno (0, KA_TGS_NAME,
+ code = ka_LookupKvno (tt, KA_TGS_NAME,
((strlen(authDomain) > 0) ? authDomain : lrealm),
kvno, &tgskey);
if (code) goto abort;
}
ans.len = 2 + strlen(pkt->name) + strlen(pkt->inst) + strlen(pkt->realm) +
- 3/* nulls */ + sizeof(afs_int32) + strlen (buf) + 1;
+ 3/* nulls */ + (2 * sizeof(afs_int32)) + strlen (buf) + 1;
if (ans.len > sizeof(ans.data)) {
printf ("Answer packet too long\n");
return;
taddr.sin_family = AF_INET; /* added for NCR port */
if ( !sp )
{
- /* if kerberos-4 is not available, try "kerberos" */
+ /* if kerberos-4 is not available, try "kerberos-iv" */
+ krb4name = "kerberos-iv";
+ sp = getservbyname(krb4name, "udp");
+ }
+ if ( !sp )
+ {
+ /* if kerberos-iv is not available, try "kerberos" */
krb4name = "kerberos";
sp = getservbyname(krb4name, "udp");
}
printf(" Key Version = %d\n", entry->key_version);
printf(" Key = ");
- ka_PrintBytes (&entry->key, sizeof(entry->key));
+ ka_PrintBytes ((char *)&entry->key, sizeof(entry->key));
printf("\n");
/* What about asServer structs and such and misc_ath_bytes */
fprintf(out, "create -name %s", EntryName(entryp));
- ka_ConvertBytes (key, sizeof(key), &entryp->key, sizeof(entryp->key));
+ ka_ConvertBytes (key, sizeof(key), (char *)&entryp->key,
+ sizeof(entryp->key));
fprintf(out, " -initial_password foo\n", key);
strcpy(flags,"");
# System specific build commands and flags
DEFINES= -DAFSDEBUG -DKERNEL -DAFS -DVICE -DNFS -DUFS -DINET -DQUOTA -DGETMOUNT
-LD = /usr/ccs/bin/ld
-LORDER = /usr/ccs/bin/lorder
-CC = /opt/SUNWspro/bin/cc
+#These are redundant
+#LD = /usr/ccs/bin/ld
+#LORDER = /usr/ccs/bin/lorder
+#CC = /opt/SUNWspro/bin/cc
KDEFS= -Dsun4c -DSUN4C_60 -DNFSCLIENT -DSYSACCT -DOLDSCSI -DVDDRV -D_KERNEL \
-DSYSV -dn ${ARCH_DEFS}
LIBAFS = libafs.o
LIBAFSNONFS = libafs.nonfs.o
-<all -sun4x_57 sun4x_58>
+<all -sun4x_57 -sun4x_58>
DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
system install:
if [ -f "../des/Makefile" ] ; then \
- make install.lib ; \
+ $(MAKE) install.lib ; \
else \
- make libstub ; \
+ $(MAKE) libstub ; \
fi
install.lib: ${DESTDIR}lib/libafsrpc.a
#
# $ what /opt/langtools/bin/pxdb32
# /opt/langtools/bin/pxdb32:
-# HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.2 $
+# HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.3 $
#
# The problem occurs when -g and -O are both used when compiling des.c.
# The simplest way to work around the problem is to leave out either -g or -O.
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
# System specific build commands and flags
-CC = /opt/SUNWspro/bin/cc
+# Redundant
+# CC = /opt/SUNWspro/bin/cc
DEFINES= -D_REENTRANT -DAFSDEBUG -DKERNEL -DUKERNEL -DAFS -DVICE
CFLAGS=-I. -I.. ${FSINCLUDES} $(DEFINES) $(KOPTS) ${DBUG}
OPTF=-O
$(LIBAFSWEB): $(AFSWEBOBJ) ${DES}/libdes.a
-rm -f $(LIBAFSWEB)
- ld -G -M../mapfile -o $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS)
+ ${LD} -G -M../mapfile -o $(LIBAFSWEB) $(AFSWEBOBJ) ${DES}/libdes.a $(WEBLIBS)
$(LIBAFSWEBKRB): $(AFSWEBOBJKRB) $(DES)/libdes.a
-rm -f $(LIBAFSWEBKRB)
- ld -G -M../mapfile -o $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS)
+ ${LD} -G -M../mapfile -o $(LIBAFSWEBKRB) $(AFSWEBOBJKRB) ${DES}/libdes.a $(WEBLIBS)
# make ${MFLAGS} DESTDIR=${DESTDIR} install-link
install-man:
- cd man; make ${MFLAGS} DESTDIR=${DESTDIR} install
+ cd man; $(MAKE) ${MFLAGS} DESTDIR=${DESTDIR} install
install-link:
rm -f ${BINDIR}/${LINKDIR}/ntpd
clean:
$(RM) -f *.o ptserver ptint.cs.c ptint.ss.c ptclient ptint.xdr.c ptint.h \
- libprot.a pts readgroup readpwd db_verify testpt pterror.h pterror.c \
+ libprot.a pts readgroup readpwd db_verify testpt pt_util pterror.h pterror.c \
core AFS_component_version_number.c
ptserver: ptserver.o ptutils.o ptprocs.o ptint.ss.o ptint.xdr.o utils.o $(LIBS) ${auditlib}
$(RM) -f libprot.a
$(AR) r libprot.a ${LIBOBJS} AFS_component_version_number.o
$(RANLIB) libprot.a
-
pts: pts.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
$(CC) ${CFLAGS} -o pts pts.o ${SRCDIR}lib/afs/libcmd.a libprot.a ${LIBS} ${XLIBS}
testpt.o: testpt.c ${INCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
+pt_util: pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS)
+ $(CC) ${CFLAGS} -o pt_util pt_util.o ptutils.o ubik.o utils.o libprot.a $(LIBS) ${XLIBS}
+
+ubik.o: ubik.c ${INCLS}
system: install
${INSTALL} Kptint.xdr.c ${UKERNELDIR}afsint/ptint.xdr.c
${INSTALL} ${UKSRCS} ${UKERNELDIR}afs
-all: ptclient libprot.a pts db_verify readgroup readpwd testpt
+all: ptclient libprot.a pts db_verify readgroup readpwd testpt pt_util
${DESTDIR}root.server/usr/afs/bin/ptserver: ptserver
${INSTALL} $? $@
${DESTDIR}bin/pts ${DESTDIR}root.server/usr/afs/bin/pts: pts
${INSTALL} $? $@
+${DESTDIR}root.server/usr/afs/bin/pt_util: pt_util
+ ${INSTALL} $? $@
+
${DESTDIR}lib/afs/libprot.a: libprot.a
${INSTALL} $? $@
-install: all ukinstall ${DESTDIR}root.server/usr/afs/bin/ptserver ${DESTDIR}root.server/usr/afs/bin/pts ${DESTDIR}bin/pts ${DESTDIR}lib/afs/libprot.a
+install: all ukinstall ${DESTDIR}root.server/usr/afs/bin/ptserver ${DESTDIR}root.server/usr/afs/bin/pts ${DESTDIR}bin/pts ${DESTDIR}lib/afs/libprot.a ${DESTDIR}root.server/usr/afs/bin/pt_util
${INSTALL} libprot.a ${DESTDIR}lib/afs/libprot.a
${INSTALL} ptserver.h ptint.h pterror.h ptclient.h ${DESTDIR}include/afs
${INSTALL} ptserver.h ${DESTDIR}include/afs/prserver.h
}
/* Check and see if database exists and is approximately OK. */
if (ntohl(cheader.headerSize) != sizeof(cheader) ||
- ntohl(cheader.eofPtr) == NULL) {
+ ntohl(cheader.eofPtr) == 0) {
if (code) return code;
com_err (whoami, PRDBBAD, "header is bad");
return PRDBBAD;
afs_int32 listElements(), listOwned(), isAMemberOf(), idToName();
static stolower();
+extern int IDCmp();
/* When abort, reset initd so that the header is read in on next call.
* Abort the transarction and return the code.
/* Delete each continuation block as a separate transaction so that no one
* transaction become to large to complete. */
nptr = tentry.next;
- while (nptr != NULL) {
+ while (nptr != (afs_int32)NULL) {
struct contentry centry;
int i;
* transaction, we start a new transaction every 50 entries. */
count = 0;
nptr = tentry.owned;
- while (nptr != NULL) {
+ while (nptr != (afs_int32)NULL) {
struct prentry nentry;
code = pr_ReadEntry (tt, 0, nptr, &nentry);
afs_int32 hostid;
int size = 0, i, code;
int added = 0;
- extern afs_int32 IDCmp();
while (host = (host & wild)) {
wild = htonl ( ntohl(wild) << 8) ;
return code;
}
-void CleanUp (as)
+int CleanUp (as)
register struct cmd_syndesc *as;
{
if (!strcmp(as->name,"help")) return;
/* Need to shutdown the ubik_client & other connections */
pr_End();
rx_Finalize();
+
+ return 0;
}
CreateGroup (as)
extern struct ubik_dbase *dbase;
extern struct afsconf_dir *prdir;
extern int pr_noAuth;
+extern int IDCmp();
extern afs_int32 AddToEntry();
static char *whoami = "ptserver";
}
hloc = 0;
nptr = tentry.next;
- while (nptr != NULL) {
+ while (nptr != 0) {
code = pr_ReadCoEntry(at,0,nptr,¢ry);
if (code != 0) return code;
if ((centry.id != bid) || !(centry.flags & PRCONT)) return PRDBBAD;
if (code) return code;
}
nptr = tentry->next;
- while (nptr != NULL) {
+ while (nptr != (afs_int32)NULL) {
code = pr_ReadCoEntry(at,0,nptr,¢ry);
if (code != 0) return PRDBFAIL;
for (i=0;i<COSIZE;i++) {
}
last = 0;
nptr = entry->next;
- while (nptr != NULL) {
+ while (nptr != (afs_int32)NULL) {
code = pr_ReadCoEntry(tt,0,nptr,&nentry);
if (code != 0) return code;
last = nptr;
bzero(&aentry,sizeof(aentry));
aentry.flags |= PRCONT;
aentry.id = entry->id;
- aentry.next = NULL;
+ aentry.next = 0;
aentry.entries[0] = aid;
code = pr_WriteCoEntry(tt,0,nptr,&aentry);
if (code != 0) return code;
afs_int32 nptr;
int size;
int count = 0;
- extern afs_int32 IDCmp();
size = 0;
alist->prlist_val = 0;
if (code) return code;
}
- for (nptr = tentry->next; nptr != NULL; nptr = centry.next) {
+ for (nptr = tentry->next; nptr != 0; nptr = centry.next) {
/* look through cont entries */
code = pr_ReadCoEntry(at,0,nptr,¢ry);
if (code != 0) return code;
afs_int32 nptr;
afs_int32 size;
int count = 0;
- extern afs_int32 IDCmp();
size = 0;
alist->prlist_val = 0;
}
nptr = tentry->next;
- while (nptr != NULL) {
+ while (nptr != (afs_uint32)NULL) {
/* look through cont entries */
code = pr_ReadCoEntry(at,0,nptr,¢ry);
if (code != 0) return code;
if (!code) {
nptr = tentry2->next;
- while (nptr != NULL) {
+ while (nptr != (afs_uint32)NULL) {
/* look through cont entries */
code = pr_ReadCoEntry(at,0,nptr,¢ry);
if (code != 0) break;
struct prentry tentry;
int size;
int count = 0;
- extern afs_int32 IDCmp();
size = 0;
alist->prlist_val = 0;
}
if ((ntohl(cheader.version) == PRDBVERSION) &&
ntohl(cheader.headerSize) == sizeof(cheader) &&
- ntohl(cheader.eofPtr) != NULL &&
+ ntohl(cheader.eofPtr) != (afs_uint32)NULL &&
FindByID(tt,ANONYMOUSID) != 0){
/* database exists, so we don't have to build it */
code = ubik_EndTrans(tt);
*/
if ((ntohl(cheader.version) == PRDBVERSION) &&
ntohl(cheader.headerSize) == sizeof(cheader) &&
- ntohl(cheader.eofPtr) != NULL &&
+ ntohl(cheader.eofPtr) != (afs_uint32)NULL &&
FindByID(tt,ANONYMOUSID) != 0){
/* database exists, so we don't have to build it */
code = ubik_EndTrans(tt);
static char tmp_cell_file[128] = "";
static char tmp_noauth_file[128] = "";
-static afs_int32 MyAfterProc (as, arock)
+static int MyAfterProc (as, arock)
struct cmd_syndesc *as;
char *arock;
{ afs_int32 code;
return 0;
}
-static afs_int32 MyBeforeProc (as, arock)
+static int MyBeforeProc (as, arock)
struct cmd_syndesc *as;
char *arock;
{ afs_int32 code;
if (code != 0) return 0;
if (aid == tentry.id) return entry;
entry = tentry.nextID;
- while (entry != NULL) {
+ while (entry != 0) {
bzero(&tentry,sizeof(tentry));
code = pr_ReadEntry(at,0,entry,&tentry);
if (code != 0) return 0;
if (code != 0) return 0;
if ((strncmp(aname,tentryp->name,PR_MAXNAMELEN)) == 0) return entry;
entry = tentryp->nextName;
- while (entry != NULL) {
+ while (entry != 0) {
bzero(tentryp, sizeof(struct prentry));
code = pr_ReadEntry(at,0,entry, tentryp);
if (code != 0) return 0;
return PRSUCCESS;
}
-afs_int32 IDCmp(a,b)
+int IDCmp(a,b)
afs_int32 *a;
afs_int32 *b;
{
bzero(&tentry,sizeof(tentry));
bzero(&bentry,sizeof(bentry));
trail = 0;
- if (current == NULL) return PRSUCCESS; /* already gone */
+ if (current == 0) return PRSUCCESS; /* already gone */
code = pr_ReadEntry(tt,0,current,&tentry);
if (code) return PRDBFAIL;
while (aid != tentry.id) {
trail = current;
current = tentry.nextID;
- if (current == NULL) break;
+ if (current == 0) break;
code = pr_ReadEntry(tt,0,current,&tentry);
if (code) return PRDBFAIL;
}
- if (current == NULL) return PRSUCCESS; /* we didn't find him, so he's already gone */
- if (trail == NULL) {
+ if (current == 0) return PRSUCCESS; /* we didn't find him, so he's already gone */
+ if (trail == 0) {
/* it's the first entry! */
cheader.idHash[i] = htonl(tentry.nextID);
code = pr_Write(tt,0,72+HASHSIZE*4+i*4,(char *)&cheader.idHash[i],sizeof(cheader.idHash[i]));
bzero(&tentry,sizeof(tentry));
bzero(&bentry,sizeof(bentry));
trail = 0;
- if (current == NULL) return PRSUCCESS; /* already gone */
+ if (current == 0) return PRSUCCESS; /* already gone */
code = pr_ReadEntry(tt,0,current,&tentry);
if (code) return PRDBFAIL;
while (strcmp(aname,tentry.name)) {
trail = current;
current = tentry.nextName;
- if (current == NULL) break;
+ if (current == 0) break;
code = pr_ReadEntry(tt,0,current,&tentry);
if (code) return PRDBFAIL;
}
- if (current == NULL) return PRSUCCESS; /* we didn't find him, already gone */
- if (trail == NULL) {
+ if (current == 0) return PRSUCCESS; /* we didn't find him, already gone */
+ if (trail == 0) {
/* it's the first entry! */
cheader.nameHash[i] = htonl(tentry.nextName);
code = pr_Write(tt,0,72+i*4,(char *)&cheader.nameHash[i],sizeof(cheader.nameHash[i]));
le = &thisEntry;
lastLoc = 0;
nptr = thisEntry.owned;
- while (nptr != NULL) {
+ while (nptr != 0) {
if (nptr == lastLoc) te = le;
else {
if (&thisEntry == le) te = &thatEntry;
nptr = ntohl(cheader.orphan);
bzero(&bentry,sizeof(bentry));
loc = 0;
- while (nptr != NULL) {
+ while (nptr != 0) {
code = pr_ReadEntry(at,0,nptr,&tentry);
if (code != 0) return PRDBFAIL;
if (gid == tentry.id) {
esac
../rsh/rcmd.o: ../rsh/rcmd.c
- (cd ../rsh ; make rcmd.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR})
+ (cd ../rsh ; $(MAKE) rcmd.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR})
../rsh/herror.o: ../rsh/herror.c
- (cd ../rsh ; make herror.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR})
+ (cd ../rsh ; $(MAKE) herror.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR})
../inetd/ta-rauth.o: ../inetd/ta-rauth.c
- (cd ../inetd ; make ta-rauth.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR})
+ (cd ../inetd ; $(MAKE) ta-rauth.o SRCDIR=${SRCDIR} DESTDIR=${DESTDIR})
clean:
clean:
../login/libutil.a : ../login/util_login.c ../login/util_logout.c ../login/util_logwtmp.c
- ( cd ../login ; make libutil.a )
+ ( cd ../login ; $(MAKE) libutil.a )
../rsh/rcmd.o : ../rsh/rcmd.c
- (cp AFS_component_version_number.c ../rsh/AFS_component_version_number.c ; cd ../rsh ; make rsh.o )
+ (cp AFS_component_version_number.c ../rsh/AFS_component_version_number.c ; cd ../rsh ; $(MAKE) rsh.o )
../rsh/herror.o : ../rsh/herror.c
- ( cd ../rsh ; make herror.o )
+ ( cd ../rsh ; $(MAKE) herror.o )
clean:
rm -f ${OBJS} core rlogind AFS_component_version_number.c
rsh.o: rsh.c AFS_component_version_number.c
../rlogind/herror.o: ../rlogind/herror.c
- (cd ../rlogind ; make herror.o )
+ (cd ../rlogind ; $(MAKE) herror.o )
../inetd/ta-rauth.o : ../inetd/ta-rauth.c
- (cd ../inetd ; make ta-rauth.o DESTDIR=${DESTDIR})
+ (cd ../inetd ; $(MAKE) ta-rauth.o DESTDIR=${DESTDIR})
clean:
rm -f ${OBJS} core rsh *.BAK AFS_component_version_number.c
nodomain = 1;
return(0);
}
- ldomain[MAXHOSTNAMELEN] = NULL;
+ ldomain[MAXHOSTNAMELEN] = '\0';
if ((domainp = index(ldomain, '.')) == (char *)NULL) {
nodomain = 1;
return(0);
struct rx_call *rxi_NewCall();
void rxi_FreeCall();
struct rx_call *rxi_FindCall();
-void rx_ListenerProc();
int rxi_ReadPacket();
struct rx_packet *rxi_ReceivePacket();
struct rx_packet *rxi_ReceiveDataPacket();
}
PROCESS rx_listenerPid; /* LWP process id of socket listener process */
-void rx_ListenerProc();
+static void rx_ListenerProc(void *dummy);
/*
* Delay the current thread the specified number of seconds.
/* This is the listener process request loop. The listener process loop
* becomes a server thread when rxi_ListenerProc returns, and stays
* server thread until rxi_ServerProc returns. */
-static void rx_ListenerProc()
+static void rx_ListenerProc(void *dummy)
{
int threadID;
int sock;
*/
static int rx_pthread_event_rescheduled = 0;
+static void rx_ListenerProc(void *);
+
/*
* We supply an event handling thread for Rx's event processing.
* The condition variable is used to wakeup the thread whenever a new
static def_package();
static def_prefix();
static def_startingopcode();
+static def_statindex();
static def_split();
static customize_struct();
static def_special();
static void init_random_int32 ()
{ struct timeval key;
- gettimeofday (&key, (char *) 0);
+ gettimeofday (&key, NULL);
LOCK_RM
fc_keysched (&key, random_int32_schedule);
UNLOCK_RM
$(LD) ${LDFLAGS} -shared -all -o afskauthlib.so sgi_auth.o $(KAFSLIBS) ${AUTHFILES}
../rsh/rcmd.o: ../rsh/rcmd.c
- (cd ../rsh ; make rcmd.o )
+ (cd ../rsh ; $(MAKE) rcmd.o )
../rsh/herror.o: ../rsh/herror.c
- (cd ../rsh ; make herror.o )
+ (cd ../rsh ; $(MAKE) herror.o )
sgi_auth.o: sgi_auth.c
${CC} ${CFLAGS} -c sgi_auth.c
{
struct rx_connection *conn;
clientcred creds;
- afs_int32 errorcode, groups[NGROUPS_MAX], errornumber, ins= data->in_size;
+ afs_int32 errorcode, errornumber, ins= data->in_size;
+ afs_uint32 groups[NGROUPS_MAX];
rmtbulk InData, OutData;
char pathname[256], *pathp = pathname, *inbuffer;
#if 0/*ndef HAVE_GETCWD*/ /* XXX enable when autoconf happens */
* use time and pid to try to get some initial randomness.
*/
#if !defined(UKERNEL)
-#define ranstage(x) (x)= (afs_uint32) (3141592621*((afs_uint32)x)+1)
+#define ranstage(x) (x)= (afs_uint32) (3141592621U*((afs_uint32)x)+1)
unsigned int afs_random(void)
{
static int usd_FileRead(
usd_handle_t usd,
char *buf,
- u_int nbytes,
- u_int *xferdP)
+ afs_uint32 nbytes,
+ afs_uint32 *xferdP)
{
int fd = (int)(usd->handle);
int got;
static int usd_FileWrite(
usd_handle_t usd,
char *buf,
- u_int nbytes,
- u_int *xferdP)
+ afs_uint32 nbytes,
+ afs_uint32 *xferdP)
{
int fd = (int)(usd->handle);
int sent;
return error;
}
+
+static afs_int32 SetCryptCmd(as)
+ struct cmd_syndesc *as;
+{
+ afs_int32 code = 0, flag;
+ struct ViceIoctl blob;
+ char *tp;
+
+ tp = as->parms[0].items->data;
+ if (strcmp(tp, "on") == 0)
+ flag = 1;
+ else if (strcmp(tp, "off") == 0)
+ flag = 0;
+ else {
+ fprintf (stderr, "%s: %s must be \"on\" or \"off\".\n", pn, tp);
+ return EINVAL;
+ }
+
+ blob.in = (char *) &flag;
+ blob.in_size = sizeof(flag);
+ blob.out_size = 0;
+ code = pioctl(0, VIOC_SETRXKCRYPT, &blob, 1);
+ if (code)
+ Die(code, (char *) 0);
+ return 0;
+}
+
+
+static afs_int32 GetCryptCmd(as)
+ struct cmd_syndesc *as;
+{
+ afs_int32 code = 0, flag;
+ struct ViceIoctl blob;
+ char *tp;
+
+ blob.in = (char *) 0;
+ blob.in_size = 0;
+ blob.out_size = sizeof(flag);
+ blob.out = space;
+
+ code = pioctl(0, VIOC_GETRXKCRYPT, &blob, 1);
+
+ if (code) Die(code, (char *) 0);
+ else {
+ tp = space;
+ bcopy(tp, &flag, sizeof(afs_int32));
+ printf("Security level is currently ");
+ if (flag == 1)
+ printf("crypt (data security).\n");
+ else
+ printf("clear.\n");
+ }
+ return 0;
+}
+
#include "AFS_component_version_number.c"
main(argc, argv)
cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "show status");
cmd_CreateAlias(ts, "sb");
+ ts = cmd_CreateSyntax("setcrypt", SetCryptCmd, 0, "set cache manager encryption flag");
+ cmd_AddParm(ts, "-crypt", CMD_SINGLE, 0, "on or off");
+
ts = cmd_CreateSyntax("rxstatproc", RxStatProcCmd, 0,
"Manage per process RX statistics");
cmd_AddParm(ts, "-enable", CMD_FLAG, CMD_OPTIONAL,
int smallMem = 0;
int rxJumbograms = 1; /* default is to send and receive jumbo grams */
-CheckSignal_Signal() {IOMGR_SoftSig(CheckSignal, 0);}
+static void CheckSignal_Signal() {IOMGR_SoftSig(CheckSignal, 0);}
static CheckSignal()
{
void showlog(void);
int UseTheForceLuke(char *path);
-
+static int IsVnodeOrphaned(VnodeId vnode);
/* Uniquifier stored in the Inode */
static Unique IUnique(u)
orphans = ORPH_ATTACH;
}
+#ifdef FAST_RESTART
+ if (ti = as->parms[16].items) { /* -DontSalvage */
+ printf("Exiting immediately without salvage. Look into the FileLog");
+ printf(" to find volumes which really need to be salvaged!\n");
+ Exit(0);
+ }
+#endif /* FAST_RESTART */
+
/* Note: if seemvol we initialize this as a standard volume utility: this has the
implication that the file server may be running; negotations have to be made with
the file server in this case to take the read write volume and associated read-only
cmd_AddParm(ts, "-showsuid", CMD_FLAG,CMD_OPTIONAL, "Report on suid/sgid files");
cmd_AddParm(ts, "-showmounts", CMD_FLAG,CMD_OPTIONAL, "Report on mountpoints");
cmd_AddParm(ts, "-orphans", CMD_SINGLE, CMD_OPTIONAL, "ignore | remove | attach");
+#ifdef FAST_RESTART
+ cmd_AddParm(ts, "-DontSalvage", CMD_FLAG, CMD_OPTIONAL, "Don't salvage. This my be set in BosConfig to let the fileserver restart immediately after a crash. Bad volumes will be taken offline");
+#endif /* FAST_RESTART */
err = cmd_Dispatch(argc, argv);
Exit(err);
}
#include <sys/time.h>
#endif /* ITIMER_REAL */
#endif /* AFS_NT40_ENV */
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_LINUX20_ENV)
#include <string.h>
#else
#include <strings.h>
return NULL;
}
if (programType == fileServer) {
+#ifndef FAST_RESTART
if (V_inUse(vp) && VolumeWriteable(vp)) {
if (!V_needsSalvaged(vp)) {
V_needsSalvaged(vp) = 1;
*ec = VSALVAGE;
return NULL;
}
+#endif /* FAST_RESTART */
if (V_destroyMe(vp) == DESTROY_ME) {
FreeVolume(vp);
Log("VAttachVolume: volume %s is junk; it should be destroyed at next salvage\n", path);
AddVolumeToHashTable(vp, V_id(vp));
vp->nextVnodeUnique = V_uniquifier(vp);
vp->vnodeIndex[vSmall].bitmap = vp->vnodeIndex[vLarge].bitmap = NULL;
+#ifndef BITMAP_LATER
if (programType == fileServer && VolumeWriteable(vp)) {
int i;
for (i = 0; i<nVNODECLASSES; i++) {
}
}
}
+#endif /* BITMAP_LATER */
if (programType == fileServer) {
if (vp->specialStatus) vp->specialStatus = 0;
*ec = VREADONLY;
return 0;
}
+#ifdef BITMAP_LATER
+ if ((programType == fileServer) && !index->bitmap) {
+ int i;
+ int wasVBUSY = 0;
+ if (vp->specialStatus == VBUSY) {
+ if (vp->goingOffline) { /* vos dump waiting for the volume to
+ go offline. We probably come here
+ from AddNewReadableResidency */
+ wasVBUSY = 1;
+ } else {
+ VOL_UNLOCK
+ while (vp->specialStatus == VBUSY)
+#ifdef AFS_PTHREAD_ENV
+ sleep(2);
+#else /* AFS_PTHREAD_ENV */
+ IOMGR_Sleep(2);
+#endif /* AFS_PTHREAD_ENV */
+ VOL_LOCK
+ }
+ }
+ if (!index->bitmap) {
+ vp->specialStatus = VBUSY; /* Stop anyone else from using it.*/
+ for (i = 0; i<nVNODECLASSES; i++) {
+ VOL_UNLOCK
+ GetBitmap(ec,vp,i);
+ VOL_LOCK
+ if (*ec) {
+ vp->specialStatus = 0;
+ vp->shuttingDown = 1; /* Let who has it free it. */
+ return NULL;
+ }
+ }
+ if (!wasVBUSY)
+ vp->specialStatus = 0; /* Allow others to have access. */
+ }
+ }
+#endif /* BITMAP_LATER */
bp = index->bitmap + index->bitmapOffset;
ep = index->bitmap + index->bitmapSize;
while (bp < ep) {
{
unsigned int offset;
*ec = 0;
+#ifdef BITMAP_LATER
+ if (!index->bitmap) return;
+#endif /* BITMAP_LATER */
offset = bitNumber>>3;
if (offset >= index->bitmapSize) {
*ec = VNOVNODE;
struct VnodeDiskObject *vnode;
unsigned int unique = 0;
FdHandle_t *fdP;
+#ifdef BITMAP_LATER
+ byte *BitMap = 0;
+#endif /* BITMAP_LATER */
*ec = 0;
the whole thing is rounded up to nearest 4
bytes, because the bit map allocator likes
it that way */
+#ifdef BITMAP_LATER
+ BitMap = (byte *) calloc(1, vip->bitmapSize);
+ assert(BitMap != NULL);
+#else /* BITMAP_LATER */
vip->bitmap = (byte *) calloc(1, vip->bitmapSize);
assert(vip->bitmap != NULL);
vip->bitmapOffset = 0;
+#endif /* BITMAP_LATER */
if (STREAM_SEEK(file,vcp->diskSize,0) != -1) {
int bitNumber = 0;
for (bitNumber = 0; bitNumber < nVnodes+100; bitNumber++) {
*ec = VSALVAGE;
break;
}
+#ifdef BITMAP_LATER
+ *(BitMap + (bitNumber>>3)) |= (1 << (bitNumber & 0x7));
+#else /* BITMAP_LATER */
*(vip->bitmap + (bitNumber>>3)) |= (1 << (bitNumber & 0x7));
+#endif /* BITMAP_LATER */
if (unique <= vnode->uniquifier)
unique = vnode->uniquifier + 1;
}
STREAM_CLOSE(file);
FDH_CLOSE(fdP);
free(vnode);
+#ifdef BITMAP_LATER
+ /* There may have been a racing condition with some other thread, both
+ * creating the bitmaps for this volume. If the other thread was faster
+ * the pointer to bitmap should already be filled and we can free ours.
+ */
+ if (vip->bitmap == NULL) {
+ vip->bitmap = BitMap;
+ vip->bitmapOffset = 0;
+ } else
+ free((byte *)BitMap);
+#endif /* BITMAP_LATER */
}
static void GetVolumePath(Error *ec, VolId volumeId, char **partitionp,
#ifdef AFS_AIX_ENV
#include <sys/lockf.h>
#endif
-#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_NT40_ENV) || defined(AFS_LINUX20_ENV)
#include <string.h>
#else
#include <strings.h>
if (!code) code = DumpString(iodp, 'n',V_name(vp));
dumpTimes[0] = fromtime;
dumpTimes[1] = V_backupDate(vp); /* Until the time the clone was made */
- if (!code) code = DumpArrayInt32(iodp, 't', (unsigned int *)dumpTimes, 2);
+ if (!code) code = DumpArrayInt32(iodp, 't', (afs_uint32 *)dumpTimes, 2);
return code;
}
register Volume *vp;
struct iod iod;
register struct iod *iodp = &iod;
- int *b1=0, *b2=0;
+ afs_int32 *b1=0, *b2=0;
int s1=0, s2=0, delo=0, tdelo;
int tag;
while (tag == D_VNODE) {
int haveStuff = 0;
bzero(buf, sizeof (buf));
- if (!ReadInt32(iodp, (unsigned int *)&vnodeNumber))
+ if (!ReadInt32(iodp, (afs_uint32 *)&vnodeNumber))
break;
ReadInt32(iodp, &vnode->uniquifier);
ReadInt32(iodp, &vnode->owner);
break;
case 'g':
- ReadInt32(iodp, (unsigned int *)&vnode->group);
+ ReadInt32(iodp, (afs_uint32 *)&vnode->group);
break;
case 'b': {
unsigned short modeBits;
register tag;
afs_uint32 beginMagic;
if (iod_getc(iodp) != D_DUMPHEADER || !ReadInt32(iodp, &beginMagic)
- || !ReadInt32(iodp, (unsigned int *)&hp->version)
+ || !ReadInt32(iodp, (afs_uint32 *)&hp->version)
|| beginMagic != DUMPBEGINMAGIC
) return 0;
hp->volumeId = 0;
return 0;
hp->nDumpTimes = (arrayLength >> 1);
for (i = 0; i<hp->nDumpTimes; i++)
- if (!ReadInt32(iodp, (unsigned int *)&hp->dumpTimes[i].from) || !ReadInt32(iodp, (unsigned int *)&hp->dumpTimes[i].to))
+ if (!ReadInt32(iodp, (afs_uint32 *)&hp->dumpTimes[i].from)
+ || !ReadInt32(iodp, (afs_uint32 *)&hp->dumpTimes[i].to))
return 0;
break;
}