which included commits to RCS files with non-trunk default branches.
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.
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:
extern int RXAFSCB_ExecuteRequest();
extern int RXSTATS_ExecuteRequest();
+extern afs_int32 cryptall;
+
char AFSConfigKeyName[] =
"SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
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 */
long RDRtimeout = CM_CONN_DEFAULTRDRTIMEOUT;
+afs_int32 cryptall = 0;
+
void cm_PutConn(cm_conn_t *connp)
{
lock_ObtainWrite(&cm_connLock);
int serviceID;
int secIndex;
struct rx_securityClass *secObjp;
+ afs_int32 level;
if (serverp->type == CM_SERVER_VLDB) {
port = htons(7003);
}
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);
}
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);
}
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 */
osi_mutex_t cm_Afsdsbmt_Lock;
+extern afs_int32 cryptall;
+
void cm_InitIoctl(void)
{
lock_InitializeMutex(&cm_Afsdsbmt_Lock, "AFSDSBMT.INI Access Lock");
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;
+}
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__ */
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; {
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");
#define VIOC_DELSYMLINK 0x25
#define VIOC_MAKESUBMOUNT 0x26
+#define VIOC_GETRXKCRYPT 0x27
+#define VIOC_SETRXKCRYPT 0x28
+
#endif /* __SMB_IOCONS_H_ENV_ */
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 */
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);
(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]);
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
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
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)
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;
}
#include "../afs/afs_stats.h" /* statistics stuff */
#include <ufs/ufsmount.h>
+/* 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;
}
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;
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];
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)
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;
/* 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
AFS_GLOCK();
AFS_STATCNT(afs_unmount);
- if (!suser())
+ if (!suser()) {
+ AFS_GUNLOCK();
return;
+ }
afs_globalVFS = 0;
afs_globalVp = 0;
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;
}
*/
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.
*/
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
}
# directory or online at http://www.openafs.org/dl/license10.html
SHELL=/bin/sh
-INSTALL = ${SRCDIR}bin/install
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
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)
${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 ;; \
{
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);
}
}
#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;
struct vnode *vp;
struct fs *fs;
struct inode *pip;
+ struct ufsvfs *ufsvfsp;
AFS_STATCNT(getinode);
) {
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;
}
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);
}
struct inode *ip, *newip;
register int code;
dev_t newdev;
+ struct ufsvfs *ufsvfsp;
AFS_STATCNT(afs_syscall_icreate);
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;
*/
if (CrSync)
(*ufs_iupdatp)(newip, 1);
+ AFS_ITIMES(newip);
rw_exit(&newip->i_contents);
- (*ufs_iputp)(newip);
+ VN_RELE(ITOV(newip));
return (code);
}
}
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);
}
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) {
/* 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);
}
/*
* 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;
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");
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);
* 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 */
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);
#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;
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;
#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)
(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 */
*/
#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 */
#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
#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)
#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)
#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 */
}
#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)
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
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) {
#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;
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;
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
#endif
#endif
#endif
+#endif
#endif
auio->afsio_offset += avc->quick.minLoc;
osi_UFSClose(tfile);
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
#endif
#endif
#endif
+#endif
#ifdef IHINT
if (!tdc->ihint && nihints < maxIHint) {
-#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
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];
*/
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;
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. */
#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
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. */
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 */
* 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,
if (noLock && ((aio & IO_SYNC) | (auio->uio_fpflags & FSYNCIO))) {
#else
if (noLock && (aio & FSYNC)) {
+#endif
#endif
if (!AFS_NFSXLATORREQ(acred))
afs_fsync(avc, acred);
-#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)
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#ifndef UKERNEL
-#ifndef AFS_LINUX20_ENV
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
#include <net/if.h>
#include <netinet/in.h>
#endif
#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 <netinet/in_var.h>
#endif
#endif /* !UKERNEL */
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
) {
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)) {
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();
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
/* 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;
#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
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 */
#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);
#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);
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)
#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);
}
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
#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 */
}
#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.
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)
{
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)
#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)
{
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) */
#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);
* 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;
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;
}
/* 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);
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
#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;
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
#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 */
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);
#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.
*/
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);
vcache2inode(tvc);
#endif
ReleaseWriteLock(&tvc->lock);
+#ifdef AFS_DARWIN_ENV
+ osi_VM_Setup(tvc);
+#endif
return tvc;
}
}
ReleaseWriteLock(&tvc->lock);
+#ifdef AFS_DARWIN_ENV
+ osi_VM_Setup(avc);
+#endif
return tvc;
} /*afs_GetVCache*/
afs_ProcessFS(tvc, &OutStatus, areq);
ReleaseWriteLock(&tvc->lock);
+#ifdef AFS_DARWIN_ENV
+ osi_VM_Setup(tvc);
+#endif
return tvc;
}
return code;
}
+#if 0
/*
* afs_StuffVcache
*
*/
afs_PutVCache(tvc, WRITE_LOCK);
} /*afs_StuffVcache*/
+#endif
/*
* afs_PutVCache
#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*/
#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
#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 */
#include <linux/errno.h>
#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"
#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"
# 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 <sys/uio.h>
+# include <sys/mount.h>
+# include <sys/namei.h>
+# include <sys/vnode.h>
+# include <sys/queue.h>
+#ifndef AFS_FBSD_ENV
+# include <sys/ubc.h>
+#define timeout_fcn_t mach_timeout_fcn_t
+# include <kern/sched_prim.h>
+#else
+# include <ufs/ufs/dinode.h>
+# include <vm/vm.h>
+# include <vm/vm_extern.h>
+# include <vm/pmap.h>
+# include <vm/vm_map.h>
+# include <sys/lock.h>
+#endif
+#undef timeout_fcn_t
+#define _DIR_H_
+#define doff_t int32_t
+# include <ufs/ufs/quota.h>
+# include <ufs/ufs/inode.h>
+# include <ufs/ffs/fs.h>
+#else
# include "../h/vfs.h"
# include "../h/vnode.h"
# ifdef AFS_SUN5_ENV
# 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 */
/* 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"
#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
#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 <sys/mount.h>
#else
#include <sys/vfs.h>
#if AFS_HAVE_STATVFS
#include <sys/statvfs.h>
#else
-#if !defined(AFS_OSF_ENV)
+#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
#include <sys/statfs.h>
#endif
#endif
}
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.
#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
#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
#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);
COMPONENT=afsmonitor
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
-
CFLAGS=-g -I. \
-I${SRCDIR}include \
-I${SRCDIR}include/afs \
}
/* 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
/* 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
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
${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
#include "adkint.h"
#include "assert.h"
-#include <permit_xprt.h>
#include <des.h>
#include <afs/afsutil.h>
UKERNELDIR = ../libuafs/
LOCALDIR = ${DESTDIR}root.server/usr/afs/local/
-INSTALL = ${SRCDIR}bin/install
audobjs = audit.o
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
#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
* 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"
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;
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
static DoStat();
#include "bosint.h"
-#include "../permit_xprt.h"
#define MRAFS_OFFSET 9
#define ADDPARMOFFSET 26
#else
#include <unistd.h>
#include <netinet/in.h>
+#include <syslog.h>
#endif /* AFS_NT40_ENV */
#include <afs/cellconfig.h>
#include <rx/rx.h>
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;
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;
/* 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();
}
/* 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);
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 ();
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);
}
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}
COMPONENT=bubasics
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
RXGEN=${SRCDIR}bin/rxgen
COMPILE_ET = ${SRCDIR}bin/compile_et
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}
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);
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];
COMPONENT=budb
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
RXGEN=${SRCDIR}bin/rxgen
{
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);
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
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;
/* 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,
SHELL = /bin/sh
SRCDIR=DEST/
DESTDIR=DEST/
-INSTALL=${SRCDIR}bin/install
CFLAGS = -g -w -I${SRCDIR}include ${XCFLAGS}
LDFLAGS = -g ${XLDFLAGS}
COMPONENT=cmd
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
INCLS=cmd.h ${XINCLS}
}
}
-static AproposProc(as, arock)
+static int AproposProc(as, arock)
char *arock;
register struct cmd_syndesc *as; {
register struct cmd_syndesc *ts;
return 0;
}
-static HelpProc(as, arock)
+static int HelpProc(as, arock)
char *arock;
register struct cmd_syndesc *as; {
register struct cmd_syndesc *ts;
return(code);
}
-cmd_SetBeforeProc(aproc, arock)
+int cmd_SetBeforeProc(aproc, arock)
int (*aproc)();
char *arock; {
beforeProc = aproc;
return 0;
}
-cmd_SetAfterProc(aproc, arock)
+int cmd_SetAfterProc(aproc, arock)
int (*aproc)();
char *arock; {
afterProc = aproc;
}
/* thread on list in alphabetical order */
-static SortSyntax(as)
+static int SortSyntax(as)
struct cmd_syndesc *as; {
register struct cmd_syndesc **ld, *ud;
}
/* 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;
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;
}
}
/* 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;
}
/* 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;
} /*InsertInitOpcode*/
-static NoParmsOK(as)
+static int NoParmsOK(as)
register struct cmd_syndesc *as; {
register int i;
register struct cmd_parmdesc *td;
}
/* 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;
{
}
/* 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) {
}
/* 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)
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;
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;
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;
char *helpp
);
-extern cmd_SetBeforeProc(
+extern int cmd_SetBeforeProc(
int (*aproc)(),
char *arock
);
-extern cmd_SetAfterProc(
+extern int cmd_SetAfterProc(
int (*aproc)(),
char *arock
);
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,
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 \
${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) $? $@
${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)
${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.
#
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
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 \
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
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
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
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
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
#
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
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
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
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
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
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
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
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
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
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
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
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
LD = /usr/ccs/bin/ld
LORDER = /usr/ccs/bin/lorder
STRIP= /usr/ccs/bin/strip
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
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
$(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
#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
#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
#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];
#include <sys/types.h>
#include <sys/file.h>
#include <stdio.h>
-
-#if defined(__alpha)
-extern void *malloc(int size);
-#endif
+#include <stdlib.h>
#define TOK_DONTUSE 1 /* Don't copy if match and this flag is set. */
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) {
}
#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;
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) {
}
/* 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; {
}
}
}
-mc_copy(ain, aout, alist)
+
+int mc_copy(ain, aout, alist)
register FILE *ain;
register FILE *aout;
char *alist[]; {
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
+#ifndef __APPLE_CC__
#include <malloc.h>
+#endif
#include <assert.h>
#include <string.h>
#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 <afs/afs_sysnames.h>
#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 <afs/afs_sysnames.h>
COMPONENT= dauth
include ../config/Makefile.${SYS_NAME}
-INSTALL= ${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
OPTMZ= -g
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
dlog_test: dlog.c $(OBJS) $(LIBS)
$(CC) $(LDFLAGS) -DDLOG_TEST -o dlog_test dlog.c $(OBJS) \
$(LIBS) ${XLIBS}
-
+
system: install
${DESTDIR}bin/dlog: dlog
#include <des.h>
#include <afs/afsutil.h>
-#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
include ../config/Makefile.${SYS_NAME}
UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
SRC =.
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
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
#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)
#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 */
#include <afs/param.h>
#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
* 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 */
#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,
* 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 */
#include "stats.h"
#define XPRT_DES
-#include "../permit_xprt.h"
#ifdef DEBUG
#define DBG_PRINT(s) if (des_debug & 2) \
#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;
#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)
fprintf(stderr,"\n");
}
#endif
+
+ return(0);
}
#include <mit-cpyright.h>
#include <stdio.h>
#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));
#include <mit-cpyright.h>
#include <stdio.h>
#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))
}
/* 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++) {
/*
*/
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");
}
#include <mit-cpyright.h>
#include <stdio.h>
#include "des_internal.h"
+
+#define WANT_P_TABLE
#include "tables.h"
extern afs_uint32 swap_byte_bits();
#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
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
#include <mit-cpyright.h>
#include <stdio.h>
#include "des_internal.h"
+
+#define WANT_S_TABLE
#include "tables.h"
extern afs_uint32 swap_bit_pos_0();
}
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,", ");
}
#endif /* LSBFIRST */
}
-swap_long_bytes_bit_number(x)
+int swap_long_bytes_bit_number(x)
afs_uint32 x;
{
/*
#include "AFS_component_version_number.c"
-main(argc, argv)
+int main(argc, argv)
int argc;
char *argv[];
{
#ifdef AFS_PTHREAD_ENV
#include <pthread.h>
#endif
+#include <string.h>
#include <des.h>
#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
*
* 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
#include <afs/afsutil.h>
#else
#include <sys/time.h>
+#include <unistd.h>
#endif
void des_init_random_number_generator(key)
#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
*
*/
-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 */
#ifdef AFS_SUN5_ENV
#define BSD_COMP
#endif
+#if defined(AFS_FBSD_ENV)
+#define USE_OLD_TTY
+#endif
#include <sys/ioctl.h>
#include <signal.h>
#include <setjmp.h>
#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 <signal.h>
+#include <unistd.h>
#endif
#ifdef AFS_HPUX_ENV
#include <termios.h>
#endif
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <termios.h>
+#endif
#ifdef AFS_NT40_ENV
#include <windows.h>
#endif
#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)
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
{
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;
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. */
ok = 1;
}
+#ifdef BSDUNIX
lose:
+#endif
if (!ok)
bzero(s, maxa);
printf("\n");
#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)
{
#include <mit-cpyright.h>
#include <stdio.h>
+#include <string.h>
#include <afs/param.h>
#include <des.h>
#include "des_internal.h"
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;
/*
* 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,
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,
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,
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,
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
extern int des_cbc_encrypt();
extern int des_pcbc_encrypt();
-#include "../../permit_xprt.h"
-
char *progname;
int sflag;
int vflag;
extern int des_ecb_encrypt();
extern int des_cbc_encrypt();
-#include "../../permit_xprt.h"
-
char *progname;
int nflag = 2;
int vflag;
#include <sys/types.h>
#include <des.h>
-des_cblock_print_file(x, fp)
+int des_cblock_print_file(x, fp)
des_cblock *x;
FILE *fp;
{
fprintf(fp,", ");
}
fprintf(fp," }");
+
+ return(0);
}
#ifdef DEBUG
* Originally written 8/85 by Steve Miller, MIT Project Athena.
*/
+#include <string.h>
#include <des.h>
#include "des_internal.h"
RM = /bin/rm
UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
SRC =.
DESPAR =../../../DESLIB/dest/
DESINC =${DESPAR}include/
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
-INSTALL = ${SRCDIR}bin/install
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
INCDIRS= -I${DESTDIR}include ${XINCLS}
#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)
#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"
COMPONENT=export
include ../config/Makefile.${SYS_NAME}
- INSTALL = ${SRCDIR}bin/install
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
DEFS =
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
#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
/* 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.
*/
}
return(TRUE);
}
+#endif
#endif /* KERNEL */
#ifndef KERNEL
COMPONENT=fsprobe
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
-
CFLAGS=-g -I. \
-I${SRCDIR}include \
-I${SRCDIR}include/afs \
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}
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);
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 \
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 \
# 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}
${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
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}
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;
}
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. */
#include "../afs/kautils.h"
#include "../afs/pthread_glock.h"
-#include "../afs/permit_xprt.h"
#else /* defined(UKERNEL) */
#include <afs/param.h>
#include <afs/stds.h>
#include <afs/afsutil.h>
#include "kauth.h"
#include "kautils.h"
-
-#include "../permit_xprt.h"
#endif /* defined(UKERNEL) */
* 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"
#include "../afs/pthread_glock.h"
#include "../des/des.h"
-#include "../afs/permit_xprt.h"
#else /* defined(UKERNEL) */
#include <afs/param.h>
#include <afs/stds.h>
#include <afs/afsutil.h>
#include "kauth.h"
#include "kautils.h"
-
-#include "../permit_xprt.h"
#endif /* defined(UKERNEL) */
#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 */
int npwSums = KA_NPWSUMS; /* needs to be variable sometime */
#include <stdarg.h>
-#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
#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
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 */
}
}
* login -h hostname (for telnetd, etc.)
*/
#include <afs/param.h>
-#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 <sys/param.h>
#define quota(a,b,c,d) 0
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;
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; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
code = read_pass (passwd, sizeof(passwd), "Old password: ", 0);
if (code || (strlen (passwd) == 0)) {
if (code) code = KAREADPW;
+ bzero (&mitkey, sizeof(mitkey));
bzero (&key, sizeof(key));
bzero (passwd, sizeof(passwd));
if (code) com_err (rn, code, "reading password");
}
}
ka_StringToKey (passwd, realm, &key);
+ des_string_to_key(passwd, &mitkey);
give_to_child(passwd);
/* Get new password if it wasn't provided. */
npasswd[8] = 0; /* in case the password was exactly 8 chars long */
#endif
ka_StringToKey (npasswd, realm, &newkey);
+ des_string_to_key(npasswd, &newmitkey);
bzero (npasswd, sizeof(npasswd));
if (lexplicit) ka_ExplicitCell (realm, serverList);
code = ka_GetAdminToken (pw->pw_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) {
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);
}
}
bzero (&newkey, sizeof(newkey));
+ bzero (&newmitkey, sizeof(newmitkey));
/* Might need to close down the ubik_Client connection */
if (conn) {
#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
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",
}
#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
#include <rx/rxkad.h>
#include <crypt.h>
#include <des.h>
-#include "../permit_xprt.h"
int krb_add_host (struct sockaddr_in *server_list_p);
static void krb_set_port(long port);
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/
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
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;
#ifdef AFS_NT40_ENV
#include <io.h>
#endif
-#include "../../permit_xprt.h"
/*
#include <afs/vlserver.h>
#include <afs/pthread_glock.h>
-
-#include "../../permit_xprt.h"
-
/*
* AFS client administration functions.
*
# Compile the clients.
${COMPDIRS}:
+ if false; then \
for b in $(BITS); do \
for t in $(KOBJ); do \
dir=$$t.$$b; \
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:
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)
include ../config/Makefile.${SYS_NAME}
CC=${MT_CC}
-INSTALL = ${SRCDIR}bin/install
CFLAGS = ${OPTMZ} ${DBG} -I${SRCDIR}include ${MT_CFLAGS}
CCRULE = ${CC} ${CFLAGS} -c $?
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}
#
# $ 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.
/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; \
rx_SetRxStatUserOk @201
rx_RxStatUserOk @202
rx_enable_hot_thread @203 DATA
+ xdr_int64 @204
+ xdr_uint64 @205
#
SHELL=/bin/sh
-INSTALL = ${SRCDIR}bin/install
INCLUDE= -I. -I/usr/include
UOBJ =../UAFS
WEBOBJ =../AFSWEB
${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 $?
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
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 \
#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 <ufs/quota.h>
+#elif defined(AFS_FBSD_ENV)
+#include <ufs/ufs/quota.h>
#else
#include <sys/quota.h>
#endif
#include <sys/ttold.h>
#include <sys/filio.h>
#endif
+#ifdef AFS_FBSD_ENV
+#define USE_OLD_TTY 1
+#include <sys/ttydefaults.h>
+#endif
#include <sys/ioctl.h>
#include <utmp.h>
#include <dirent.h>
#endif
#include <signal.h>
-#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 <lastlog.h>
#endif
#include <errno.h>
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}
/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; \
.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 */
.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 */
#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
+
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
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.
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 */
#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);
DESTDIR=DEST/
SRCDIR=DEST/
CFLAGS= ${OPTMZ} ${XCFLAGS}
-INSTALL=${SRCDIR}bin/install
LIBS = ${XLIBS}
PROGRAM=mpp
COMPONENT=ntp
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
INCPATH= -I${DESTDIR}include
BINDIR=/usr/local/etc
LINKDIR=/etc
# Makefile for the null library.
DESTDIR=DEST/
SRCDIR=DEST/
-INSTALL=${SRCDIR}bin/install
SHELL=/bin/sh
COMPONENT=null
YFLAGS = -vd
#LFLAGS = -ll
LINT = lint -hp
-INSTALL = ${SRCDIR}bin/install
HFILES = package.h \
validupdates.h \
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();
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();
# 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 \
$(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
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
$(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
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
- [ -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
#include <string.h>
#include <elf.h>
#else
+#ifdef AFS_DARWIN_ENV
+#include <fcntl.h>
+#include <string.h>
+#else
#include <strings.h>
#include <a.out.h>
#endif
+#endif
#ifdef AFS_HPUX_ENV
#include <utime.h>
#endif
+#include <unistd.h>
+#include <string.h>
+#include <sys/wait.h>
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
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;
}
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;
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"
* Since /bin/strip will make that call for us, we will lie so that
* it has a chance.
*/
+int
AIXobject(ignored) {
return !0;
#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)
#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;
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 */
include ../config/Makefile.${SYS_NAME}
include ../config/Makefile.version
-INSTALL=${SRCDIR}bin/install
CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS}
########################################################################
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 \
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
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
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)
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 <db path>] "
- "[-p <number of processes>] [-rebuildDB] "
+#ifndef AFS_NT40_ENV
+ "[-syslog[=FACILITY]] "
+#endif
+ "[-p <number of processes>] [-rebuild] "
/* "[-enable_peer_stats] [-enable_process_stats] " */
"[-help]\n");
fflush(stdout);
#define PRBADID 0x80000000
+#define SYSVIEWERID -203
#define SYSADMINID -204
#define SYSBACKUPID -205
#define ANYUSERID -101
#include "../afs/ptclient.h"
#include "../afs/pterror.h"
-#include "../afs/permit_xprt.h"
#else /* defined(UKERNEL) */
#include <afs/param.h>
#include <afs/stds.h>
#include <afs/afsutil.h>
#include "ptclient.h"
#include "pterror.h"
-
-#include "../permit_xprt.h"
#endif /* defined(UKERNEL) */
} 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 */
}
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
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\
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();
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 \
COMPONENT=rsh
include ../config/Makefile.${SYS_NAME}
-INSTALL = ${SRCDIR}bin/install
LIBDIR = ${DESTDIR}lib/
INCLUDES= -I${SRCDIR}include
CFLAGS= ${DBUG} ${INCLUDES} ${XCFLAGS}
#endif /* LIBC_SCCS and not lint */
#include <afs/param.h>
+#ifndef AFS_DARWIN_ENV
#include <sys/types.h>
#include <sys/uio.h>
v->iov_len = 1;
writev(2, iov, (v - iov) + 1);
}
+#endif
#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;
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;
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
-INSTALL=${SRCDIR}bin/install
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
#CC=pcc
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
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;; \
* ) \
#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 */
#include <net/if.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <sys/sysctl.h>
+#include <net/route.h>
+#include <net/if_dl.h>
+#endif
+
/*
* By including this, we get any system dependencies. In particular,
* the pthreads for solaris requires the socket call to be mapped.
#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;
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) {
return count;
#endif /* AFS_USERSPACE_IP_ADDR */
}
+#endif
#endif /* ! AFS_NT40_ENV */
#endif /* !KERNEL || UKERNEL */
*/
-#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.
*/
#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)
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) {
/* 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);
#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 */
#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;
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);
if (code) {
soclose(newSocket);
m_freem(nam);
- return(struct osi_socket *) 0;
+ goto bad;
}
freeb(bindnam);
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
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
#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;
}
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 */
#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 */
#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.
*/
#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
#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
extern int rxk_initDone;
+#if defined(AFS_FBSD_ENV)
+extern struct domain inetdomain;
+#endif /* AFS_FBSD_ENV */
+
#endif /* _RX_KCOMMON_H_ */
#define MAXTHREADNAMELENGTH 64
+extern int (*registerProgram)();
+extern int (*swapNameProgram)();
+
int debugSelectFailure; /* # of times select failed */
/*
* Sleep on the unique wait channel provided.
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.
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() {
#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
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) */
if (p) {
rxi_FreePacket(p);
}
+ if (swapNameProgram) {
+ (*swapNameProgram)(rx_listenerPid, &name, 0);
+ rx_listenerPid = 0;
+ }
return;
}
}
if (p) {
rxi_FreePacket(p);
}
+ if (swapNameProgram) {
+ (*swapNameProgram)(rx_listenerPid, &name, 0);
+ rx_listenerPid = 0;
+ }
return;
}
}
#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 <sys/sysmacros.h> /* MIN, MAX on Solaris */
+#endif
#include <sys/param.h> /* MIN, MAX elsewhere */
#endif /* AFS_NT40_ENV */
-/*
+ /*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
*
#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"
#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))
#ifdef RXDEBUG
#undef RXDEBUG /* turn off debugging */
#endif /* RXDEBUG */
-#include "../afsint/afsint.h"
#include "../rx/rx_kmutex.h"
#include "../rx/rx_kernel.h"
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",
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);
"#include <rx/rx_null.h>\n"
"#include <rx/rxkad.h>\n"
"#include <afs/cmd.h>\n"
- "#include \"../../../permit_xprt.h\"\n"
"#include \"%s%d.h\"\n"
,
platform[4], serverName, srv_no);
"#include <rx/rx_null.h>\n"
"#include <rx/rxkad.h>\n"
"#include <afs/cmd.h>\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"
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 \
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
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
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}
#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;
char * data;
int i,tlen;
- if (!xprt_CryptOK (conn)) return RXKADILLEGALLEVEL;
obj = rx_SecurityObjectOf(conn);
tp = (struct rxkad_cprivate *)obj->privateData;
LOCK_RXKAD_STATS
return 0;
}
-AFS_HIDE
afs_int32 rxkad_EncryptPacket (conn, schedule, ivec, len, packet)
IN struct rx_connection *conn;
IN fc_KeySchedule *schedule;
char *data;
int i,tlen;
- if (!xprt_CryptOK (conn)) return RXKADILLEGALLEVEL;
obj = rx_SecurityObjectOf(conn);
tp = (struct rxkad_cprivate *)obj->privateData;
LOCK_RXKAD_STATS
#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;
return 0;
}
-AFS_HIDE
afs_int32 fc_ecb_encrypt(clear, cipher, schedule, encrypt)
IN afs_uint32 *clear;
OUT afs_uint32 *cipher;
* 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;
#include "private_data.h"
#define XPRT_RXKAD_CLIENT
-#ifdef KERNEL
-#include "../afs/permit_xprt.h"
-#else
-#include "../permit_xprt.h"
-#endif
-
char *rxi_Alloc();
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));
#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"
#include "private_data.h"
#define XPRT_RXKAD_COMMON
-#ifdef KERNEL
-#include "../afs/permit_xprt.h"
-#else
-#include "../permit_xprt.h"
-#endif
-
char *rxi_Alloc();
#include <afs/afsutil.h>
#include "private_data.h"
#define XPRT_RXKAD_SERVER
-#include "../permit_xprt.h"
-
/*
* This can be set to allow alternate ticket decoding.
#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)
* 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"
#include "../des/des.h"
#include "../afs/lifetimes.h"
#include "../afs/rxkad.h"
-
-#include "../afs/permit_xprt.h"
#else /* defined(UKERNEL) */
#include <afs/param.h>
#include <afs/stds.h>
#include <des.h>
#include "lifetimes.h"
#include "rxkad.h"
-
-#include "../permit_xprt.h"
#endif /* defined(UKERNEL) */
KERNELDIR = ../libafs/
UKERNELDIR = ../libuafs/
-INSTALL=${SRCDIR}bin/install
RXGEN=${SRCDIR}bin/rxgen
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
COMPONENT=scout
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
-
CFLAGS= ${DBUG} -I. \
-I${SRCDIR}include \
-I${SRCDIR}include/afs \
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 \
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
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}
/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; \
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; \
include ../config/Makefile.${SYS_NAME}
CC =${MT_CC}
-INSTALL =${SRCDIR}bin/install
CFLAGS = ${DBG} -w ${MT_CFLAGS}
LDFLAGS = ${DBG} ${XLDFLAGS}
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) \
$(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 \
$(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 \
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 \
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}
${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
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
}
++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 {
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 */
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();
}
{
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;
}
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;
}
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; (i<UBIK_MAX_INTERFACE_ADDR) && ts->addr[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)
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) {
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 */
}
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");
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];
(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)"));
}
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 \
COMPONENT=ptserver
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
RXGEN=${SRCDIR}bin/rxgen
COMPILE_ET = ${SRCDIR}bin/compile_et
#include <sys/tape.h>
#include <sys/statfs.h>
#else
+#ifdef AFS_DARWIN_ENV
+#include <sys/ioccom.h>
+#endif
#include <sys/mtio.h>
#endif /* AFS_AIX_ENV */
#ifdef AFS_DUX40_ENV
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;
COMPONENT=uss
include ../config/Makefile.${SYS_NAME}
-INSTALL = ${SRCDIR}bin/install
-
#
# This makefile creates the following things:
#
#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
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
${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 \
${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
#include <stdio.h>
#include <stdarg.h>
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)
/* 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. */
* 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
#ifdef AFS_NT40_ENV
#include <windows.h>
+#include <io.h>
#include "errmap_nt.h"
#else
#include <unistd.h>
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;
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;
}
fd = bp->fd;
free(bp);
+#ifdef AFS_NT40_ENV
+ rc = _close(fd);
+#else
rc = close(fd);
+#endif
return rc;
}
* 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)
/* 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) {
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 */
* variable addr is in network byte order.
*/
char *hostutil_GetNameByINet(addr)
- afs_int32 addr;
+ afs_uint32 addr;
{
struct hostent *th;
static char tbuffer[256];
** w.x.y.z # machineName
** returns the network interface in network byte order
*/
-afs_int32
+afs_uint32
extractAddr(line, maxSize)
char* line;
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 )
** 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;
#include <stdlib.h>
#include <stdio.h>
-#include <errno.h>
-#include <sys/errno.h>
#ifdef KERNEL
#include "../afs/param.h"
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#else
+#ifdef __FreeBSD__
+#include <sys/types.h>
+#endif
#include <netinet/in.h>
+#include <errno.h>
+#include <sys/errno.h>
#endif
#include "assert.h"
** 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;
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 ) {
* 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 */
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);
*/
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;
* 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);
* 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;
/* 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[],
);
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
#endif
#include <sys/param.h>
#include <sys/time.h>
+#include <syslog.h>
#endif
#include <afs/procmgmt.h> /* signal(), kill(), wait(), etc. */
#include <fcntl.h>
#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 <stdarg.h>
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, ...)
{
info = &timeStamp[25];
if (mrafsStyleLogs) {
- name = threadname();
+ name = (*threadNameProgram)();
sprintf(info, "[%s] ", name);
info += strlen(info);
}
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
}
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);
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)
/* snprintf.c - Formatted, length-limited print to a string */
#include <afs/param.h>
-#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 <sys/types.h>
#include <stdarg.h>
#include <stdio.h>
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);
* 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))
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,
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
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 \
${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}\
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}
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*) \
${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
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
#include <rx/rx.h>
#include <rx/rx_globals.h>
#include <sys/stat.h>
-#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 <sys/map.h>
#endif
#if !defined(AFS_NT40_ENV)
#include <sys/statfs.h>
#include <sys/lockf.h>
#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 <sys/dk.h>
#endif
#endif
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;
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
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,
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);
}
KERNELDIR=../libafs/
UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
COMPILE_ET = ${SRCDIR}bin/compile_et
CFLAGS = ${DBUG} -I. -I.. -I${SRCDIR}include ${XCFLAGS}
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 <number of processes>] [-nojumbo] "
+#ifndef AFS_NT40_ENV
+ "[-syslog[=FACILITY]] "
+#endif
/*" [-enable_peer_stats] [-enable_process_stats] " */
"[-help]\n");
fflush(stdout);
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 \
# 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
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 ; \
#ifdef AFS_SUN5_ENV
#include <sys/fs/ufs_fs.h>
#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <ufs/ufs/dinode.h>
+#include <ufs/ffs/fs.h>
+#else
#include <ufs/fs.h>
#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 <sys/fs.h>
#endif
#endif /* AFS_VFSINCL_ENV */
#ifndef lint
#endif
/*
+
System: VICE-TWO
Module: listinodes.c
Institution: The Information Technology Center, Carnegie-Mellon University
#ifdef AFS_SUN5_ENV
#include <sys/fs/ufs_fs.h>
#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <ufs/ufs/dinode.h>
+#include <ufs/ffs/fs.h>
+#define itod ino_to_fsba
+#else
#include <ufs/fs.h>
#endif
+#endif
#else /* AFS_VFSINCL_ENV */
#ifdef AFS_AIX_ENV
#include <sys/filsys.h>
#ifdef AFS_SUN5_ENV
#include <sys/fs/ufs_inode.h>
#else
+#if defined(AFS_DARWIN_ENV)
#include <ufs/inode.h>
#endif
+#endif
#else /* AFS_VFSINCL_ENV */
#ifdef AFS_DEC_ENV
#include <sys/time.h>
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)
#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;
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) {
#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;
#include <sys/file.h>
#include <sys/param.h>
#include <lock.h>
+#ifdef AFS_AIX_ENV
+#include <sys/lockf.h>
+#endif
+#ifdef AFS_SUN5_ENV
+#include <unistd.h>
+#endif
#include <afs/afsutil.h>
#include <lwp.h>
#include "nfs.h"
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;
}
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;
}
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;
}
}
/* Now find a free column in this row and claim it. */
- coldata = 0x7;
for (col = 0; col<NAMEI_MAXVOLS; col++) {
- coldata <<= col * 3;
- if ((row & coldata) == 0)
- break;
+ coldata = 7 << (col * 3);
+ if ((row & coldata) == 0)
+ break;
}
if (col >= NAMEI_MAXVOLS)
goto badGetFreeTag;
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;
}
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;
}
}
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;
}
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;
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)
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);
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;
}
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;
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");
}
#ifdef AFS_SUN5_ENV
#include <sys/fs/ufs_inode.h>
#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <ufs/ufs/dinode.h>
+#include <ufs/ffs/fs.h>
+#else
#include <ufs/inode.h>
#endif
+#endif
#else /* AFS_VFSINCL_ENV */
#ifdef AFS_OSF_ENV
#include <ufs/inode.h>
#else /* AFS_OSF_ENV */
-#ifndef AFS_LINUX20_ENV
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
#include <sys/inode.h>
#endif
#endif
#include <afs/afsutil.h>
#include <afs/fileutil.h>
#include <afs/procmgmt.h> /* signal(), kill(), wait(), etc. */
+#ifndef AFS_NT40_ENV
+#include <syslog.h>
+#endif
#include "nfs.h"
#include "lwp.h"
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 */
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);
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 */
#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);
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);
} /* 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<jobcount; i++) {
sprintf(logFileName, "%s.%d", AFSDIR_SERVER_SLVGLOG_FILEPATH, i);
(void)unlink(logFileName);
}
fflush(logFile);
- return;
}
+ return;
}
{
char oldSlvgLog[AFSDIR_PATH_MAX];
+#ifndef AFS_NT40_ENV
+ if ( useSyslog ) {
+ ShowLog = 0;
+ return;
+ }
+#endif
+
strcpy(oldSlvgLog, AFSDIR_SERVER_SLVGLOG_FILEPATH);
strcat(oldSlvgLog, ".old");
if (!logFile) {
{
char line[256];
+#ifndef AFS_NT40_ENV
+ if ( useSyslog ) {
+ printf("Can't show log since using syslog.\n");
+ fflush(stdout);
+ return;
+ }
+#endif
+
rewind(logFile);
fclose(logFile);
char *a, *b, *c, *d, *e, *f, *g, *h, *i, *j, *k;
{
struct timeval now;
- gettimeofday(&now, 0);
- fprintf(logFile, "%s ", TimeStamp(now.tv_sec, 1));
- fprintf(logFile, a,b,c,d,e,f,g,h,i,j,k);
- fflush(logFile);
+
+#ifndef AFS_NT40_ENV
+ if ( useSyslog )
+ {
+ syslog(LOG_INFO, a,b,c,d,e,f,g,h,i,j,k);
+ } else
+#endif
+ {
+ gettimeofday(&now, 0);
+ fprintf(logFile, "%s ", TimeStamp(now.tv_sec, 1));
+ fprintf(logFile, a,b,c,d,e,f,g,h,i,j,k);
+ fflush(logFile);
+ }
}
void Abort(a,b,c,d,e,f,g,h,i,j,k)
char *a, *b, *c, *d, *e, *f, *g, *h, *i, *j, *k;
{
- fprintf(logFile, a,b,c,d,e,f,g,h,i,j,k);
- fflush(logFile);
- if (ShowLog) showlog();
+#ifndef AFS_NT40_ENV
+ if ( useSyslog )
+ {
+ syslog(LOG_INFO, a,b,c,d,e,f,g,h,i,j,k);
+ } else
+#endif
+ {
+ fprintf(logFile, a,b,c,d,e,f,g,h,i,j,k);
+ fflush(logFile);
+ if (ShowLog) showlog();
+ }
if (debug)
abort();
Exit(1);
#ifdef AFS_SUN5_ENV
#include <sys/fs/ufs_fs.h>
#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <ufs/ufs/dinode.h>
+#include <ufs/ffs/fs.h>
+#else
#include <ufs/fs.h>
#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 <sys/fs.h>
#endif
#endif /* AFS_VFSINCL_ENV */
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}
}
}
}
-#endif notdef
+#endif /* notdef */
/*
SHELL = /bin/sh
COMPONENT=xstat
include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
CFLAGS= ${DBUG} -I. \
-I${SRCDIR}include \