From: Sam Hartman Date: Mon, 23 Apr 2001 18:45:23 +0000 (+0000) Subject: This commit was generated by cvs2svn to compensate for changes in r212, X-Git-Tag: debian/1.0.4-1~8 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=118c1e85e58cdac8ff825b640796659247b89218;p=packages%2Fo%2Fopenafs.git This commit was generated by cvs2svn to compensate for changes in r212, which included commits to RCS files with non-trunk default branches. --- diff --git a/src/BUILDNOTES b/src/BUILDNOTES index 7cf152937..52d9beea4 100644 --- a/src/BUILDNOTES +++ b/src/BUILDNOTES @@ -13,7 +13,15 @@ Redhat 7.0 (i386_linux22): source tree with a switch in include/linux/version.h. HPUX 11.0 (hp_ux110): - Does not currently build. However, you will need to make sure - the KernDevKit package from the CoreOS media is installed if - you wish to work on it. + Does not currently build libafs, which means no afs client support, + however, the client tools, and all of the server code does get built. + + For future kernel development, the KernDevKit package from the CoreOS + media is required. +HPUX 10.2 (hp_ux102): + Does not currently build libafs, which means no afs client support, + however, the client tools, and all of the server code does get built. + + Requires that the DCE-CoreTools and possible the KernDevKit package + from CoreOS media be installed. diff --git a/src/README b/src/README index 27beaa75e..c3a40097f 100644 --- a/src/README +++ b/src/README @@ -27,16 +27,17 @@ A. Creating the proper directory structure. sun4x_56/ sun4x_57/ sun4x_58/ + ppc_darwin_13/ + alpha_linux_2216_22/ (DES does not work, will require one more change to + compile) + hp_ux110/ (No client support, but db servers and utilities work) + hp_ux102/ (No client support, but db servers and utilities work) Example: % mkdir i386_linux22 % ls -CF i386_linux22/ src/ - Builds for the following platforms will not fully compile: - - hp_ux110/ - 2. Within each of those directories, create a dest/ and obj/ directory. Example: diff --git a/src/WINNT/afsd/afsd_init.c b/src/WINNT/afsd/afsd_init.c index aba2900be..f7c7feca5 100644 --- a/src/WINNT/afsd/afsd_init.c +++ b/src/WINNT/afsd/afsd_init.c @@ -31,6 +31,8 @@ extern int RXAFSCB_ExecuteRequest(); extern int RXSTATS_ExecuteRequest(); +extern afs_int32 cryptall; + char AFSConfigKeyName[] = "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters"; @@ -380,6 +382,16 @@ int afsd_InitCM(char **reasonP) afsi_log("Default sys name %s", cm_sysName); } + dummyLen = sizeof(cryptall); + code = RegQueryValueEx(parmKey, "SecurityLevel", NULL, NULL, + (BYTE *) &cryptall, &dummyLen); + if (code == ERROR_SUCCESS) + afsi_log("SecurityLevel is %s", cryptall?"crypt":"clear"); + else { + cryptall = rxkad_clear; + afsi_log("Default SecurityLevel is clear"); + } + RegCloseKey (parmKey); /* setup early variables */ diff --git a/src/WINNT/afsd/cm_conn.c b/src/WINNT/afsd/cm_conn.c index 704720c68..c78bc66d0 100644 --- a/src/WINNT/afsd/cm_conn.c +++ b/src/WINNT/afsd/cm_conn.c @@ -23,6 +23,8 @@ osi_rwlock_t cm_connLock; long RDRtimeout = CM_CONN_DEFAULTRDRTIMEOUT; +afs_int32 cryptall = 0; + void cm_PutConn(cm_conn_t *connp) { lock_ObtainWrite(&cm_connLock); @@ -329,6 +331,7 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp, int serviceID; int secIndex; struct rx_securityClass *secObjp; + afs_int32 level; if (serverp->type == CM_SERVER_VLDB) { port = htons(7003); @@ -341,7 +344,13 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp, } if (ucellp->flags & CM_UCELLFLAG_RXKAD) { secIndex = 2; - secObjp = rxkad_NewClientSecurityObject(rxkad_clear, + if (cryptall) { + level = rxkad_crypt; + tcp->cryptlevel = rxkad_crypt; + } else { + level = rxkad_clear; + } + secObjp = rxkad_NewClientSecurityObject(level, &ucellp->sessionKey, ucellp->kvno, ucellp->ticketLen, ucellp->ticketp); } @@ -382,11 +391,13 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, cm_conn_t **connpp) cm_HoldUser(userp); lock_InitializeMutex(&tcp->mx, "cm_conn_t mutex"); tcp->serverp = serverp; + tcp->cryptlevel = rxkad_clear; cm_NewRXConnection(tcp, ucellp, serverp); tcp->refCount = 1; } else { - if (tcp->ucgen < ucellp->gen) { + if ((tcp->ucgen < ucellp->gen) || (tcp->cryptlevel != cryptall)) + { rx_DestroyConnection(tcp->callp); cm_NewRXConnection(tcp, ucellp, serverp); } diff --git a/src/WINNT/afsd/cm_conn.h b/src/WINNT/afsd/cm_conn.h index 2e2ab4dbf..e03bfe601 100644 --- a/src/WINNT/afsd/cm_conn.h +++ b/src/WINNT/afsd/cm_conn.h @@ -23,6 +23,7 @@ typedef struct cm_conn { int refCount; /* locked by cm_connLock */ int ucgen; /* ucellp's generation number */ long flags; /* locked by mx */ + int cryptlevel; /* encrytion status */ } cm_conn_t; /* structure used for tracking RPC progress */ diff --git a/src/WINNT/afsd/cm_ioctl.c b/src/WINNT/afsd/cm_ioctl.c index 2764b6f66..db9346df5 100644 --- a/src/WINNT/afsd/cm_ioctl.c +++ b/src/WINNT/afsd/cm_ioctl.c @@ -35,6 +35,8 @@ osi_mutex_t cm_Afsdsbmt_Lock; +extern afs_int32 cryptall; + void cm_InitIoctl(void) { lock_InitializeMutex(&cm_Afsdsbmt_Lock, "AFSDSBMT.INI Access Lock"); @@ -1788,3 +1790,19 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp) return 0; } +long cm_IoctlGetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp) +{ + memcpy(ioctlp->outDatap, &cryptall, sizeof(cryptall)); + ioctlp->outDatap += sizeof(cryptall); + + return 0; +} + +long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp) +{ + cm_SkipIoctlPath(ioctlp); + + memcpy(&cryptall, ioctlp->inDatap, sizeof(cryptall)); + + return 0; +} diff --git a/src/WINNT/afsd/cm_ioctl.h b/src/WINNT/afsd/cm_ioctl.h index c0ce809a5..0346d29c7 100644 --- a/src/WINNT/afsd/cm_ioctl.h +++ b/src/WINNT/afsd/cm_ioctl.h @@ -119,6 +119,10 @@ extern long cm_IoctlDeletelink(smb_ioctl_t *ioctlp, cm_user_t *userp); extern long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp); +extern long cm_IoctlGetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp); + +extern long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp); + #endif /* __CM_IOCTL_INTERFACES_ONLY__ */ #endif /* __CM_IOCTL_H_ENV__ */ diff --git a/src/WINNT/afsd/fs.c b/src/WINNT/afsd/fs.c index a76946450..985c44400 100644 --- a/src/WINNT/afsd/fs.c +++ b/src/WINNT/afsd/fs.c @@ -2621,6 +2621,59 @@ struct cmd_syndesc *as; { return 0; } +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; +} + main(argc, argv) int argc; char **argv; { @@ -2838,7 +2891,12 @@ defect 3069 cmd_AddParm(ts, "-files", CMD_LIST, CMD_OPTIONAL, "specific pathnames"); cmd_AddParm(ts, "-allfiles", CMD_SINGLE, CMD_OPTIONAL, "new default (KB)"); 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("getcrypt", GetCryptCmd, 0, "get cache manager encryption flag"); + ts = cmd_CreateSyntax("trace", TraceCmd, 0, "enable or disable CM tracing"); cmd_AddParm(ts, "-on", CMD_FLAG, CMD_OPTIONAL, "enable tracing"); cmd_AddParm(ts, "-off", CMD_FLAG, CMD_OPTIONAL, "disable tracing"); diff --git a/src/WINNT/afsd/smb_iocons.h b/src/WINNT/afsd/smb_iocons.h index 78daaa6c9..4986e1f59 100644 --- a/src/WINNT/afsd/smb_iocons.h +++ b/src/WINNT/afsd/smb_iocons.h @@ -88,4 +88,7 @@ typedef struct cm_cacheParms { #define VIOC_DELSYMLINK 0x25 #define VIOC_MAKESUBMOUNT 0x26 +#define VIOC_GETRXKCRYPT 0x27 +#define VIOC_SETRXKCRYPT 0x28 + #endif /* __SMB_IOCONS_H_ENV_ */ diff --git a/src/WINNT/afsd/smb_ioctl.c b/src/WINNT/afsd/smb_ioctl.c index 63cfe5c9c..0e0f742f3 100644 --- a/src/WINNT/afsd/smb_ioctl.c +++ b/src/WINNT/afsd/smb_ioctl.c @@ -62,6 +62,8 @@ void smb_InitIoctl(void) smb_ioctlProcsp[VIOC_LISTSYMLINK] = cm_IoctlListlink; smb_ioctlProcsp[VIOC_DELSYMLINK] = cm_IoctlDeletelink; smb_ioctlProcsp[VIOC_MAKESUBMOUNT] = cm_IoctlMakeSubmount; + smb_ioctlProcsp[VIOC_GETRXKCRYPT] = cm_IoctlGetRxkcrypt; + smb_ioctlProcsp[VIOC_SETRXKCRYPT] = cm_IoctlSetRxkcrypt; } /* called to make a fid structure into an IOCTL fid structure */ diff --git a/src/WINNT/client_config/dlg_automap.cpp b/src/WINNT/client_config/dlg_automap.cpp index 0bc2869af..d179543a1 100644 --- a/src/WINNT/client_config/dlg_automap.cpp +++ b/src/WINNT/client_config/dlg_automap.cpp @@ -212,13 +212,14 @@ BOOL UpdateRegistry(DRIVEMAP *pDrive, BOOL bRemove) TCHAR szValueName[128]; HKEY hKey; LONG result; + DWORD dwDispo; if (!pDrive) return FALSE; _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSConfigKeyName); - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_SET_VALUE, &hKey) != ERROR_SUCCESS) + if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDispo) != ERROR_SUCCESS) return FALSE; _stprintf(szValueName, TEXT("%c:"), pDrive->chDrive); diff --git a/src/WINNT/client_config/drivemap.cpp b/src/WINNT/client_config/drivemap.cpp index 0b08e8eae..0acaed0a1 100644 --- a/src/WINNT/client_config/drivemap.cpp +++ b/src/WINNT/client_config/drivemap.cpp @@ -689,7 +689,7 @@ void AdjustAfsPath (LPTSTR pszTarget, LPCTSTR pszSource, BOOL fWantAFS, BOOL fWa (pszSource[4] == TEXT('\\')) || (lstrlen(pszSource) == 4))) wsprintf (pszTarget, TEXT("/afs%s"), pszSource); - else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) || ((pszSource[4] == TEXT('/')) || + else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) && ((pszSource[4] == TEXT('/')) || (pszSource[4] == TEXT('\\')) || (lstrlen(pszSource) == 4)))) lstrcpy (pszTarget, &pszSource[4]); diff --git a/src/WINNT/install/InstallShield5/GenFileGroups.bat b/src/WINNT/install/InstallShield5/GenFileGroups.bat index 600af60c8..ab12b9e4c 100644 --- a/src/WINNT/install/InstallShield5/GenFileGroups.bat +++ b/src/WINNT/install/InstallShield5/GenFileGroups.bat @@ -1262,7 +1262,7 @@ echo file0=%IS5_INCL%\afs\afs_args.h >> Client_Afs_Header_Files.fgl echo file1=%IS5_INCL%\afs\debug.h >> Client_Afs_Header_Files.fgl echo file2=%IS5_INCL%\afs\param.h >> Client_Afs_Header_Files.fgl echo file3=%IS5_INCL%\afs\afs_sysnames.h >> Client_Afs_Header_Files.fgl -echo file4=%IS5_INCL%\afs\permit_xprt.h >> Client_Afs_Header_Files.fgl +echo file4=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl echo file5=%IS5_INCL%\afs\stds.h >> Client_Afs_Header_Files.fgl echo file6=%IS5_INCL%\afs\icl.h >> Client_Afs_Header_Files.fgl echo file7=%IS5_INCL%\afs\procmgmt.h >> Client_Afs_Header_Files.fgl @@ -1349,7 +1349,6 @@ echo file87=%IS5_INCL%\afs\volser.h >> Client_Afs_Header_Files.fgl echo file88=%IS5_INCL%\afs\volint.h >> Client_Afs_Header_Files.fgl echo file89=%IS5_INCL%\afs\fs_stats.h >> Client_Afs_Header_Files.fgl echo file90=%IS5_INCL%\afs\bosint.h >> Client_Afs_Header_Files.fgl -echo file91=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl echo. >> Client_Afs_Header_Files.fgl echo [General] >> Client_Afs_Header_Files.fgl echo Type=FILELIST >> Client_Afs_Header_Files.fgl diff --git a/src/afs/DUX/osi_file.c b/src/afs/DUX/osi_file.c index 080f2340e..7391e87d8 100644 --- a/src/afs/DUX/osi_file.c +++ b/src/afs/DUX/osi_file.c @@ -23,36 +23,82 @@ extern struct mount *afs_cacheVfsp; void *osi_UFSOpen(ainode) afs_int32 ainode; { + static struct vnode *tags_vnode = NULL; struct inode *ip; register struct osi_file *afile = NULL; extern int cacheDiskType; afs_int32 code = 0; int dummy; AFS_STATCNT(osi_UFSOpen); - if(cacheDiskType != AFS_FCACHE_TYPE_UFS) { + if(cacheDiskType != AFS_FCACHE_TYPE_UFS) osi_Panic("UFSOpen called for non-UFS cache\n"); - } - if (!afs_osicred_initialized) { - /* valid for alpha_osf, SunOS, Ultrix */ - bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED)); - afs_osi_cred.cr_ref++; - afs_osicred_initialized = 1; - } + afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); - code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &ip, &dummy); - AFS_GLOCK(); - if (code) { - osi_FreeSmallSpace(afile); - osi_Panic("UFSOpen: igetinode failed"); + + switch(afs_cacheVfsp->m_stat.f_type) { + case MOUNT_UFS: + code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &ip, &dummy); + if (code) { + osi_FreeSmallSpace(afile); + osi_Panic("UFSOpen: igetinode failed"); + } + IN_UNLOCK(ip); + afile->vnode = ITOV(ip); + afile->size = VTOI(afile->vnode)->i_size; + afile->offset = 0; + afile->proc = NULL; + afile->inum = ainode; /* for hint validity checking */ + break; + case MOUNT_MSFS: { + char path[1024]; + struct nameidata nd, *ndp = &nd; + struct utask_nd utnd = { NULL, NULL }; + struct vattr attr; + + bzero(&nd, sizeof(nd)); + ndp->ni_utnd = &utnd; + ndp->ni_nameiop = LOOKUP; + ndp->ni_cred = &afs_osi_cred; + ndp->ni_segflg = UIO_SYSSPACE; + + /* get hold of a vnode for the .tags directory, so we can + lookup files relative to it */ + if(tags_vnode == NULL) { + ndp->ni_cdir = afs_cacheVfsp->m_vnodecovered; + strcpy(path, afs_cacheVfsp->m_stat.f_mntonname); + strcat(path, "/.tags"); + ndp->ni_dirp = path; + if((code = namei(ndp))) + osi_Panic("failed to lookup %s (%d)", path, code); + tags_vnode = ndp->ni_vp; + } + sprintf(path, "%d", ainode); + ndp->ni_dirp = path; + ndp->ni_cdir = tags_vnode; + if((code = namei(ndp))) + osi_Panic("failed to lookup %s (%d)", path, code); + + /* XXX this sucks, chances are we're going to do this again right + away, but apparently we can't just set the size to 0 */ + VOP_GETATTR(ndp->ni_vp, &attr, &afs_osi_cred, code); + if(code) + osi_Panic("failed to stat %s (%d)", path, code); + + afile->vnode = ndp->ni_vp; + afile->size = attr.va_size; + afile->offset = 0; + afile->proc = NULL; + afile->inum = ainode; /* for hint validity checking */ + break; } - IN_UNLOCK(ip); - afile->vnode = ITOV(ip); - afile->size = VTOI(afile->vnode)->i_size; - afile->offset = 0; - afile->proc = (int (*)()) 0; - afile->inum = ainode; /* for hint validity checking */ - return (void *)afile; + default: + osi_Panic("UFSOpen called for unknown cache-type (%d)", + afs_cacheVfsp->m_stat.f_type); + } + + AFS_GLOCK(); + return afile; } afs_osi_Stat(afile, astat) @@ -121,7 +167,9 @@ osi_UFSTruncate(afile, asize) void osi_DisableAtimes(avp) struct vnode *avp; { - struct inode *ip = VTOI(avp); + struct inode *ip; + assert(avp->v_tag == VT_UFS); + ip = VTOI(avp); ip->i_flag &= ~IACC; } diff --git a/src/afs/DUX/osi_inode.c b/src/afs/DUX/osi_inode.c index 0679b2a18..9e7776160 100644 --- a/src/afs/DUX/osi_inode.c +++ b/src/afs/DUX/osi_inode.c @@ -20,6 +20,42 @@ #include "../afs/afs_stats.h" /* statistics stuff */ #include +/* given a vnode, return the `inode number'; if it's a UFS vnode just + return the i_number from the in kernel inode struct, if not stat + the file to get the inumber from there */ +afs_uint32 +osi_vnodeToInumber(struct vnode *vnode) +{ + int error; + struct vattr attr; + + /* use faster version with UFS */ + if(vnode->v_tag == VT_UFS) + return VTOI(vnode)->i_number; + /* otherwise stat the file */ + VOP_GETATTR(vnode, &attr, NULL, error); + if(error) + osi_Panic("VOP_GETATTR = %d", error); + return attr.va_fileid; +} + +/* return the id of the device containing the file */ +afs_uint32 +osi_vnodeToDev(struct vnode *vnode) +{ + int error; + struct vattr attr; + + /* use faster version with UFS */ + if(vnode->v_tag == VT_UFS) + return VTOI(vnode)->i_dev; + /* otherwise stat the file */ + VOP_GETATTR(vnode, &attr, NULL, error); + if(error) + osi_Panic("VOP_GETATTR = %d", error); + return attr.va_rdev; +} + getinode(fs, dev, inode, ipp, perror) struct mount *fs; struct inode **ipp; @@ -67,6 +103,7 @@ getinode(fs, dev, inode, ipp, perror) } vp = (struct vnode *) fake_vnode; fake_inode_init(vp, fs); + assert(vp->v_tag == VT_UFS); code = iget(VTOI(vp), inode, &ip, 0); if (code != 0) { *perror = BAD_IGET; diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index d89069381..760e8a533 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -126,7 +126,39 @@ asmlinkage int afs_xsetgroups(int gidsetsize, gid_t *grouplist) return code; } -#ifdef AFS_SPARC64_LINUX20_ENV +#if defined(AFS_LINUX24_ENV) +/* Intercept the standard uid32 system call. */ +extern int (*sys_setgroups32p)(int gidsetsize, gid_t *grouplist); +asmlinkage int afs_xsetgroups32(int gidsetsize, gid_t *grouplist) +{ + int code; + cred_t *cr = crref(); + afs_uint32 junk; + int old_pag; + + lock_kernel(); + old_pag = PagInCred(cr); + crfree(cr); + unlock_kernel(); + + code = (*sys_setgroups32p)(gidsetsize, grouplist); + if (code) { + return code; + } + + lock_kernel(); + cr = crref(); + if (old_pag != NOPAG && PagInCred(cr) == NOPAG) { + /* re-install old pag if there's room. */ + code = setpag(&cr, old_pag, &junk, 0); + } + crfree(cr); + unlock_kernel(); + + return code; +} +#endif +#if defined(AFS_SPARC64_LINUX20_ENV) asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist) { gid_t gl[NGROUPS]; diff --git a/src/afs/LINUX/osi_vfs.h b/src/afs/LINUX/osi_vfs.h index 3e795caf2..ac09f995a 100644 --- a/src/afs/LINUX/osi_vfs.h +++ b/src/afs/LINUX/osi_vfs.h @@ -49,6 +49,9 @@ typedef struct vnode { unsigned long i_version; #if !defined(AFS_LINUX24_ENV) unsigned long i_nrpages; +#endif +#ifdef STRUCT_INODE_HAS_I_BYTES + unsigned short i_bytes; #endif struct semaphore i_sem; #if defined(AFS_LINUX24_ENV) diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index f471d0819..36dd7aa7e 100644 --- a/src/afs/LINUX/osi_vfsops.c +++ b/src/afs/LINUX/osi_vfsops.c @@ -89,6 +89,9 @@ struct super_block *afs_read_super(struct super_block *sb, void *data, sb->s_blocksize_bits = 10; sb->s_magic = AFS_VFSMAGIC; sb->s_op = &afs_sops; /* Super block (vfs) ops */ +#if defined(MAX_NON_LFS) + sb->s_maxbytes = MAX_NON_LFS; +#endif code = afs_root(sb); if (code) MOD_DEC_USE_COUNT; @@ -134,7 +137,7 @@ static int afs_root(struct super_block *afsp) /* setup super_block and mount point inode. */ afs_globalVp = tvp; #if defined(AFS_LINUX24_ENV) - afsp->s_root = d_alloc_root((struct inode*)tvp); + afsp->s_root = d_alloc_root((struct inode*)&tvp->v); #else afsp->s_root = d_alloc_root((struct inode*)tvp, NULL); #endif @@ -255,8 +258,10 @@ void afs_put_super(struct super_block *sbp) AFS_GLOCK(); AFS_STATCNT(afs_unmount); - if (!suser()) + if (!suser()) { + AFS_GUNLOCK(); return; + } afs_globalVFS = 0; afs_globalVp = 0; diff --git a/src/afs/LINUX/osi_vm.c b/src/afs/LINUX/osi_vm.c index 2b8fbb793..73ba8561f 100644 --- a/src/afs/LINUX/osi_vm.c +++ b/src/afs/LINUX/osi_vm.c @@ -45,7 +45,13 @@ int osi_VM_FlushVCache(struct vcache *avc, int *slept) if (avc->opens != 0) return EBUSY; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) + truncate_inode_pages(&ip->i_data, 0); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15) + truncate_inode_pages(ip, 0); +#else invalidate_inode_pages(ip); +#endif return 0; } @@ -88,7 +94,17 @@ void osi_VM_StoreAllSegments(struct vcache *avc) */ void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) + struct inode *ip = (struct inode*)avc; + + truncate_inode_pages(&ip->i_data, 0); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15) + struct inode *ip = (struct inode*)avc; + + truncate_inode_pages(ip, 0); +#else invalidate_inode_pages((struct inode*)avc); +#endif } /* Purge pages beyond end-of-file, when truncating a file. @@ -99,5 +115,15 @@ void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp) */ void osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) + struct inode *ip = (struct inode*)avc; + + truncate_inode_pages(&ip->i_data, alen); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15) + struct inode *ip = (struct inode*)avc; + + truncate_inode_pages(ip, alen); +#else invalidate_inode_pages((struct inode*)avc); +#endif } diff --git a/src/afs/Makefile b/src/afs/Makefile index a73f40f7b..efc6126af 100644 --- a/src/afs/Makefile +++ b/src/afs/Makefile @@ -6,7 +6,6 @@ # directory or online at http://www.openafs.org/dl/license10.html SHELL=/bin/sh -INSTALL = ${SRCDIR}bin/install KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ @@ -34,11 +33,13 @@ kinstall: AFS_component_version_number.c gencat -m afszcm.cat afs_trace.msf ;; \ *_linux* ) \ gencat --new afszcm.cat afs_trace.msf ;; \ + ppc_darwin* | i386_fbsd*) \ + echo No gencat for ${SYS_NAME} ;; \ * ) \ gencat afszcm.cat afs_trace.msf ;; \ esac - - + + ukinstall webinstall: AFS_component_version_number.c set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED) @@ -58,7 +59,7 @@ install install.noversion: kinstall ukinstall ${INSTALL} longc_procs.h ${DESTDIR}include/afs ;; \ esac case ${SYS_NAME} in \ - next_mach30 | vax_ul43) \ + next_mach30 | vax_ul43 | ppc_darwin* | i386_fbsd* ) \ echo skipping afszcm.cat install for ${SYS_NAME} ;; \ * ) \ ${INSTALL} afszcm.cat ${DESTDIR}root.client/usr/vice/etc/C ;; \ diff --git a/src/afs/SOLARIS/osi_file.c b/src/afs/SOLARIS/osi_file.c index fd9d1248f..0366f6f4b 100644 --- a/src/afs/SOLARIS/osi_file.c +++ b/src/afs/SOLARIS/osi_file.c @@ -263,7 +263,11 @@ struct vnode *avp; { if (afs_CacheFSType == AFS_SUN_UFS_CACHE) { struct inode *ip = VTOI(avp); + rw_enter(&ip->i_contents, RW_READER); + mutex_enter(&ip->i_tlock); ip->i_flag &= ~IACC; + mutex_exit(&ip->i_tlock); + rw_exit(&ip->i_contents); } } diff --git a/src/afs/SOLARIS/osi_inode.c b/src/afs/SOLARIS/osi_inode.c index 42bdc89dc..2f2437b64 100644 --- a/src/afs/SOLARIS/osi_inode.c +++ b/src/afs/SOLARIS/osi_inode.c @@ -19,7 +19,14 @@ #include "../afs/osi_inode.h" #include "../afs/afs_stats.h" /* statistics stuff */ -extern int (*ufs_iputp)(), (*ufs_iallocp)(), (*ufs_iupdatp)(), (*ufs_igetp)(); +extern int (*ufs_iallocp)(), (*ufs_iupdatp)(), (*ufs_igetp)(), + (*ufs_itimes_nolockp)(); + +#define AFS_ITIMES(ip) { \ + mutex_enter(&(ip)->i_tlock); \ + (*ufs_itimes_nolockp)(ip); \ + mutex_exit(&(ip)->i_tlock); \ +} getinode(vfsp, dev, inode, ipp, credp,perror) struct vfs *vfsp; @@ -34,6 +41,7 @@ getinode(vfsp, dev, inode, ipp, credp,perror) struct vnode *vp; struct fs *fs; struct inode *pip; + struct ufsvfs *ufsvfsp; AFS_STATCNT(getinode); @@ -48,7 +56,17 @@ getinode(vfsp, dev, inode, ipp, credp,perror) ) { return (ENODEV); } - if (code = (*ufs_igetp)(vfsp, inode, &ip, credp)) { + ufsvfsp = (struct ufsvfs *)vfsp->vfs_data; + +#if defined(AFS_SUN57_ENV) + rw_enter(&ufsvfsp->vfs_dqrwlock, RW_READER); +#endif + code = (*ufs_igetp)(vfsp, inode, &ip, credp); +#if defined(AFS_SUN57_ENV) + rw_exit(&ufsvfsp->vfs_dqrwlock); +#endif + + if (code) { *perror = BAD_IGET; return code; } @@ -81,14 +99,16 @@ igetinode(vfsp, dev, inode, ipp, credp,perror) if (ip->i_mode == 0) { /* Not an allocated inode */ + AFS_ITIMES(ip); rw_exit(&ip->i_contents); - (*ufs_iputp)(ip); + VN_RELE(ITOV(ip)); return (ENOENT); } if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) { + AFS_ITIMES(ip); rw_exit(&ip->i_contents); - (*ufs_iputp)(ip); + VN_RELE(ITOV(ip)); return (ENOENT); } @@ -122,6 +142,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) struct inode *ip, *newip; register int code; dev_t newdev; + struct ufsvfs *ufsvfsp; AFS_STATCNT(afs_syscall_icreate); @@ -142,11 +163,26 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) if (code) { return (code); } - if (code = (*ufs_iallocp)(ip, near_inode, 0, &newip, credp)) { - (*ufs_iputp)(ip); + + ufsvfsp = ip->i_ufsvfs; + rw_enter(&ip->i_rwlock, RW_WRITER); +#if defined(AFS_SUN57_ENV) + rw_enter(&ufsvfsp->vfs_dqrwlock, RW_READER); +#endif + rw_enter(&ip->i_contents, RW_WRITER); + code = (*ufs_iallocp)(ip, near_inode, 0, &newip, credp); +#if defined(AFS_SUN57_ENV) + rw_exit(&ufsvfsp->vfs_dqrwlock); +#endif + rw_exit(&ip->i_rwlock); + + AFS_ITIMES(ip); + rw_exit(&ip->i_contents); + VN_RELE(ITOV(ip)); + + if (code) { return (code); } - (*ufs_iputp)(ip); rw_enter(&newip->i_contents, RW_WRITER); mutex_enter(&newip->i_tlock); newip->i_flag |= IACC|IUPD|ICHG; @@ -184,8 +220,9 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp) */ if (CrSync) (*ufs_iupdatp)(newip, 1); + AFS_ITIMES(newip); rw_exit(&newip->i_contents); - (*ufs_iputp)(newip); + VN_RELE(ITOV(newip)); return (code); } @@ -224,7 +261,10 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp) } code = falloc((struct vnode *)NULL, FWRITE|FREAD, &fp, &fd); if (code) { - (*ufs_iputp)(ip); + rw_enter(&ip->i_contents, RW_READER); + AFS_ITIMES(ip); + rw_exit(&ip->i_contents); + VN_RELE(ITOV(ip)); return (code); } @@ -284,9 +324,13 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp) if (code) { return (code); } - if (!IS_VICEMAGIC(ip)) + if (!IS_VICEMAGIC(ip)) { code = EPERM; - else { + rw_enter(&ip->i_contents, RW_READER); + AFS_ITIMES(ip); + rw_exit(&ip->i_contents); + VN_RELE(ITOV(ip)); + } else { rw_enter(&ip->i_contents, RW_WRITER); ip->i_nlink += amount; if (ip->i_nlink == 0) { @@ -300,9 +344,10 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp) /* We may want to force the inode to the disk in case of crashes, other references, etc. */ if (IncSync) (*ufs_iupdatp)(ip, 1); + AFS_ITIMES(ip); rw_exit(&ip->i_contents); + VN_RELE(ITOV(ip)); } - (*ufs_iputp)(ip); return (code); } diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c index 40d72507b..a16dea180 100644 --- a/src/afs/SOLARIS/osi_vfsops.c +++ b/src/afs/SOLARIS/osi_vfsops.c @@ -231,10 +231,10 @@ struct vfsops Afs_vfsops = { /* * afsinit - intialize VFS */ -void (*ufs_iputp)(); int (*ufs_iallocp)(); void (*ufs_iupdatp)(); int (*ufs_igetp)(); +void (*ufs_itimes_nolockp)(); struct streamtab *udp_infop = 0; struct ill_s *ill_g_headp = 0; @@ -302,14 +302,14 @@ afsinit(struct vfssw *vfsswp, int fstype) nfs_checkauth = (int (*)()) modlookup("nfssrv", "checkauth"); if ( !nfs_checkauth ) afs_warn("nfs_checkauth not initialised"); #endif - ufs_iputp = (int (*)()) modlookup("ufs", "ufs_iput"); ufs_iallocp = (int (*)()) modlookup("ufs", "ufs_ialloc"); ufs_iupdatp = (int (*)()) modlookup("ufs", "ufs_iupdat"); ufs_igetp = (int (*)()) modlookup("ufs", "ufs_iget"); + ufs_itimes_nolockp = (void (*)()) modlookup("ufs", "ufs_itimes_nolock"); udp_infop = (struct streamtab *) modlookup("udp", "udpinfo"); ill_g_headp = (struct ill_s *) modlookup("ip", "ill_g_head"); - if ( !ufs_iputp || !ufs_iallocp || !ufs_iupdatp || + if ( !ufs_iallocp || !ufs_iupdatp || !ufs_itimes_nolockp || !ufs_igetp || !udp_infop || !ill_g_headp ) afs_warn("AFS to UFS mapping cannot be fully initialised\n"); diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c index 5bff120ba..2d93e7c88 100644 --- a/src/afs/UKERNEL/afs_usrops.c +++ b/src/afs/UKERNEL/afs_usrops.c @@ -1845,7 +1845,7 @@ void uafs_Init( iob.out = tbuffer; iob.out_size = sizeof(tbuffer); -#if defined(AFS_USR_SUN5_ENV) || defined(AFS_USR_OSF_ENV) || defined(AFS_USR_HPUX_ENV) || defined(AFS_USR_LINUX22_ENV) +#if defined(AFS_USR_SUN5_ENV) || defined(AFS_USR_OSF_ENV) || defined(AFS_USR_HPUX_ENV) || defined(AFS_USR_LINUX22_ENV) || defined(AFS_USR_DARWIN_ENV) || defined(AFS_USR_FBSD_ENV) rc = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, 0, _VICEIOCTL(8), &iob, 0); #elif defined(AFS_USR_SGI_ENV) rc = syscall(AFS_PIOCTL, 0, _VICEIOCTL(8), &iob, 0); diff --git a/src/afs/VNOPS/afs_vnop_attrs.c b/src/afs/VNOPS/afs_vnop_attrs.c index 34675191d..311f2161f 100644 --- a/src/afs/VNOPS/afs_vnop_attrs.c +++ b/src/afs/VNOPS/afs_vnop_attrs.c @@ -97,11 +97,11 @@ afs_CopyOutAttrs(avc, attrs) * anyway, so the difference between 512K and 1000000 shouldn't matter * much, and "&" is a lot faster than "%". */ -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec = attrs->va_ctime.tv_nsec = (hgetlo(avc->m.DataVersion) & 0x7ffff) * 1000; -#ifdef AFS_AIX41_ENV +#if defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */ #else attrs->va_blksize = PAGESIZE; /* XXX Was 8192 XXX */ @@ -137,7 +137,7 @@ afs_CopyOutAttrs(avc, attrs) attrs->va_flags = 0; #endif /* AFS_OSF_ENV */ -#if !defined(AFS_OSF_ENV) +#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #if !defined(AFS_HPUX_ENV) #ifdef AFS_SUN5_ENV attrs->va_nblocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) << 1 : 0); @@ -151,7 +151,7 @@ afs_CopyOutAttrs(avc, attrs) #else /* !defined(AFS_HPUX_ENV) */ attrs->va_blocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) : 0); #endif /* !defined(AFS_HPUX_ENV) */ -#else /* ! AFS_OSF_ENV */ +#else /* ! AFS_OSF_ENV && !AFS_FBSD_ENV */ attrs->va_bytes = (attrs->va_size? (attrs->va_size + 1023) : 1024); #ifdef va_bytes_rsv attrs->va_bytes_rsv = -1; @@ -232,7 +232,7 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred) return EACCES; } if (avc->mvstat == 2) { -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000); #else attrs->va_mtime.tv_usec += ++avc->xlatordv; @@ -359,7 +359,7 @@ register struct AFSStoreStatus *as; { #endif mask |= AFS_SETMODTIME; #ifndef AFS_SGI_ENV -#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) if (av->va_mtime.tv_nsec == -1) #else if (av->va_mtime.tv_usec == -1) diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index 9a1ba19ff..b8deaf201 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -287,7 +287,7 @@ tagain: (afs_Analyze(tc, code, &adp->fid, &treq, AFS_STATS_FS_RPCIDX_CREATEFILE, SHARED_LOCK, (struct cell *)0)); -#ifdef AFS_OSF_ENV +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) if (code == EEXIST && aexcl == NONEXCL) { /* This lookup was handled in the common vn_open code in the vnode layer */ diff --git a/src/afs/VNOPS/afs_vnop_fid.c b/src/afs/VNOPS/afs_vnop_fid.c index 2516273f3..57819b5d1 100644 --- a/src/afs/VNOPS/afs_vnop_fid.c +++ b/src/afs/VNOPS/afs_vnop_fid.c @@ -15,7 +15,7 @@ */ #include "../afs/param.h" /* Should be always first */ -#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) #include "../afs/sysincludes.h" /* Standard vendor system headers */ #include "../afs/afsincludes.h" /* Afs-based standard headers */ #include "../afs/afs_stats.h" /* statistics */ diff --git a/src/afs/VNOPS/afs_vnop_flock.c b/src/afs/VNOPS/afs_vnop_flock.c index 518186300..35375b511 100644 --- a/src/afs/VNOPS/afs_vnop_flock.c +++ b/src/afs/VNOPS/afs_vnop_flock.c @@ -40,7 +40,7 @@ void lockIdSet(flock, slp, clid) #if defined(AFS_SUN5_ENV) register proc_t *procp = ttoproc(curthread); #else -#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) +#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #ifdef AFS_SGI_ENV struct proc *procp = OSI_GET_CURRENT_PROCP(); #else @@ -80,7 +80,7 @@ void lockIdSet(flock, slp, clid) #endif slp->pid = clid; #else -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) slp->pid = clid; #else #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) @@ -119,7 +119,7 @@ void lockIdSet(flock, slp, clid) #endif flock->l_pid = clid; #else -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) flock->l_pid = clid; #else #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) @@ -154,7 +154,7 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid) #if defined(AFS_SUN5_ENV) register proc_t *procp = ttoproc(curthread); #else -#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) +#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #ifdef AFS_SGI64_ENV struct proc *procp = curprocp; #else /* AFS_SGI64_ENV */ @@ -171,7 +171,7 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid) } #endif if ((flock1->l_pid == alp->pid) || -#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) +#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) (!onlymine && (flock1->l_pid == getppid())) #else #if defined(AFS_SGI65_ENV) @@ -481,7 +481,7 @@ int flag; pid_t clid; off_t offset; #else -#if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) +#if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) afs_lockctl(avc, af, acmd, acred, clid) pid_t clid; #else @@ -536,6 +536,10 @@ struct AFS_UCRED *acred; { this way at least, they can get work done */ if (af->l_len == 0x7fffffff) af->l_len = 0; /* since some systems indicate it as EOF */ +#ifdef AFS_LINUX_64BIT_KERNEL + if (af->l_len == LONG_MAX) + af->l_len = 0; /* since some systems indicate it as EOF */ +#endif /* next line makes byte range locks always succeed, even when they should block */ if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) { @@ -824,7 +828,7 @@ static int GetFlockCount(struct vcache *avc, struct vrequest *areq) #endif -#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) /* Flock not support on System V systems */ #ifdef AFS_OSF_ENV extern struct fileops afs_fileops; @@ -852,7 +856,11 @@ afs_xflock () { uap = (struct a *)args; getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state); #else /* AFS_OSF_ENV */ +#if defined(AFS_FBSD_ENV) + uap = (struct a *)u.u_ap; +#else uap = (struct a *)u.u_ap; +#endif /* AFS_FBSD_ENV */ fd = getf(uap->fd); #endif if (!fd) return; diff --git a/src/afs/VNOPS/afs_vnop_read.c b/src/afs/VNOPS/afs_vnop_read.c index 70c752176..2d06f6379 100644 --- a/src/afs/VNOPS/afs_vnop_read.c +++ b/src/afs/VNOPS/afs_vnop_read.c @@ -419,6 +419,13 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock) AFS_GUNLOCK(); code = osi_file_uio_rdwr(tfile, auio, UIO_READ); AFS_GLOCK(); +#else +#if defined(AFS_DARWIN_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); + code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred); + VOP_UNLOCK(tfile->vnode, 0, current_proc()); + AFS_GLOCK(); #else code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred); #endif @@ -426,6 +433,7 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock) #endif #endif #endif +#endif #endif auio->afsio_offset += avc->quick.minLoc; osi_UFSClose(tfile); @@ -749,6 +757,13 @@ tagain: AFS_GUNLOCK(); code = osi_file_uio_rdwr(tfile, &tuio, UIO_READ); AFS_GLOCK(); +#else +#if defined(AFS_DARWIN_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); + code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred); + VOP_UNLOCK(tfile->vnode, 0, current_proc()); + AFS_GLOCK(); #else code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred); #endif @@ -758,6 +773,7 @@ tagain: #endif #endif #endif +#endif #ifdef IHINT if (!tdc->ihint && nihints < maxIHint) { diff --git a/src/afs/VNOPS/afs_vnop_strategy.c b/src/afs/VNOPS/afs_vnop_strategy.c index 0868f00a7..aa62ffd19 100644 --- a/src/afs/VNOPS/afs_vnop_strategy.c +++ b/src/afs/VNOPS/afs_vnop_strategy.c @@ -25,7 +25,7 @@ -#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) afs_ustrategy(abp, credp) struct AFS_UCRED *credp; #else @@ -36,14 +36,14 @@ afs_ustrategy(abp) struct uio tuio; register struct vcache *tvc = (struct vcache *) abp->b_vp; register afs_int32 len = abp->b_bcount; -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #ifdef AFS_AIX41_ENV struct ucred *credp; #else struct AFS_UCRED *credp = u.u_cred; #endif #endif -#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) int async = abp->b_flags & B_ASYNC; #endif struct iovec tiovec[1]; @@ -71,7 +71,7 @@ afs_ustrategy(abp) */ tuio.afsio_iov = tiovec; tuio.afsio_iovcnt = 1; -#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV) tuio.afsio_offset = (u_int) dbtob(abp->b_blkno); #if defined(AFS_SUN5_ENV) tuio._uio_offset._p._u = 0; @@ -84,7 +84,11 @@ afs_ustrategy(abp) tuio.afsio_fmode = 0; #endif tuio.afsio_resid = abp->b_bcount; +#if defined(AFS_FBSD_ENV) + tiovec[0].iov_base = abp->b_saveaddr; +#else tiovec[0].iov_base = abp->b_un.b_addr; +#endif /* AFS_FBSD_ENV */ tiovec[0].iov_len = abp->b_bcount; /* are user's credentials valid here? probably, but this sure seems like the wrong things to do. */ @@ -95,7 +99,11 @@ afs_ustrategy(abp) #endif if (code == 0) { if (tuio.afsio_resid > 0) +#if defined(AFS_FBSD_ENV) + bzero(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid); +#else bzero(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid); +#endif /* AFS_FBSD_ENV */ #ifdef AFS_AIX32_ENV /* * If we read a block that is past EOF and the user was not storing @@ -140,7 +148,11 @@ afs_ustrategy(abp) len = MIN(abp->b_bcount, ((struct vcache *)abp->b_vp)->m.Length - dbtob(abp->b_blkno)); #endif /* AFS_ALPHA_ENV */ tuio.afsio_resid = len; +#if defined(AFS_FBSD_ENV) + tiovec[0].iov_base = abp->b_saveaddr; +#else tiovec[0].iov_base = abp->b_un.b_addr; +#endif /* AFS_FBSD_ENV */ tiovec[0].iov_len = len; /* are user's credentials valid here? probably, but this sure seems like the wrong things to do. */ diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index e73c1f47b..77b56aa00 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -528,8 +528,16 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) AFS_GUNLOCK(); code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE); AFS_GLOCK(); +#else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + AFS_GUNLOCK(); + VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc()); + code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred); + VOP_UNLOCK(tfile->vnode, 0, current_proc()); + AFS_GLOCK(); #else code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred); +#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ #endif /* AFS_LINUX20_ENV */ #endif /* AFS_HPUX100_ENV */ #endif /* AFS_OSF_ENV */ @@ -601,6 +609,9 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) * If write is implemented via VM, afs_fsync() is called from the high-level * write op. */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + if (noLock && (aio & IO_SYNC)) { +#else #ifdef AFS_HPUX_ENV /* On hpux on synchronous writes syncio will be set to IO_SYNC. If * we're doing them because the file was opened with O_SYNCIO specified, @@ -609,6 +620,7 @@ afs_UFSWrite(avc, auio, aio, acred, noLock) if (noLock && ((aio & IO_SYNC) | (auio->uio_fpflags & FSYNCIO))) { #else if (noLock && (aio & FSYNC)) { +#endif #endif if (!AFS_NFSXLATORREQ(acred)) afs_fsync(avc, acred); @@ -638,7 +650,7 @@ struct vrequest *areq; { -#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #ifdef AFS_DUX50_ENV #define vno_close(X) vn_close((X), 0, NOCRED) #elif defined(AFS_DUX40_ENV) diff --git a/src/afs/afs_analyze.c b/src/afs/afs_analyze.c index 32bfc5cba..849eb03ff 100644 --- a/src/afs/afs_analyze.c +++ b/src/afs/afs_analyze.c @@ -15,7 +15,7 @@ #include "../afs/sysincludes.h" /* Standard vendor system headers */ #ifndef UKERNEL -#ifndef AFS_LINUX20_ENV +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) #include #include #endif @@ -23,7 +23,7 @@ #ifdef AFS_SGI62_ENV #include "../h/hashing.h" #endif -#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) #include #endif #endif /* !UKERNEL */ diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 56c5c83e1..9c7018f1f 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -1237,7 +1237,7 @@ static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake, tlen = (alen > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : alen); got = afs_osi_Read(afile, -1, tbuffer, tlen); if ((got < 0) -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) || (got != tlen && getuerror()) #endif ) { @@ -1718,6 +1718,7 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags) updateV2DC(setLocks,avc,tdc,567); return tdc; /* check if we're done */ } + osi_Assert(setLocks || WriteLocked(&avc->lock)); if (setLocks) ObtainReadLock(&avc->lock); if (!hsame(avc->m.DataVersion, tdc->f.versionNo)) { @@ -2299,7 +2300,7 @@ struct dcache *afs_UFSGetDSlot(aslot, tmpdc) tdc->f.chunk = -1; hones(tdc->f.versionNo); tdc->flags |= DFEntryMod; -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) last_error = getuerror(); #endif lasterrtime = osi_Time(); @@ -2473,11 +2474,7 @@ int afs_InitCacheFile(afile, ainode) tdc->f.inode = VTOI(filevp->d_inode)->i_number; dput(filevp); #else -#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) - tdc->f.inode = VnodeToIno(filevp); -#else - tdc->f.inode = VTOI(filevp)->i_number; -#endif + tdc->f.inode = afs_vnodeToInumber(filevp); #ifdef AFS_DEC_ENV grele(filevp); #else diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index 765f5660f..9cfb2614c 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -97,7 +97,7 @@ extern afs_lock_t afs_ftf; /* Exported variables */ struct osi_dev cacheDev; /*Cache device*/ afs_int32 cacheInfoModTime; /*Last time cache info modified*/ -#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) struct mount *afs_cacheVfsp=0; #elif defined(AFS_LINUX20_ENV) struct super_block *afs_cacheSBp = 0; @@ -325,11 +325,7 @@ afs_InitVolumeInfo(afile) #else code = gop_lookupname(afile, AFS_UIOSYS, 0, (struct vnode **) 0, &filevp); if (code) return ENOENT; -#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) - fce.inode = volumeInode = VnodeToIno(filevp); -#else - fce.inode = volumeInode = VTOI(filevp)->i_number; -#endif + fce.inode = volumeInode = afs_vnodeToInumber(filevp); #ifdef AFS_DEC_ENV grele(filevp); #else @@ -436,7 +432,11 @@ afs_InitCacheInfo(afile) TO_KERNEL_SPACE(); } #else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + if (!VFS_STATFS(filevp->v_mount, &st, current_proc())) +#else if (!VFS_STATFS(filevp->v_vfsp, &st)) +#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ #endif /* AFS_LINUX20_ENV */ #endif /* AIX41 */ #endif /* OSF */ @@ -449,17 +449,14 @@ afs_InitCacheInfo(afile) #endif } #ifdef AFS_LINUX20_ENV - cacheInode = filevp->i_ino; - afs_cacheSBp = filevp->i_sb; + cacheInode = filevp->i_ino; + afs_cacheSBp = filevp->i_sb; #else -#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) +#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV) afs_InitDualFSCacheOps(filevp); - cacheInode = VnodeToIno(filevp); - cacheDev.dev = VnodeToDev(filevp); -#else - cacheInode = VTOI(filevp)->i_number; - cacheDev.dev = VTOI(filevp)->i_dev; #endif + cacheInode = afs_vnodeToInumber(filevp); + cacheDev.dev = afs_vnodeToDev(filevp); afs_cacheVfsp = filevp->v_vfsp; #endif /* AFS_LINUX20_ENV */ AFS_RELE((struct vnode *)filevp); diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index 2b2fd206d..e36f9b819 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -50,6 +50,9 @@ void osi_Init() #elif defined(AFS_OSF_ENV) usimple_lock_init(&afs_global_lock); afs_global_owner = (thread_t)0; +#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + lockinit(&afs_global_lock, PLOCK, "afs global lock", 0, 0); + afs_global_owner = (thread_t)0; #elif defined(AFS_AIX41_ENV) lock_alloc((void*)&afs_global_lock, LOCK_ALLOC_PIN, 1, 1); simple_lock_init((void *)&afs_global_lock); @@ -77,7 +80,7 @@ void osi_Init() osi_Active(avc) register struct vcache *avc; { AFS_STATCNT(osi_Active); -#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) if ((avc->opens > 0) || (avc->states & CMAPPED)) return 1; /* XXX: Warning, verify this XXX */ #else #if defined(AFS_MACH_ENV) @@ -292,12 +295,16 @@ void afs_osi_Invisible() { #if defined(AFS_HPUX101_ENV) set_system_proc(u.u_procp); #else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + current_proc()->p_flag |= P_SYSTEM; +#else #if !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) u.u_procp->p_flag |= SSYS; #endif /* AFS_SGI64_ENV */ #endif #endif #endif +#endif #endif AFS_STATCNT(osi_Invisible); } @@ -343,6 +350,11 @@ afs_osi_SetTime(atv) sta.time = atv->tv_sec; stime(&sta); AFS_GLOCK(); +#else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + AFS_GUNLOCK(); + setthetime(atv); + AFS_GLOCK(); #else /* stolen from kern_time.c */ #ifndef AFS_AUX_ENV @@ -367,6 +379,7 @@ afs_osi_SetTime(atv) #ifdef AFS_AUX_ENV logtchg(atv->tv_sec); #endif +#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ #endif /* AFS_SGI_ENV */ #endif /* AFS_SUN55_ENV */ #endif /* AFS_SUN5_ENV */ @@ -729,6 +742,22 @@ extern int npid; } #endif +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +void afs_osi_TraverseProcTable() +{ + struct proc *p; + LIST_FOREACH(p, &allproc, p_list) { + if (p->p_stat == SIDL) + continue; + if (p->p_stat == SZOMB) + continue; + if (p->p_flag & P_SYSTEM) + continue; + afs_GCPAGs_perproc_func(p); + } +} +#endif + /* return a pointer (sometimes a static copy ) to the cred for a * given AFS_PROC. * subsequent calls may overwrite the previously returned value. @@ -885,6 +914,31 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) return rv; } +#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) +{ + struct AFS_UCRED *rv=NULL; + static struct AFS_UCRED cr; + + if(pr == NULL) { + return NULL; + } + + if((pr->p_stat == SSLEEP) || + (pr->p_stat == SRUN) || + (pr->p_stat == SSTOP)) { + pcred_readlock(pr); + cr.cr_ref=1; + cr.cr_uid=pr->p_cred->pc_ucred->cr_uid; + cr.cr_ngroups=pr->p_cred->pc_ucred->cr_ngroups; + bcopy(pr->p_cred->pc_ucred->cr_groups, cr.cr_groups,NGROUPS * + sizeof(gid_t)); + pcred_unlock(pr); + rv = &cr; + } + + return rv; +} #else const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr) { diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index c193f3a44..a1b6cec7e 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -100,7 +100,7 @@ afs_uint32 getpag(void) { int #if defined(AFS_SUN5_ENV) afs_setpag (struct AFS_UCRED **credpp) -#elif defined(AFS_OSF_ENV) +#elif defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) afs_setpag (struct proc *p, void *args, int *retval) #else afs_setpag (void) @@ -127,7 +127,7 @@ afs_setpag (void) #if defined(AFS_SUN5_ENV) code = AddPag(genpag(), credpp); -#elif defined(AFS_OSF_ENV) +#elif defined(AFS_OSF_ENV) || defined(AFS_FBSD_ENV) code = AddPag(p, genpag(), &p->p_rcred); #elif defined(AFS_AIX41_ENV) { @@ -159,12 +159,18 @@ afs_setpag (void) code = AddPag(genpag(), &credp); crfree(credp); } +#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + { + struct ucred *credp=crdup(p->p_cred->pc_ucred); + code=AddPag(p, genpag(), &credp); + crfree(credp); + } #else code = AddPag(genpag(), &u.u_cred); #endif afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code); -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #if defined(AFS_SGI53_ENV) && defined(MP) AFS_GUNLOCK(); #endif /* defined(AFS_SGI53_ENV) && defined(MP) */ @@ -176,20 +182,20 @@ afs_setpag (void) #endif } -#ifdef AFS_OSF_ENV +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp) -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ int AddPag(afs_int32 aval, struct AFS_UCRED **credpp) #endif { afs_int32 newpag, code; AFS_STATCNT(AddPag); -#ifdef AFS_OSF_ENV +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) if (code = setpag(p, credpp, aval, &newpag, 0)) #else /* AFS_OSF_ENV */ if (code = setpag(credpp, aval, &newpag, 0)) #endif -#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) return (code); #else return (setuerror(code), code); @@ -211,7 +217,12 @@ afs_InitReq(av, acred) * think it's ok to use the real uid to make setuid * programs (without setpag) to work properly. */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + av->uid = acred->cr_uid; /* default when no pag is set */ + /* bsd creds don't have ruid */ +#else av->uid = acred->cr_ruid; /* default when no pag is set */ +#endif } av->initd = 0; return 0; @@ -268,17 +279,27 @@ afs_int32 PagInCred(const struct AFS_UCRED *cred) if (cred == NULL) { return NOPAG; } +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + if (cred == NOCRED || cred == FSCRED) { + return NOPAG; + } + if (cred->cr_ngroups < 3) return NOPAG; + /* gid is stored in cr_groups[0] */ + g0 = cred->cr_groups[1]; + g1 = cred->cr_groups[2]; +#else #ifdef AFS_AIX_ENV if (cred->cr_ngrps < 2) { return NOPAG; } #else -#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX_ENV) || defined(AFS_FBSD_ENV) if (cred->cr_ngroups < 2) return NOPAG; #endif #endif g0 = cred->cr_groups[0]; g1 = cred->cr_groups[1]; +#endif pag = (afs_int32)afs_get_pag_from_groups(g0, g1); return pag; } diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 91ff82c5e..bd100abd8 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -38,9 +38,9 @@ extern void afs_osi_TraverseProcTable(void); /* afs_osi_pag.c */ extern afs_uint32 genpag(void); extern afs_uint32 getpag(void); -#ifdef AFS_OSF_ENV +#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) extern int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp); -#else /* AFS_OSF_ENV */ +#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ extern int AddPag(afs_int32 aval, struct AFS_UCRED **credpp); #endif extern afs_uint32 afs_get_pag_from_groups(gid_t g0, gid_t g1); @@ -119,7 +119,7 @@ extern void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve, int acell, struct cell *tcell, struct vrequest *areq); extern void afs_ResetVolumeInfo(struct volume *tv); -#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) +#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #include "../afs/osi_prototypes.h" #endif diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index 84a3b35ba..e8dfc7fa8 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -1202,6 +1202,13 @@ static afs_SetServerPrefs(sa) #ifdef AFS_SGI62_ENV (void) hash_enum(&hashinfo_inaddr, afsi_enum_set_rank, HTF_INET, NULL, (caddr_t)sa, NULL); +#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + { + struct in_ifaddr *ifa; + TAILQ_FOREACH(ifa , &in_ifaddrhead, ia_link) { + afsi_SetServerIPRank(sa, ifa); + } + } #else { extern struct in_ifaddr *in_ifaddr; diff --git a/src/afs/afs_user.c b/src/afs/afs_user.c index 18c317d57..3c2a5d5a6 100644 --- a/src/afs/afs_user.c +++ b/src/afs/afs_user.c @@ -606,7 +606,11 @@ void afs_GCPAGs_perproc_func(AFS_PROC *pproc) afs_GCPAGs_cred_count++; pag = PagInCred(pcred); +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV) + uid = (pag != NOPAG ? pag : pcred->cr_uid); +#else uid = (pag != NOPAG ? pag : pcred->cr_ruid); +#endif hash = UHash(uid); /* if this token is PAG based, or it's UID based and diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 699f5919b..a238e5c1f 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -66,6 +66,8 @@ extern struct vcache *afs_globalVp; #ifdef AFS_OSF_ENV extern struct mount *afs_globalVFS; extern struct vnodeops Afs_vnodeops; +#elif defined(AFS_DARWIN_ENV) +extern struct mount *afs_globalVFS; #else extern struct vfs *afs_globalVFS; #endif /* AFS_OSF_ENV */ @@ -703,6 +705,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, else if (QNext(uq) != tq) refpanic("VLRU inconsistent"); +#ifdef AFS_DARWIN_ENV + if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0) && + tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) { + osi_VM_TryReclaim(tvc, &fv_slept); + if (fv_slept) { + uq = VLRU.prev; + i = 0; + continue; /* start over - may have raced. */ + } + } +#endif if (tvc->vrefCount == 0 && tvc->opens == 0 && (tvc->states & CUnlinkedDel) == 0) { code = afs_FlushVCache(tvc, &fv_slept); @@ -867,6 +880,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp, #else SetAfsVnode((struct vnode *)tvc); #endif /* AFS_SGI64_ENV */ +#ifdef AFS_DARWIN_ENV + tvc->v.v_ubcinfo = UBC_INFO_NULL; + lockinit(&tvc->rwlock, PINOD, "vcache rwlock", 0, 0); + cache_purge((struct vnode *)tvc); + tvc->v.v_data=tvc; + tvc->v.v_tag=VT_AFS; + /* VLISTNONE(&tvc->v); */ + tvc->v.v_freelist.tqe_next=0; + tvc->v.v_freelist.tqe_prev=(struct vnode **)0xdeadb; + /*tvc->vrefCount++;*/ +#endif /* * The proper value for mvstat (for root fids) is setup by the caller. */ @@ -1113,6 +1137,12 @@ afs_FlushActiveVcaches(doflocks) crfree(cred); } } +#ifdef AFS_DARWIN_ENV + if (tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) { + if (tvc->opens) panic("flushactive open, hasubc, but refcnt 1"); + osi_VM_TryReclaim(tvc,0); + } +#endif } } ReleaseReadLock(&afs_xvcache); @@ -1601,6 +1631,9 @@ loop: vcache2inode(tvc); #endif ReleaseWriteLock(&tvc->lock); +#ifdef AFS_DARWIN_ENV + osi_VM_Setup(tvc); +#endif return tvc; } @@ -1657,6 +1690,9 @@ loop: } ReleaseWriteLock(&tvc->lock); +#ifdef AFS_DARWIN_ENV + osi_VM_Setup(avc); +#endif return tvc; } /*afs_GetVCache*/ @@ -1812,6 +1848,9 @@ struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, afs_ProcessFS(tvc, &OutStatus, areq); ReleaseWriteLock(&tvc->lock); +#ifdef AFS_DARWIN_ENV + osi_VM_Setup(tvc); +#endif return tvc; } @@ -2116,6 +2155,7 @@ else { /* used to undo the local callback, but that's too extreme. return code; } +#if 0 /* * afs_StuffVcache * @@ -2254,6 +2294,7 @@ afs_StuffVcache(afid, OutStatus, CallBack, tc, areq) */ afs_PutVCache(tvc, WRITE_LOCK); } /*afs_StuffVcache*/ +#endif /* * afs_PutVCache @@ -2376,6 +2417,10 @@ struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit, #ifdef AFS_LINUX22_ENV if (tvc && (tvc->states & CStatd)) vcache2inode(tvc); /* mainly to reset i_nlink */ +#endif +#ifdef AFS_DARWIN_ENV + if (tvc) + osi_VM_Setup(tvc); #endif return tvc; } /*afs_FindVCache*/ diff --git a/src/afs/afsincludes.h b/src/afs/afsincludes.h index 97e51b42c..834b45fd4 100644 --- a/src/afs/afsincludes.h +++ b/src/afs/afsincludes.h @@ -51,6 +51,6 @@ #include "../afs/afs_axscache.h" #include "../afs/icl.h" #include "../afs/afs_prototypes.h" -#ifdef AFS_LINUX20_ENV +#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #include "../afs/osi_machdep.h" #endif diff --git a/src/afs/lock.h b/src/afs/lock.h index 86893a252..4318a66ec 100644 --- a/src/afs/lock.h +++ b/src/afs/lock.h @@ -109,7 +109,11 @@ extern tid_t thread_self(); #ifdef AFS_LINUX20_ENV #define MyPidxx current->pid #else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#define MyPidxx (current_proc()->p_pid ) +#else #define MyPidxx (u.u_procp->p_pid ) +#endif /* AFS_DARWIN_ENV */ #endif /* AFS_LINUX20_ENV */ #endif /* AFS_SGI64_ENV */ #endif /* AFS_HPUX101_ENV */ diff --git a/src/afs/sysincludes.h b/src/afs/sysincludes.h index 6139b6a9a..0475cedf9 100644 --- a/src/afs/sysincludes.h +++ b/src/afs/sysincludes.h @@ -41,6 +41,10 @@ struct xfs_inode_info {}; #include #else /* AFS_LINUX22_ENV */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#define _MACH_ETAP_H_ +typedef unsigned short etap_event_t; +#endif #if !defined(AFS_OSF_ENV) #include "../h/errno.h" #include "../h/types.h" @@ -128,7 +132,7 @@ struct xfs_inode_info {}; #include "../h/socketvar.h" #include "../h/protosw.h" -#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV) # include "../h/dirent.h" # ifdef AFS_SUN5_ENV # include "../h/sysmacros.h" @@ -180,6 +184,31 @@ struct vfspage; /* for vnode.h compiler warnings */ # include "../h/swap.h" /* for struct swpdbd, for vnode.h compiler warnings */ # include "../h/dbd.h" /* for union idbd, for vnode.h compiler warnings */ # endif /* AFS_HPUX_ENV */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV) +# include +# include +# include +# include +# include +#ifndef AFS_FBSD_ENV +# include +#define timeout_fcn_t mach_timeout_fcn_t +# include +#else +# include +# include +# include +# include +# include +# include +#endif +#undef timeout_fcn_t +#define _DIR_H_ +#define doff_t int32_t +# include +# include +# include +#else # include "../h/vfs.h" # include "../h/vnode.h" # ifdef AFS_SUN5_ENV @@ -193,6 +222,7 @@ struct vfspage; /* for vnode.h compiler warnings */ # endif /* !AFS_HPUX_ENV */ # endif /* !AFS_AIX32_ENV */ # endif /* AFS_SUN5_ENV */ +#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */ #endif /* AFS_DEC_ENV */ /* These mainly deal with networking and rpc headers */ @@ -213,7 +243,9 @@ struct vfspage; /* for vnode.h compiler warnings */ /* Miscellaneous headers */ #include "../h/proc.h" +#if !defined(AFS_FBSD_ENV) #include "../h/ioctl.h" +#endif /* AFS_FBSD_ENV */ #if defined(AFS_HPUX101_ENV) #include "../h/proc_iface.h" @@ -225,7 +257,8 @@ struct vfspage; /* for vnode.h compiler warnings */ #include "../h/tty.h" #endif -#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) +#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) + # include "../h/text.h" #endif diff --git a/src/afsd/afsd.c b/src/afsd/afsd.c index 0ca577e39..bf4b9aa15 100644 --- a/src/afsd/afsd.c +++ b/src/afsd/afsd.c @@ -93,7 +93,7 @@ #endif #endif -#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) +#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #include #else #include @@ -132,7 +132,7 @@ void set_staticaddrs(void); #if AFS_HAVE_STATVFS #include #else -#if !defined(AFS_OSF_ENV) +#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #include #endif #endif @@ -601,6 +601,12 @@ int SweepAFSCache(vFilesFound) } else if ((strcmp(currp->d_name, ".") == 0) || (strcmp(currp->d_name, "..") == 0) || +#ifdef AFS_DECOSF_ENV + /* these are magic AdvFS files */ + (strcmp(currp->d_name, ".tags") == 0) || + (strcmp(currp->d_name, "quota.user") == 0) || + (strcmp(currp->d_name, "quota.group") == 0) || +#endif (strcmp(currp->d_name, "lost+found") == 0)) { /* * Don't do anything - this file is legit, and is to be left alone. @@ -1337,6 +1343,9 @@ mainproc(as, arock) #ifdef AFS_DEC_ENV if ((mount("AFS",cacheMountDir,mountFlags,GT_AFS,(caddr_t) 0)) < 0) { #else +#ifdef AFS_FBSD_ENV + if ((mount("AFS",cacheMountDir,mountFlags,(caddr_t) 0)) < 0) { +#else #ifdef AFS_AUX_ENV if ((fsmount(MOUNT_AFS,cacheMountDir,mountFlags,(caddr_t) 0)) < 0) { #else @@ -1374,7 +1383,6 @@ mainproc(as, arock) #else #if defined(AFS_SGI_ENV) mountFlags = MS_FSS; - if ((mount(MOUNT_AFS,cacheMountDir,mountFlags,(caddr_t) MOUNT_AFS)) < 0) { #else #ifdef AFS_LINUX20_ENV @@ -1389,6 +1397,7 @@ mainproc(as, arock) #endif /* AFS_HPUX_ENV */ #endif /* AFS_AIX_ENV */ #endif /* AFS_AUX_ENV */ +#endif /* AFS_FBSD_ENV */ #endif /* AFS_DEC_ENV */ printf("%s: Can't mount AFS on %s(%d)\n", rn, cacheMountDir, errno); diff --git a/src/afsmonitor/Makefile b/src/afsmonitor/Makefile index c3b231e84..c535dc120 100644 --- a/src/afsmonitor/Makefile +++ b/src/afsmonitor/Makefile @@ -13,8 +13,6 @@ SRCDIR=DEST/ COMPONENT=afsmonitor include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install - CFLAGS=-g -I. \ -I${SRCDIR}include \ -I${SRCDIR}include/afs \ diff --git a/src/afsmonitor/afsmonitor.c b/src/afsmonitor/afsmonitor.c index 0951a928d..89d9c2cc0 100644 --- a/src/afsmonitor/afsmonitor.c +++ b/src/afsmonitor/afsmonitor.c @@ -1722,7 +1722,7 @@ int a_newProbeCycle; /* start of a new probe cycle ? */ } /* copy connection information */ -#ifdef AFS_LINUX20_ENV +#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) bcopy(&(xstat_fs_Results.connP->skt), &(tmp_fsPR->connP->skt), sizeof(struct sockaddr_in)); #else @@ -2454,7 +2454,7 @@ int a_newProbeCycle; /* start of new probe cycle ? */ /* copy connection information */ -#ifdef AFS_LINUX20_ENV +#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) bcopy(&(xstat_cm_Results.connP->skt), &(tmp_cmPR->connP->skt), sizeof(struct sockaddr_in)); #else diff --git a/src/afsweb/Makefile b/src/afsweb/Makefile index e5e3593c0..6c61a6205 100644 --- a/src/afsweb/Makefile +++ b/src/afsweb/Makefile @@ -11,7 +11,6 @@ COMPONENT=nsafs include ../config/Makefile.${SYS_NAME} UKERNELDIR=../libuafs/ -INSTALL=${SRCDIR}bin/install COMPILE_ET=${SRCDIR}bin/compile_et MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 @@ -160,7 +159,7 @@ INCLS=${SRCDIR}include/ubik.h \ ${SRCDIR}include/rx/xdr.h \ ${SRCDIR}include/rx/rxkad.h \ ${SRCDIR}include/afs/com_err.h \ - weblog_errors.h $(DCE_DLOG_INCLUDES) + weblog_errors.h $(DCE_DLOG_INCLUDES) deslib=${SRCDIR}lib/libdes.a rxkadlib=${SRCDIR}lib/librxkad.a authlib=${SRCDIR}lib/afs/libauth.a diff --git a/src/afsweb/weblog.c b/src/afsweb/weblog.c index 9fe9e80be..d2654905a 100644 --- a/src/afsweb/weblog.c +++ b/src/afsweb/weblog.c @@ -274,7 +274,6 @@ static int makeNewPAG() #include "adkint.h" #include "assert.h" -#include #include #include diff --git a/src/audit/Makefile b/src/audit/Makefile index b78498576..618af14cf 100644 --- a/src/audit/Makefile +++ b/src/audit/Makefile @@ -20,7 +20,6 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 UKERNELDIR = ../libuafs/ LOCALDIR = ${DESTDIR}root.server/usr/afs/local/ -INSTALL = ${SRCDIR}bin/install audobjs = audit.o diff --git a/src/auth/Makefile b/src/auth/Makefile index a6afaf105..17ef83774 100644 --- a/src/auth/Makefile +++ b/src/auth/Makefile @@ -12,7 +12,6 @@ include ../config/Makefile.${SYS_NAME} KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ -INSTALL = ${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et OBJS= cellconfig.o ktc.o userok.o writeconfig.o authcon.o \ acfg_errors.o ktc_errors.o # comktc.o comvice.o comauth.o @@ -48,8 +47,7 @@ setkey.o: setkey.c ${INCLS} AFS_component_version_number.o #comauth.o: comauth.c ${INCLS} ${SRCDIR}include/afs/vice.h ktc.krb.o: ktc.c ${INCLS} ${SRCDIR}include/afs/vice.h - ${CC} ${CFLAGS} -DMAYBE_NO_KTC -DAFS_KERBEROS_ENV -c ktc.c - mv ktc.o ktc.krb.o + ${CC} ${CFLAGS} -DMAYBE_NO_KTC -DAFS_KERBEROS_ENV -c ktc.c -o ktc.krb.o ktc.o: ktc.c ${INCLS} ${SRCDIR}include/afs/vice.h ${CC} ${CFLAGS} -DMAYBE_NO_KTC -c ktc.c diff --git a/src/auth/authcon.c b/src/auth/authcon.c index ac8d81e1b..1a838f203 100644 --- a/src/auth/authcon.c +++ b/src/auth/authcon.c @@ -7,19 +7,6 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -/* - * Revision 2.3 90/08/31 16:11:49 - * Move permit_xprt.h. - * - * Revision 2.2 90/08/20 10:05:54 - * Include permit_xprt.h. - * Use stds.h. - * - * Revision 2.1 90/08/07 18:51:45 - * Start with clean version to sync test and dev trees. - * */ -/* See RCS log for older history. */ - #if defined(UKERNEL) #include "../afs/param.h" #include "../afs/sysincludes.h" @@ -60,20 +47,6 @@ extern int afsconf_GetKey(); extern struct rx_securityClass *rxkad_NewServerSecurityObject(); extern struct rx_securityClass *rxkad_NewClientSecurityObject(); -/* - * Note: it is necessary for the #include of permit_xprt.h occur - * AFTER the above declaration of rxkad_NewClientSecurityObject() -- - * otherwise, depending on the version of permit_xprt.h that gets - * included, there might be a syntax error. - */ - -#if defined(UKERNEL) -#include "../afs/permit_xprt.h" -#else /* defined(UKERNEL) */ -#include "../permit_xprt.h" -#endif /* defined(UKERNEL) */ - - /* return a null security object if nothing else can be done */ static afs_int32 QuickAuth(astr, aindex) struct rx_securityClass **astr; diff --git a/src/bozo/Makefile b/src/bozo/Makefile index 0a7887f87..adc108054 100644 --- a/src/bozo/Makefile +++ b/src/bozo/Makefile @@ -9,7 +9,6 @@ SHELL=/bin/sh COMPONENT=bozo include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install COMPILE_ET=$(SRCDIR)bin/compile_et CFLAGS=-g -I${SRCDIR}include ${XCFLAGS} RPCINCLS=${SRCDIR}include/lwp.h ${SRCDIR}include/rx/rx.h bosint.h diff --git a/src/bozo/bos.c b/src/bozo/bos.c index 9659b1328..75ce0c308 100644 --- a/src/bozo/bos.c +++ b/src/bozo/bos.c @@ -53,7 +53,6 @@ static IStatServer(); static DoStat(); #include "bosint.h" -#include "../permit_xprt.h" #define MRAFS_OFFSET 9 #define ADDPARMOFFSET 26 diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 0fce29aeb..347a93090 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -24,6 +24,7 @@ #else #include #include +#include #endif /* AFS_NT40_ENV */ #include #include @@ -55,6 +56,10 @@ FILE *bozo_logFile; extern int rx_stackSize; /* for rx_SetStackSize macro */ int DoLogging = 0; +int DoSyslog = 0; +#ifndef AFS_NT40_ENV +int DoSyslogFacility = LOG_DAEMON; +#endif static afs_int32 nextRestart; static afs_int32 nextDay; @@ -117,6 +122,20 @@ bozo_ReBozo() { i++; } +#ifndef AFS_NT40_ENV + /* if syslog logging is on, pass "-syslog" to new bosserver */ + if (DoSyslog) { + char *arg=(char *)malloc(40); /* enough for -syslog=# */ + if ( DoSyslogFacility != LOG_DAEMON ) { + snprintf(arg, 40, "-syslog=%d", DoSyslogFacility); + } else { + strcpy(arg, "-syslog"); + } + argv[i] = arg; + i++; + } +#endif + /* null-terminate argument list */ argv[i] = NULL; @@ -714,6 +733,16 @@ char **envp; /* set extra logging flag */ DoLogging = 1; } +#ifndef AFS_NT40_ENV + else if (strcmp(argv[code], "-syslog")==0) { + /* set syslog logging flag */ + DoSyslog = 1; + } + else if (strncmp(argv[code], "-syslog=",8)==0) { + DoSyslog = 1; + DoSyslogFacility = atoi(argv[code]+8); + } +#endif else if (strcmp(argv[code], "-enable_peer_stats")==0) { rx_enablePeerRPCStats(); } @@ -730,6 +759,9 @@ char **envp; /* hack to support help flag */ printf("Usage: bosserver [-noauth] [-log] " +#ifndef AFS_NT40_ENV + "[-syslog[=FACILITY]] " +#endif /* "[-enable_peer_stats] [-enable_process_stats] " */ "[-help]\n"); fflush(stdout); @@ -772,21 +804,24 @@ char **envp; background(); #endif /* ! AFS_NT40_ENV */ - /* switch to logging information to the BosLog file */ - strcpy(namebuf, AFSDIR_BOZLOG_FILE); - strcat(namebuf, ".old"); - renamefile(AFSDIR_BOZLOG_FILE, namebuf); /* try rename first */ - bozo_logFile = fopen(AFSDIR_BOZLOG_FILE, "a"); - if (!bozo_logFile) { - printf("bosserver: can't initialize log file (%s).\n", - AFSDIR_SERVER_BOZLOG_FILEPATH); - exit(1); + if (!DoSyslog) { + strcpy(namebuf, AFSDIR_BOZLOG_FILE); + strcat(namebuf, ".old"); + renamefile(AFSDIR_BOZLOG_FILE, namebuf); /* try rename first */ + bozo_logFile = fopen(AFSDIR_BOZLOG_FILE, "a"); + if (!bozo_logFile) { + printf("bosserver: can't initialize log file (%s).\n", + AFSDIR_SERVER_BOZLOG_FILEPATH); + exit(1); + } + /* keep log closed normally, so can be removed */ + fclose(bozo_logFile); + } else { +#ifndef AFS_NT40_ENV + openlog("bosserver", LOG_PID, DoSyslogFacility); +#endif } - /* keep log closed normally, so can be removed */ - - fclose(bozo_logFile); - /* Write current state of directory permissions to log file */ DirAccessOK (); @@ -881,30 +916,33 @@ char *a, *b, *c, *d, *e, *f; { char tdate[26]; time_t myTime; - myTime = time(0); - strcpy(tdate, ctime(&myTime)); /* copy out of static area asap */ - tdate[24] = ':'; + if (DoSyslog) { +#ifndef AFS_NT40_ENV + syslog(LOG_INFO, a, b, c, d, e, f); +#endif + } else { + myTime = time(0); + strcpy(tdate, ctime(&myTime)); /* copy out of static area asap */ + tdate[24] = ':'; - /* log normally closed, so can be removed */ + /* log normally closed, so can be removed */ - bozo_logFile=fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a"); - if(bozo_logFile == NULL) - { - printf("bosserver: WARNING: problem with %s", AFSDIR_SERVER_BOZLOG_FILEPATH); - fflush(stdout); - } + bozo_logFile=fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a"); + if(bozo_logFile == NULL) { + printf("bosserver: WARNING: problem with %s", AFSDIR_SERVER_BOZLOG_FILEPATH); + fflush(stdout); + } - if (bozo_logFile) { - fprintf(bozo_logFile, "%s ", tdate); - fprintf(bozo_logFile, a, b, c, d, e, f); - fflush(bozo_logFile); - } - else { - printf("%s ", tdate); - printf(a, b, c, d, e, f); + if (bozo_logFile) { + fprintf(bozo_logFile, "%s ", tdate); + fprintf(bozo_logFile, a, b, c, d, e, f); + fflush(bozo_logFile); + } else { + printf("%s ", tdate); + printf(a, b, c, d, e, f); + } + + /* close so rm BosLog works */ + fclose(bozo_logFile); } - - /* close so rm BosLog works */ - - fclose(bozo_logFile); } diff --git a/src/bu_utils/Makefile b/src/bu_utils/Makefile index 62adef932..7ccf9153f 100644 --- a/src/bu_utils/Makefile +++ b/src/bu_utils/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT=bu_utils include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install COMPILE_ET = ${DESTDIR}/bin/compile_et CFLAGS= -g -w -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS} LDFLAGS = ${XLDFLAGS} diff --git a/src/bubasics/Makefile b/src/bubasics/Makefile index 0df9aa5c6..91420e14c 100644 --- a/src/bubasics/Makefile +++ b/src/bubasics/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT=bubasics include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install RXGEN=${SRCDIR}bin/rxgen COMPILE_ET = ${SRCDIR}bin/compile_et diff --git a/src/bucoord/Makefile b/src/bucoord/Makefile index d97cbc7a9..517708a9f 100644 --- a/src/bucoord/Makefile +++ b/src/bucoord/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT=bucoord include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et CFLAGS= ${DBUG} -w -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS} diff --git a/src/bucoord/ubik_db_if.c b/src/bucoord/ubik_db_if.c index 45ceef830..017fe0146 100644 --- a/src/bucoord/ubik_db_if.c +++ b/src/bucoord/ubik_db_if.c @@ -1395,7 +1395,11 @@ int bc_openTextFile(udbClientTextP ctPtr, char *tmpFileName) fclose(ctPtr->textStream); sprintf(tmpFileName, "%s/bu_XXXXXX", gettmpdir()); +#ifdef AFS_LINUX20_ENV + mkstemp(tmpFileName); +#else mktemp(tmpFileName); +#endif ctPtr->textStream = fopen(tmpFileName, "w+"); if ( ctPtr->textStream == NULL ) ERROR(BUDB_INTERNALERROR); diff --git a/src/bucoord/vol_sets.c b/src/bucoord/vol_sets.c index 0d4fadd62..e35159915 100644 --- a/src/bucoord/vol_sets.c +++ b/src/bucoord/vol_sets.c @@ -188,6 +188,12 @@ afs_int32 bc_DeleteVolEntryCmd(as, arock) vsname = as->parms[0].items->data; + code = bc_UpdateVolumeSet(); + if (code) { + com_err(whoami, code, "; Can't retrieve volume sets"); + return(code); + } + /* lock schedules and check validity */ ctPtr = &bc_globalConfig->configText[TB_VOLUMESET]; diff --git a/src/budb/Makefile b/src/budb/Makefile index c375f3e1a..ac0b03378 100644 --- a/src/budb/Makefile +++ b/src/budb/Makefile @@ -12,7 +12,6 @@ SHELL = /bin/sh COMPONENT=budb include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et RXGEN=${SRCDIR}bin/rxgen diff --git a/src/budb/db_text.c b/src/budb/db_text.c index 48097a44e..7d453ea72 100644 --- a/src/budb/db_text.c +++ b/src/budb/db_text.c @@ -518,7 +518,11 @@ mkstemp(st) { int retval = -1; +#ifdef AFS_LINUX20_ENV + retval = open(mkstemp(st), O_RDWR|O_CREAT|O_EXCL, 0600); +#else retval = open(mktemp(st), O_RDWR|O_CREAT|O_EXCL, 0600); +#endif error_exit: return(retval); diff --git a/src/butc/Makefile b/src/butc/Makefile index 105d3f5ab..edfddbba5 100644 --- a/src/butc/Makefile +++ b/src/butc/Makefile @@ -9,8 +9,6 @@ SHELL = /bin/sh COMPONENT=butc include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install - CFLAGS=-g -w ${INCDIRS} ${XCFLAGS} INCDIRS= -I${SRCDIR}include/afs -I${SRCDIR}include/rx -I${SRCDIR}include diff --git a/src/butc/dump.c b/src/butc/dump.c index db7df4f4c..cc5eae34d 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -97,7 +97,7 @@ afs_int32 tapeblocks; /* Number of 16K tape datablocks in buffer (!CONF_XBS else \ sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId); -#ifdef AFS_NT40_ENV +#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV) localtime_r(t, tm) time_t *t; struct tm *tm; diff --git a/src/butc/tcudbprocs.c b/src/butc/tcudbprocs.c index 932dadd64..8b70406f6 100644 --- a/src/butc/tcudbprocs.c +++ b/src/butc/tcudbprocs.c @@ -1386,7 +1386,11 @@ restoreText(tapeInfo, rstTapeInfoPtr, nextHeader) /* open the text file */ sprintf(filename, "%s/bu_XXXXXX", gettmpdir()); +#ifdef AFS_LINUX20_ENV + fid = open(mkstemp(filename), O_RDWR|O_CREAT|O_EXCL, 0600); +#else fid = open(mktemp(filename), O_RDWR|O_CREAT|O_EXCL, 0600); +#endif if (fid < 0) { ErrorLog(0, rstTapeInfoPtr->taskId, errno, 0, diff --git a/src/butm/Makefile b/src/butm/Makefile index c56fbb25f..9e12ce2e8 100644 --- a/src/butm/Makefile +++ b/src/butm/Makefile @@ -10,7 +10,6 @@ SHELL = /bin/sh SRCDIR=DEST/ DESTDIR=DEST/ -INSTALL=${SRCDIR}bin/install CFLAGS = -g -w -I${SRCDIR}include ${XCFLAGS} LDFLAGS = -g ${XLDFLAGS} diff --git a/src/cmd/Makefile b/src/cmd/Makefile index cd5ac4a45..61dcd3458 100644 --- a/src/cmd/Makefile +++ b/src/cmd/Makefile @@ -11,7 +11,6 @@ SHELL = /bin/sh COMPONENT=cmd include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et INCLS=cmd.h ${XINCLS} diff --git a/src/cmd/cmd.c b/src/cmd/cmd.c index 253586972..934bba8e8 100644 --- a/src/cmd/cmd.c +++ b/src/cmd/cmd.c @@ -223,7 +223,7 @@ register struct cmd_syndesc *as; { } } -static AproposProc(as, arock) +static int AproposProc(as, arock) char *arock; register struct cmd_syndesc *as; { register struct cmd_syndesc *ts; @@ -249,7 +249,7 @@ register struct cmd_syndesc *as; { return 0; } -static HelpProc(as, arock) +static int HelpProc(as, arock) char *arock; register struct cmd_syndesc *as; { register struct cmd_syndesc *ts; @@ -294,7 +294,7 @@ register struct cmd_syndesc *as; { return(code); } -cmd_SetBeforeProc(aproc, arock) +int cmd_SetBeforeProc(aproc, arock) int (*aproc)(); char *arock; { beforeProc = aproc; @@ -302,7 +302,7 @@ char *arock; { return 0; } -cmd_SetAfterProc(aproc, arock) +int cmd_SetAfterProc(aproc, arock) int (*aproc)(); char *arock; { afterProc = aproc; @@ -311,7 +311,7 @@ char *arock; { } /* thread on list in alphabetical order */ -static SortSyntax(as) +static int SortSyntax(as) struct cmd_syndesc *as; { register struct cmd_syndesc **ld, *ud; @@ -440,7 +440,7 @@ afs_int32 aflags;{ } /* add a text item to the end of the parameter list */ -static AddItem(aparm, aval) +static int AddItem(aparm, aval) register struct cmd_parmdesc *aparm; register char *aval; { register struct cmd_item *ti, *ni; @@ -450,7 +450,7 @@ register char *aval; { assert(ti->data); strcpy(ti->data, aval); /* now put ti at the *end* of the list */ - if (ni=aparm->items) { + if ((ni=aparm->items)) { for(;ni;ni=ni->next) if (ni->next == 0) break; /* skip to last one */ ni->next = ti; } @@ -459,7 +459,7 @@ register char *aval; { } /* skip to next non-flag item, if any */ -static AdvanceType(as, aval) +static int AdvanceType(as, aval) register afs_int32 aval; register struct cmd_syndesc *as; { register afs_int32 next; @@ -504,7 +504,7 @@ register struct cmd_syndesc *as; { } /* move the expands flag to the last one in the list */ -static SetupExpandsFlag(as) +static int SetupExpandsFlag(as) register struct cmd_syndesc *as; { register struct cmd_parmdesc *tp; register int last, i; @@ -563,7 +563,7 @@ char **aargv; } /*InsertInitOpcode*/ -static NoParmsOK(as) +static int NoParmsOK(as) register struct cmd_syndesc *as; { register int i; register struct cmd_parmdesc *td; @@ -580,7 +580,7 @@ register struct cmd_syndesc *as; { } /* Call the appropriate function, or return syntax error code. Note: if no opcode is specified, an initialization routine exists, and it has NOT been called before, we invoke the special initialization opcode*/ -cmd_Dispatch(argc, argv) +int cmd_Dispatch(argc, argv) int argc; char **argv; { @@ -831,7 +831,7 @@ char **argv; } /* free token list returned by parseLine */ -static FreeTokens(alist) +static int FreeTokens(alist) register struct cmd_token *alist; { register struct cmd_token *nlist; for(; alist; alist = nlist) { @@ -843,7 +843,7 @@ static FreeTokens(alist) } /* free an argv list returned by parseline */ -cmd_FreeArgv(argv) +int cmd_FreeArgv(argv) register char **argv; { register char *tp; for(tp = *argv; tp; argv++, tp = *argv) @@ -855,7 +855,7 @@ register char **argv; { data is still malloc'd, and will be freed when the caller calls cmd_FreeArgv later on */ #define INITSTR "" -static CopyBackArgs(alist, argv, an, amaxn) +static int CopyBackArgs(alist, argv, an, amaxn) register struct cmd_token *alist; register char **argv; afs_int32 amaxn; @@ -887,25 +887,25 @@ afs_int32 *an; { return 0; } -static quote(x) +static int quote(x) register int x; { if (x == '"' || x == 39 /* single quote */) return 1; else return 0; } -static space(x) +static int space(x) register int x; { if (x == 0 || x == ' ' || x == '\t' || x== '\n') return 1; else return 0; } -cmd_ParseLine(aline, argv, an, amaxn) +int cmd_ParseLine(aline, argv, an, amaxn) char **argv; afs_int32 *an; afs_int32 amaxn; char *aline; { char tbuffer[256]; - register char *tptr; + register char *tptr = 0; int inToken, inQuote; struct cmd_token *first, *last; register struct cmd_token *ttok; @@ -920,7 +920,10 @@ char *aline; { if (tc == 0 || (!inQuote && space(tc))) { /* terminating null gets us in here, too */ if (inToken) { inToken = 0; /* end of this token */ - *tptr++ = 0; + if ( !tptr ) + return -1; /* should never get here */ + else + *tptr++ = 0; ttok = (struct cmd_token *) malloc(sizeof(struct cmd_token)); assert(ttok); ttok->next = (struct cmd_token *) 0; diff --git a/src/cmd/cmd.p.h b/src/cmd/cmd.p.h index a4a77bff2..8595d8e67 100644 --- a/src/cmd/cmd.p.h +++ b/src/cmd/cmd.p.h @@ -66,12 +66,12 @@ extern struct cmd_syndesc *cmd_CreateSyntax( char *helpp ); -extern cmd_SetBeforeProc( +extern int cmd_SetBeforeProc( int (*aproc)(), char *arock ); -extern cmd_SetAfterProc( +extern int cmd_SetAfterProc( int (*aproc)(), char *arock ); @@ -94,16 +94,16 @@ extern int cmd_AddParm( char *ahelp ); -extern cmd_Dispatch( +extern int cmd_Dispatch( int argc, char **argv ); -extern cmd_FreeArgv( +extern int cmd_FreeArgv( char **argv ); -extern cmd_ParseLine( +extern int cmd_ParseLine( char *aline, char **argv, afs_int32 *an, diff --git a/src/comerr/Makefile b/src/comerr/Makefile index d0575c64e..b895d19fe 100644 --- a/src/comerr/Makefile +++ b/src/comerr/Makefile @@ -17,7 +17,6 @@ LINTFILES= error_msg.c et_name.c com_err.c LIBOBJS= error_msg.o et_name.o com_err.o UKERNELDIR=../libuafs/ -INSTALL=${SRCDIR}bin/install CFLAGS= ${OPTMZ} -I${DESTDIR}include ${XCFLAGS} FILES= Makefile et_name.c error_msg.c compile_et.c \ diff --git a/src/config/Makefile b/src/config/Makefile index 6ea8484b7..125069c1d 100644 --- a/src/config/Makefile +++ b/src/config/Makefile @@ -68,7 +68,7 @@ ${KERNELDIR}/afs/param.h ${DESTDIR}include/afs/param.h :: param.${SYS_NAME}.h ${KERNELDIR}/afs/afs_sysnames.h ${DESTDIR}include/afs/afs_sysnames.h :: afs_sysnames.h $(RM) -f $@; $(CP) $? $@ -DESTINCLS = ${DESTDIR}include/afs/afs_args.h ${DESTDIR}include/afs/venus.h ${DESTDIR}include/afs/debug.h ${DESTDIR}include/afs/afs_sysnames.h ${DESTDIR}include/afs/param.h ${DESTDIR}include/afs/stds.h ${DESTDIR}include/afs/icl.h ../permit_xprt.h +DESTINCLS = ${DESTDIR}include/afs/afs_args.h ${DESTDIR}include/afs/venus.h ${DESTDIR}include/afs/debug.h ${DESTDIR}include/afs/afs_sysnames.h ${DESTDIR}include/afs/param.h ${DESTDIR}include/afs/stds.h ${DESTDIR}include/afs/icl.h ${KERNELDIR}/afs/stds.h ${DESTDIR}include/afs/stds.h :: stds.h $(RM) -f $@; $(CP) $? $@ @@ -88,24 +88,6 @@ ${DESTDIR}include/afs/venus.h :: venus.h ${DESTDIR}include/afs/debug.h :: debug.h $(RM) -f $@; $(CP) $? $@ -${KERNELDIR}/afs/permit_xprt.h ../permit_xprt.h: - $(RM) -f ${KERNELDIR}/afs/permit_xprt.h ../permit_xprt.h - if [ -f SRC/../xprt/permit_xprt.h ] ; then \ - echo "XPRT" ; \ - perm_src=`pwd`/../xprt ; \ - echo "perm_src='$$perm_src'" ; \ - set -x ; \ - $(CP) $$perm_src/permit_export.h ${KERNELDIR}/afs/permit_xprt.h ; \ - ln -s $$perm_src/permit_xprt.h ../permit_xprt.h ; \ - else \ - echo "CONFIG" ; \ - perm_src=`pwd` ; \ - echo "perm_src='$$perm_src'" ; \ - set -x ; \ - $(CP) $$perm_src/permit_xprt.h ${KERNELDIR}/afs/permit_xprt.h ; \ - ln -s $$perm_src/permit_xprt.h ../permit_xprt.h ; \ - fi - $(UKDIRS): set $@; $(MKDIR_IF_NEEDED) @@ -133,19 +115,6 @@ ${UKERNELDIR}/afs/venus.h :: venus.h ${UKERNELDIR}/afs/afs_args.h :: afs_args.h $(RM) -f $@; $(CP) $? $@ -${UKERNELDIR}/afs/permit_xprt.h: - $(RM) -f ${UKERNELDIR}/afs/permit_xprt.h - if [ -f SRC/../xprt/permit_xprt.h ] ; then \ - echo "XPRT" ; \ - perm_src=`pwd`/../xprt ; \ - else \ - echo "CONFIG" ; \ - perm_src=`pwd`/../config ; \ - fi; \ - echo "perm_src='$$perm_src'" ; \ - set -x ; \ - ln -s $$perm_src/permit_xprt.h ${UKERNELDIR}/afs/permit_xprt.h - # lkversion is the target the Linux build uses to verify the build machine # has headers in the right place for the requested kernel builds. # @@ -161,8 +130,6 @@ lkversion: esac install.noversion: $(KDIRS) noversionMakef all $(DESTINCLS) venus.h - $(RM) -f ${DESTDIR}/include/afs/permit_xprt.h - $(CP) permit_xprt.h ${DESTDIR}/include/afs/ system: install install: version install.noversion kinstall ukinstall @@ -174,14 +141,14 @@ install: version install.noversion kinstall ukinstall kinstall: lkversion config $(KDIRS) ${KERNELDIR}/afs/param.h \ ${KERNELDIR}/afs/stds.h \ - ${KERNELDIR}/afs/permit_xprt.h ${KERNELDIR}/afs/afs_sysnames.h \ + ${KERNELDIR}/afs/afs_sysnames.h \ ${KERNELDIR}/config/Makefile.${SYS_NAME} \ ${KERNELDIR}/afs/afs_args.h \ ${KERNELDIR}/afs/icl.h \ ${KERNELDIR}/afs/AFS_component_version_number.c ukinstall webinstall: $(DESTINCLS) config $(UKDIRS) ${UKERNELDIR}/afs/param.h ${UKERNELDIR}/afs/stds.h \ - ${UKERNELDIR}/afs/permit_xprt.h ${UKERNELDIR}/afs/afs_sysnames.h \ + ${UKERNELDIR}/afs/afs_sysnames.h \ ${UKERNELDIR}/config/Makefile.${SYS_NAME} \ ${UKERNELDIR}/afs/afs_args.h \ ${UKERNELDIR}/afs/icl.h \ diff --git a/src/config/Makefile.alpha_dux40 b/src/config/Makefile.alpha_dux40 index d9567006b..3e364770e 100644 --- a/src/config/Makefile.alpha_dux40 +++ b/src/config/Makefile.alpha_dux40 @@ -21,8 +21,8 @@ OPTMZ=-O2 DBG=-g3 CSTATIC=-non_shared RANLIB=/bin/true -WASHTOOL=${SRCDIR}bin/washtool -INSTALL=${SRCDIR}bin/install +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install #this is for the vol package FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D diff --git a/src/config/Makefile.alpha_dux50 b/src/config/Makefile.alpha_dux50 index 7bc6378de..39abb115e 100644 --- a/src/config/Makefile.alpha_dux50 +++ b/src/config/Makefile.alpha_dux50 @@ -22,8 +22,8 @@ DBG=-g3 CP=cp CSTATIC=-non_shared RANLIB=/bin/true -WASHTOOL=${SRCDIR}bin/washtool -INSTALL=${SRCDIR}bin/install +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install #this is for the vol package FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D diff --git a/src/config/Makefile.hp_ux110 b/src/config/Makefile.hp_ux110 index 3064e51d6..caab152fa 100644 --- a/src/config/Makefile.hp_ux110 +++ b/src/config/Makefile.hp_ux110 @@ -21,8 +21,8 @@ LWP_OPTMZ=-O OPTMZ=-O DBG=-g RANLIB=ranlib -INSTALL=${SRCDIR}bin/install -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install RM=/bin/rm CP=/bin/cp AR=/bin/ar diff --git a/src/config/Makefile.rs_aix42 b/src/config/Makefile.rs_aix42 index c2074b6c7..cb0c2e33c 100644 --- a/src/config/Makefile.rs_aix42 +++ b/src/config/Makefile.rs_aix42 @@ -29,13 +29,13 @@ MT_CC=xlc_r AR=ar AS=as CP=cp -INSTALL=${SRCDIR}bin/install LD=ld LEX=lex MV=mv RANLIB=ranlib RM=rm -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # This is the XBSA make flag and pathname to XBSA header files (xbsa.h) XBSA_FLAGS=-Dxbsa diff --git a/src/config/Makefile.s390_linux22 b/src/config/Makefile.s390_linux22 index 2c213bc7d..9104a6efc 100644 --- a/src/config/Makefile.s390_linux22 +++ b/src/config/Makefile.s390_linux22 @@ -35,13 +35,13 @@ XLIBS= AR=ar AS=as CP=cp -INSTALL=${SRCDIR}bin/install LD=gcc MT_CC=gcc MV=mv RANLIB=ranlib RM=rm -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # Other OS specific requirements # diff --git a/src/config/Makefile.sgi_62 b/src/config/Makefile.sgi_62 index 964b0ccb5..15185cac7 100644 --- a/src/config/Makefile.sgi_62 +++ b/src/config/Makefile.sgi_62 @@ -33,13 +33,13 @@ AR=ar AS=as CP=cp MT_CC=cc -INSTALL=${SRCDIR}bin/install LD=ld LEX=lex MV=mv RANLIB=/bin/true RM=rm -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # This is for the vol package XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check diff --git a/src/config/Makefile.sgi_63 b/src/config/Makefile.sgi_63 index 4caf1b5ed..11f274664 100644 --- a/src/config/Makefile.sgi_63 +++ b/src/config/Makefile.sgi_63 @@ -33,10 +33,10 @@ AR=ar AS=as CP=cp MT_CC=cc -INSTALL=${SRCDIR}bin/install LD=ld LEX=lex MV=mv RANLIB=/bin/true RM=rm -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install diff --git a/src/config/Makefile.sgi_64 b/src/config/Makefile.sgi_64 index 3d63a167b..421d80171 100644 --- a/src/config/Makefile.sgi_64 +++ b/src/config/Makefile.sgi_64 @@ -34,13 +34,13 @@ AR=ar AS=as CP=cp MT_CC=cc -INSTALL=${SRCDIR}bin/install LD=ld LEX=lex MV=mv RANLIB=/bin/true RM=rm -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # This is for the vol package XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check diff --git a/src/config/Makefile.sgi_65 b/src/config/Makefile.sgi_65 index 07d163f14..604028ec9 100644 --- a/src/config/Makefile.sgi_65 +++ b/src/config/Makefile.sgi_65 @@ -34,13 +34,13 @@ AR=ar AS=as CP=cp MT_CC=/usr/bin/cc -INSTALL=${SRCDIR}bin/install LD=/usr/bin/ld LEX=lex MV=mv RANLIB=/bin/true RM=rm -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # This is for the vol package XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check diff --git a/src/config/Makefile.sun4x_55 b/src/config/Makefile.sun4x_55 index a02e8b681..b69193d54 100644 --- a/src/config/Makefile.sun4x_55 +++ b/src/config/Makefile.sun4x_55 @@ -32,7 +32,6 @@ AS=as CC=/opt/SUNWspro/bin/cc MT_CC=/opt/SUNWspro/bin/cc CP=/bin/cp -INSTALL=${SRCDIR}bin/install LEX=lex LD= /usr/ccs/bin/ld LORDER = /usr/ccs/bin/lorder @@ -40,7 +39,8 @@ MV=mv RANLIB=/bin/true RM=rm STRIP= /usr/ccs/bin/strip -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # this is for the vol package FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26 diff --git a/src/config/Makefile.sun4x_56 b/src/config/Makefile.sun4x_56 index f048a0efd..74e144e4b 100644 --- a/src/config/Makefile.sun4x_56 +++ b/src/config/Makefile.sun4x_56 @@ -36,7 +36,6 @@ AS=as CC=/opt/SUNWspro/bin/cc MT_CC=/opt/SUNWspro/bin/cc CP=/bin/cp -INSTALL=${SRCDIR}bin/install LEX=lex LD= /usr/ccs/bin/ld LORDER = /usr/ccs/bin/lorder @@ -44,7 +43,8 @@ MV=mv RANLIB=/bin/true RM=rm STRIP= /usr/ccs/bin/strip -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # this is for the vol package FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26 diff --git a/src/config/Makefile.sun4x_57 b/src/config/Makefile.sun4x_57 index bcc489714..0003637bf 100644 --- a/src/config/Makefile.sun4x_57 +++ b/src/config/Makefile.sun4x_57 @@ -40,7 +40,6 @@ AS=as CC=/opt/SUNWspro/bin/cc MT_CC=/opt/SUNWspro/bin/cc CP=/bin/cp -INSTALL=${SRCDIR}bin/install LEX=lex LD= /usr/ccs/bin/ld LORDER = /usr/ccs/bin/lorder @@ -48,7 +47,8 @@ MV=mv RANLIB=/bin/true RM=rm STRIP= /usr/ccs/bin/strip -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # this is for the vol package FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26 diff --git a/src/config/Makefile.sun4x_58 b/src/config/Makefile.sun4x_58 index 3701bfda6..5d07dfbe4 100644 --- a/src/config/Makefile.sun4x_58 +++ b/src/config/Makefile.sun4x_58 @@ -33,7 +33,6 @@ AS=as CC=/opt/SUNWspro/bin/cc MT_CC=/opt/SUNWspro/bin/cc CP=/bin/cp -INSTALL=${SRCDIR}bin/install LEX=lex LD= /usr/ccs/bin/ld LORDER = /usr/ccs/bin/lorder @@ -41,7 +40,8 @@ MV=mv RANLIB=/bin/true RM=rm STRIP= /usr/ccs/bin/strip -WASHTOOL=${SRCDIR}bin/washtool +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install # # this is for the vol package FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26 diff --git a/src/config/Makefile.sunx86_54 b/src/config/Makefile.sunx86_54 index 51c15e497..ab8e0cf58 100644 --- a/src/config/Makefile.sunx86_54 +++ b/src/config/Makefile.sunx86_54 @@ -18,3 +18,5 @@ AR = /usr/ccs/bin/ar LD = /usr/ccs/bin/ld LORDER = /usr/ccs/bin/lorder STRIP= /usr/ccs/bin/strip +WASHTOOL=${DESTDIR}bin/washtool +INSTALL=${DESTDIR}bin/install diff --git a/src/config/Makefile.version-NOCML b/src/config/Makefile.version-NOCML index fc692ef5e..81e6ac5c4 100644 --- a/src/config/Makefile.version-NOCML +++ b/src/config/Makefile.version-NOCML @@ -8,8 +8,8 @@ AFS_component_version_number.o: AFS_component_version_number.c AFS_component_version_number.c: - echo 'char cml_version_number[]="@(#) OpenAFS stable 1.0.3 built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c; - echo 'char* AFSVersion = "openafs stable 1.0.3"; ' >>AFS_component_version_number.c; + echo 'char cml_version_number[]="@(#) OpenAFS stable 1.0.4 built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c; + echo 'char* AFSVersion = "openafs stable 1.0.4"; ' >>AFS_component_version_number.c; noversion: install diff --git a/src/config/NTMakefile b/src/config/NTMakefile index a5ef7dbae..917e8cbfe 100644 --- a/src/config/NTMakefile +++ b/src/config/NTMakefile @@ -26,26 +26,13 @@ INCFILES =\ $(INCFILEDIR)\debug.h \ $(INCFILEDIR)\param.h \ $(INCFILEDIR)\afs_sysnames.h \ - $(INCFILEDIR)\permit_xprt.h \ $(INCFILEDIR)\stds.h \ - $(INCFILEDIR)\icl.h \ - ..\permit_xprt.h + $(INCFILEDIR)\icl.h $(INCFILEDIR)\param.h: param.$(SYS_NAME).h $(COPY) $? $@ -!IF (EXIST($(SRCROOT)\xprt\permit_xprt.h)) -..\permit_xprt.h: $(SRCROOT)\xprt\permit_xprt.h - $(DEL) ..\permit_xprt.h - $(COPY) $(SRCROOT)\xprt\permit_xprt.h ..\permit_xprt.h -!ELSE -..\permit_xprt.h: .\permit_xprt.h - $(DEL) ..\permit_xprt.h - $(COPY) .\permit_xprt.h ..\permit_xprt.h -!ENDIF - - idirs: doclink ! IF (!EXIST($(DESTDIR)\include)) $(MKDIR) $(DESTDIR)\include diff --git a/src/config/afs_sysnames.h b/src/config/afs_sysnames.h index ada6df6f3..0b4ebec6e 100644 --- a/src/config/afs_sysnames.h +++ b/src/config/afs_sysnames.h @@ -47,6 +47,8 @@ #define SYS_NAME_ID_mac2_51 500 #define SYS_NAME_ID_mac_aux10 501 #define SYS_NAME_ID_mac_mach51 502 +#define SYS_NAME_ID_ppc_darwin_12 503 +#define SYS_NAME_ID_ppc_darwin_13 504 #define SYS_NAME_ID_next_mach20 601 #define SYS_NAME_ID_next_mach30 602 @@ -125,6 +127,11 @@ #define SYS_NAME_ID_s390_linux22 1901 #define SYS_NAME_ID_s390_linux24 1902 +#define SYS_NAME_ID_alpha_linux_2 2000 +#define SYS_NAME_ID_alpha_linux_22 2001 +#define SYS_NAME_ID_alpha_linux_24 2002 + +#define SYS_NAME_ID_i386_fbsd_42 2100 /* * Placeholder to keep system-wide standard flags since this file is included by all diff --git a/src/config/config.c b/src/config/config.c index c29bd71bf..46f4610a1 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -16,9 +16,10 @@ #include "AFS_component_version_number.c" -main(argc, argv) -int argc; -char **argv; { +/* prototypes */ +int mc_copy(FILE *, FILE *, char **); + +int main(int argc, char **argv) { register FILE *infile; register FILE *outfile; char *alist[3]; diff --git a/src/config/mc.c b/src/config/mc.c index 4df628338..ac1dba55f 100644 --- a/src/config/mc.c +++ b/src/config/mc.c @@ -13,10 +13,7 @@ #include #include #include - -#if defined(__alpha) -extern void *malloc(int size); -#endif +#include #define TOK_DONTUSE 1 /* Don't copy if match and this flag is set. */ struct token { @@ -26,7 +23,7 @@ struct token { }; /* free token list returned by parseLine */ -static FreeTokens(alist) +static int FreeTokens(alist) register struct token *alist; { register struct token *nlist; for(; alist; alist = nlist) { @@ -38,11 +35,11 @@ static FreeTokens(alist) } #define space(x) ((x) == ' ' || (x) == '\t' || (x) == '<' || (x) == '>') -static ParseLine(aline, alist) +static int ParseLine(aline, alist) char *aline; struct token **alist; { char tbuffer[MAXTOKLEN+1]; - register char *tptr; + register char *tptr = NULL; int inToken; struct token *first, *last; register struct token *ttok; @@ -57,7 +54,10 @@ static ParseLine(aline, alist) if (tc == 0 || space(tc)) { /* terminating null gets us in here, too */ if (inToken) { inToken = 0; /* end of this token */ - *tptr++ = 0; + if ( !tptr ) + return -1; /* should never get here */ + else + *tptr++ = 0; ttok = (struct token *) malloc(sizeof(struct token)); ttok->next = (struct token *) 0; if (dontUse) { @@ -101,7 +101,7 @@ static ParseLine(aline, alist) } /* read a line into a buffer, putting in null termination and stopping on appropriate end of line char. Returns 0 at eof, > 0 at normal line end, and < 0 on error */ -static GetLine(afile, abuffer, amax) +static int GetLine(afile, abuffer, amax) FILE *afile; int amax; register char *abuffer; { @@ -124,7 +124,8 @@ static GetLine(afile, abuffer, amax) } } } -mc_copy(ain, aout, alist) + +int mc_copy(ain, aout, alist) register FILE *ain; register FILE *aout; char *alist[]; { diff --git a/src/config/mkvers.c b/src/config/mkvers.c index f785b7269..0eb60b043 100644 --- a/src/config/mkvers.c +++ b/src/config/mkvers.c @@ -16,7 +16,9 @@ #include #include #include +#ifndef __APPLE_CC__ #include +#endif #include #include diff --git a/src/config/param.i386_linux22.h b/src/config/param.i386_linux22.h index 7f3277e9f..85506a61c 100644 --- a/src/config/param.i386_linux22.h +++ b/src/config/param.i386_linux22.h @@ -25,7 +25,6 @@ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */ #define AFS_SYSCALL 137 -#define AFS_64BIT_ENV #define AFS_64BIT_IOPS_ENV 1 #define AFS_NAMEI_ENV 1 /* User space interface to file system */ #include diff --git a/src/config/param.i386_linux24_usr.h b/src/config/param.i386_linux24_usr.h index 01c1ab1cc..394d1a988 100644 --- a/src/config/param.i386_linux24_usr.h +++ b/src/config/param.i386_linux24_usr.h @@ -17,6 +17,7 @@ #define AFS_MOUNT_AFS "afs" /* The name of the filesystem type. */ #define AFS_SYSCALL 137 +#define AFS_64BIT_ENV #define AFS_64BIT_IOPS_ENV 1 #define AFS_NAMEI_ENV 1 /* User space interface to file system */ #include diff --git a/src/dauth/Makefile b/src/dauth/Makefile index 27ac5bd97..9fd72fc92 100644 --- a/src/dauth/Makefile +++ b/src/dauth/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT= dauth include ../config/Makefile.${SYS_NAME} -INSTALL= ${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et OPTMZ= -g @@ -17,11 +16,11 @@ CFLAGS = ${OPTMZ} -I${SRCDIR}include ${XCFLAGS} LDFLAGS = ${OPTMZ} ${XLDFLAGS} INCLS= ${SRCDIR}include/ubik.h \ - ${SRCDIR}include/lwp.h \ - ${SRCDIR}include/lock.h \ - ${SRCDIR}include/rx/rx.h \ - ${SRCDIR}include/rx/xdr.h \ - ${SRCDIR}include/afs/com_err.h + ${SRCDIR}include/lwp.h \ + ${SRCDIR}include/lock.h \ + ${SRCDIR}include/rx/rx.h \ + ${SRCDIR}include/rx/xdr.h \ + ${SRCDIR}include/afs/com_err.h VERSION = AFS_component_version_number.o OBJS = adkint.cs.o adkint.xdr.o @@ -71,7 +70,7 @@ dpass: dpass.o $(VERSION) $(LIBS) dlog_test: dlog.c $(OBJS) $(LIBS) $(CC) $(LDFLAGS) -DDLOG_TEST -o dlog_test dlog.c $(OBJS) \ $(LIBS) ${XLIBS} - + system: install ${DESTDIR}bin/dlog: dlog diff --git a/src/dauth/dlog.c b/src/dauth/dlog.c index 02c56fc3d..afce5ec55 100644 --- a/src/dauth/dlog.c +++ b/src/dauth/dlog.c @@ -89,9 +89,6 @@ #include #include -#include "../permit_xprt.h" - - /* * The password reading routine in des/readpassword.c will not work if the * buffer size passed in is greater than BUFSIZ, so we pretty well have to diff --git a/src/des/Makefile b/src/des/Makefile index 3d58d5380..a3c6b06a7 100644 --- a/src/des/Makefile +++ b/src/des/Makefile @@ -26,7 +26,6 @@ SHELL = /bin/sh include ../config/Makefile.${SYS_NAME} UKERNELDIR=../libuafs/ -INSTALL=${SRCDIR}bin/install SRC =. MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 @@ -209,9 +208,6 @@ ${DES_LIB}: ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o ar r ${DES_LIB} ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o $(RANLIB) ${DES_LIB} -# export stuff -des.o cbc_encrypt.o pcbc_encrypt.o new_rnd_key.o cksum.o testit.o verify.o: ../permit_xprt.h - # host system stuff make_ip: make_ip.o misc.o ${CC} make_ip.o misc.o ${LDFLAGS} -o make_ip diff --git a/src/des/andrew-conf.h b/src/des/andrew-conf.h index 99ec3cde2..0f9d238e4 100644 --- a/src/des/andrew-conf.h +++ b/src/des/andrew-conf.h @@ -31,7 +31,7 @@ #if defined(sgi) #include "conf-sgi.h" #else -#ifdef __alpha +#if defined(__alpha) && !defined(AFS_ALPHA_LINUX20_ENV) #include "conf-bsd-alpha.h" #else #if defined(AFS_X86_ENV) @@ -53,14 +53,22 @@ #ifdef AFS_S390_LINUX20_ENV #include "conf-s390-linux.h" #else +#ifdef AFS_ALPHA_LINUX20_ENV +#include "conf-alpha-linux.h" +#else #include "conf-i386-linux.h" +#endif /* AFS_ALPHA_LINUX20_ENV */ #endif /* AFS_S390_LINUX20_ENV */ #endif /* AFS_SPARC64_LINUX20_ENV */ #endif /* AFS_SPARC_LINUX20_ENV */ #endif #else +#if defined(AFS_DARWIN_ENV) && defined(AFS_PPC_ENV) +#include "conf-ppc-darwin.h" +#else Sorry, you lose. Figure out what the machine looks like and fix this file to include it. +#endif #endif /* AFS_LINUX20_ENV */ #endif /* AFS_NT40_ENV */ #endif /* NCR || X86 */ diff --git a/src/des/cbc_encrypt.c b/src/des/cbc_encrypt.c index 740821dd3..7b52e5144 100644 --- a/src/des/cbc_encrypt.c +++ b/src/des/cbc_encrypt.c @@ -23,10 +23,10 @@ #include #define XPRT_CBC_ENCRYPT -#include "../permit_xprt.h" extern int des_debug; extern int des_debug_print(); +extern int des_ecb_encrypt(); /* * This routine performs DES cipher-block-chaining operation, either @@ -47,7 +47,7 @@ extern int des_debug_print(); * cleartext. */ -AFS_HIDE afs_int32 +afs_int32 des_cbc_encrypt(in,out,length,key,iv,encrypt) des_cblock *in; /* >= length bytes of input text */ des_cblock *out; /* >= length bytes of output text */ diff --git a/src/des/cksum.c b/src/des/cksum.c index c9a6457bf..e85add710 100644 --- a/src/des/cksum.c +++ b/src/des/cksum.c @@ -30,10 +30,10 @@ #include "des_internal.h" #define XPRT_CKSUM -#include "../permit_xprt.h" extern int des_debug; extern int des_debug_print(); +extern int des_ecb_encrypt(); /* * This routine performs DES cipher-block-chaining checksum operation, @@ -50,7 +50,7 @@ extern int des_debug_print(); * multiple of eight bytes. */ -AFS_HIDE afs_uint32 +afs_uint32 des_cbc_cksum(in,out,length,key,iv) des_cblock *in; /* >= length bytes of inputtext */ des_cblock *out; /* >= length bytes of outputtext */ diff --git a/src/des/des.c b/src/des/des.c index b1381f2a5..0e2b020c6 100644 --- a/src/des/des.c +++ b/src/des/des.c @@ -48,7 +48,6 @@ #include "stats.h" #define XPRT_DES -#include "../permit_xprt.h" #ifdef DEBUG #define DBG_PRINT(s) if (des_debug & 2) \ @@ -59,14 +58,15 @@ #endif extern int des_debug; -extern des_cblock_print_file (); -extern des_debug_print (); +extern int des_cblock_print_file (); +extern int des_debug_print (); +extern int swap_long_bytes_bit_number(int); #ifdef AFS_PTHREAD_ENV pthread_mutex_t rxkad_stats_mutex; #endif /* AFS_PTHREAD_ENV */ -AFS_HIDE afs_int32 +afs_int32 des_ecb_encrypt(clear, cipher, schedule, encrypt) afs_uint32 *clear; afs_uint32 *cipher; diff --git a/src/des/key_sched.c b/src/des/key_sched.c index 65fd76ea0..47717cafd 100644 --- a/src/des/key_sched.c +++ b/src/des/key_sched.c @@ -36,12 +36,15 @@ #include "stats.h" extern int des_debug; -extern rev_swap_bit_pos_0(); +extern int rev_swap_bit_pos_0(); +extern int des_check_key_parity(des_cblock); +extern int des_is_weak_key(des_cblock); typedef char key[64]; /* the following are really void but cc86 doesnt allow it */ static int make_key_sched(); + #ifdef AFS_DUX40_ENV #pragma weak des_key_sched = afs_des_key_sched int afs_des_key_sched(k,schedule) @@ -246,4 +249,6 @@ make_key_sched(Key,Schedule) fprintf(stderr,"\n"); } #endif + + return(0); } diff --git a/src/des/make_fp.c b/src/des/make_fp.c index 336bdb429..c11e55687 100644 --- a/src/des/make_fp.c +++ b/src/des/make_fp.c @@ -11,10 +11,13 @@ #include #include #include "des_internal.h" + +#define WANT_FP_TABLE #include "tables.h" extern unsigned int swap_bit_pos_0_to_ansi PROTOTYPE((unsigned int)); extern afs_int32 swap_long_bytes(); +extern afs_int32 swap_long_bytes_bit_number(); extern void test_set PROTOTYPE((FILE *, char const *, int, char const *, int)); diff --git a/src/des/make_ip.c b/src/des/make_ip.c index 2a8b6bc91..3c5de48de 100644 --- a/src/des/make_ip.c +++ b/src/des/make_ip.c @@ -11,10 +11,16 @@ #include #include #include "des_internal.h" + +#define WANT_IP_TABLE #include "tables.h" extern afs_int32 swap_bit_pos_0(); extern afs_int32 rev_swap_bit_pos_0(); +extern void test_set PROTOTYPE((FILE *, char const *, int, + char const *, int)); +extern int swap_long_bytes_bit_number(int); +extern int swap_bit_pos_0_to_ansi(int); #define SWAP(x) swap_long_bytes_bit_number(swap_bit_pos_0_to_ansi(x)) diff --git a/src/des/make_keyperm.c b/src/des/make_keyperm.c index cf25d38cb..60791fced 100644 --- a/src/des/make_keyperm.c +++ b/src/des/make_keyperm.c @@ -186,9 +186,10 @@ void gen(stream) } /* now output the resulting key permutation */ - fprintf(stream, " /* ks permutation iteration = %2d */", + fprintf(stream, "\n /* ks permutation iteration = %2d */", iter); for (i = 1; i <= 6; i++) { + if ( i == 1 ) fprintf(stream, "\n {"); fprintf(stream, "\n "); for (j = 1; j <= 8; j++) { /* @@ -197,11 +198,16 @@ void gen(stream) */ fprintf(stream, "%d", ks_perm[iter][(i-1)*8+j]-1); /* omit last comma */ - if ((j != 8) || (i != 6) || (iter != 16)) { + if ((j != 8) || (i != 6)) { fprintf(stream,", "); } } } + if ( iter != 16) { + fprintf(stream, "\n }, "); + } else { + fprintf(stream, "\n }"); + } } fprintf(stream,"\n};\n"); } diff --git a/src/des/make_p_table.c b/src/des/make_p_table.c index 9e40687b2..d2248ffd3 100644 --- a/src/des/make_p_table.c +++ b/src/des/make_p_table.c @@ -9,6 +9,8 @@ #include #include #include "des_internal.h" + +#define WANT_P_TABLE #include "tables.h" extern afs_uint32 swap_byte_bits(); @@ -25,7 +27,7 @@ void gen(stream) #ifdef BIG /* flip p into p_temp */ for (i = 0; i<32; i++) - P_temp[P[rev_swap_bit_pos_0(i)]] = rev_swap_bit_pos_0(i); + P_temp[(int) P[rev_swap_bit_pos_0(i)]] = rev_swap_bit_pos_0(i); /* * now for each byte of input, figure out all possible combinations @@ -47,11 +49,13 @@ void gen(stream) fprintf(stream, "\n\tstatic afs_uint32 const P_prime[4][256] = {\n\t"); for (i = 0; i < 4; i++) { - fprintf(stream,"\n"); + fprintf(stream,"\n{ "); for (j = 0; j < 64; j++) { fprintf(stream,"\n"); for (k = 0; k < 4; k++) { fprintf(stream,"0x%08X",P_prime[i][j*4+k]); + if ((j == 63) && (k == 3)) + fprintf(stream, "}"); if ((i == 3) && (j == 63) && (k == 3)) fprintf(stream,"\n};"); else diff --git a/src/des/make_s_table.c b/src/des/make_s_table.c index e28f859e3..3dfe74b49 100644 --- a/src/des/make_s_table.c +++ b/src/des/make_s_table.c @@ -8,6 +8,8 @@ #include #include #include "des_internal.h" + +#define WANT_S_TABLE #include "tables.h" extern afs_uint32 swap_bit_pos_0(); @@ -51,12 +53,16 @@ void gen(stream) } for (i = 0; i<=7; i++) { - fprintf(stream,"\n"); + fprintf(stream,"\n{ "); k =0; for (j = 0; j<= 3; j++) { fprintf(stream,"\n"); for (m = 0; m <= 15; m++) { fprintf(stream,"%2d",temp[i][k]); + if (k==63) + { + fprintf(stream,"\n}"); + } if ((k++ != 63) || (i !=7)) { fprintf(stream,", "); } diff --git a/src/des/misc.c b/src/des/misc.c index d3ab60e61..10f2d82b7 100644 --- a/src/des/misc.c +++ b/src/des/misc.c @@ -238,7 +238,7 @@ afs_uint32 swap_byte_bits(x) #endif /* LSBFIRST */ } -swap_long_bytes_bit_number(x) +int swap_long_bytes_bit_number(x) afs_uint32 x; { /* @@ -290,7 +290,7 @@ char const *whoami; #include "AFS_component_version_number.c" -main(argc, argv) +int main(argc, argv) int argc; char *argv[]; { diff --git a/src/des/new_rnd_key.c b/src/des/new_rnd_key.c index 98f2ec8d8..b4206267b 100644 --- a/src/des/new_rnd_key.c +++ b/src/des/new_rnd_key.c @@ -19,19 +19,21 @@ #ifdef AFS_PTHREAD_ENV #include #endif +#include #include #include "des_internal.h" #include "stats.h" extern void des_fixup_key_parity(); extern int des_is_weak_key(); +extern int des_ecb_encrypt(); +extern int des_key_sched(); void des_set_random_generator_seed(); static afs_int32 des_set_sequence_number(des_cblock new_sequence_number); static afs_int32 des_generate_random_block(des_cblock block); #define XPRT_NEW_RND_KEY -#include "../permit_xprt.h" static int is_inited = 0; #ifdef AFS_PTHREAD_ENV @@ -93,7 +95,7 @@ des_random_key(key) * * Note: this routine calls des_set_random_generator_seed. */ -#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) you lose... (aka, you get to implement an analog of this for your system...) #else @@ -104,6 +106,7 @@ des_random_key(key) #include #else #include +#include #endif void des_init_random_number_generator(key) diff --git a/src/des/pcbc_encrypt.c b/src/des/pcbc_encrypt.c index c14b9d7c5..79b0eceec 100644 --- a/src/des/pcbc_encrypt.c +++ b/src/des/pcbc_encrypt.c @@ -27,10 +27,10 @@ #include "des_internal.h" #define XPRT_PCBC_ENCRYPT -#include "../permit_xprt.h" extern int des_debug; extern int des_debug_print(); +extern int des_ecb_encrypt(); /* * pcbc_encrypt is an "error propagation chaining" encrypt operation @@ -62,7 +62,7 @@ extern int des_debug_print(); * */ -AFS_HIDE afs_int32 +afs_int32 des_pcbc_encrypt(in,out,length,key,iv,encrypt) des_cblock *in; /* >= length bytes of inputtext */ des_cblock *out; /* >= length bytes of outputtext */ diff --git a/src/des/read_pssword.c b/src/des/read_pssword.c index d632f18f0..4fd9e8175 100644 --- a/src/des/read_pssword.c +++ b/src/des/read_pssword.c @@ -28,13 +28,17 @@ #ifdef AFS_SUN5_ENV #define BSD_COMP #endif +#if defined(AFS_FBSD_ENV) +#define USE_OLD_TTY +#endif #include #include #include #endif -#if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #include +#include #endif #ifdef AFS_HPUX_ENV @@ -48,6 +52,9 @@ static int intrupt; #include #endif +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#include +#endif #ifdef AFS_NT40_ENV #include #endif @@ -70,9 +77,11 @@ typedef int sigtype; #endif static sigtype sig_restore(); static push_signals(), pop_signals(); -int des_read_pw_string(); #endif +int des_read_pw_string(char *, int, char *, int); +int des_string_to_key(char *, des_cblock *); + /*** Routines ****************************************************** */ int des_read_password(k,prompt,verify) @@ -94,12 +103,14 @@ des_read_password(k,prompt,verify) if (ok == 0) des_string_to_key(key_string, k); +#ifdef BSDUNIX lose: +#endif bzero(key_string, sizeof (key_string)); return ok; } -#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) +#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) static void catch(int); #endif @@ -121,11 +132,14 @@ des_read_pw_string(s,maxa,prompt,verify) { int ok = 0, cnt1=0; char *ptr; -#ifdef AFS_HPUX_ENV +#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) register int fno; struct sigaction newsig, oldsig; struct termios save_ttyb, ttyb; #endif +#if defined(AFS_DARWIN_ENV) + FILE *fi; +#endif #if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV) struct termios ttyb; struct sigaction osa, sa; @@ -156,7 +170,7 @@ des_read_pw_string(s,maxa,prompt,verify) return -1; } -#ifdef AFS_HPUX_ENV +#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) if ((fi = fopen("/dev/tty", "r")) == NULL) return -1; setbuf(fi, (char *)NULL); /* We don't want any buffering for our i/o. */ @@ -288,7 +302,9 @@ des_read_pw_string(s,maxa,prompt,verify) ok = 1; } +#ifdef BSDUNIX lose: +#endif if (!ok) bzero(s, maxa); printf("\n"); @@ -382,7 +398,7 @@ sig_restore() #endif -#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) +#if defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) static void catch(int junk) { diff --git a/src/des/strng_to_key.c b/src/des/strng_to_key.c index f539f7d48..d821e1696 100644 --- a/src/des/strng_to_key.c +++ b/src/des/strng_to_key.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include "des_internal.h" @@ -31,12 +32,13 @@ extern int des_debug_print(); extern void des_fixup_key_parity(); extern afs_uint32 des_cbc_cksum(); -#include "../permit_xprt.h" +/* prototypes */ +int des_key_sched(register des_cblock *k, des_key_schedule schedule); /* * convert an arbitrary length string to a DES key */ -int +void des_string_to_key(str,key) char *str; register des_cblock *key; diff --git a/src/des/tables.h b/src/des/tables.h index b3c01398e..dac5ff7cd 100644 --- a/src/des/tables.h +++ b/src/des/tables.h @@ -12,6 +12,7 @@ /* * Initial permutation, adjust to zero based subscript */ +#ifdef WANT_IP_TABLE static char IP[] = { 58-1, 50-1, 42-1, 34-1, 26-1, 18-1, 10-1, 2-1, 60-1, 52-1, 44-1, 36-1, 28-1, 20-1, 12-1, 4-1, @@ -22,10 +23,12 @@ static char IP[] = { 61-1, 53-1, 45-1, 37-1, 29-1, 21-1, 13-1, 5-1, 63-1, 55-1, 47-1, 39-1, 31-1, 23-1, 15-1, 7-1, }; +#endif /* * Final permutation, FP = IP^(-1) adjust to zero based subscript */ +#ifdef WANT_FP_TABLE static char FP[] = { 40-1, 8-1, 48-1, 16-1, 56-1, 24-1, 64-1, 32-1, 39-1, 7-1, 47-1, 15-1, 55-1, 23-1, 63-1, 31-1, @@ -36,8 +39,10 @@ static char FP[] = { 34-1, 2-1, 42-1, 10-1, 50-1, 18-1, 58-1, 26-1, 33-1, 1-1, 41-1, 9-1, 49-1, 17-1, 57-1, 25-1, }; +#endif /* the E selection function, adjusted to zero based subscripts */ +#ifdef WANT_E_TABLE static char E[] = { 32-1, 1-1, 2-1, 3-1, 4-1, 5-1, 4-1, 5-1, 6-1, 7-1, 8-1, 9-1, @@ -48,8 +53,10 @@ static char E[] = { 24-1, 25-1, 26-1, 27-1, 28-1, 29-1, 28-1, 29-1, 30-1, 31-1, 32-1, 1-1, }; +#endif /* the P permutation, adjusted to zero based subscripts */ +#ifdef WANT_P_TABLE static char P[] = { 16-1, 7-1, 20-1, 21-1, 29-1, 12-1, 28-1, 17-1, @@ -60,46 +67,49 @@ static char P[] = { 19-1, 13-1, 30-1, 6-1, 22-1, 11-1, 4-1, 25-1, }; +#endif /* S tables, original form */ +#ifdef WANT_S_TABLE static char S[8][64] = { - 14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7, +{ 14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7, 0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8, 4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0, - 15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13, + 15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13, }, - 15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10, +{ 15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10, 3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5, 0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15, - 13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9, + 13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9, }, - 10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8, +{ 10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8, 13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1, 13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7, - 1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12, + 1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12, }, - 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15, +{ 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15, 13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9, 10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4, - 3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14, + 3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14, }, - 2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9, +{ 2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9, 14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6, 4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14, - 11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3, + 11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3, }, - 12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11, +{ 12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11, 10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8, 9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6, - 4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13, + 4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13, }, - 4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1, +{ 4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1, 13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6, 1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2, - 6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12, + 6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12, }, - 13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7, +{ 13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7, 1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2, 7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8, - 2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11, + 2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11 } }; +#endif diff --git a/src/des/test/testit.c b/src/des/test/testit.c index e2bdbe2f7..b7d2610b2 100644 --- a/src/des/test/testit.c +++ b/src/des/test/testit.c @@ -30,8 +30,6 @@ extern int des_ecb_encrypt(); extern int des_cbc_encrypt(); extern int des_pcbc_encrypt(); -#include "../../permit_xprt.h" - char *progname; int sflag; int vflag; diff --git a/src/des/test/verify.c b/src/des/test/verify.c index 4a1b8e80f..dd485823d 100644 --- a/src/des/test/verify.c +++ b/src/des/test/verify.c @@ -27,8 +27,6 @@ extern int des_key_sched(); extern int des_ecb_encrypt(); extern int des_cbc_encrypt(); -#include "../../permit_xprt.h" - char *progname; int nflag = 2; int vflag; diff --git a/src/des/util.c b/src/des/util.c index f0d683dee..9be7e5d9d 100644 --- a/src/des/util.c +++ b/src/des/util.c @@ -12,7 +12,7 @@ #include #include -des_cblock_print_file(x, fp) +int des_cblock_print_file(x, fp) des_cblock *x; FILE *fp; { @@ -26,6 +26,8 @@ des_cblock_print_file(x, fp) fprintf(fp,", "); } fprintf(fp," }"); + + return(0); } #ifdef DEBUG diff --git a/src/des/weak_key.c b/src/des/weak_key.c index 491fdcb14..0ebe45aaa 100644 --- a/src/des/weak_key.c +++ b/src/des/weak_key.c @@ -12,6 +12,7 @@ * Originally written 8/85 by Steve Miller, MIT Project Athena. */ +#include #include #include "des_internal.h" diff --git a/src/des_stub/Makefile b/src/des_stub/Makefile index 9ac3745cd..c1ce9904a 100644 --- a/src/des_stub/Makefile +++ b/src/des_stub/Makefile @@ -14,7 +14,6 @@ include ../config/Makefile.${SYS_NAME} RM = /bin/rm UKERNELDIR=../libuafs/ -INSTALL=${SRCDIR}bin/install SRC =. DESPAR =../../../DESLIB/dest/ DESINC =${DESPAR}include/ diff --git a/src/dir/Makefile b/src/dir/Makefile index d2c60b66d..69e9aa33f 100644 --- a/src/dir/Makefile +++ b/src/dir/Makefile @@ -11,7 +11,6 @@ include ../config/Makefile.${SYS_NAME} KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ -INSTALL = ${SRCDIR}bin/install MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 INCDIRS= -I${DESTDIR}include ${XINCLS} diff --git a/src/dir/dir.c b/src/dir/dir.c index df9fb35cb..8ea21ddc0 100644 --- a/src/dir/dir.c +++ b/src/dir/dir.c @@ -20,7 +20,7 @@ #include "../h/errno.h" #endif #include "../h/time.h" -#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV) #include "../h/errno.h" #else #if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) @@ -31,6 +31,13 @@ #include "../afs/sysincludes.h" #endif #ifndef AFS_SGI64_ENV +#if defined(AFS_FBSD_ENV) +#include "../h/lock.h" +#include "../vm/vm.h" +#include "../vm/vm_extern.h" +#include "../vm/pmap.h" +#include "../vm/vm_map.h" +#endif /* AFS_FBSD_ENV */ #include "../h/user.h" #endif /* AFS_SGI64_ENV */ #include "../h/uio.h" diff --git a/src/export/Makefile b/src/export/Makefile index d95326227..35990273a 100644 --- a/src/export/Makefile +++ b/src/export/Makefile @@ -13,7 +13,6 @@ COMPONENT=export include ../config/Makefile.${SYS_NAME} - INSTALL = ${SRCDIR}bin/install KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ DEFS = diff --git a/src/fsint/Makefile b/src/fsint/Makefile index 375eb3aaa..ee8288e1f 100644 --- a/src/fsint/Makefile +++ b/src/fsint/Makefile @@ -10,7 +10,6 @@ include ../config/Makefile.${SYS_NAME} SHELL = /bin/sh KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ -INSTALL = ${SRCDIR}bin/install MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 OBJS=afsaux.o afscbint.cs.o afscbint.ss.o afscbint.xdr.o afsint.cs.o afsint.ss.o afsint.xdr.o diff --git a/src/fsint/afsaux.c b/src/fsint/afsaux.c index a97394d99..ce8c592a2 100644 --- a/src/fsint/afsaux.c +++ b/src/fsint/afsaux.c @@ -16,7 +16,7 @@ #include "../afs/afsincludes.h" #include "../rx/xdr.h" #else /* defined(UKERNEL) */ -#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) #include "../afs/sysincludes.h" #include "../afs/afsincludes.h" #else @@ -57,12 +57,13 @@ static afs_int32 bslosers = 0; /* these things are defined in R (but not RX's) library. For now, we add them only for the kernel system. Later, when R is expunged, we'll remove the ifdef */ #ifdef KERNEL +#ifndef AFS_USR_DARWIN_ENV #ifdef AFS_AIXNFS11 #define AUTH_DES 1 #endif #if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV) #ifndef AFS_AIX32_ENV -#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) /* * XDR chars; from user mode xdr package. */ @@ -145,6 +146,7 @@ xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) } return(TRUE); } +#endif #endif /* KERNEL */ #ifndef KERNEL diff --git a/src/fsprobe/Makefile b/src/fsprobe/Makefile index 39fb6b8f8..a91c240d3 100644 --- a/src/fsprobe/Makefile +++ b/src/fsprobe/Makefile @@ -12,8 +12,6 @@ SHELL = /bin/sh COMPONENT=fsprobe include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install - CFLAGS=-g -I. \ -I${SRCDIR}include \ -I${SRCDIR}include/afs \ diff --git a/src/gtx/Makefile b/src/gtx/Makefile index 8196c90a0..ce627b301 100644 --- a/src/gtx/Makefile +++ b/src/gtx/Makefile @@ -12,7 +12,6 @@ SHELL=/bin/sh COMPONENT=gtx include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install COMPILE_ET=$(SRCDIR)bin/compile_et CFLAGS= ${DBUG} -I. -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS} LDFLAGS = ${XLDFLAGS} diff --git a/src/gtx/curseswindows.c b/src/gtx/curseswindows.c index 8ae20cecd..0757bd004 100644 --- a/src/gtx/curseswindows.c +++ b/src/gtx/curseswindows.c @@ -754,8 +754,13 @@ int gator_cursesgwin_getdimensions(gwp, aparms) struct gator_cursesgwin *cwp; /*Curses-specific data*/ cwp = (struct gator_cursesgwin *)(gwp->w_data); +#ifdef AFS_DARWIN_ENV + aparms->maxx = cwp->wp->maxx; + aparms->maxy = cwp->wp->maxy; +#else aparms->maxx = cwp->wp->_maxx; aparms->maxy = cwp->wp->_maxy; +#endif return(0); diff --git a/src/inetd/Makefile b/src/inetd/Makefile index 853a6ed23..531847a70 100644 --- a/src/inetd/Makefile +++ b/src/inetd/Makefile @@ -4,7 +4,6 @@ include ../config/Makefile.${SYS_NAME} INCLUDES = -I${DESTDIR}include DEFINES = ${INCLUDES} -INSTALL = ${DESTDIR}bin/install LIBDIR = ${DESTDIR}lib/ AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}libubik.a\ ${LIBDIR}afs/libauth.a ${LIBDIR}afs/libsys.a \ diff --git a/src/kauth/Makefile b/src/kauth/Makefile index 92d1ff122..5f2e4a7b7 100644 --- a/src/kauth/Makefile +++ b/src/kauth/Makefile @@ -13,13 +13,11 @@ COMPONENT=kauth include ../config/Makefile.${SYS_NAME} UKERNELDIR = ../libuafs/ -INSTALL=${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 CFLAGS = ${OPTMZ} -I${SRCDIR}include ${XCFLAGS} LDFLAGS = ${OPTMZ} ${XLDFLAGS} -PE = ../permit_xprt.h INCLS=${SRCDIR}include/ubik.h \ ${SRCDIR}include/lwp.h \ ${SRCDIR}include/lock.h \ @@ -94,10 +92,10 @@ xkaprocs: kaprocs.c ${INCLS} # tightly controlled. # ${CC} ${CFLAGS} -c kaprocs.c -DSPECIAL=1 -DGETPASSWORD -kaprocs.o: kaprocs.c ${INCLS} ${PE} kaport.h +kaprocs.o: kaprocs.c ${INCLS} kaport.h ${CC} ${CFLAGS} -c kaprocs.c -DSPECIAL=1 -authclient.o: authclient.c ${INCLS} ${PE} +authclient.o: authclient.c ${INCLS} #authserver.o: authserver.c ${INCLS} @@ -190,8 +188,7 @@ kpwvalid: kpwvalid.o $(LIBS) ${CC} ${LDFLAGS} -o kpwvalid kpwvalid.o ${LIBS} ${XLIBS} user.krb.o: user.c ${INCLS} ${SRCDIR}include/afs/vice.h - ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c user.c - mv user.o user.krb.o + ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c user.c -o user.krb.o user.o: user.c ${INCLS} ${SRCDIR}include/afs/vice.h ${CC} ${CFLAGS} -c user.c @@ -201,7 +198,7 @@ kdb: kdb.o ${INCLS} kdb.o: kdb.c AFS_component_version_number.o krb_udp.o: krb_udp.c kaserver.h kautils.h kauth.h prot.h \ - ${SRCDIR}include/lwp.h ${PE} AFS_component_version_number.o + ${SRCDIR}include/lwp.h AFS_component_version_number.o krb_udp: krb_udp.o libkauth.a ${CC} ${LDFLAGS} -o krb_udp krb_udp.o libkauth.a ${SRCDIR}lib/liblwp.a ${deslib} ${rxkadlib} ${SRCDIR}lib/afs/libcom_err.a ${utilib} ${auditlib} diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index 46c6300f1..dc68cb09c 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -707,6 +707,13 @@ int StringToKey ( ka_PrintBytes ((char *)&key, sizeof(key)); printf ("'.\n"); + des_string_to_key (as->parms[0].items->data, &key); + + printf ("Converting %s with the DES string to key yields key='", + as->parms[0].items->data); + ka_PrintBytes (&key, sizeof(key)); + printf ("'.\n"); + return 0; } @@ -1329,6 +1336,11 @@ static int MyBeforeProc( ka_StringToKey (passwd, cell, &key); code = ka_GetAdminToken (name, instance, cell, &key, KA_SIXHOURS, &token, 0/* !new */); + if (code == KABADREQUEST) { + des_string_to_key (passwd, &key); + code = ka_GetAdminToken (name, instance, cell, &key, KA_SIXHOURS, + &token, 0/* !new */); + } if ((code == KABADREQUEST) && (strlen(passwd) > 8)) { /* try with only the first 8 characters incase they set * their password with an old style passwd program. */ diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index e21a01ddc..c48868f2c 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -43,7 +43,6 @@ #include "../afs/kautils.h" #include "../afs/pthread_glock.h" -#include "../afs/permit_xprt.h" #else /* defined(UKERNEL) */ #include #include @@ -63,8 +62,6 @@ #include #include "kauth.h" #include "kautils.h" - -#include "../permit_xprt.h" #endif /* defined(UKERNEL) */ diff --git a/src/kauth/client.c b/src/kauth/client.c index 4e7f3c4e3..db91476cc 100644 --- a/src/kauth/client.c +++ b/src/kauth/client.c @@ -7,13 +7,6 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -/* - * Revision 2.2 90/08/20 11:15:39 - * Include permit_xprt.h. - * Cleanup line length. - * */ -/* See RCS log for older history. */ - #if defined(UKERNEL) #include "../afs/param.h" #include "../afs/sysincludes.h" @@ -28,7 +21,6 @@ #include "../afs/pthread_glock.h" #include "../des/des.h" -#include "../afs/permit_xprt.h" #else /* defined(UKERNEL) */ #include #include @@ -43,8 +35,6 @@ #include #include "kauth.h" #include "kautils.h" - -#include "../permit_xprt.h" #endif /* defined(UKERNEL) */ diff --git a/src/kauth/kaprocs.c b/src/kauth/kaprocs.c index 562fba91b..9667a6e0a 100644 --- a/src/kauth/kaprocs.c +++ b/src/kauth/kaprocs.c @@ -41,9 +41,6 @@ #include "kaport.h" #include "afs/audit.h" -#include "../permit_xprt.h" - - extern struct ubik_dbase *KA_dbase; struct kaheader cheader; Date cheaderReadTime; /* time cheader last read in */ diff --git a/src/kauth/kaserver.c b/src/kauth/kaserver.c index 3bb2cf37b..f0f96262f 100644 --- a/src/kauth/kaserver.c +++ b/src/kauth/kaserver.c @@ -63,7 +63,7 @@ int MinHours = 0; int npwSums = KA_NPWSUMS; /* needs to be variable sometime */ #include -#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #undef vfprintf #define vfprintf(stream,fmt,args) _doprnt(fmt,args,stream) #endif diff --git a/src/kauth/kautils.c b/src/kauth/kautils.c index 3a27fe648..1a2b1bc0e 100644 --- a/src/kauth/kautils.c +++ b/src/kauth/kautils.c @@ -42,9 +42,6 @@ #include "kauth.h" #include "kautils.h" -#include "../permit_xprt.h" - - /* This should match the behavior of ParseLoginName on input so that the output * and input are compatible. In names "." should show as \056 and in names and @@ -184,12 +181,14 @@ void ka_timestr ( afs_int32 tlen) { char tbuffer[32]; /* need at least 26 bytes */ + time_t passtime; /* modern systems have 64 bit time */ if (!time) strcpy (tstr, "no date");/* special case this */ else if (time == NEVERDATE) strcpy(tstr, "never"); else { + passtime = time; strncpy(tstr, - afs_ctime((time_t *)&time, tbuffer, sizeof(tbuffer)), tlen); + afs_ctime(&passtime, tbuffer, sizeof(tbuffer)), tlen); tstr[strlen(tstr)-1] = '\0'; /* punt the newline character */ } } diff --git a/src/kauth/klogin.c b/src/kauth/klogin.c index 34988c808..95ecbfa26 100644 --- a/src/kauth/klogin.c +++ b/src/kauth/klogin.c @@ -29,7 +29,7 @@ static char sccsid[] = "@(#)login.c 5.15 (Berkeley) 4/12/86"; * login -h hostname (for telnetd, etc.) */ #include -#if !defined(AFS_SUN_ENV) && !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_SUN_ENV) && !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) &&!defined(AFS_FBSD_ENV) #include #define quota(a,b,c,d) 0 diff --git a/src/kauth/kpasswd.c b/src/kauth/kpasswd.c index d6e0d6bdd..96d682db9 100644 --- a/src/kauth/kpasswd.c +++ b/src/kauth/kpasswd.c @@ -198,7 +198,9 @@ CommandProc (as, arock) struct ubik_client *conn = 0; struct ktc_encryptionKey key; + struct ktc_encryptionKey mitkey; struct ktc_encryptionKey newkey; + struct ktc_encryptionKey newmitkey; struct ktc_token token; @@ -211,6 +213,13 @@ CommandProc (as, arock) int foundPassword = 0; /*Not yet, anyway*/ int foundNewPassword = 0; /*Not yet, anyway*/ int foundExplicitCell = 0; /*Not yet, anyway*/ +#ifdef DEFAULT_MITV4_STRINGTOKEY + int dess2k = 1; +#elif DEFAULT_AFS_STRINGTOKEY + int dess2k = 0; +#else + int dess2k = -1; +#endif /* blow away command line arguments */ for (i=1; ipw_name, instance, realm, &key, ADMIN_LIFETIME, &token, /*!new*/0); - - if ((code == KABADREQUEST) && (strlen (passwd) > 8)) { - /* try with only the first 8 characters incase they set their password - * with an old style passwd program. */ - char pass8[9]; - strncpy (pass8, passwd, 8); - pass8[8] = 0; - ka_StringToKey (pass8, realm, &key); - bzero (pass8, sizeof(pass8)); - bzero (passwd, sizeof(passwd)); + if (code == KABADREQUEST) { code = ka_GetAdminToken (pw->pw_name, instance, realm, - &key, ADMIN_LIFETIME, &token, /*!new*/0); + &mitkey, ADMIN_LIFETIME, &token, /*!new*/0); + if ((code == KABADREQUEST) && (strlen (passwd) > 8)) { + /* try with only the first 8 characters incase they set their password + * with an old style passwd program. */ + char pass8[9]; + strncpy (pass8, passwd, 8); + pass8[8] = 0; + ka_StringToKey (pass8, realm, &key); + bzero (pass8, sizeof(pass8)); + bzero (passwd, sizeof(passwd)); + code = ka_GetAdminToken (pw->pw_name, instance, realm, + &key, ADMIN_LIFETIME, &token, /*!new*/0); #ifdef notdef - /* the folks in testing really *hate* this message */ - if (code == 0) { - fprintf (stderr, "Warning: only the first 8 characters of your old password were significant.\n"); - } + /* the folks in testing really *hate* this message */ + if (code == 0) { + fprintf (stderr, "Warning: only the first 8 characters of your old password were significant.\n"); + } #endif - } + if (code == 0) { + if (dess2k == -1) + dess2k=0; + } + } else { + if (dess2k == -1) + dess2k=1; + } + } else { + if (dess2k == -1) + dess2k=0; + } + bzero (&mitkey, sizeof(mitkey)); bzero (&key, sizeof(key)); if (code == KAUBIKCALL) com_err (rn, code, "(Authentication Server unavailable, try later)"); else if (code) { @@ -454,8 +480,12 @@ CommandProc (as, arock) code = ka_AuthServerConn (realm, KA_MAINTENANCE_SERVICE, &token, &conn); if (code) com_err (rn, code, "contacting Admin Server"); else { - code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newkey); + if (dess2k == 1) + code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newmitkey); + else + code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newkey); bzero (&newkey, sizeof(newkey)); + bzero (&newmitkey, sizeof(newmitkey)); if (code) { char * reason; reason = (char *) error_message(code); @@ -465,6 +495,7 @@ CommandProc (as, arock) } } bzero (&newkey, sizeof(newkey)); + bzero (&newmitkey, sizeof(newmitkey)); /* Might need to close down the ubik_Client connection */ if (conn) { diff --git a/src/kauth/krb_udp.c b/src/kauth/krb_udp.c index d8f8db245..d5e5ad7b0 100644 --- a/src/kauth/krb_udp.c +++ b/src/kauth/krb_udp.c @@ -41,9 +41,6 @@ #include "afs/audit.h" #include "kalog.h" -#include "../permit_xprt.h" - - /* my kerberos error codes */ #define KERB_ERR_BAD_MSG_TYPE 99 #define KERB_ERR_BAD_LIFETIME 98 @@ -446,7 +443,10 @@ afs_int32 UDP_GetTicket (ksoc, pkt, kvno, authDomain, ticket, ticketLen, auth, a code = KERB_ERR_PKT_VER; /* was KABADTICKET */ goto abort; } - if (celllen == 0) strcpy (cell, lrealm); + if (celllen == 0) { + strncpy (cell, lrealm, MAXKTCREALMLEN-1); + cell[MAXKTCREALMLEN-1] = 0; + }; if (krb_udp_debug) { printf ("UGetTicket: got ticket from '%s'.'%s'@'%s'\n", diff --git a/src/kauth/user.c b/src/kauth/user.c index b2a822a10..23fd0cca9 100644 --- a/src/kauth/user.c +++ b/src/kauth/user.c @@ -179,7 +179,7 @@ afs_int32 ka_UserAuthenticateGeneral ( } #endif -#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) +#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) && !defined(AFS_FBSD_ENV) /* handle smoothly the case where no AFS system calls exists (yet) */ old = (int (*)())signal(SIGSYS, SIG_IGN); #endif diff --git a/src/kauth/user_nt.c b/src/kauth/user_nt.c index f70cbd41b..4fd2ed45b 100644 --- a/src/kauth/user_nt.c +++ b/src/kauth/user_nt.c @@ -23,7 +23,6 @@ #include #include #include -#include "../permit_xprt.h" int krb_add_host (struct sockaddr_in *server_list_p); static void krb_set_port(long port); diff --git a/src/libacl/Makefile b/src/libacl/Makefile index 6be8a6514..116a66aa0 100644 --- a/src/libacl/Makefile +++ b/src/libacl/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT=libacl include ../config/Makefile.${SYS_NAME} -INSTALL = ${SRCDIR}bin/install INCDIRS= -I${DESTDIR}include -I.. -I${BACKDIR}include -I${DESTDIR}include/afs KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ @@ -26,7 +25,7 @@ libacl.a: $(LIBOBJS) AFS_component_version_number.o rm -f libacl.a ar rv libacl.a $(LIBOBJS) AFS_component_version_number.o $(RANLIB) libacl.a - + aclprocs.o: aclprocs.c acl.h netprocs.o: netprocs.c acl.h diff --git a/src/libacl/aclprocs.c b/src/libacl/aclprocs.c index 4a1408180..de7d0031b 100644 --- a/src/libacl/aclprocs.c +++ b/src/libacl/aclprocs.c @@ -248,13 +248,15 @@ struct acl_accessList **acl; if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[i], &k) != 2) return(-1); (*acl)->entries[i].rights = k; - nextc = (char *) (1 + index(nextc, '\n')); + nextc = (char *) (index(nextc, '\n')); + nextc ++; /* 1 + index can cast ptr to integer */ } j=i; for (i = (*acl)->total - 1; i >= (*acl)->total - (*acl)->negative; i--,j++) { if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[j], &((*acl)->entries[j].rights)) != 2) return(-1); - nextc = (char *) (1 + index(nextc, '\n')); + nextc = (char *) (index(nextc, '\n')); + nextc ++; } lids.idlist_len = 0; lids.idlist_val = 0; diff --git a/src/libadmin/bos/afs_bosAdmin.c b/src/libadmin/bos/afs_bosAdmin.c index 8c44ea794..ea6ead431 100644 --- a/src/libadmin/bos/afs_bosAdmin.c +++ b/src/libadmin/bos/afs_bosAdmin.c @@ -23,7 +23,6 @@ #ifdef AFS_NT40_ENV #include #endif -#include "../../permit_xprt.h" /* diff --git a/src/libadmin/client/afs_clientAdmin.c b/src/libadmin/client/afs_clientAdmin.c index 56e90464f..c415298d8 100644 --- a/src/libadmin/client/afs_clientAdmin.c +++ b/src/libadmin/client/afs_clientAdmin.c @@ -40,9 +40,6 @@ #include #include - -#include "../../permit_xprt.h" - /* * AFS client administration functions. * diff --git a/src/libafs/MakefileProto.HPUX b/src/libafs/MakefileProto.HPUX index d80386e13..d52ce7d87 100644 --- a/src/libafs/MakefileProto.HPUX +++ b/src/libafs/MakefileProto.HPUX @@ -100,6 +100,7 @@ setup: # Compile the clients. ${COMPDIRS}: + if false; then \ for b in $(BITS); do \ for t in $(KOBJ); do \ dir=$$t.$$b; \ @@ -109,10 +110,11 @@ ${COMPDIRS}: 64) bopts="$(KDEFS_64)"; bsuff="64";; \ esac; \ cd $$dir; \ - $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=../${DESTDIR} libafs || exit $$?; \ + $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=${DESTDIR} libafs || exit $$?; \ cd ..; \ done; \ - done + done; \ + fi # Below this line are targets when in the static directory: diff --git a/src/libafs/MakefileProto.SOLARIS b/src/libafs/MakefileProto.SOLARIS index d6592bcac..1c7847d0f 100644 --- a/src/libafs/MakefileProto.SOLARIS +++ b/src/libafs/MakefileProto.SOLARIS @@ -111,6 +111,8 @@ LIBAFSNONFS = libafs.nonfs.o DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS} DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS} +# Without this line, gmake tries to build libafs.o +.PHONY: libafs # libafs: $(DEST_LIBAFS) $(DEST_LIBAFSNONFS) libafs: $(DEST_LIBAFSNONFS) diff --git a/src/libafsauthent/Makefile b/src/libafsauthent/Makefile index 304260c6a..33be0bcd9 100644 --- a/src/libafsauthent/Makefile +++ b/src/libafsauthent/Makefile @@ -12,7 +12,6 @@ COMPONENT=libafsauthent include ../config/Makefile.${SYS_NAME} CC=${MT_CC} -INSTALL = ${SRCDIR}bin/install CFLAGS = ${OPTMZ} ${DBG} -I${SRCDIR}include ${MT_CFLAGS} CCRULE = ${CC} ${CFLAGS} -c $? diff --git a/src/libafsrpc/Makefile b/src/libafsrpc/Makefile index fbc53ab83..e411bd773 100644 --- a/src/libafsrpc/Makefile +++ b/src/libafsrpc/Makefile @@ -11,7 +11,6 @@ SHELL = /bin/sh COMPONENT=libafsrpc include ../config/Makefile.${SYS_NAME} -INSTALL = ${SRCDIR}bin/install CC=${MT_CC} INCLUDES = -I${SRCDIR}include -I.. -I../rx CFLAGS = ${OPTMZ} ${DBG} ${INCLUDES} -DRXDEBUG ${MT_CFLAGS} @@ -242,7 +241,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c # # $ what /opt/langtools/bin/pxdb32 # /opt/langtools/bin/pxdb32: -# HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.4 $ +# HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.5 $ # # 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. @@ -321,12 +320,14 @@ syscall.o: ${SYS}/syscall.s /usr/ccs/lib/cpp ${SFLAGS} ${SYS}/syscall.s syscall.ss; \ as -o syscall.o syscall.ss; \ rm syscall.ss;; \ - sgi_* ) \ + sgi_* | ppc_darwin* ) \ ${CC} ${CFLAGS} -c ${SYS}/syscall.s;; \ alpha_dux?? ) \ ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${SYS}/syscall.s; \ ${AS} -o syscall.o syscall.i; \ rm -f syscall.ss syscall.i;; \ + *fbsd* ) \ + touch syscall.o ;; \ *) \ /lib/cpp ${SFLAGS} ${SYS}/syscall.s syscall.ss; \ as -o syscall.o syscall.ss; \ diff --git a/src/libafsrpc/afsrpc.def b/src/libafsrpc/afsrpc.def index 853945545..95ec3c992 100644 --- a/src/libafsrpc/afsrpc.def +++ b/src/libafsrpc/afsrpc.def @@ -196,3 +196,5 @@ EXPORTS rx_SetRxStatUserOk @201 rx_RxStatUserOk @202 rx_enable_hot_thread @203 DATA + xdr_int64 @204 + xdr_uint64 @205 diff --git a/src/libuafs/Makefile.common b/src/libuafs/Makefile.common index 3957c7faa..c57974a28 100644 --- a/src/libuafs/Makefile.common +++ b/src/libuafs/Makefile.common @@ -9,7 +9,6 @@ # SHELL=/bin/sh -INSTALL = ${SRCDIR}bin/install INCLUDE= -I. -I/usr/include UOBJ =../UAFS WEBOBJ =../AFSWEB @@ -28,16 +27,22 @@ webinstall: AFSWEB/$(LIBAFSWEB) AFSWEB/$(LIBAFSWEBKRB) ${INSTALL} AFSWEB/$(LIBAFSWEB) ${DESTDIR}root.afsweb/usr/lib ${INSTALL} AFSWEB/$(LIBAFSWEBKRB) ${DESTDIR}root.afsweb/usr/lib -ukinstall: UAFS/$(LIBUAFS) +ukinsthdrs: ${INSTALL} afs/param.h ${DESTDIR}root.perf/include/afs ${INSTALL} afs/stds.h ${DESTDIR}root.perf/include/afs ${INSTALL} afs/afs_sysnames.h ${DESTDIR}root.perf/include/afs ${INSTALL} afs/afs_stats.h ${DESTDIR}root.perf/include/afs ${INSTALL} afs/sysincludes.h ${DESTDIR}root.perf/include/afs ${INSTALL} afs/afs_usrops.h ${DESTDIR}root.perf/include/afs + +ukinstlibs: ${INSTALL} des/libdes.a ${DESTDIR}root.perf/lib - ${INSTALL} UAFS/$(LIBUAFS) ${DESTDIR}root.perf/lib - $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${DESTDIR}include -I${DESTDIR}include/rx -I${DESTDIR}root.perf/include ${DESTDIR}root.perf/lib/$(LIBUAFS) ${DESTDIR}root.perf/lib/libdes.a $(TEST_LIBS) + ${INSTALL} UAFS/$(LIBUAFS) ${DESTDIR}root.perf/lib + +ukinstall: ukinsthdrs UAFS/$(LIBUAFS) linktest ukinstlibs + +linktest: UAFS/$(LIBUAFS) des/libdes.a + $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${DESTDIR}include -I${DESTDIR}include/rx -I${DESTDIR}root.perf/include UAFS/$(LIBUAFS) des/libdes.a $(TEST_LIBS) CRULE1= $(CC) $(OPTF) -DKERNEL $(CFLAGS) -c $? CRULE2= $(CC) $(OPTF) $(WEBOPTS) -DKERNEL $(CFLAGS) -c $? diff --git a/src/log/Makefile b/src/log/Makefile index b15bee887..f053437d3 100644 --- a/src/log/Makefile +++ b/src/log/Makefile @@ -15,9 +15,6 @@ CFLAGS = ${OPTMZ} ${INCDIRS} ${XCFLAGS} ${DBUG} PROGRAMS= unlog tokens tokens.krb kseal -INSTALL = ${SRCDIR}bin/install -INSTALLro = ${SRCDIR}bin/install -m 644 - INCLS=${SRCDIR}include/afs/auth.h ${SRCDIR}include/rx/rx.h \ ${SRCDIR}include/rx/xdr.h ${SRCDIR}include/des.h ${SRCDIR}include/rx/rxkad.h \ ${SRCDIR}include/afs/cellconfig.h diff --git a/src/login/Makefile b/src/login/Makefile index c14e56ecc..53f1bc672 100644 --- a/src/login/Makefile +++ b/src/login/Makefile @@ -21,7 +21,6 @@ COMPONENT=login include ../config/Makefile.${SYS_NAME} LIBDIR = ${DESTDIR}lib/ -INSTALL=${SRCDIR}bin/install AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a \ ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \ ${DESTDIR}lib/libdes.a ${LIBDIR}librx.a ${LIBDIR}liblwp.a \ diff --git a/src/login/login.c b/src/login/login.c index 56ba39777..52905245c 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -53,6 +53,8 @@ char copyright[] = #if !defined(AFS_HPUX_ENV) && !defined(AFS_AIX_ENV) #if defined(AFS_SUN_ENV) || (defined(AFS_ATHENA_STDENV) && !defined(AFS_DEC_ENV)) || defined(AFS_OSF_ENV) #include +#elif defined(AFS_FBSD_ENV) +#include #else #include #endif @@ -71,6 +73,10 @@ char copyright[] = #include #include #endif +#ifdef AFS_FBSD_ENV +#define USE_OLD_TTY 1 +#include +#endif #include #include @@ -79,7 +85,7 @@ char copyright[] = #include #endif #include -#if !defined(AIX) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX32_ENV) +#if !defined(AIX) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_FBSD_ENV) #include #endif #include diff --git a/src/lwp/Makefile b/src/lwp/Makefile index 4111dc468..9e44ef5c4 100644 --- a/src/lwp/Makefile +++ b/src/lwp/Makefile @@ -9,9 +9,6 @@ SHELL = /bin/sh COMPONENT=lwp include ../config/Makefile.${SYS_NAME} -INSTALL = ${SRCDIR}bin/install - -include ../config/Makefile.${SYS_NAME} # this is important code, so let's optimize it. The optimizer aggravates any # subtle bugs that may have been introduced in process.s, be warned! OPTIMIZE=${LWP_OPTMZ} @@ -70,7 +67,13 @@ process.o : process.s process.c /lib/cpp -P -I${SRCDIR}include process.s >process.ss; \ ${AS} -ahlns process.ss -o process.o >process.lst; \ rm process.ss ;; \ - hp* | *_linux* | sgi_64 | sgi_65) \ + ppc_darwin* ) \ + $(CC) -c ${XCFLAGS} -I${SRCDIR}include process.s;; \ + i386_fbsd* ) \ + /usr/bin/cpp -P process.fbsd.s > process.ss; \ + ${AS} -o process.o process.ss; \ + rm process.ss ;; \ + hp* | *_linux* | sgi_64 | sgi_65 ) \ ${CC} ${CFLAGS} -c process.c;; \ ncrx86_*) \ /usr/ccs/lib/cpp -P -I${SRCDIR}include process.s process.ss; \ diff --git a/src/lwp/process.s b/src/lwp/process.s index 899e3842c..6412af693 100644 --- a/src/lwp/process.s +++ b/src/lwp/process.s @@ -202,7 +202,7 @@ savecontext: .long PRE_Block .L0: l %r5,0(%r5) /* Get A(PRE_Block) */ - mvi 0(%r5),1 /* Set it */ + mvi 3(%r5),1 /* Set it */ lr %r6,%r3 /* Get base of savearea */ st %r15,0(%r3) /* Save stack pointer */ ltr %r4,%r4 /* If new sp is 0 */ @@ -236,8 +236,9 @@ returnto: .long PRE_Block .L3: l %r5,0(%r5) /* Get A(PRE_Block) */ - xc 0(4,%r5),0(%r5) /* Clear it */ - l %r15,0(%r15) + /*xc 0(4,%r5),0(%r5) /* Clear it */ + mvi 3(%r5),0 /* Clear it */ + l %r15,0(%r15) lm %r6,%r15,24(%r15) /* Restore registers */ br %r14 /* Return */ @@ -1231,4 +1232,159 @@ returnto: #endif /* AFS_NCR_ENV */ +#ifdef AFS_PPC_ENV +/* Comments: + * 1. Registers R10..R31 and CR0..CR7 are saved + * 2. "struct savearea" must hold at least 3 pointers (long) + * 3. This code will only work on 32 bit machines (601..604), not 620 + * 4. No floating point registers are saved + * 5. The save stack "frame" is bigger than absolutely necessary. The + * PowerPC [AIX] ABI needs this extra space. + */ + + +/* Mach-O assemblers */ +#if !defined(NeXT) && !defined(__APPLE__) +#define r0 0 +#define r1 1 +#define r2 2 +#define r3 3 +#define r4 4 +#define r5 5 +#define r6 6 +#define r7 7 +#define r8 8 +#define r9 9 +#define r10 10 +#define r11 11 +#define r12 12 +#define r13 13 +#define r14 14 +#define r15 15 +#define r16 16 +#define r17 17 +#define r18 18 +#define r19 19 +#define r20 20 +#define r21 21 +#define r22 22 +#define r23 23 +#define r24 24 +#define r25 25 +#define r26 26 +#define r27 27 +#define r28 28 +#define r29 29 +#define r30 30 +#define r31 31 +#endif /* !NeXT && !__APPLE__ */ + + +/* + * savecontext(int (*f)(), struct savearea *save, char *newsp) + */ + +#define FRAME_SIZE (32*4)+(8*4) +#define FRAME_OFFSET (8*4) +#define TOP_OF_STACK (0*4) +#define RETURN (1*4) +#define CCR (2*4) + +#if defined(NeXT) || defined(__APPLE__) + .globl _savecontext +_savecontext: + lis r9,ha16(_PRE_Block) /* Disable interrupt fiddling */ + li r8,1 + stb r8,lo16(_PRE_Block)(r9) +#else + .globl savecontext +savecontext: + lis r9,PRE_Block@ha /* Disable interrupt fiddling */ + li r8,1 + stb r8,PRE_Block@l(r9) +#endif /* NeXT || __APPLE__ */ + subi r1,r1,FRAME_SIZE + mfcr r9 + stw r9,CCR(r4) + stw r10,10*4+FRAME_OFFSET(r1) /* Save registers */ + stw r11,11*4+FRAME_OFFSET(r1) + stw r12,12*4+FRAME_OFFSET(r1) + stw r13,13*4+FRAME_OFFSET(r1) + stw r14,14*4+FRAME_OFFSET(r1) + stw r15,15*4+FRAME_OFFSET(r1) + stw r16,16*4+FRAME_OFFSET(r1) + stw r17,17*4+FRAME_OFFSET(r1) + stw r18,18*4+FRAME_OFFSET(r1) + stw r19,19*4+FRAME_OFFSET(r1) + stw r20,20*4+FRAME_OFFSET(r1) + stw r21,21*4+FRAME_OFFSET(r1) + stw r22,22*4+FRAME_OFFSET(r1) + stw r23,23*4+FRAME_OFFSET(r1) + stw r24,24*4+FRAME_OFFSET(r1) + stw r25,25*4+FRAME_OFFSET(r1) + stw r26,26*4+FRAME_OFFSET(r1) + stw r27,27*4+FRAME_OFFSET(r1) + stw r28,28*4+FRAME_OFFSET(r1) + stw r29,29*4+FRAME_OFFSET(r1) + stw r30,30*4+FRAME_OFFSET(r1) + stw r31,31*4+FRAME_OFFSET(r1) + stw r1,TOP_OF_STACK(r4) + cmpi 0,r5,0 /* New stack specified? */ + mflr r0 + stw r0,RETURN(r4) + mtlr r3 + beq L1 /* No - don't muck with pointer */ + + mr r1,r5 +L1: blr /* Return */ +/* + * returnto(struct savearea *area) + */ +#if defined(NeXT) || defined(__APPLE__) + .globl _returnto +_returnto: +#else + .globl returnto +returnto: +#endif /* NeXT || __APPLE__ */ + lwz r1,TOP_OF_STACK(r3) /* Update stack pointer */ + lwz r0,RETURN(r3) /* Get return address */ + mtlr r0 + lwz r4,CCR(r3) + mtcrf 0xFF,r4 + lwz r10,10*4+FRAME_OFFSET(r1) /* Restore registers */ + lwz r11,11*4+FRAME_OFFSET(r1) + lwz r12,12*4+FRAME_OFFSET(r1) + lwz r13,13*4+FRAME_OFFSET(r1) + lwz r14,14*4+FRAME_OFFSET(r1) + lwz r15,15*4+FRAME_OFFSET(r1) + lwz r16,16*4+FRAME_OFFSET(r1) + lwz r17,17*4+FRAME_OFFSET(r1) + lwz r18,18*4+FRAME_OFFSET(r1) + lwz r19,19*4+FRAME_OFFSET(r1) + lwz r20,20*4+FRAME_OFFSET(r1) + lwz r21,21*4+FRAME_OFFSET(r1) + lwz r22,22*4+FRAME_OFFSET(r1) + lwz r23,23*4+FRAME_OFFSET(r1) + lwz r24,24*4+FRAME_OFFSET(r1) + lwz r25,25*4+FRAME_OFFSET(r1) + lwz r26,26*4+FRAME_OFFSET(r1) + lwz r27,27*4+FRAME_OFFSET(r1) + lwz r28,28*4+FRAME_OFFSET(r1) + lwz r29,29*4+FRAME_OFFSET(r1) + lwz r30,30*4+FRAME_OFFSET(r1) + lwz r31,31*4+FRAME_OFFSET(r1) +#if defined(NeXT) || defined(__APPLE__) + lis r9,ha16(_PRE_Block) /* Re-enable interrupt fiddling */ + li r8,0 + stb r8,lo16(_PRE_Block)(r9) +#else + lis r9,PRE_Block@ha /* Re-enable interrupt fiddling */ + li r8,0 + stb r8,PRE_Block@l(r9) +#endif /* NeXT || __APPLE__ */ + addi r1,r1,FRAME_SIZE + blr +#endif + diff --git a/src/lwp/timer.c b/src/lwp/timer.c index 1efa91b23..09de7e6ea 100644 --- a/src/lwp/timer.c +++ b/src/lwp/timer.c @@ -52,7 +52,7 @@ typedef unsigned char bool; static globalInitDone = 0; -#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) extern insque(); #endif @@ -256,7 +256,7 @@ struct TM_Elem *TM_GetEarliest(tlist) return (e == tlist ? NULL : e); } -#if defined(AFS_HPUX_ENV) || defined(AFS_NT40_ENV) +#if defined(AFS_HPUX_ENV) || defined(AFS_NT40_ENV) || defined(AFS_FBSD_ENV) /* This used to be in hputils.c, but it's only use is in the LWP package. */ /* * Emulate the vax instructions for queue insertion and deletion, somewhat. @@ -285,4 +285,4 @@ void remque(struct TM_Elem *elementp) elementp->Prev = elementp->Next = (struct TM_Elem*)0; } -#endif /* AFS_HPUX_ENV || AFS_NT40_ENV */ +#endif /* AFS_HPUX_ENV || AFS_NT40_ENV || AFS_FBSD_ENV */ diff --git a/src/lwp/waitkey.c b/src/lwp/waitkey.c index 74d58bc9b..fc7be400a 100644 --- a/src/lwp/waitkey.c +++ b/src/lwp/waitkey.c @@ -153,10 +153,15 @@ int LWP_WaitForKeystroke(int seconds) #ifdef AFS_LINUX20_ENV if (stdin->_IO_read_ptr < stdin->_IO_read_end) return 1; +#else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + if (stdin->_bf._size > 0) + return 1; #else if (stdin->_cnt > 0) return 1; #endif +#endif FD_ZERO(&rdfds); diff --git a/src/mpp/Makefile b/src/mpp/Makefile index 13bd903b0..403dbdddf 100644 --- a/src/mpp/Makefile +++ b/src/mpp/Makefile @@ -5,7 +5,6 @@ SHELL = /bin/sh DESTDIR=DEST/ SRCDIR=DEST/ CFLAGS= ${OPTMZ} ${XCFLAGS} -INSTALL=${SRCDIR}bin/install LIBS = ${XLIBS} PROGRAM=mpp diff --git a/src/ntp/Makefile b/src/ntp/Makefile index ff773628f..93fd206ef 100644 --- a/src/ntp/Makefile +++ b/src/ntp/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT=ntp include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install INCPATH= -I${DESTDIR}include BINDIR=/usr/local/etc LINKDIR=/etc diff --git a/src/null/Makefile b/src/null/Makefile index 513c7c3fd..7ab2cda57 100644 --- a/src/null/Makefile +++ b/src/null/Makefile @@ -8,7 +8,6 @@ # Makefile for the null library. DESTDIR=DEST/ SRCDIR=DEST/ -INSTALL=${SRCDIR}bin/install SHELL=/bin/sh COMPONENT=null diff --git a/src/package/Makefile b/src/package/Makefile index 606607341..2cfcbdff8 100644 --- a/src/package/Makefile +++ b/src/package/Makefile @@ -15,7 +15,6 @@ CFLAGS = ${DBUG} -DKFLAG -DANDREW -DVICE $(DBGFLAG) $(INCLUDES) $(XCFLAGS) YFLAGS = -vd #LFLAGS = -ll LINT = lint -hp -INSTALL = ${SRCDIR}bin/install HFILES = package.h \ validupdates.h \ diff --git a/src/package/gram.y b/src/package/gram.y index 711072166..4dd02e337 100644 --- a/src/package/gram.y +++ b/src/package/gram.y @@ -26,7 +26,7 @@ char *emalloc(); -#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV) int test_linecounter; /*Line number currently being parsed*/ char *ch2str(); char *appendchtostr(); diff --git a/src/package/test_gram.y b/src/package/test_gram.y index 2d52a9919..6bc69c8b7 100644 --- a/src/package/test_gram.y +++ b/src/package/test_gram.y @@ -28,7 +28,7 @@ char *emalloc(); -#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV) int test_linecounter; /*Line number currently being parsed*/ char *ch2str(); diff --git a/src/pam/Makefile b/src/pam/Makefile index 03d0d4c21..9b218cb9d 100644 --- a/src/pam/Makefile +++ b/src/pam/Makefile @@ -6,14 +6,12 @@ # directory or online at http://www.openafs.org/dl/license10.html SHELL=/bin/sh -INSTALL = ${SRCDIR}bin/install KERNELDIR = ../libafs/ COMPONENT=afs include ../config/Makefile.${SYS_NAME} LIBDIR = ${DESTDIR}lib/ -INSTALL=${SRCDIR}bin/install LIBSA = ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a AFSLIBS = ${DESTDIR}lib/librxkad.a \ ${LIBDIR}afs/libsys.a ${DESTDIR}lib/libdes.a \ @@ -54,6 +52,8 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o $(SHOBJS) $(LIBS) ;; \ *linux*) \ $(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\ + *fbsd*) \ + $(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\ * ) \ echo No link line for system $(SYS_NAME). ;; \ esac @@ -69,6 +69,8 @@ pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o afs_setcred_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \ *linux*) \ $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\ + *fbsd*) \ + $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\ * ) \ echo No link line for system $(SYS_NAME). ;; \ esac @@ -82,6 +84,8 @@ test_pam: test_pam.o $(CC) $(CFLAGS) -o $@ test_pam.o ${PAMLIBS};; \ *linux*) \ $(CC) $(CFLAGS) -rdynamic -o $@ test_pam.o -lpam -ldl;; \ + *fbsd*) \ + $(CC) $(CFLAGS) -rdynamic -o $@ test_pam.o -lpam ;; \ *) \ echo No link line for system $(SYS_NAME). ;; \ esac diff --git a/src/pam/test_pam.c b/src/pam/test_pam.c index f5c928e50..1939437ab 100644 --- a/src/pam/test_pam.c +++ b/src/pam/test_pam.c @@ -29,7 +29,7 @@ static const char *service = "afstest"; static const char *new_envstring = "GOTHEREVIATESTPAM=1"; static const char *new_homestring = "HOME=/tmp"; -#ifdef AFS_LINUX20_ENV +#if defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV) #define getpassphrase getpass #endif diff --git a/src/pinstall/Makefile b/src/pinstall/Makefile index 165bbe4a4..d5d3b5723 100644 --- a/src/pinstall/Makefile +++ b/src/pinstall/Makefile @@ -47,7 +47,12 @@ pinstall: install.c AFS_component_version_number.c - [ -d test ] && ./test/test_install ${DESTDIR}bin/install: pinstall - ./pinstall -f pinstall ${DESTDIR}bin/install + case ${SYS_NAME} in \ + ppc_darwin*) \ + ./pinstall -f pinstall ${DESTDIR}bin/pinstall ;;\ + *) \ + ./pinstall -f pinstall ${DESTDIR}bin/install ;;\ + esac # Note: Some rule needs to appear here so that OSF's make does not try to # compile install from install.c. A ";" will not work since other platforms diff --git a/src/pinstall/install.c b/src/pinstall/install.c index 004a9c110..36b3e265e 100644 --- a/src/pinstall/install.c +++ b/src/pinstall/install.c @@ -66,21 +66,29 @@ Generic install command. Options are: #include #include #else +#ifdef AFS_DARWIN_ENV +#include +#include +#else #include #include #endif +#endif #ifdef AFS_HPUX_ENV #include #endif +#include +#include +#include struct stat istat, ostat; extern int errno; extern int sys_nerr; -#ifndef AFS_LINUX20_ENV +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) extern char *sys_errlist[]; #endif -#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) extern struct passwd *getpwnam(); int stripcalled = 0; #endif @@ -110,9 +118,9 @@ static char *strrpbrk (s, set) int i; bzero (sets, sizeof(sets)); - while (*set) sets[*set++] = 1; + while (*set) sets[(int) *set++] = 1; i = strlen (s); - while (i > 0) if (sets[s[--i]]) return &s[i]; + while (i > 0) if (sets[(int)s[--i]]) return &s[i]; return 0; } @@ -121,35 +129,38 @@ char *ErrorString(aerrno) static char tbuffer[100]; if (aerrno < 0 || aerrno >= sys_nerr) { sprintf(tbuffer, "undefined error code %d", aerrno); - return tbuffer; + } else { + strcpy(tbuffer, sys_errlist[aerrno]); } - return sys_errlist[aerrno]; + return tbuffer; } +int stripName(aname) char *aname; {if (rindex(aname, '.') == 0) return 1; else return 0; } +int atoo(astr) register char *astr; {register afs_int32 value; register char tc; value = 0; - while (tc = *astr++) + while ((tc = *astr++)) {value <<= 3; value += tc-'0'; } return value; } -#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) /* * Implementation lifted from that for AIX 3.1, since there didn't seem to be any * reason why it wouldn't work. */ -static +static int quickStrip (iname, oname, ignored, copy_only) char *iname, *oname; { int pid, status; @@ -211,7 +222,7 @@ char *iname, *oname; { strip[1] = oname; #ifdef AFS_SUN5_ENV #define STRIP_BIN "/usr/ccs/bin/strip" -#elif defined(AFS_LINUX20_ENV) +#elif defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #define STRIP_BIN "/usr/bin/strip" #else #define STRIP_BIN "/bin/strip" @@ -243,6 +254,7 @@ char *iname, *oname; { * Since /bin/strip will make that call for us, we will lie so that * it has a chance. */ +int AIXobject(ignored) { return !0; @@ -446,16 +458,17 @@ static int quickStrip (afd, asize) #include "AFS_component_version_number.c" +int main (argc, argv) int argc; char **argv; { int setOwner, setMode, setGroup, ifd, ofd; - afs_int32 mode, owner, group; + afs_int32 mode=0, owner, group; struct passwd *tpw; struct group *tgp; char *fnames[MAXFILES], *newNames[MAXFILES]; - afs_int32 rcode, code, newcode; + afs_int32 rcode, code; char *dname; char pname[1024]; #if defined (AFS_HPUX_ENV) @@ -463,7 +476,10 @@ main (argc, argv) #endif /* AFS_HPUX_ENV */ char pnametmp[1024]; int pnamelen; +#if defined (AFS_AIX_ENV) || defined(AFS_FBSD_ENV) + afs_int32 newcode; static char diskBuffer[BUFSIZE]; /* must be static to avoid compiler bugs for large stuff */ +#endif char myHostName[100]; struct timeval tvp[2]; int isDir; @@ -671,10 +687,10 @@ main (argc, argv) continue; } } -#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) stripcalled = 0; if (strip == 1 || - (strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i])) + ((strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i]))) stripcalled = 1; if (!stripcalled) { /* Simply copy target to dest */ diff --git a/src/procmgmt/Makefile b/src/procmgmt/Makefile index 058aa1701..82c35dbdd 100644 --- a/src/procmgmt/Makefile +++ b/src/procmgmt/Makefile @@ -8,7 +8,6 @@ include ../config/Makefile.${SYS_NAME} include ../config/Makefile.version -INSTALL=${SRCDIR}bin/install CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS} ######################################################################## diff --git a/src/ptserver/Makefile b/src/ptserver/Makefile index af05c4eab..3a0308fa4 100644 --- a/src/ptserver/Makefile +++ b/src/ptserver/Makefile @@ -10,13 +10,11 @@ COMPONENT=ptserver include ../config/Makefile.${SYS_NAME} UKERNELDIR=../libuafs/ -INSTALL=${SRCDIR}bin/install RXGEN=${SRCDIR}bin/rxgen COMPILE_ET = ${SRCDIR}bin/compile_et MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS} -PE = ../permit_xprt.h INCLS=${SRCDIR}include/ubik.h \ ${SRCDIR}include/lock.h \ ${SRCDIR}include/lwp.h \ @@ -99,7 +97,7 @@ ptclient: ptclient.o display.o libprot.a $(LIBS) ptclient.o: ptclient.c ${INCLS} AFS_component_version_number.c -ptuser.o: ptuser.c ${LINCLS} ${PE} +ptuser.o: ptuser.c ${LINCLS} pterror.h pterror.c: pterror.et $(RM) -f pterror.h pterror.c; ${COMPILE_ET} pterror @@ -125,7 +123,12 @@ readpwd: readpwd.o libprot.a $(LIBS) readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c testpt: testpt.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS) - $(CC) ${CFLAGS} -o testpt testpt.o -lm ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ${XLIBS} + case "$(SYS_NAME)" in \ + ppc_darwin_12 ) \ + $(CC) ${CFLAGS} -o testpt testpt.o ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ;; \ + * ) \ + $(CC) ${CFLAGS} -o testpt testpt.o -lm ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \ + esac testpt.o: testpt.c ${INCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index 23b988408..bb19f1e79 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -125,8 +125,11 @@ CreateGroup (as) if (code) { if (owner || id) com_err (whoami, code, - "; unable to create group %s with id %d owned by '%s' %s", - namei->data, id, owner, (force?"(ignored)":"")); + "; unable to create group %s with id %d%s%s%s%s", + namei->data, id, owner ? " owned by '" : "", + owner ? owner : "", + owner ? "'" : "", + (force ? " (ignored)" : "")); else com_err (whoami, code, "; unable to create group %s %s", namei->data, (force?"(ignored)":"")); if (!force) diff --git a/src/ptserver/ptserver.c b/src/ptserver/ptserver.c index e29fe7cfd..56371f6be 100644 --- a/src/ptserver/ptserver.c +++ b/src/ptserver/ptserver.c @@ -143,13 +143,26 @@ void main (argc, argv) else if (strncmp (arg, "-enable_process_stats", alen) == 0) { rx_enableProcessRPCStats(); } +#ifndef AFS_NT40_ENV + else if (strncmp(arg, "-syslog", alen)==0) { + /* set syslog logging flag */ + serverLogSyslog = 1; + } + else if (strncmp(arg, "-syslog=", MIN(8,alen))==0) { + serverLogSyslog = 1; + serverLogSyslogFacility = atoi(arg+8); + } +#endif else if (*arg == '-') { usage: /* hack in help flag support */ printf ("Usage: ptserver [-database ] " - "[-p ] [-rebuildDB] " +#ifndef AFS_NT40_ENV + "[-syslog[=FACILITY]] " +#endif + "[-p ] [-rebuild] " /* "[-enable_peer_stats] [-enable_process_stats] " */ "[-help]\n"); fflush(stdout); diff --git a/src/ptserver/ptserver.h b/src/ptserver/ptserver.h index 0e5c59ceb..45e7f4688 100644 --- a/src/ptserver/ptserver.h +++ b/src/ptserver/ptserver.h @@ -20,6 +20,7 @@ #define PRBADID 0x80000000 +#define SYSVIEWERID -203 #define SYSADMINID -204 #define SYSBACKUPID -205 #define ANYUSERID -101 diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index d85805d90..7d3382c55 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -23,7 +23,6 @@ #include "../afs/ptclient.h" #include "../afs/pterror.h" -#include "../afs/permit_xprt.h" #else /* defined(UKERNEL) */ #include #include @@ -43,8 +42,6 @@ #include #include "ptclient.h" #include "pterror.h" - -#include "../permit_xprt.h" #endif /* defined(UKERNEL) */ diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c index bcaef4bb9..e4596d48a 100644 --- a/src/ptserver/ptutils.c +++ b/src/ptserver/ptutils.c @@ -167,6 +167,8 @@ int AccessOK (ut, cid, tentry, mem, any) } else if (aid < 0) { /* checking on group */ if ((flags & mem) && IsAMemberOf (ut, cid, aid)) return 1; } + /* Allow members of SYSVIEWERID to get membership and status only */ + if (((mem == PRP_STATUS_MEM)||(mem == PRP_MEMBER_MEM))&&(IsAMemberOf (ut, cid, SYSVIEWERID))) return 1; if (IsAMemberOf (ut, cid, SYSADMINID)) return 1; return 0; /* no access */ } @@ -1048,6 +1050,7 @@ afs_int32 Initdb() InitialGroup (SYSBACKUPID, "system:backup"); InitialGroup (ANYUSERID, "system:anyuser"); InitialGroup (AUTHUSERID, "system:authuser"); + InitialGroup (SYSVIEWERID, "system:ptsviewers"); InitialGroup (ANONYMOUSID, "anonymous"); /* Well, we don't really want the max id set to anonymousid, so we'll set diff --git a/src/rcp/Makefile b/src/rcp/Makefile index 9525c2024..2fbf5cceb 100644 --- a/src/rcp/Makefile +++ b/src/rcp/Makefile @@ -24,7 +24,6 @@ SRCS= rcp.c OBJS= rcp.o ../rsh/rcmd.o ../rsh/herror.o ../inetd/ta-rauth.o COMPONENT=rcp -INSTALL = ${DESTDIR}bin/install CFLAGS = ${OPTMZ} -I${DESTDIR}include ${XCFLAGS} LIBDIR = ${DESTDIR}lib/ AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}libubik.a\ diff --git a/src/rcp/rcp.c b/src/rcp/rcp.c index 951efe244..a11c525bb 100644 --- a/src/rcp/rcp.c +++ b/src/rcp/rcp.c @@ -78,7 +78,7 @@ static char sccsid[] = "@(#)rcp.c 5.11 (Berkeley) 9/22/88"; int rem; char *colon(), *index(), *rindex(), *malloc(), *strcpy(); int errs; -#ifndef AFS_LINUX20_ENV +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) extern char *sys_errlist[]; #endif void lostconn(); diff --git a/src/rlogind/Makefile b/src/rlogind/Makefile index 1b399bf28..7d8f9fa26 100644 --- a/src/rlogind/Makefile +++ b/src/rlogind/Makefile @@ -25,7 +25,6 @@ LIBC= /lib/libc.a SRCS= rlogind.c ../rsh/rcmd.c ../rsh/herror.c ../inetd/ta-rauth.c OBJS= rlogind.o ../rsh/rcmd.o ../rsh/herror.o ../inetd/ta-rauth.o MAN= -INSTALL = ${DESTDIR}bin/install LIBDIR = ${DESTDIR}lib/ AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a\ ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \ diff --git a/src/rsh/Makefile b/src/rsh/Makefile index a76f10831..e85445e2e 100644 --- a/src/rsh/Makefile +++ b/src/rsh/Makefile @@ -20,7 +20,6 @@ SHELL=/bin/sh COMPONENT=rsh include ../config/Makefile.${SYS_NAME} -INSTALL = ${SRCDIR}bin/install LIBDIR = ${DESTDIR}lib/ INCLUDES= -I${SRCDIR}include CFLAGS= ${DBUG} ${INCLUDES} ${XCFLAGS} diff --git a/src/rsh/herror.c b/src/rsh/herror.c index 1ce5e57b8..eebe2c686 100644 --- a/src/rsh/herror.c +++ b/src/rsh/herror.c @@ -20,6 +20,7 @@ static char sccsid[] = "@(#)herror.c 6.4 (Berkeley) 10/30/88"; #endif /* LIBC_SCCS and not lint */ #include +#ifndef AFS_DARWIN_ENV #include #include @@ -64,3 +65,4 @@ herror(s) v->iov_len = 1; writev(2, iov, (v - iov) + 1); } +#endif diff --git a/src/rsh/rcmd.c b/src/rsh/rcmd.c index 9772e0439..c043e1c69 100644 --- a/src/rsh/rcmd.c +++ b/src/rsh/rcmd.c @@ -97,7 +97,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p) #endif char **ahost; u_short rport; -#ifdef AFS_LINUX20_ENV +#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) const char *locuser, *remuser, *cmd; #else char *locuser, *remuser, *cmd; @@ -359,7 +359,7 @@ rresvport(alport) int _check_rhosts_file = 1; -#if defined(AFS_HPUX102_ENV) || defined(AFS_LINUX20_ENV) +#if defined(AFS_HPUX102_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) ruserok(rhost, superuser, ruser, luser) const char *rhost; int superuser; diff --git a/src/rx/Makefile b/src/rx/Makefile index f4af35252..1056e225c 100644 --- a/src/rx/Makefile +++ b/src/rx/Makefile @@ -11,7 +11,6 @@ include ../config/Makefile.${SYS_NAME} KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ -INSTALL=${SRCDIR}bin/install MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 #CC=pcc @@ -82,8 +81,8 @@ rx_trace.o: rx_trace.h rxdumptrace: rx_trace.c rm -f rxdumptrace - $(CC) $(CFLAGS) -DDUMPTRACE -o rxdumptrace rx_trace.c ${LIBS} ${XLIBS} - rm -f rx_trace.o + $(CC) $(CFLAGS) -DDUMPTRACE -c -o rxdumptrace.o rx_trace.c + $(CC) $(CFLAGS) -o rxdumptrace rxdumptrace.o ${LIBS} ${XLIBS} rx_getaddr.o: rx.h rx_getaddr.c @@ -123,14 +122,16 @@ kinstall: includes case ${SYS_NAME} in \ alpha_dux* ) \ $(INSTALL) DUX/*.[ch] $(KERNELDIR)rx;; \ - hp_ux* ) \ - $(INSTALL) HPUX/*.[ch] $(KERNELDIR)rx;; \ + i386_fbsd* ) \ + $(INSTALL) FBSD/*.[ch] $(KERNELDIR)rx;; \ *_linux* ) \ $(INSTALL) LINUX/*.[ch] $(KERNELDIR)rx;; \ rs_aix* ) \ $(INSTALL) AIX/*.[ch] $(KERNELDIR)rx;; \ sgi_* ) \ $(INSTALL) IRIX/*.[ch] $(KERNELDIR)rx;; \ + ppc_darwin* ) \ + $(INSTALL) DARWIN/*.[ch] $(KERNELDIR)rx;; \ sun4x_5* ) \ $(INSTALL) SOLARIS/*.[ch] $(KERNELDIR)rx;; \ * ) \ diff --git a/src/rx/rx.h b/src/rx/rx.h index 9f7d24b53..7820cb068 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -690,6 +690,8 @@ struct rx_ackPacket { #define RX_ACK_PING 6 /* This is a keep-alive ack */ #define RX_ACK_PING_RESPONSE 7 /* Ack'ing because we were pinged */ #define RX_ACK_DELAY 8 /* Ack generated since nothing has happened since receiving packet */ +#define RX_ACK_IDLE 9 /* Similar to RX_ACK_DELAY, but can + be */ /* Packet acknowledgement type */ #define RX_ACK_TYPE_NACK 0 /* I Don't have this packet */ diff --git a/src/rx/rx_getaddr.c b/src/rx/rx_getaddr.c index 37381895f..1432d6e68 100644 --- a/src/rx/rx_getaddr.c +++ b/src/rx/rx_getaddr.c @@ -20,6 +20,12 @@ #include #include #include +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#include +#include +#include +#endif + /* * By including this, we get any system dependencies. In particular, * the pthreads for solaris requires the socket call to be mapped. @@ -100,12 +106,219 @@ afs_int32 rxi_getaddr () #undef socket #endif /* UKERNEL */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#define ROUNDUP(a) \ + ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) +#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len)) + +static void +rt_xaddrs(cp, cplim, rtinfo) + caddr_t cp, cplim; + struct rt_addrinfo *rtinfo; +{ + struct sockaddr *sa; + int i; + + memset(rtinfo->rti_info, 0, sizeof(rtinfo->rti_info)); + for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) { + if ((rtinfo->rti_addrs & (1 << i)) == 0) + continue; + rtinfo->rti_info[i] = sa = (struct sockaddr *)cp; + ADVANCE(cp, sa); + } +} +#endif + + /* this function returns the total number of interface addresses ** the buffer has to be passed in by the caller */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) int rx_getAllAddr (buffer,maxSize) afs_int32 buffer[]; int maxSize; /* sizeof of buffer in afs_int32 units */ +{ + size_t needed; + int mib[6]; + struct if_msghdr *ifm, *nextifm; + struct ifa_msghdr *ifam; + struct sockaddr_dl *sdl; + struct rt_addrinfo info; + char *buf, *lim, *next; + int count=0,addrcount=0; + + mib[0] = CTL_NET; + mib[1] = PF_ROUTE; + mib[2] = 0; + mib[3] = AF_INET; /* address family */ + mib[4] = NET_RT_IFLIST; + mib[5] = 0; + if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + return 0; + if ((buf = malloc(needed)) == NULL) + return 0; + if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { + free(buf); + return 0; + } + lim = buf + needed; + next = buf; + while (next < lim) { + ifm = (struct if_msghdr *)next; + if (ifm->ifm_type != RTM_IFINFO) { + printf("out of sync parsing NET_RT_IFLIST\n"); + free(buf); + return 0; + } + sdl = (struct sockaddr_dl *)(ifm + 1); + next += ifm->ifm_msglen; + ifam = NULL; + addrcount = 0; + while (next < lim) { + nextifm = (struct if_msghdr *)next; + if (nextifm->ifm_type != RTM_NEWADDR) + break; + if (ifam == NULL) + ifam = (struct ifa_msghdr *)nextifm; + addrcount++; + next += nextifm->ifm_msglen; + } + if ((ifm->ifm_flags & IFF_UP) == 0) + continue; /* not up */ + if (ifm->ifm_flags & IFF_LOOPBACK) { + continue; /* skip aliased loopbacks as well. */ + } + while (addrcount > 0) { + struct sockaddr_in *a; + + info.rti_addrs = ifam->ifam_addrs; + + /* Expand the compacted addresses */ + rt_xaddrs((char *)(ifam + 1), ifam->ifam_msglen + (char *)ifam, + &info); + if (info.rti_info[RTAX_IFA]->sa_family != AF_INET) + continue; + a=info.rti_info[RTAX_IFA]; + + if ( count >= maxSize ) /* no more space */ + printf("Too many interfaces..ignoring 0x%x\n", + a->sin_addr.s_addr); + else + buffer[count++] = a->sin_addr.s_addr; + addrcount--; + ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen); + } + } + free(buf); + return count; +} +int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize) + afs_int32 addrBuffer[]; /* the network addrs in net byte order */ + afs_int32 maskBuffer[]; /* the subnet masks */ + afs_int32 mtuBuffer[]; /* the MTU sizes */ + int maxSize; /* sizeof of buffer in afs_int32 units */ +{ + int s; + + size_t needed; + int mib[6]; + struct if_msghdr *ifm, *nextifm; + struct ifa_msghdr *ifam; + struct sockaddr_dl *sdl; + struct rt_addrinfo info; + char *buf, *lim, *next; + int count=0,addrcount=0; + + mib[0] = CTL_NET; + mib[1] = PF_ROUTE; + mib[2] = 0; + mib[3] = AF_INET; /* address family */ + mib[4] = NET_RT_IFLIST; + mib[5] = 0; + if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) + return 0; + if ((buf = malloc(needed)) == NULL) + return 0; + if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { + free(buf); + return 0; + } + s=socket(PF_INET, SOCK_DGRAM, 0); + if (s < 0) + return 0; + lim = buf + needed; + next = buf; + while (next < lim) { + ifm = (struct if_msghdr *)next; + if (ifm->ifm_type != RTM_IFINFO) { + printf("out of sync parsing NET_RT_IFLIST\n"); + free(buf); + return 0; + } + sdl = (struct sockaddr_dl *)(ifm + 1); + next += ifm->ifm_msglen; + ifam = NULL; + addrcount = 0; + while (next < lim) { + nextifm = (struct if_msghdr *)next; + if (nextifm->ifm_type != RTM_NEWADDR) + break; + if (ifam == NULL) + ifam = (struct ifa_msghdr *)nextifm; + addrcount++; + next += nextifm->ifm_msglen; + } + if ((ifm->ifm_flags & IFF_UP) == 0) + continue; /* not up */ + if (ifm->ifm_flags & IFF_LOOPBACK) { + continue; /* skip aliased loopbacks as well. */ + } + while (addrcount > 0) { + struct sockaddr_in *a; + + info.rti_addrs = ifam->ifam_addrs; + + /* Expand the compacted addresses */ + rt_xaddrs((char *)(ifam + 1), ifam->ifam_msglen + (char *)ifam, + &info); + if (info.rti_info[RTAX_IFA]->sa_family != AF_INET) + continue; + a=info.rti_info[RTAX_IFA]; + + if ( count >= maxSize ) { /* no more space */ + printf("Too many interfaces..ignoring 0x%x\n", + a->sin_addr.s_addr); + } else { + struct ifreq ifr; + + addrBuffer[count] = a->sin_addr.s_addr; + a=info.rti_info[RTAX_NETMASK]; + if (a) + maskBuffer[count]=a->sin_addr.s_addr; + else + maskBuffer[count] = htonl(0xffffffff); + memset(&ifr, sizeof(ifr), 0); + ifr.ifr_addr.sa_family=AF_INET; + strncpy(ifr.ifr_name, sdl->sdl_data, sdl->sdl_nlen); + if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) < 0) + mtuBuffer[count]=1500; + else + mtuBuffer[count]=ifr.ifr_mtu; + count++; + } + addrcount--; + ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen); + } + } + free(buf); + return count; +} + + +#else +int rx_getAllAddr (buffer,maxSize) +afs_int32 buffer[]; +int maxSize; /* sizeof of buffer in afs_int32 units */ { int s; int i, len, count=0; @@ -125,13 +338,18 @@ int maxSize; /* sizeof of buffer in afs_int32 units */ len = ifc.ifc_len / sizeof(struct ifreq); if (len > NIFS) len = NIFS; -#if defined(AFS_AIX41_ENV) +#if defined(AFS_AIX41_ENV) || defined (AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) if ( ifc.ifc_len > sizeof(ifs) ) /* safety check */ ifc.ifc_len = sizeof(ifs); for ( cp = (char *)ifc.ifc_buf, cplim= ifc.ifc_buf+ifc.ifc_len; cp < cplim; - cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))){ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + cp += _SIZEOF_ADDR_IFREQ(*ifr)) +#else + cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))) +#endif + { ifr = (struct ifreq *)cp; #else for (i = 0; i < len; ++i) { @@ -258,6 +476,7 @@ int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize) return count; #endif /* AFS_USERSPACE_IP_ADDR */ } +#endif #endif /* ! AFS_NT40_ENV */ #endif /* !KERNEL || UKERNEL */ diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index 005664ddc..73a140e7c 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -423,7 +423,7 @@ register struct rx_peer *pp; */ -#if ! defined(AFS_AIX_ENV) && ! defined(AFS_SUN5_ENV) && ! defined(UKERNEL) && ! defined(AFS_LINUX20_ENV) +#if ! defined(AFS_AIX_ENV) && ! defined(AFS_SUN5_ENV) && ! defined(UKERNEL) && ! defined(AFS_LINUX20_ENV) && !defined (AFS_DARWIN_ENV) && !defined (AFS_FBSD_ENV) /* Routine called during the afsd "-shutdown" process to put things back to * the initial state. */ @@ -548,7 +548,7 @@ afs_int32 rxi_Findcbi(addr) #else /* AFS_USERSPACE_IP_ADDR */ -#if !defined(AFS_AIX41_ENV) && !defined(AFS_DUX40_ENV) +#if !defined(AFS_AIX41_ENV) && !defined(AFS_DUX40_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #define IFADDR2SA(f) (&((f)->ifa_addr)) #else /* AFS_AIX41_ENV */ #define IFADDR2SA(f) ((f)->ifa_addr) @@ -569,10 +569,20 @@ int rxi_GetIFInfo() bzero(addrs, sizeof(addrs)); bzero(mtus, sizeof(mtus)); +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + TAILQ_FOREACH(ifn, &ifnet, if_link) { + if (i >= ADDRSPERSITE) break; +#else for (ifn = ifnet; ifn != NULL && i < ADDRSPERSITE; ifn = ifn->if_next) { +#endif rxmtu = (ifn->if_mtu - RX_IPUDP_SIZE); +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + TAILQ_FOREACH(ifad, &ifn->if_addrhead, ifa_link) { + if (i >= ADDRSPERSITE) break; +#else for (ifad = ifn->if_addrlist; ifad != NULL && i < ADDRSPERSITE; ifad = ifad->ifa_next){ +#endif if (IFADDR2SA(ifad)->sa_family == AF_INET) { ifinaddr = ntohl(((struct sockaddr_in *) IFADDR2SA(ifad))->sin_addr.s_addr); if (myNetAddrs[i] != ifinaddr) { @@ -626,14 +636,26 @@ rxi_FindIfnet(addr, pifad) /* if we're given an address, skip everything until we find it */ if (!*pifad) +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + *pifad = TAILQ_FIRST(&in_ifaddrhead); +#else *pifad = in_ifaddr; +#endif else { if (((ppaddr & (*pifad)->ia_subnetmask) == (*pifad)->ia_subnet)) match_value = 2; /* don't find matching nets, just subnets */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + *pifad = TAILQ_NEXT(*pifad, ia_link); +#else *pifad = (*pifad)->ia_next; +#endif } +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + for (ifa = *pifad; ifa; ifa = TAILQ_NEXT(ifa, ia_link) ) { +#else for (ifa = *pifad; ifa; ifa = ifa->ia_next ) { +#endif if ((ppaddr & ifa->ia_netmask) == ifa->ia_net) { if ((ppaddr & ifa->ia_subnetmask) == ifa->ia_subnet) { sin=IA_SIN(ifa); @@ -691,6 +713,9 @@ struct osi_socket *rxk_NewSocket(short aport) #endif AFS_STATCNT(osi_NewSocket); +#if (defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)) && defined(KERNEL_FUNNEL) + thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL); +#endif #if defined(AFS_HPUX102_ENV) #if defined(AFS_HPUX110_ENV) /* blocking socket */ @@ -701,11 +726,13 @@ struct osi_socket *rxk_NewSocket(short aport) #else #ifdef AFS_SGI65_ENV code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP); +#elif defined(AFS_FBSD_ENV) + code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP, curproc); #else code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0); #endif /* AFS_SGI65_ENV */ #endif /* AFS_HPUX102_ENV */ - if (code) return (struct osi_socket *) 0; + if (code) goto bad; myaddr.sin_family = AF_INET; myaddr.sin_port = aport; @@ -715,7 +742,7 @@ struct osi_socket *rxk_NewSocket(short aport) bindnam = allocb_wait((addrsize+SO_MSGOFFSET+1), BPRI_MED); if (!bindnam) { setuerror(ENOBUFS); - return(struct osi_socket *) 0; + goto bad; } bcopy((caddr_t)&myaddr, (caddr_t)bindnam->b_rptr+SO_MSGOFFSET, addrsize); bindnam->b_wptr = bindnam->b_rptr + (addrsize+SO_MSGOFFSET+1); @@ -724,7 +751,7 @@ struct osi_socket *rxk_NewSocket(short aport) if (code) { soclose(newSocket); m_freem(nam); - return(struct osi_socket *) 0; + goto bad; } freeb(bindnam); @@ -735,16 +762,29 @@ struct osi_socket *rxk_NewSocket(short aport) if (code) osi_Panic("osi_NewSocket: last attempt to reserve 32K failed!\n"); } +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + myaddr.sin_len = sizeof(myaddr); +#if defined(AFS_FBSD_ENV) + code = sobind(newSocket, (struct sockaddr *)&myaddr, curproc); +#else + code = sobind(newSocket, (struct sockaddr *)&myaddr); +#endif + if (code) { + printf("sobind fails\n"); + soclose(newSocket); + goto bad; + } +#else #ifdef AFS_OSF_ENV nam = m_getclr(M_WAIT, MT_SONAME); #else /* AFS_OSF_ENV */ nam = m_get(M_WAIT, MT_SONAME); #endif if (nam == NULL) { -#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV) setuerror(ENOBUFS); #endif - return (struct osi_socket *) 0; + goto bad; } nam->m_len = sizeof(myaddr); #ifdef AFS_OSF_ENV @@ -755,6 +795,8 @@ struct osi_socket *rxk_NewSocket(short aport) BHV_PDATA(&bhv) = (void*)newSocket; code = sobind(&bhv, nam); m_freem(nam); +#elif defined(AFS_FBSD_ENV) + code = sobind(newSocket, nam, curproc); #else code = sobind(newSocket, nam); #endif @@ -763,11 +805,21 @@ struct osi_socket *rxk_NewSocket(short aport) #ifndef AFS_SGI65_ENV m_freem(nam); #endif - return (struct osi_socket *) 0; + goto bad; } +#endif /* else AFS_DARWIN_ENV */ #endif /* else AFS_HPUX110_ENV */ +#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL) + thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL); +#endif return (struct osi_socket *) newSocket; + +bad: +#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL) + thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL); +#endif + return (struct osi_socket *) 0; } @@ -776,7 +828,13 @@ int rxk_FreeSocket(asocket) register struct socket *asocket; { AFS_STATCNT(osi_FreeSocket); +#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL) + thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL); +#endif soclose(asocket); +#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL) + thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL); +#endif return 0; } #endif /* !SUN5 && !LINUX20 */ @@ -938,6 +996,9 @@ void rxk_Listener(void) #ifdef AFS_SUN5_ENV rxk_ListenerPid = ttoproc(curthread)->p_pidp->pid_id; #endif /* AFS_SUN5_ENV */ +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) + rxk_ListenerPid = current_proc()->p_pid; +#endif #if defined(RX_ENABLE_LOCKS) && !defined(AFS_SUN5_ENV) AFS_GUNLOCK(); #endif /* RX_ENABLE_LOCKS && !AFS_SUN5_ENV */ @@ -977,7 +1038,7 @@ void rxk_Listener(void) #endif /* AFS_SUN5_ENV */ } -#if !defined(AFS_LINUX20_ENV) && !defined(AFS_SUN5_ENV) +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) /* The manner of stopping the rx listener thread may vary. Most unix's should * be able to call soclose. */ diff --git a/src/rx/rx_kcommon.h b/src/rx/rx_kcommon.h index 7f99e4b4d..389d66a49 100644 --- a/src/rx/rx_kcommon.h +++ b/src/rx/rx_kcommon.h @@ -14,6 +14,12 @@ #ifndef _RX_KCOMMON_H_ #define _RX_KCOMMON_H_ +#ifdef AFS_DARWIN_ENV +#ifndef _MACH_ETAP_H_ +#define _MACH_ETAP_H_ +typedef unsigned short etap_event_t; +#endif +#endif #include "../h/types.h" #include "../h/param.h" #ifndef AFS_LINUX22_ENV @@ -29,11 +35,19 @@ #ifndef AFS_LINUX22_ENV #include "../h/socketvar.h" #include "../h/protosw.h" -#ifndef AFS_SUN5_ENV +#if !defined(AFS_SUN5_ENV) && !defined(AFS_FBSD_ENV) #include "../h/domain.h" #include "../h/dir.h" #include "../h/buf.h" #include "../h/mbuf.h" +#else +#if defined(AFS_FBSD_ENV) +#include "../h/dirent.h" +#include "../h/socket.h" +#include "../h/domain.h" +#include "../h/buf.h" +#include "../h/mbuf.h" +#endif /* AFS_FBSD_ENV */ #endif #endif /* AFS_LINUX22_ENV */ #ifdef AFS_SGI62_ENV @@ -100,4 +114,8 @@ extern struct ifnet *rxi_FindIfnet(); extern int rxk_initDone; +#if defined(AFS_FBSD_ENV) +extern struct domain inetdomain; +#endif /* AFS_FBSD_ENV */ + #endif /* _RX_KCOMMON_H_ */ diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index f54df1a66..63ad212fe 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -36,6 +36,9 @@ #define MAXTHREADNAMELENGTH 64 +extern int (*registerProgram)(); +extern int (*swapNameProgram)(); + int debugSelectFailure; /* # of times select failed */ /* * Sleep on the unique wait channel provided. @@ -54,8 +57,8 @@ void rxi_Wakeup(void *addr) LWP_NoYieldSignal(addr); } -PROCESS rx_listenerPid; /* LWP process id of socket listener process */ -static void rx_ListenerProc(void *dummy); +PROCESS rx_listenerPid = 0; /* LWP process id of socket listener process */ +void rx_ListenerProc(void *dummy); /* * Delay the current thread the specified number of seconds. @@ -97,8 +100,14 @@ void rxi_StartServerProc(proc, stacksize) long (*proc)(); { PROCESS scratchPid; + static int number = 0; + char name[32]; + + sprintf(name, "srv_%d", ++number); LWP_CreateProcess(proc, stacksize, RX_PROCESS_PRIORITY, 0, "rx_ServerProc", &scratchPid); + if (registerProgram) + (*registerProgram)(scratchPid, name); } void rxi_StartListener() { @@ -106,6 +115,8 @@ void rxi_StartListener() { #define RX_LIST_STACK 24000 LWP_CreateProcess(rx_ListenerProc, RX_LIST_STACK, LWP_MAX_PRIORITY, 0, "rx_Listener", &rx_listenerPid); + if (registerProgram) + (*registerProgram)(rx_listenerPid, "listener"); } /* The main loop which listens to the net for datagrams, and handles timeouts @@ -151,7 +162,8 @@ void rxi_ListenerProc(rfds, tnop, newcallp) exit(1); } rx_listenerPid = pid; - swapthreadname(pid, "listener", &name); + if (swapNameProgram) + (*swapNameProgram)(pid, "listener", &name); for (;;) { /* Grab a new packet only if necessary (otherwise re-use the old one) */ @@ -245,6 +257,10 @@ void rxi_ListenerProc(rfds, tnop, newcallp) if (p) { rxi_FreePacket(p); } + if (swapNameProgram) { + (*swapNameProgram)(rx_listenerPid, &name, 0); + rx_listenerPid = 0; + } return; } } @@ -261,6 +277,10 @@ void rxi_ListenerProc(rfds, tnop, newcallp) if (p) { rxi_FreePacket(p); } + if (swapNameProgram) { + (*swapNameProgram)(rx_listenerPid, &name, 0); + rx_listenerPid = 0; + } return; } } diff --git a/src/rx/rx_packet.h b/src/rx/rx_packet.h index 6323b49a2..cb49d1e47 100644 --- a/src/rx/rx_packet.h +++ b/src/rx/rx_packet.h @@ -40,7 +40,9 @@ #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #else /* AFS_NT40_ENV */ +#if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_USR_FBSD_ENV) #include /* MIN, MAX on Solaris */ +#endif #include /* MIN, MAX elsewhere */ #endif /* AFS_NT40_ENV */ diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c index b1bbadd13..0b409905c 100644 --- a/src/rx/rx_rdwr.c +++ b/src/rx/rx_rdwr.c @@ -1,4 +1,4 @@ -/* + /* * Copyright 2000, International Business Machines Corporation and others. * All Rights Reserved. * @@ -10,6 +10,9 @@ #ifdef KERNEL #include "../afs/param.h" #ifndef UKERNEL +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#include "../afs/sysincludes.h" +#else #include "../h/types.h" #include "../h/time.h" #include "../h/stat.h" @@ -23,6 +26,7 @@ #if defined(AFS_SGI_ENV) #include "../afs/sysincludes.h" #endif +#endif #include "../afs/afs_args.h" #include "../afs/afs_osi.h" #if (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV)) @@ -34,7 +38,6 @@ #ifdef RXDEBUG #undef RXDEBUG /* turn off debugging */ #endif /* RXDEBUG */ -#include "../afsint/afsint.h" #include "../rx/rx_kmutex.h" #include "../rx/rx_kernel.h" diff --git a/src/rx/rxdebug.c b/src/rx/rxdebug.c index c9ec3fcdf..1cd7ffddd 100644 --- a/src/rx/rxdebug.c +++ b/src/rx/rxdebug.c @@ -463,6 +463,9 @@ struct cmd_syndesc *as; break; } + if ((onlyHost != -1) && (onlyHost != tpeer.host)) continue; + if ((onlyPort != -1) && (onlyPort != tpeer.port)) continue; + /* now display the peer */ hostAddr.s_addr = tpeer.host; printf("Peer at host %s, port %hu\n", @@ -475,6 +478,10 @@ struct cmd_syndesc *as; tpeer.bytesSent.high, tpeer.bytesSent.low); printf("\tbytes received high %d low %d\n", tpeer.bytesReceived.high, tpeer.bytesReceived.low); + printf("\trtt %d msec, rtt_dev %d msec\n", + tpeer.rtt >> 3, tpeer.rtt_dev >> 2); + printf("\ttimeout %d.%03d sec\n", + tpeer.timeout.sec, tpeer.timeout.usec / 1000); } } exit(0); diff --git a/src/rx/test/generator.c b/src/rx/test/generator.c index 7974cf684..7a7154fcf 100644 --- a/src/rx/test/generator.c +++ b/src/rx/test/generator.c @@ -930,7 +930,6 @@ PRIVATE void WriteCltHeader(char *serverName, int srv_no, FILE *itl_h) "#include \n" "#include \n" "#include \n" - "#include \"../../../permit_xprt.h\"\n" "#include \"%s%d.h\"\n" , platform[4], serverName, srv_no); @@ -1264,7 +1263,6 @@ PRIVATE void WriteServHeader(FILE *srv_h, char *serverName, int srv_no) "#include \n" "#include \n" "#include \n" - "#include \"../../../permit_xprt.h\"\n" "#include \"%s.h\"\n\n" "struct ktc_encryptionKey serviceKey =\n" "\t{0x45, 0xe3, 0x3d, 0x16, 0x29, 0x64, 0x8a, 0x8f};\n" diff --git a/src/rxgen/Makefile b/src/rxgen/Makefile index 4cb495ccc..830f527ef 100644 --- a/src/rxgen/Makefile +++ b/src/rxgen/Makefile @@ -9,7 +9,6 @@ COMPONENT=rxgen include ../config/Makefile.${SYS_NAME} UKERNELDIR=../libuafs/ -INSTALL =${SRCDIR}bin/install MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 SRCS= rpc_main.c rpc_hout.c rpc_cout.c rpc_parse.c rpc_scan.c rpc_util.c \ diff --git a/src/rxgen/rpc_main.c b/src/rxgen/rpc_main.c index 15d771ff9..e96aba488 100644 --- a/src/rxgen/rpc_main.c +++ b/src/rxgen/rpc_main.c @@ -88,8 +88,12 @@ int debug = 0; static char *cmdname; #ifdef AFS_SUN5_ENV static char CPP[] = "/usr/ccs/lib/cpp"; +#elif defined(AFS_FBSD_ENV) +static char CPP[] = "/usr/bin/cpp"; #elif defined(AFS_NT40_ENV) static char CPP[MAXCMDLINE]; +#elif defined(AFS_DARWIN_ENV) +static char CPP[] = "cc -E"; #else static char CPP[] = "/lib/cpp"; #endif diff --git a/src/rxkad/Makefile b/src/rxkad/Makefile index 0c2a7b954..be08e3dc2 100644 --- a/src/rxkad/Makefile +++ b/src/rxkad/Makefile @@ -14,15 +14,13 @@ include ../config/Makefile.${SYS_NAME} KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ -INSTALL=${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 CFLAGS = ${OPTMZ} -I${SRCDIR}include ${XCFLAGS} -PE = ../permit_xprt.h INCLS= ${SRCDIR}include/rx/rx.h \ ${SRCDIR}include/rx/xdr.h \ - rxkad.h ${PE} + rxkad.h OBJS= rxkad_client.o rxkad_server.o rxkad_common.o ticket.o rxkad_errs.o @@ -63,7 +61,7 @@ rxkad_errs.c rxkad.h: rxkad_errs.et rxkad.p.h ticket.o: ticket.c lifetimes.h ${INCLS} -fcrypt.o: fcrypt.c fcrypt.h sboxes.h rxkad.h ${PE} +fcrypt.o: fcrypt.c fcrypt.h sboxes.h rxkad.h ${CC} ${CFLAGS} -c fcrypt.c kinstall: ${KSRCS} diff --git a/src/rxkad/domestic/crypt_conn.c b/src/rxkad/domestic/crypt_conn.c index ecf42def5..1bd7cb7d3 100644 --- a/src/rxkad/domestic/crypt_conn.c +++ b/src/rxkad/domestic/crypt_conn.c @@ -39,14 +39,7 @@ #include "private_data.h" #define XPRT_RXKAD_CRYPT -#ifdef KERNEL -#include "../afs/permit_xprt.h" -#else -#include "../permit_xprt.h" -#endif - -AFS_HIDE afs_int32 rxkad_DecryptPacket (conn, schedule, ivec, len, packet) IN struct rx_connection *conn; IN fc_KeySchedule *schedule; @@ -60,7 +53,6 @@ afs_int32 rxkad_DecryptPacket (conn, schedule, ivec, len, packet) char * data; int i,tlen; - if (!xprt_CryptOK (conn)) return RXKADILLEGALLEVEL; obj = rx_SecurityObjectOf(conn); tp = (struct rxkad_cprivate *)obj->privateData; LOCK_RXKAD_STATS @@ -84,7 +76,6 @@ afs_int32 rxkad_DecryptPacket (conn, schedule, ivec, len, packet) return 0; } -AFS_HIDE afs_int32 rxkad_EncryptPacket (conn, schedule, ivec, len, packet) IN struct rx_connection *conn; IN fc_KeySchedule *schedule; @@ -98,7 +89,6 @@ afs_int32 rxkad_EncryptPacket (conn, schedule, ivec, len, packet) char *data; int i,tlen; - if (!xprt_CryptOK (conn)) return RXKADILLEGALLEVEL; obj = rx_SecurityObjectOf(conn); tp = (struct rxkad_cprivate *)obj->privateData; LOCK_RXKAD_STATS diff --git a/src/rxkad/domestic/fcrypt.c b/src/rxkad/domestic/fcrypt.c index ba0b0ce7f..a07a10081 100644 --- a/src/rxkad/domestic/fcrypt.c +++ b/src/rxkad/domestic/fcrypt.c @@ -56,11 +56,6 @@ int ROUNDS = 16; #endif #define XPRT_FCRYPT -#ifdef KERNEL -#include "../afs/permit_xprt.h" -#else -#include "../permit_xprt.h" -#endif int fc_keysched (key, schedule) IN struct ktc_encryptionKey *key; @@ -104,7 +99,6 @@ int fc_keysched (key, schedule) return 0; } -AFS_HIDE afs_int32 fc_ecb_encrypt(clear, cipher, schedule, encrypt) IN afs_uint32 *clear; OUT afs_uint32 *cipher; @@ -194,7 +188,6 @@ afs_int32 fc_ecb_encrypt(clear, cipher, schedule, encrypt) * NOTE: fc_cbc_encrypt now modifies its 5th argument, to permit chaining over * scatter/gather vectors. */ -AFS_HIDE afs_int32 fc_cbc_encrypt (input, output, length, key, xor, encrypt) char *input; char *output; diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c index 2fd46b1a9..19bae1612 100644 --- a/src/rxkad/rxkad_client.c +++ b/src/rxkad/rxkad_client.c @@ -51,12 +51,6 @@ #include "private_data.h" #define XPRT_RXKAD_CLIENT -#ifdef KERNEL -#include "../afs/permit_xprt.h" -#else -#include "../permit_xprt.h" -#endif - char *rxi_Alloc(); @@ -185,7 +179,7 @@ rxkad_NewClientSecurityObject(level, sessionkey, kvno, ticketLen, ticket) bzero ((void *)tcp, size); tsc->privateData = (char *) tcp; tcp->type |= rxkad_client; - tcp->level = xprt_CoerceLevel(level); + tcp->level = level; code = fc_keysched (sessionkey, tcp->keysched); if (code) return 0; /* bad key */ bcopy ((void *)sessionkey, (void *)tcp->ivec, sizeof(tcp->ivec)); diff --git a/src/rxkad/rxkad_common.c b/src/rxkad/rxkad_common.c index 2991f1d9b..8e0012709 100644 --- a/src/rxkad/rxkad_common.c +++ b/src/rxkad/rxkad_common.c @@ -19,7 +19,6 @@ #endif #include "../h/types.h" #include "../h/time.h" -#include "../netinet/in.h" #ifndef AFS_LINUX22_ENV #include "../rpc/types.h" #include "../rpc/xdr.h" @@ -50,12 +49,6 @@ #include "private_data.h" #define XPRT_RXKAD_COMMON -#ifdef KERNEL -#include "../afs/permit_xprt.h" -#else -#include "../permit_xprt.h" -#endif - char *rxi_Alloc(); diff --git a/src/rxkad/rxkad_server.c b/src/rxkad/rxkad_server.c index 43c232a60..add3e7b03 100644 --- a/src/rxkad/rxkad_server.c +++ b/src/rxkad/rxkad_server.c @@ -26,8 +26,6 @@ #include #include "private_data.h" #define XPRT_RXKAD_SERVER -#include "../permit_xprt.h" - /* * This can be set to allow alternate ticket decoding. diff --git a/src/rxkad/test/stress_c.c b/src/rxkad/test/stress_c.c index 21ae378e9..85bcf7af4 100644 --- a/src/rxkad/test/stress_c.c +++ b/src/rxkad/test/stress_c.c @@ -29,13 +29,8 @@ #define FT_ApproxTime() (int)time(0) #endif -#ifdef rx_GetPacketCksum -#include "../../permit_xprt.h" -#endif - extern int maxSkew; - static char *whoami; static long GetServer(aname) diff --git a/src/rxkad/ticket.c b/src/rxkad/ticket.c index b9219f990..d0b14ddd2 100644 --- a/src/rxkad/ticket.c +++ b/src/rxkad/ticket.c @@ -7,18 +7,6 @@ * directory or online at http://www.openafs.org/dl/license10.html */ -/* - * Revision 2.3 90/08/31 16:19:53 - * Move permit_xprt.h. - * - * Revision 2.2 90/08/20 10:21:25 - * Include permit_xprt.h. - * Cleanup; prune log, flush andrew style ticket functions. - * - * Revision 2.1 90/08/07 19:33:44 - * Start with clean version to sync test and dev trees. - * */ - #if defined(UKERNEL) #include "../afs/param.h" #include "../afs/sysincludes.h" @@ -29,8 +17,6 @@ #include "../des/des.h" #include "../afs/lifetimes.h" #include "../afs/rxkad.h" - -#include "../afs/permit_xprt.h" #else /* defined(UKERNEL) */ #include #include @@ -45,8 +31,6 @@ #include #include "lifetimes.h" #include "rxkad.h" - -#include "../permit_xprt.h" #endif /* defined(UKERNEL) */ diff --git a/src/rxstat/Makefile b/src/rxstat/Makefile index c07f38557..8f81ed8a2 100644 --- a/src/rxstat/Makefile +++ b/src/rxstat/Makefile @@ -11,7 +11,6 @@ include ../config/Makefile.version KERNELDIR = ../libafs/ UKERNELDIR = ../libuafs/ -INSTALL=${SRCDIR}bin/install RXGEN=${SRCDIR}bin/rxgen MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 diff --git a/src/scout/Makefile b/src/scout/Makefile index 87395535f..83006ed52 100644 --- a/src/scout/Makefile +++ b/src/scout/Makefile @@ -10,8 +10,6 @@ SHELL = /bin/sh COMPONENT=scout include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install - CFLAGS= ${DBUG} -I. \ -I${SRCDIR}include \ -I${SRCDIR}include/afs \ diff --git a/src/sgistuff/Makefile b/src/sgistuff/Makefile index 8ec1c4c98..5a42979ac 100644 --- a/src/sgistuff/Makefile +++ b/src/sgistuff/Makefile @@ -17,7 +17,6 @@ OPTIMIZE=-g CFLAGS = ${OPTIMIZE} -I${SRCDIR}include ${XCFLAGS} LDFLAGS = ${OPTIMIZE} ${XLDFLAGS} LIBDIR = ${DESTDIR}lib/ -INSTALL=${SRCDIR}bin/install AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a \ ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \ ${DESTDIR}lib/libdes.a ${LIBDIR}librx.a ${LIBDIR}liblwp.a \ diff --git a/src/sia/Makefile b/src/sia/Makefile index 856d7cebb..74403e866 100644 --- a/src/sia/Makefile +++ b/src/sia/Makefile @@ -27,8 +27,6 @@ KLIBS = ${DESTDIR}/lib/afs/libkauth.krb.a ${LIBS1} ${DESTDIR}/lib/afs/libauth.kr all: test-reauth ${DESTDIR}/lib/afs/libafssiad.so ${DESTDIR}/lib/afs/libafssiad.krb.so -INSTALL=${SRCDIR}bin/install - CFLAGS = $(DEBUG) -I${SRCDIR}include ${XCFLAGS} ${DESTDIR}/lib/afs/libafssiad.so: libafssiad.so diff --git a/src/sys/Makefile b/src/sys/Makefile index d94d9040e..72267e6e0 100644 --- a/src/sys/Makefile +++ b/src/sys/Makefile @@ -14,7 +14,6 @@ include ../config/Makefile.${SYS_NAME} MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 UKERNELDIR=../libuafs/ -INSTALL = ${SRCDIR}bin/install CFLAGS= ${DBUG} -I${SRCDIR}include ${XCFLAGS} ${DBG_DEFS} SFLAGS=-P -I${SRCDIR}include LIBS= libsys.a ${SRCDIR}lib/librx.a libsys.a ${SRCDIR}lib/liblwp.a ${SRCDIR}lib/afs/util.a ${XLIBS} @@ -80,7 +79,7 @@ syscall.o: syscall.s /usr/ccs/lib/cpp ${SFLAGS} syscall.s syscall.ss; \ as -o syscall.o syscall.ss; \ rm syscall.ss;; \ - sgi_* ) \ + sgi_* |ppc_darwin* ) \ ${CC} ${CFLAGS} -c syscall.s;; \ alpha_osf1 | alpha_osf20 | alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \ ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER syscall.s; \ @@ -88,6 +87,8 @@ syscall.o: syscall.s rm -f syscall.ss syscall.i;; \ hp_ux11? ) \ touch syscall.o;; \ + i386_fbsd* ) \ + touch syscall.o;; \ *) \ /lib/cpp ${SFLAGS} syscall.s syscall.ss; \ as -o syscall.o syscall.ss; \ diff --git a/src/tbutc/Makefile b/src/tbutc/Makefile index 47615cd40..dfd2516c7 100644 --- a/src/tbutc/Makefile +++ b/src/tbutc/Makefile @@ -15,7 +15,6 @@ COMPONENT=tbutc include ../config/Makefile.${SYS_NAME} CC =${MT_CC} -INSTALL =${SRCDIR}bin/install CFLAGS = ${DBG} -w ${MT_CFLAGS} LDFLAGS = ${DBG} ${XLDFLAGS} diff --git a/src/tbutc/NTMakefile b/src/tbutc/NTMakefile index d6c739abe..52bbe47e6 100644 --- a/src/tbutc/NTMakefile +++ b/src/tbutc/NTMakefile @@ -47,7 +47,7 @@ BUTMINCLUDE = -I$(DESTDIR)\include BUTCOBJS = dbentries.obj tcprocs.obj lwps.obj tcmain.obj list.obj recoverDb.obj \ tcudbprocs.obj dump.obj tcstatus.obj butc_xbsa.obj \ $(LWPOBJS) $(BUCOORDOBJS) -BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)\ +BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)\ BUTCLIBS = $(DESTDIR)\lib\afs\afsbudb.lib \ $(DESTDIR)\lib\afs\afsbubasics.lib \ $(VOLSERLIBS) \ @@ -57,6 +57,7 @@ BUTCLIBS = $(DESTDIR)\lib\afs\afsbudb.lib \ $(DESTDIR)\lib\afsubik.lib \ $(DESTDIR)\lib\afs\afsauth.lib \ \ + $(DESTDIR)\lib\afsrpc.lib \ $(DESTDIR)\lib\afsrxkad.lib \ $(DESTDIR)\lib\afsrx.lib \ $(DESTDIR)\lib\afslwp.lib \ @@ -64,7 +65,6 @@ BUTCLIBS = $(DESTDIR)\lib\afs\afsbudb.lib \ $(DESTDIR)\lib\afs\afsutil.lib \ $(DESTDIR)\lib\afs\afsusd.lib \ $(DESTDIR)\lib\afs\afspioctl.lib \ - $(DESTDIR)\lib\afsrpc.lib \ $(DESTDIR)\lib\afs\afscmd.lib \ $(DESTDIR)\lib\afs\afscom_err.lib \ $(DESTDIR)\lib\afs\afsreg.lib \ diff --git a/src/tsm41/Makefile b/src/tsm41/Makefile index e5550c70c..efb9f64fd 100644 --- a/src/tsm41/Makefile +++ b/src/tsm41/Makefile @@ -9,7 +9,6 @@ include ../config/Makefile.${SYS_NAME} OPTIMIZE=-g CFLAGS = ${OPTIMIZE} -I${SRCDIR}include ${XCFLAGS} LIBDIR = ${DESTDIR}lib/ -INSTALL=${SRCDIR}bin/install AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a \ ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \ ${DESTDIR}lib/libdes.a ${LIBDIR}librx.a ${LIBDIR}liblwp.a \ diff --git a/src/tviced/Makefile b/src/tviced/Makefile index 0d37a5736..a7bab2ad1 100644 --- a/src/tviced/Makefile +++ b/src/tviced/Makefile @@ -10,7 +10,6 @@ COMPONENT=tviced include ../config/Makefile.${SYS_NAME} CC=${MT_CC} -INSTALL=${SRCDIR}bin/install INCLUDES=-I. -I.. -I${SRCDIR}include -I${SRCDIR}include/afs CFLAGS=${DBG} ${OPTMZ} -DNINTERFACE ${INCLUDES} ${MT_CFLAGS} -DRXDEBUG LDFLAGS=${DBG} ${XLDFLAGS} @@ -183,14 +182,7 @@ afsint.xdr.o: ${FSINT}/afsint.xdr.c ${CC} -c ${CFLAGS} ${FSINT}/afsint.xdr.c fileserver: callback_clean1 viced.o ${objects} ${LIBS} - case ${SYS_NAME} in \ - *linux*) \ - ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS} \ - ${MTLIBS} ${XLIBS} ;; \ - *) \ - ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS} \ - ${MTLIBS} ${XLIBS} ;; \ - esac; + ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS} ${MTLIBS} ${XLIBS} ${DESTDIR}root.server/usr/afs/bin/fileserver : fileserver ${INSTALL} -ns fileserver ${DESTDIR}root.server/usr/afs/bin/fileserver diff --git a/src/ubik/Makefile b/src/ubik/Makefile index aaf6be9f9..7a89360c7 100644 --- a/src/ubik/Makefile +++ b/src/ubik/Makefile @@ -12,7 +12,6 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 CFLAGS=${OPTMZ} -I./ -I${SRCDIR}include ${XCFLAGS} UKERNELDIR=../libuafs/ -INSTALL=${SRCDIR}bin/install LIBOBJS=disk.o remote.o beacon.o recovery.o ubik.o vote.o lock.o phys.o \ ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \ ubikclient.o uerrors.o diff --git a/src/ubik/beacon.c b/src/ubik/beacon.c index 59fb4c8d6..fe8ac9ec3 100644 --- a/src/ubik/beacon.c +++ b/src/ubik/beacon.c @@ -211,12 +211,16 @@ ubeacon_InitServerListCommon(ame, info, clones, aservers) } ++nServers; } - ts->vote_rxcid = rx_NewConnection(servAddr, ubik_callPortal, - VOTE_SERVICE_ID, - ubikSecClass, ubikSecIndex); /* for vote reqs */ - ts->disk_rxcid = rx_NewConnection(servAddr, ubik_callPortal, - DISK_SERVICE_ID, ubikSecClass, - ubikSecIndex); /* for disk reqs */ + /* for vote reqs */ + ts->vote_rxcid = rx_NewConnection(info->hostAddr[i].sin_addr.s_addr, + ubik_callPortal, + VOTE_SERVICE_ID, + ubikSecClass, ubikSecIndex); + /* for disk reqs */ + ts->disk_rxcid = rx_NewConnection(info->hostAddr[i].sin_addr.s_addr, + ubik_callPortal, + DISK_SERVICE_ID, ubikSecClass, + ubikSecIndex); ts->up = 1; } } else { @@ -611,9 +615,8 @@ afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]; code = UBADHOST; /* remote CellServDB inconsistency */ ubik_print("Inconsistent Cell Info on server: "); for ( j=0; j < UBIK_MAX_INTERFACE_ADDR && ts->addr[j]; j++) - printf("%s ", afs_inet_ntoa(ts->addr[j])); - printf("\n"); - fflush(stdout); fflush(stderr); + ubik_print("%s ", afs_inet_ntoa(ts->addr[j])); + ubik_print("\n"); } else { ts->up= 0; /* mark the remote server as down */ diff --git a/src/ubik/lock.c b/src/ubik/lock.c index c7773a413..a81150cee 100644 --- a/src/ubik/lock.c +++ b/src/ubik/lock.c @@ -74,7 +74,7 @@ ulock_getLock(atrans, atype, await) return UDONE; if (atrans->locktype != 0) { - printf("Ubik: Internal Error: attempted to take lock twice\n"); + ubik_print("Ubik: Internal Error: attempted to take lock twice\n"); abort(); } diff --git a/src/ubik/remote.c b/src/ubik/remote.c index eeb102022..4ed4dc8fa 100644 --- a/src/ubik/remote.c +++ b/src/ubik/remote.c @@ -592,8 +592,8 @@ UbikInterfaceAddr *inAddr, *outAddr; { ubik_print("Inconsistent Cell Info from server: "); for ( i=0; i < UBIK_MAX_INTERFACE_ADDR && inAddr->hostAddr[i]; i++) - printf("%s ", afs_inet_ntoa(htonl(inAddr->hostAddr[i]))); - printf("\n"); + ubik_print("%s ", afs_inet_ntoa(htonl(inAddr->hostAddr[i]))); + ubik_print("\n"); printServerInfo(); return UBADHOST; } @@ -604,9 +604,8 @@ UbikInterfaceAddr *inAddr, *outAddr; ubik_print("ubik: A Remote Server has addresses: "); for ( i=0; i < UBIK_MAX_INTERFACE_ADDR && ts->addr[i]; i++) - printf("%s ", afs_inet_ntoa(ts->addr[i])); - printf("\n"); - fflush(stdout); fflush(stderr); + ubik_print("%s ", afs_inet_ntoa(ts->addr[i])); + ubik_print("\n"); return 0; } @@ -619,12 +618,11 @@ printServerInfo() ubik_print("Local CellServDB:"); for ( ts=ubik_servers; ts; ts= ts->next, j++) { - printf("Server %d: ", j); + ubik_print("Server %d: ", j); for ( i=0; (iaddr[i]; i++) - printf("%s ", afs_inet_ntoa(ts->addr[i])); + ubik_print("%s ", afs_inet_ntoa(ts->addr[i])); } - printf("\n"); - fflush(stdout); fflush(stderr); + ubik_print("\n"); } SDISK_SetVersion(rxcall, atid, oldversionp, newversionp) diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index 791163382..7b1238d38 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -500,7 +500,7 @@ int ubik_EndTrans(transPtr) to us, or timeout. Put safety check in anyway */ if (now - realStart > 10 * BIGTIME) { ubik_stats.escapes++; - printf("ubik escaping from commit wait\n"); + ubik_print("ubik escaping from commit wait\n"); break; } for(ts = ubik_servers; ts; ts=ts->next) { @@ -824,9 +824,9 @@ int panic(a, b, c, d) char *a, *b, *c, *d; { ubik_print("Ubik PANIC: "); - printf(a, b, c, d); + ubik_print(a, b, c, d); abort(); - printf("BACK FROM ABORT\n"); /* shouldn't come back */ + ubik_print("BACK FROM ABORT\n"); /* shouldn't come back */ exit(1); /* never know, though */ } diff --git a/src/ubik/udebug.c b/src/ubik/udebug.c index 258624845..7145036b8 100644 --- a/src/ubik/udebug.c +++ b/src/ubik/udebug.c @@ -318,7 +318,7 @@ main(argc, argv) sigaction(SIGSEGV, &nsa, NULL); #endif ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, "probe ubik server"); - cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine"); + cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server machine"); cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port"); cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info"); diff --git a/src/ubik/vote.c b/src/ubik/vote.c index ebf831a4f..49e9c49dc 100644 --- a/src/ubik/vote.c +++ b/src/ubik/vote.c @@ -236,7 +236,7 @@ SVOTE_Beacon(rxcall, astate, astart, avers, atid) he's lowest, these loops don't occur. because if someone knows he's lowest, he will send out beacons telling others to vote for him. */ if (!amIClone && - (ntohl((afs_uint32) ubik_host) <= ntohl((afs_uint32) lowestHost) + (ntohl((afs_uint32) ubik_host[0]) <= ntohl((afs_uint32) lowestHost) || lowestTime + BIGTIME < now)) { lowestTime = now; lowestHost = ubik_host[0]; @@ -294,9 +294,8 @@ SVOTE_Beacon(rxcall, astate, astart, avers, atid) (otherHost != lastYesHost) || (lastYesState != astate)) { /* A new vote or a change in the vote or changed quorum */ - ubik_dprint("Ubik: vote 'yes' for %d.%d.%d.%d %s\n", - ((otherHost>>24)&0xff), ((otherHost>>16)&0xff), - ((otherHost>> 8)&0xff), (otherHost &0xff), + ubik_dprint("Ubik: vote 'yes' for %s %s\n", + afs_inet_ntoa(otherHost), (astate?"(in quorum)":"(NOT in quorum)")); } diff --git a/src/update/Makefile b/src/update/Makefile index 447d7f4e4..19d6b921d 100644 --- a/src/update/Makefile +++ b/src/update/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT=update include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install LIBRX=${SRCDIR}lib/librx.a LIBS = ${SRCDIR}lib/afs/libauth.a ${SRCDIR}lib/librxkad.a \ ${SRCDIR}lib/libdes.a ${LIBRX} ${SRCDIR}lib/liblwp.a \ diff --git a/src/usd/Makefile b/src/usd/Makefile index bee2956dc..fa048526b 100644 --- a/src/usd/Makefile +++ b/src/usd/Makefile @@ -9,7 +9,6 @@ SHELL = /bin/sh COMPONENT=ptserver include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install RXGEN=${SRCDIR}bin/rxgen COMPILE_ET = ${SRCDIR}bin/compile_et diff --git a/src/usd/usd_file.c b/src/usd/usd_file.c index a2b497349..fb08d4f77 100644 --- a/src/usd/usd_file.c +++ b/src/usd/usd_file.c @@ -17,6 +17,9 @@ #include #include #else +#ifdef AFS_DARWIN_ENV +#include +#endif #include #endif /* AFS_AIX_ENV */ #ifdef AFS_DUX40_ENV @@ -333,8 +336,10 @@ static int usd_FileOpen( oflags = (flags & USD_OPEN_RDWR) ? O_RDWR : O_RDONLY; +#ifdef O_SYNC /* AFS_DARWIN_ENV XXX */ if (flags & USD_OPEN_SYNC) oflags |= O_SYNC; +#endif if (flags & USD_OPEN_CREATE) oflags |= O_CREAT; diff --git a/src/uss/Makefile b/src/uss/Makefile index 7dbb0a4ef..1e979e46f 100644 --- a/src/uss/Makefile +++ b/src/uss/Makefile @@ -12,8 +12,6 @@ SHELL=/bin/sh COMPONENT=uss include ../config/Makefile.${SYS_NAME} -INSTALL = ${SRCDIR}bin/install - # # This makefile creates the following things: # diff --git a/src/uss/uss_common.h b/src/uss/uss_common.h index 1d681ca3a..0b22fac39 100644 --- a/src/uss/uss_common.h +++ b/src/uss/uss_common.h @@ -60,7 +60,7 @@ #define uss_VolumeLen 300 #define uss_DirPoolLen 300 -#ifndef AFS_LINUX20_ENV +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) extern char *sys_errlist[]; #endif diff --git a/src/util/Makefile b/src/util/Makefile index 86eadede2..cb021f421 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -11,12 +11,11 @@ include ../config/Makefile.${SYS_NAME} CFLAGS = ${OPTMZ} -I$(SRCDIR)include ${XCFLAGS} LDFLAGS = ${OPTMZ} ${XLDFLAGS} -INSTALL = ${SRCDIR}bin/install objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \ hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \ dirpath.o fileutil.o netutils.o flipbase64.o \ - afs_atomlist.o afs_lhash.o snprintf.o + afs_atomlist.o afs_lhash.o snprintf.o ${REGEX_OBJ} headers = assert.h potpourri.h itc.h errors.h afsutil.h pthread_glock.h \ dirpath.h afs_atomlist.h afs_lhash.h @@ -34,6 +33,7 @@ install0: ${DESTDIR}include/afs/dirpath.h \ ${DESTDIR}include/afs/pthread_nosigs.h \ ${objects} util.a ${DESTDIR}bin/sys ${someheaders} doc ${INSTALL} util.a ${DESTDIR}lib/afs + ${INSTALL} util.a ${DESTDIR}lib/afs/libafsutil.a ${INSTALL} assert.h errors.h vice.h remote.h ktime.h fileutil.h \ netutils.h packages.h afsutil.h pthread_glock.h \ afs_atomlist.h afs_lhash.h \ @@ -61,10 +61,10 @@ ukinstall webinstall: install0 ${DESTDIR}include/afs/dirpath.h: dirpath.h ${INSTALL} dirpath.h ${DESTDIR}include/afs - + ${DESTDIR}include/afs/pthread_nosigs.h: pthread_nosigs.h ${INSTALL} pthread_nosigs.h ${DESTDIR}include/afs - + doc: echo no documents in this directory diff --git a/src/util/afsutil.h b/src/util/afsutil.h index c152a65f1..faf824649 100644 --- a/src/util/afsutil.h +++ b/src/util/afsutil.h @@ -25,6 +25,10 @@ #include #include extern int LogLevel; +#ifndef AFS_NT40_ENV +extern int serverLogSyslog; +extern int serverLogSyslogFacility; +#endif extern void FSLog(const char *format, ...); #define ViceLog(level, str) if ((level) <= LogLevel) (FSLog str) @@ -53,7 +57,7 @@ extern char *vctime(const time_t *atime); /* Convert a 4 byte integer to a text string. */ -extern char* afs_inet_ntoa(afs_int32 addr); +extern char* afs_inet_ntoa(afs_uint32 addr); /* copy strings, converting case along the way. */ @@ -108,9 +112,15 @@ int base32_to_int(char *s); * early in name. */ typedef char lb64_string_t[12]; +#ifdef AFS_64BIT_ENV +#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (afs_int64)(A)) +char *int64_to_flipbase64(b64_string_t s, afs_int64 a); +afs_int64 flipbase64_to_int64(char *s); +#else +#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (u_int64_t)(A)) char *int64_to_flipbase64(b64_string_t s, u_int64_t a); int64_t flipbase64_to_int64(char *s); -#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (u_int64_t)(A)) +#endif #endif /* This message preserves our ability to license AFS to the U.S. Government diff --git a/src/util/fileutil.c b/src/util/fileutil.c index 1c842032c..f35b2c6e1 100644 --- a/src/util/fileutil.c +++ b/src/util/fileutil.c @@ -18,6 +18,7 @@ #ifdef AFS_NT40_ENV #include +#include #include "errmap_nt.h" #else #include @@ -105,14 +106,16 @@ FilepathNormalize(char *path) bufio_p BufioOpen(char *path, int oflag, int mode) { bufio_p bp; - BUFIO_FD fd; bp = (bufio_p)malloc(sizeof(bufio_t)); if (bp == NULL) { return NULL; } - +#ifdef AFS_NT40_ENV + bp->fd = _open(path, oflag, mode); +#else bp->fd = open(path, oflag, mode); +#endif if (bp->fd == BUFIO_INVALID_FD) { free(bp); return NULL; @@ -144,7 +147,11 @@ int BufioGets(bufio_p bp, char *buf, int buflen) len = bp->len; while (1) { if (pos >= len) { +#ifdef AFS_NT40_ENV + rc = _read(bp->fd, bp->buf, BUFIO_BUFSIZE); +#else rc = read(bp->fd, bp->buf, BUFIO_BUFSIZE); +#endif if (rc < 0) { bp->eof = 1; return -1; @@ -190,7 +197,11 @@ int BufioClose(bufio_p bp) } fd = bp->fd; free(bp); +#ifdef AFS_NT40_ENV + rc = _close(fd); +#else rc = close(fd); +#endif return rc; } diff --git a/src/util/flipbase64.c b/src/util/flipbase64.c index 27af4f8a2..20c3c0963 100644 --- a/src/util/flipbase64.c +++ b/src/util/flipbase64.c @@ -27,10 +27,18 @@ static char c_xlate[80] = * The supplied string 's' must be at least 12 bytes long. * lb64_string in stds.h provides a typedef to get the length. */ +#ifdef AFS_64BIT_ENV +char *int64_to_flipbase64(lb64_string_t s, afs_int64 a) +#else char *int64_to_flipbase64(lb64_string_t s, u_int64_t a) +#endif { int i, j; - int64_t n; +#ifdef AFS_64BIT_ENV + afs_int64 n; +#else + u_int64_t n; +#endif i = 0; if (a==0) @@ -46,10 +54,19 @@ char *int64_to_flipbase64(lb64_string_t s, u_int64_t a) /* Mapping: +=0, ==1, 0-9 = 2-11, A-Z = 12-37, a-z = 38-63 */ +#ifdef AFS_64BIT_ENV +afs_int64 flipbase64_to_int64(char *s) +#else int64_t flipbase64_to_int64(char *s) +#endif { +#ifdef AFS_64BIT_ENV + afs_int64 n = 0; + afs_int64 result = 0; +#else int64_t n = 0; int64_t result = 0; +#endif int shift; for (shift = 0; *s; s++, shift += 6) { diff --git a/src/util/hostparse.c b/src/util/hostparse.c index c9d32e462..f0ba15769 100644 --- a/src/util/hostparse.c +++ b/src/util/hostparse.c @@ -41,7 +41,7 @@ register char *ahost; { static char *addrp[2]; static char addr[4]; register char *ptr = ahost; - afs_int32 tval, numeric=0; + afs_uint32 tval, numeric=0; int dots=0; tc = *ahost; /* look at the first char */ @@ -103,7 +103,7 @@ register char *ahost; { * variable addr is in network byte order. */ char *hostutil_GetNameByINet(addr) - afs_int32 addr; + afs_uint32 addr; { struct hostent *th; static char tbuffer[256]; @@ -130,7 +130,7 @@ char *hostutil_GetNameByINet(addr) ** w.x.y.z # machineName ** returns the network interface in network byte order */ -afs_int32 +afs_uint32 extractAddr(line, maxSize) char* line; int maxSize; @@ -138,8 +138,8 @@ int maxSize; char byte1[32], byte2[32], byte3[32], byte4[32]; int i=0; char* endPtr; - afs_int32 val1, val2, val3, val4; - afs_int32 val=0; + afs_uint32 val1, val2, val3, val4; + afs_uint32 val=0; /* skip empty spaces */ while ( isspace(*line) && maxSize ) @@ -224,7 +224,7 @@ int maxSize; ** On Solaris, if we pass a 4 byte integer directly into inet_ntoa(), it ** causes a memory fault. */ -char* afs_inet_ntoa(afs_int32 addr) +char* afs_inet_ntoa(afs_uint32 addr) { struct in_addr temp; temp.s_addr = addr; diff --git a/src/util/netutils.c b/src/util/netutils.c index c10a4e1c0..684ebc74f 100644 --- a/src/util/netutils.c +++ b/src/util/netutils.c @@ -14,14 +14,17 @@ #include #include -#include -#include #ifdef KERNEL #include "../afs/param.h" #include "../afs/sysincludes.h" #include "../afs/afsincludes.h" #else +#ifdef __FreeBSD__ +#include +#endif #include +#include +#include #endif #include "assert.h" @@ -38,7 +41,7 @@ ** w.x.y.z # machineName * returns the network interface IP Address in NBO */ -u_long +afs_uint32 extract_Addr(line, maxSize) char* line; int maxSize; @@ -46,8 +49,8 @@ int maxSize; char bytes[4][32]; int i=0,n=0; char* endPtr; - u_long val[4]; - u_long retval=0; + afs_uint32 val[4]; + afs_uint32 retval=0; /* skip empty spaces */ while ( isspace(*line) && maxSize ) { @@ -96,8 +99,8 @@ int maxSize; * parsed by extract_Addr(). */ int parseNetRestrictFile(outAddrs, mask, mtu, maxAddrs, nAddrs, reason, fileName) - afs_int32 outAddrs[]; /* output address array */ - afs_int32 *mask, *mtu; /* optional mask and mtu */ + afs_uint32 outAddrs[]; /* output address array */ + afs_uint32 *mask, *mtu; /* optional mask and mtu */ afs_uint32 maxAddrs; /* max number of addresses */ afs_uint32 *nAddrs; /* number of Addresses in output array */ char reason[]; /* reason for failure */ @@ -107,7 +110,7 @@ int parseNetRestrictFile(outAddrs, mask, mtu, maxAddrs, nAddrs, reason, fileName char line[MAX_NETFILE_LINE]; int lineNo, usedfile; afs_uint32 i, neaddrs, nfaddrs, nOutaddrs; - afs_int32 addr, eAddrs[MAXIPADDRS], eMask[MAXIPADDRS], eMtu[MAXIPADDRS]; + afs_uint32 addr, eAddrs[MAXIPADDRS], eMask[MAXIPADDRS], eMtu[MAXIPADDRS]; assert(outAddrs); assert(reason); @@ -196,17 +199,17 @@ int parseNetRestrictFile(outAddrs, mask, mtu, maxAddrs, nAddrs, reason, fileName */ int ParseNetInfoFile(final, mask, mtu, max, reason, fileName) -afs_int32 *final, *mask, *mtu; +afs_uint32 *final, *mask, *mtu; int max; /* max number of interfaces */ char reason[]; const char *fileName; { - afs_int32 existingAddr[MAXIPADDRS], existingMask[MAXIPADDRS], existingMtu[MAXIPADDRS]; + afs_uint32 existingAddr[MAXIPADDRS], existingMask[MAXIPADDRS], existingMtu[MAXIPADDRS]; char line[MAX_NETFILE_LINE]; FILE* fp; int i, existNu, count = 0; - afs_int32 addr; + afs_uint32 addr; int lineNo=0; int l; @@ -294,13 +297,13 @@ const char *fileName; * entries. */ int filterAddrs(addr1,addr2,mask1,mask2,mtu1,mtu2,n1,n2) -u_long addr1[],addr2[]; -afs_int32 mask1[], mask2[]; -afs_int32 mtu1[], mtu2[]; +afs_uint32 addr1[],addr2[]; +afs_uint32 mask1[], mask2[]; +afs_uint32 mtu1[], mtu2[]; { - u_long taddr[MAXIPADDRS]; - afs_int32 tmask[MAXIPADDRS]; - afs_int32 tmtu[MAXIPADDRS]; + afs_uint32 taddr[MAXIPADDRS]; + afs_uint32 tmask[MAXIPADDRS]; + afs_uint32 tmtu[MAXIPADDRS]; int count=0,i=0,j=0,found=0; assert(addr1); @@ -349,16 +352,16 @@ afs_int32 mtu1[], mtu2[]; * set of IP addresses to use */ int parseNetFiles(addrbuf, maskbuf,mtubuf,max,reason, niFileName, nrFileName) -afs_int32 addrbuf[]; -afs_int32 maskbuf[]; -afs_int32 mtubuf[]; -u_long max; /* Entries in addrbuf, maskbuf and mtubuf */ +afs_uint32 addrbuf[]; +afs_uint32 maskbuf[]; +afs_uint32 mtubuf[]; +afs_uint32 max; /* Entries in addrbuf, maskbuf and mtubuf */ char reason[]; const char *niFileName; const char *nrFileName; { - afs_int32 addrbuf1[MAXIPADDRS],maskbuf1[MAXIPADDRS], mtubuf1[MAXIPADDRS]; - afs_int32 addrbuf2[MAXIPADDRS],maskbuf2[MAXIPADDRS], mtubuf2[MAXIPADDRS]; + afs_uint32 addrbuf1[MAXIPADDRS],maskbuf1[MAXIPADDRS], mtubuf1[MAXIPADDRS]; + afs_uint32 addrbuf2[MAXIPADDRS],maskbuf2[MAXIPADDRS], mtubuf2[MAXIPADDRS]; int nAddrs1=0; afs_uint32 nAddrs2=0; int code,i; diff --git a/src/util/netutils.h b/src/util/netutils.h index 9faedeb17..a7d938f79 100644 --- a/src/util/netutils.h +++ b/src/util/netutils.h @@ -17,9 +17,9 @@ /* Network and IP address utility and file parsing functions */ extern int parseNetRestrictFile( - afs_int32 outAddrs[], - afs_int32 mask[], - afs_int32 mtu[], + afs_uint32 outAddrs[], + afs_uint32 mask[], + afs_uint32 mtu[], afs_uint32 maxAddrs, afs_uint32 *nAddrs, char reason[], @@ -27,16 +27,16 @@ extern int parseNetRestrictFile( ); extern int filterAddrs( - u_long addr1[],u_long addr2[], - afs_int32 mask1[], afs_int32 mask2[], - afs_int32 mtu1[], afs_int32 mtu2[] + afs_uint32 addr1[],afs_uint32 addr2[], + afs_uint32 mask1[], afs_uint32 mask2[], + afs_uint32 mtu1[], afs_uint32 mtu2[] ); extern int parseNetFiles( - afs_int32 addrbuf[], - afs_int32 maskbuf[], - afs_int32 mtubuf[], - u_long max, + afs_uint32 addrbuf[], + afs_uint32 maskbuf[], + afs_uint32 mtubuf[], + afs_uint32 max, char reason[], const char *niFilename, const char *nrFilename diff --git a/src/util/serverLog.c b/src/util/serverLog.c index 3d3ed3e74..079c7d200 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -27,6 +27,7 @@ #endif #include #include +#include #endif #include /* signal(), kill(), wait(), etc. */ #include @@ -60,26 +61,21 @@ static pthread_mutex_t serverLogMutex; #define F_OK 0 #endif -char *threadname(); +char *(*threadNameProgram)(); static int serverLogFD = -1; +#ifndef AFS_NT40_ENV +int serverLogSyslog = 0; +int serverLogSyslogFacility = LOG_DAEMON; +#endif + #include int LogLevel; int mrafsStyleLogs = 0; int printLocks = 0; static char ourName[MAXPATHLEN]; -void WriteLogBuffer(buf,len) - char *buf; - afs_uint32 len; -{ - LOCK_SERVERLOG(); - if (serverLogFD > 0) - write(serverLogFD, buf, len); - UNLOCK_SERVERLOG(); -} - /* VARARGS1 */ void FSLog (const char *format, ...) { @@ -99,7 +95,7 @@ void FSLog (const char *format, ...) info = &timeStamp[25]; if (mrafsStyleLogs) { - name = threadname(); + name = (*threadNameProgram)(); sprintf(info, "[%s] ", name); info += strlen(info); } @@ -110,13 +106,20 @@ void FSLog (const char *format, ...) len = strlen(tbuffer); LOCK_SERVERLOG(); - if (serverLogFD > 0) - write(serverLogFD, tbuffer, len); +#ifndef AFS_NT40_ENV + if ( serverLogSyslog ){ + syslog(LOG_INFO, "%s", info); + } else +#endif + if (serverLogFD > 0) + write(serverLogFD, tbuffer, len); UNLOCK_SERVERLOG(); -#if !defined(AFS_PTHREAD_ENV) - fflush(stdout); - fflush(stderr); /* in case they're sharing the same FD */ +#if !defined(AFS_PTHREAD_ENV) && !defined(AFS_NT40_ENV) + if ( ! serverLogSyslog ) { + fflush(stdout); + fflush(stderr); /* in case they're sharing the same FD */ + } #endif } @@ -189,6 +192,13 @@ int OpenLog(const char *fileName) struct tm *TimeFields; char FileName[MAXPATHLEN]; +#ifndef AFS_NT40_ENV + if ( serverLogSyslog ) { + openlog(NULL, LOG_PID, serverLogSyslogFacility); + return; + } +#endif + if (mrafsStyleLogs) { TM_GetTimeOfDay(&Start, 0); TimeFields = localtime(&Start.tv_sec); @@ -244,6 +254,12 @@ int ReOpenLog(const char *fileName) if (access(fileName, F_OK)==0) return 0; /* exists, no need to reopen. */ +#if !defined(AFS_NT40_ENV) + if ( serverLogSyslog ) { + return 0; + } +#endif + #if defined(AFS_PTHREAD_ENV) LOCK_SERVERLOG(); if (serverLogFD > 0) diff --git a/src/util/snprintf.c b/src/util/snprintf.c index 4141de3e4..0b716f2b8 100644 --- a/src/util/snprintf.c +++ b/src/util/snprintf.c @@ -1,8 +1,7 @@ /* snprintf.c - Formatted, length-limited print to a string */ #include -#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) - +#if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_NT40_ENV) #include #include #include diff --git a/src/util/uuid.c b/src/util/uuid.c index fa2a4a6bd..c73fe3ed7 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -294,7 +294,8 @@ void uuid__get_os_time (uuid_time_t *os_time) char hostName1[128] = "localhost"; static int uuid_get_address (uuid_address_p_t addr) { - afs_int32 code, addr1; + afs_int32 code; + afs_uint32 addr1; struct hostent *he; code = gethostname(hostName1, 64); diff --git a/src/util/vice.h b/src/util/vice.h index 4cd72deb2..d28e4b62e 100644 --- a/src/util/vice.h +++ b/src/util/vice.h @@ -62,7 +62,7 @@ struct ViceIoctl { * version of _IOW() to check the size of user space arguments -- except * on Digital Unix. */ -#if defined(KERNEL) && !defined(AFS_OSF_ENV) +#if defined(KERNEL) && !defined(AFS_OSF_ENV) && !defined(AFS_ALPHA_LINUX20_ENV) #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl32)) #else #define _VICEIOCTL(id) ((unsigned int ) _IOW('V', id, struct ViceIoctl)) diff --git a/src/venus/fs.c b/src/venus/fs.c index 2f92a09fc..9de42c6d0 100644 --- a/src/venus/fs.c +++ b/src/venus/fs.c @@ -3045,6 +3045,8 @@ defect 3069 ts = cmd_CreateSyntax("setcrypt", SetCryptCmd, 0, "set cache manager encryption flag"); cmd_AddParm(ts, "-crypt", CMD_SINGLE, 0, "on or off"); + ts = cmd_CreateSyntax("getcrypt", GetCryptCmd, 0, "set cache manager encryption flag"); + ts = cmd_CreateSyntax("rxstatproc", RxStatProcCmd, 0, "Manage per process RX statistics"); cmd_AddParm(ts, "-enable", CMD_FLAG, CMD_OPTIONAL, diff --git a/src/venus/up.c b/src/venus/up.c index f1bc646ec..de2491826 100644 --- a/src/venus/up.c +++ b/src/venus/up.c @@ -42,7 +42,7 @@ extern char *index (); extern char *rindex (); -#ifndef AFS_LINUX20_ENV +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) extern sys_nerr; extern char *sys_errlist[]; #endif diff --git a/src/vfsck/Makefile b/src/vfsck/Makefile index a040798ba..fd97f8213 100644 --- a/src/vfsck/Makefile +++ b/src/vfsck/Makefile @@ -19,7 +19,6 @@ COMPONENT=vfsck include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install CFLAGS= ${DBUG} -w -I${SRCDIR}include ${XCFLAGS} LIBC= /lib/libc.a SRCS= dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \ @@ -44,7 +43,7 @@ ${OBJS}: ${SRCS} ${CC} -o vfsck -I/usr/old/usr/include ${DBUG} -w -I${SRCDIR}include ${SRCS} ${NON_SHARED} +DA1.0 -Wl,-a,archive -D_FILE64 \ ;; \ hp?00_ux101 | hp_ux10? ) \ - ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS} -D_FILE64\ + ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS} -D_FILE64\ ;; \ * ) \ ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS}\ diff --git a/src/viced/Makefile b/src/viced/Makefile index e17d1d34f..d9f42f7e0 100644 --- a/src/viced/Makefile +++ b/src/viced/Makefile @@ -10,7 +10,6 @@ COMPONENT=viced include ../config/Makefile.${SYS_NAME} DBUG = -g -INSTALL = ${SRCDIR}bin/install CFLAGS = -DNINTERFACE ${DBUG} -I. -I${SRCDIR}include -I${SRCDIR}include/afs \ ${XCFLAGS} ${DBG_DEFS} -DRXDEBUG LDFLAGS = ${DBUG} ${XLDFLAGS} @@ -70,7 +69,7 @@ viced.o: AFS_component_version_number.o check_sysid: check_sysid.c ${CC} ${CFLAGS} -IDEST/include -o check_sysid check_sysid.c -fileserver: callback_clean1 viced.o ${objects} ${headers} ${LIBS} +fileserver: viced.o ${objects} ${headers} ${LIBS} set -x; \ case ${SYS_NAME} in \ *linux*) \ @@ -84,10 +83,17 @@ fileserver: callback_clean1 viced.o ${objects} ${headers} ${LIBS} ${auditlib} ${LIBS} ${XLIBS} ;; \ esac -fsprobe: fsprobe.c AFS_component_version_number.c - ${CC} ${CFLAGS} -DINTERPRET_DUMP -o fsprobe fsprobe.c ${LIBS} ${XLIBS} -cbd: callback_clean2 callback.c AFS_component_version_number.c - ${CC} ${CFLAGS} -DINTERPRET_DUMP -o cbd callback.c ${LIBS} ${XLIBS} +fsprobe.o: fsprobe.c AFS_component_version_number.c + ${CC} ${CFLAGS} -DINTERPRET_DUMP -c fsprobe.c + +fsprobe: fsprobe.o + ${CC} ${CFLAGS} -o fsprobe fsprobe.o ${LIBS} ${XLIBS} + +cbd.o: callback.c AFS_component_version_number.c + ${CC} ${CFLAGS} -DINTERPRET_DUMP -c -o cbd.o callback.c + +cbd: cbd.o + ${CC} ${CFLAGS} -DINTERPRET_DUMP -o cbd cbd.o ${LIBS} ${XLIBS} lint: lint -uvn -I${SRCDIR}include viced.c afsfileprocs.c host.c physio.c callback.c ${SRCDIR}lib/afs/llib-lutil.ln @@ -106,13 +112,6 @@ install: all ${DESTDIR}root.server/usr/afs/bin/fileserver system: install -callback_clean1 callback_clean2: - case ${SYS_NAME} in \ - ncrx86_*) \ - ${RM} -f callback.o;\ - echo ${RM} callback.o;;\ - esac; - clean: rm -f *.o llib-lvice.ln fileserver core AFS_component_version_number.c diff --git a/src/viced/afsfileprocs.c b/src/viced/afsfileprocs.c index d92e55b37..9bfb3951e 100644 --- a/src/viced/afsfileprocs.c +++ b/src/viced/afsfileprocs.c @@ -74,7 +74,7 @@ #include #include #include -#if ! defined(AFS_SGI_ENV) && ! defined(AFS_AIX32_ENV) && ! defined(AFS_NT40_ENV) && ! defined(AFS_LINUX20_ENV) +#if ! defined(AFS_SGI_ENV) && ! defined(AFS_AIX32_ENV) && ! defined(AFS_NT40_ENV) && ! defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #include #endif #if !defined(AFS_NT40_ENV) @@ -85,7 +85,7 @@ #include #include #else -#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) #include #endif #endif @@ -314,7 +314,18 @@ retry: else if (thost->hostFlags & VENUSDOWN) { if (BreakDelayedCallBacks_r(thost)) { ViceLog(0,("BreakDelayedCallbacks FAILED for host %08x which IS UP. Possible network or routing failure.\n",thost->host)); - code = -1; + if ( MultiProbeAlternateAddress_r (thost) ) { + ViceLog(0, ("MultiProbe failed to find new address for host %x.%d\n", + thost->host, thost->port)); + code = -1; + } else { + ViceLog(0, ("MultiProbe found new address for host %x.%d\n", + thost->host, thost->port)); + if (BreakDelayedCallBacks_r(thost)) { + ViceLog(0,("BreakDelayedCallbacks FAILED AGAIN for host %08x which IS UP. Possible network or routing failure.\n",thost->host)); + code = -1; + } + } } } else { code = 0; diff --git a/src/viced/callback.c b/src/viced/callback.c index 23a637e53..c197140ac 100644 --- a/src/viced/callback.c +++ b/src/viced/callback.c @@ -141,7 +141,7 @@ struct FileEntry { u_short ncbs; u_short firstcb; u_short spare; -#ifdef AFS_ALPHA_ENV +#if defined(AFS_ALPHA_ENV) || defined(AFS_ALPHA_LINUX20_ENV) u_short spare1; u_short spare2; #endif diff --git a/src/viced/viced.c b/src/viced/viced.c index add63db5c..06bfa9f2c 100644 --- a/src/viced/viced.c +++ b/src/viced/viced.c @@ -563,8 +563,8 @@ main(argc, argv) assert(pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED) == 0); /* Block signals in the threads */ AFS_SIGSET_CLEAR(); - assert(pthread_create(&serverPid, &tattr, FiveMinuteCheckLWP, &fiveminutes) == 0); - assert(pthread_create(&serverPid, &tattr, HostCheckLWP, &fiveminutes) == 0); + assert(pthread_create(&serverPid, &tattr, (void *)FiveMinuteCheckLWP, &fiveminutes) == 0); + assert(pthread_create(&serverPid, &tattr, (void *)HostCheckLWP, &fiveminutes) == 0); AFS_SIGSET_RESTORE(); #else /* AFS_PTHREAD_ENV */ assert(LWP_CreateProcess(FiveMinuteCheckLWP, stack*1024, LWP_MAX_PRIORITY - 2, @@ -1177,6 +1177,18 @@ static ParseArgs(argc, argv) if (!strcmp(argv[i], "-enable_process_stats")) { rx_enableProcessRPCStats(); } +#ifndef AFS_NT40_ENV + else + if (strcmp(argv[i], "-syslog")==0) { + /* set syslog logging flag */ + serverLogSyslog = 1; + } + else + if (strncmp(argv[i], "-syslog=", 8)==0) { + serverLogSyslog = 1; + serverLogSyslogFacility = atoi(argv[i]+8); + } +#endif else { return(-1); } diff --git a/src/vlserver/Makefile b/src/vlserver/Makefile index c1caf2326..aefc0a786 100644 --- a/src/vlserver/Makefile +++ b/src/vlserver/Makefile @@ -12,7 +12,6 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1 KERNELDIR=../libafs/ UKERNELDIR=../libuafs/ -INSTALL=${SRCDIR}bin/install COMPILE_ET = ${SRCDIR}bin/compile_et CFLAGS = ${DBUG} -I. -I.. -I${SRCDIR}include ${XCFLAGS} diff --git a/src/vlserver/vlserver.c b/src/vlserver/vlserver.c index 6f17df50d..2ca67961c 100644 --- a/src/vlserver/vlserver.c +++ b/src/vlserver/vlserver.c @@ -164,9 +164,20 @@ char **argv; rx_enablePeerRPCStats(); } else if (strcmp(argv[index], "-enable_process_stats") == 0) { rx_enableProcessRPCStats(); +#ifndef AFS_NT40_ENV + } else if (strcmp(argv[index], "-syslog")==0) { + /* set syslog logging flag */ + serverLogSyslog = 1; + } else if (strncmp(argv[index], "-syslog=", 8)==0) { + serverLogSyslog = 1; + serverLogSyslogFacility = atoi(argv[index]+8); +#endif } else { /* support help flag */ printf("Usage: vlserver [-p ] [-nojumbo] " +#ifndef AFS_NT40_ENV + "[-syslog[=FACILITY]] " +#endif /*" [-enable_peer_stats] [-enable_process_stats] " */ "[-help]\n"); fflush(stdout); diff --git a/src/vol/Makefile b/src/vol/Makefile index 711de2b77..72592096e 100644 --- a/src/vol/Makefile +++ b/src/vol/Makefile @@ -11,7 +11,6 @@ include ../config/Makefile.${SYS_NAME} include ../config/Makefile.version INCDIRS= -I. -I${DESTDIR}include ${FSINCLUDES} -INSTALL = ${SRCDIR}bin/install LDFLAGS = ${OPTMZ} ${PROF} ${LDIRS} ${XLDFLAGS} LIBS= ${DESTDIR}lib/afs/libcmd.a vlib.a ${SRCDIR}lib/afs/util.a \ @@ -77,14 +76,7 @@ vlib.a: ${VLIBOBJS} AFS_component_version_number.o # new salvager: remove references to /vice by linking with novice.o salvager: vol-salvage.o physio.o vlib.a - case ${SYS_NAME} in \ - *linux* ) \ - ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \ - ${LIBS} ;; \ - *) \ - ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \ - ${LIBS};; \ - esac + ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o ${LIBS} vol-salvage: vol-salvage.o vol-info: vol-info.o physio.o ihandle.o @@ -100,7 +92,7 @@ listinodes.o: listinodes.c AFS_component_version_number.c gi: ${DESTDIR}/lib/afs/libsys.a case ${SYS_NAME} in \ - *linux* | sgi_* ) \ + *linux* | sgi_* | *fbsd* ) \ echo "Don't build gi on ${SYS_NAME}";; \ *) \ ${CC} ${CFLAGS} -c gi.c ; \ diff --git a/src/vol/devname.c b/src/vol/devname.c index 1dc430911..3af8874fa 100644 --- a/src/vol/devname.c +++ b/src/vol/devname.c @@ -21,10 +21,15 @@ #ifdef AFS_SUN5_ENV #include #else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#include +#include +#else #include #endif +#endif #else /* AFS_VFSINCL_ENV */ -#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX22_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_FBSD_ENV) #include #endif #endif /* AFS_VFSINCL_ENV */ diff --git a/src/vol/listinodes.c b/src/vol/listinodes.c index 8e9bf01a6..5222b8c1b 100644 --- a/src/vol/listinodes.c +++ b/src/vol/listinodes.c @@ -10,6 +10,7 @@ #ifndef lint #endif /* + System: VICE-TWO Module: listinodes.c Institution: The Information Technology Center, Carnegie-Mellon University @@ -49,8 +50,14 @@ int *forcep, forceR; #ifdef AFS_SUN5_ENV #include #else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#include +#include +#define itod ino_to_fsba +#else #include #endif +#endif #else /* AFS_VFSINCL_ENV */ #ifdef AFS_AIX_ENV #include @@ -65,8 +72,10 @@ int *forcep, forceR; #ifdef AFS_SUN5_ENV #include #else +#if defined(AFS_DARWIN_ENV) #include #endif +#endif #else /* AFS_VFSINCL_ENV */ #ifdef AFS_DEC_ENV #include @@ -1243,7 +1252,7 @@ int ListViceInodes(devname, mountedOn, resultFile, judgeInode, judgeParam, force if ( (super.fs.fs_magic != FS_MAGIC) || (super.fs.fs_ncg < 1) -#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) +#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) || (super.fs.fs_cpg < 1) #else || (super.fs.fs_cpg < 1 || super.fs.fs_cpg > MAXCPG) @@ -1279,8 +1288,12 @@ int ListViceInodes(devname, mountedOn, resultFile, judgeInode, judgeParam, force #else for (c = 0; c < super.fs.fs_ncg; c++) { daddr_t dblk1; -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) daddr_t f1; +#if defined(AFS_DARWIN_ENV) +#define offset_t off_t +#define llseek lseek +#endif offset_t off; #endif /* AFS_SUN5_ENV */ i = c*super.fs.fs_ipg; e = i+super.fs.fs_ipg; @@ -1288,7 +1301,7 @@ int ListViceInodes(devname, mountedOn, resultFile, judgeInode, judgeParam, force dblk1 = fsbtodb(&super.fs, itod(&super.fs, i)); if (lseek(pfd, (off_t) ((off_t)dblk1 * DEV_BSIZE), L_SET) == -1) { #else -#ifdef AFS_SUN5_ENV +#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) f1 = fsbtodb(&super.fs,itod(&super.fs,i)); off = (offset_t)f1 << DEV_BSHIFT; if (llseek(pfd, off, L_SET) == -1) { @@ -1445,6 +1458,11 @@ out1: #endif /* !AFS_SGI_ENV */ #endif /* !AFS_AIX31_ENV */ +#ifdef AFS_DARWIN_ENV +#undef dbtob +#define dbtob(db) ((unsigned)(db) << DEV_BSHIFT) +#endif + int bread(fd, buf, blk, size) int fd; char *buf; diff --git a/src/vol/namei_ops.c b/src/vol/namei_ops.c index 3432719e2..4694ed363 100644 --- a/src/vol/namei_ops.c +++ b/src/vol/namei_ops.c @@ -22,6 +22,12 @@ #include #include #include +#ifdef AFS_AIX_ENV +#include +#endif +#ifdef AFS_SUN5_ENV +#include +#endif #include #include #include "nfs.h" @@ -805,7 +811,11 @@ int namei_GetLinkCount(FdHandle_t *h, Inode ino, int lockit) namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); if (lockit) { +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + if (lockf(h->fd_fd, F_LOCK, 0) < 0) +#else if (flock(h->fd_fd, LOCK_EX)<0) +#endif return -1; } @@ -820,7 +830,11 @@ int namei_GetLinkCount(FdHandle_t *h, Inode ino, int lockit) bad_getLinkByte: if (lockit) +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(h->fd_fd, F_ULOCK, 0); +#else flock(h->fd_fd, LOCK_UN); +#endif return -1; } @@ -840,7 +854,11 @@ static int GetFreeTag(IHandle_t *ih, int vno) return -1; /* Only one manipulates at a time. */ +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { +#else if (flock(fdP->fd_fd, LOCK_EX)<0) { +#endif FDH_REALLYCLOSE(fdP); return -1; } @@ -858,11 +876,10 @@ static int GetFreeTag(IHandle_t *ih, int vno) } /* Now find a free column in this row and claim it. */ - coldata = 0x7; for (col = 0; col= NAMEI_MAXVOLS) goto badGetFreeTag; @@ -877,12 +894,20 @@ static int GetFreeTag(IHandle_t *ih, int vno) goto badGetFreeTag; } FDH_SYNC(fdP); +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(fdP->fd_fd, F_ULOCK, 0); +#else flock(fdP->fd_fd, LOCK_UN); +#endif FDH_REALLYCLOSE(fdP); return col;; badGetFreeTag: +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(fdP->fd_fd, F_ULOCK, 0); +#else flock(fdP->fd_fd, LOCK_UN); +#endif FDH_REALLYCLOSE(fdP); return -1; } @@ -902,9 +927,12 @@ int namei_SetLinkCount(FdHandle_t *fdP, Inode ino, int count, int locked) namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index); - if (!locked) { +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) { +#else if (flock(fdP->fd_fd, LOCK_EX)<0) { +#endif return -1; } } @@ -943,7 +971,11 @@ int namei_SetLinkCount(FdHandle_t *fdP, Inode ino, int count, int locked) bad_SetLinkCount: +#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) + lockf(fdP->fd_fd, F_ULOCK, 0); +#else flock(fdP->fd_fd, LOCK_UN); +#endif return code; } diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index 65a26f7b3..770f06d2d 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -58,6 +58,9 @@ int DumpVnodes = 0; /* Dump everything, i.e. summary of all vnodes */ int DumpInodeNumber = 0; /* Dump inode numbers with vnodes */ int DumpDate = 0; /* Dump vnode date (server modify date) with vnode */ int InodeTimes = 0; /* Dump some of the dates associated with inodes */ +#if defined(AFS_NAMEI_ENV) +int PrintFileNames = 0; +#endif int online = 0; int dheader=0; int dsizeOnly = 0, totvolsize=0, Vauxsize = 0, Vdiskused = 0, Vvnodesize = 0; @@ -74,8 +77,13 @@ void HandleVolume(struct DiskPartition *partP, char *name); struct DiskPartition *FindCurrentPartition(void); Volume *AttachVolume(struct DiskPartition *dp, char *volname, register struct VolumeHeader *header); +#if defined(AFS_NAMEI_ENV) +void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, + Inode ino, Volume* vp); +#else void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, Inode ino); +#endif void PrintVnodes(Volume *vp, VnodeClass class); char *date(time_t date) @@ -256,6 +264,12 @@ static int handleit(struct cmd_syndesc *as) orphaned = 1; DumpVnodes = 1; } else +#if defined(AFS_NAMEI_ENV) + if (as->parms[12].items) { + PrintFileNames = 1; + DumpVnodes = 1; + } else +#endif orphaned = 0; DInit(10); @@ -593,6 +607,9 @@ char **argv; cmd_AddParm(ts, "-fixheader", CMD_FLAG, CMD_OPTIONAL, "Try to fix header"); cmd_AddParm(ts, "-saveinodes", CMD_FLAG, CMD_OPTIONAL, "Try to save all inodes"); cmd_AddParm(ts, "-orphaned", CMD_FLAG, CMD_OPTIONAL, "List all dir/files without a parent"); +#if defined(AFS_NAMEI_ENV) + cmd_AddParm(ts, "-filenames", CMD_FLAG, CMD_OPTIONAL, "Print filenames"); +#endif code = cmd_Dispatch(argc, argv); return code; } @@ -769,16 +786,33 @@ void PrintVnodes(Volume *vp, VnodeClass class) ino, nfile, total); } } else { +#if defined(AFS_NAMEI_ENV) + PrintVnode(offset, vnode, + bitNumberToVnodeNumber(vnodeIndex, class), ino, vp); +#else PrintVnode(offset, vnode, bitNumberToVnodeNumber(vnodeIndex, class), ino); +#endif } } STREAM_CLOSE(file); FDH_CLOSE(fdP); } +#if defined(AFS_NAMEI_ENV) +void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, Inode ino, Volume *vp) +#else void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, Inode ino) +#endif { +#if defined(AFS_NAMEI_ENV) + IHandle_t *ihtmpp; +#if !defined(AFS_NT40_ENV) + namei_t filename; +#else + char filename[MAX_PATH]; +#endif +#endif Vvnodesize += vnode->length; if (dsizeOnly) return; if (orphaned && (vnode->length ==0 || vnode->parent || !offset)) return; @@ -788,5 +822,17 @@ void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, Inode ino) printf(" inode: %s", PrintInode(NULL, ino)); if (DumpDate) printf(" ServerModTime: %s", date(vnode->serverModifyTime)); +#if defined(AFS_NAMEI_ENV) + if(PrintFileNames) { + IH_INIT(ihtmpp, V_device(vp), V_parentId(vp), ino); +#if !defined(AFS_NT40_ENV) + namei_HandleToName(&filename, ihtmpp); + printf(" UFS-Filename: %s",filename.n_path); +#else + nt_HandleToName(filename, ihtmpp); + printf(" NTFS-Filename: %s",filename); +#endif + } +#endif printf("\n"); } diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 1d8a25d14..5bed33b0e 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -120,13 +120,18 @@ Vnodes with 0 inode pointers in RW volumes are now deleted. #ifdef AFS_SUN5_ENV #include #else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#include +#include +#else #include #endif +#endif #else /* AFS_VFSINCL_ENV */ #ifdef AFS_OSF_ENV #include #else /* AFS_OSF_ENV */ -#ifndef AFS_LINUX20_ENV +#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) #include #endif #endif @@ -166,6 +171,9 @@ Vnodes with 0 inode pointers in RW volumes are now deleted. #include #include #include /* signal(), kill(), wait(), etc. */ +#ifndef AFS_NT40_ENV +#include +#endif #include "nfs.h" #include "lwp.h" @@ -207,6 +215,12 @@ int ShowSuid = 0; /* -showsuid flag */ int ShowMounts = 0; /* -showmounts flag */ int orphans = ORPH_IGNORE; /* -orphans option */ int Showmode = 0; + +#ifndef AFS_NT40_ENV +int useSyslog = 0; /* -syslog flag */ +int useSyslogFacility = LOG_DAEMON; /* -syslogfacility option */ +#endif + #define MAXPARALLEL 32 int OKToZap; /* -o flag */ @@ -547,8 +561,19 @@ static handleit(as) orphans = ORPH_ATTACH; } +#ifndef AFS_NT40_ENV /* ignore options on NT */ + if ( ti = as->parms[16].items) { /* -syslog */ + useSyslog = 1; + ShowLog = 0; + } + if ( ti = as->parms[17].items) { /* -syslogfacility */ + useSyslogFacility = atoi(ti->data); + } +#endif + + #ifdef FAST_RESTART - if (ti = as->parms[16].items) { /* -DontSalvage */ + if (ti = as->parms[18].items) { /* -DontSalvage */ printf("Exiting immediately without salvage. Look into the FileLog"); printf(" to find volumes which really need to be salvaged!\n"); Exit(0); @@ -721,6 +746,12 @@ char **argv; 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"); + + /* note - syslog isn't avail on NT, but if we make it conditional, have + to deal with screwy offsets for cmd params */ + cmd_AddParm(ts, "-syslog", CMD_FLAG, CMD_OPTIONAL, "Write salvage log to syslogs"); + cmd_AddParm(ts, "-syslogfacility", CMD_SINGLE, CMD_OPTIONAL, "Syslog facility number to use"); + #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 */ @@ -745,7 +776,11 @@ void ObtainSalvageLock(void) #else salvageLock = open(AFSDIR_SERVER_SLVGLOCK_FILEPATH, O_CREAT|O_RDWR, 0666); assert(salvageLock >= 0); +#ifdef AFS_DARWIN_ENV + if (flock(salvageLock, LOCK_EX) == -1) { +#else if (lockf(salvageLock, F_LOCK, 0) == -1) { +#endif fprintf(stderr, "salvager: There appears to be another salvager running! Aborted.\n"); Exit(1); @@ -1001,8 +1036,15 @@ void SalvageFileSysParallel(struct DiskPartition *partP) ShowLog = 0; for (fd =0; fd < 16; fd++) close(fd); open("/", 0); dup2(0, 1); dup2(0, 2); - sprintf(logFileName, "%s.%d", AFSDIR_SERVER_SLVGLOG_FILEPATH, jobs[startjob]->jobnumb); - logFile = fopen(logFileName, "w"); +#ifndef AFS_NT40_ENV + if ( useSyslog ) { + openlog(NULL, LOG_PID, useSyslogFacility); + } else +#endif + { + sprintf(logFileName, "%s.%d", AFSDIR_SERVER_SLVGLOG_FILEPATH, jobs[startjob]->jobnumb); + logFile = fopen(logFileName, "w"); + } if (!logFile) logFile = stdout; SalvageFileSys1(jobs[startjob]->partP, 0); @@ -1013,6 +1055,9 @@ void SalvageFileSysParallel(struct DiskPartition *partP) } /* while ( thisjob || (!partP && numjobs > 0) ) */ /* If waited for all jobs to complete, now collect log files and return */ +#ifndef AFS_NT40_ENV + if ( ! useSyslog ) /* if syslogging - no need to collect */ +#endif if (!partP) { for (i=0; i #else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) +#include +#include +#else #include #endif +#endif #else /* AFS_VFSINCL_ENV */ -#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV) #include #endif #endif /* AFS_VFSINCL_ENV */ diff --git a/src/volser/Makefile b/src/volser/Makefile index 95b909c6a..fb63eb63a 100644 --- a/src/volser/Makefile +++ b/src/volser/Makefile @@ -9,8 +9,6 @@ SHELL=/bin/sh COMPONENT=volser include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install - COMPILE_ET=${SRCDIR}bin/compile_et CFLAGS=${DBG} ${OPTMZ} -I${SRCDIR}include ${XCFLAGS} ${DBG_DEFS} LDFLAGS=${DBG} ${OPTMZ} ${XLDFLAGS} diff --git a/src/volser/vsutils.c b/src/volser/vsutils.c index eff6a0223..0c0a33a50 100644 --- a/src/volser/vsutils.c +++ b/src/volser/vsutils.c @@ -359,7 +359,7 @@ afs_int32 subik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9, } } } -#endif notdef +#endif /* notdef */ /* diff --git a/src/xstat/Makefile b/src/xstat/Makefile index d481018fd..5d487b6a8 100644 --- a/src/xstat/Makefile +++ b/src/xstat/Makefile @@ -10,7 +10,6 @@ SHELL = /bin/sh COMPONENT=xstat include ../config/Makefile.${SYS_NAME} -INSTALL=${SRCDIR}bin/install CFLAGS= ${DBUG} -I. \ -I${SRCDIR}include \