]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
This commit was generated by cvs2svn to compensate for changes in r212,
authorSam Hartman <hartmans@debian.org>
Mon, 23 Apr 2001 18:45:23 +0000 (18:45 +0000)
committerSam Hartman <hartmans@debian.org>
Mon, 23 Apr 2001 18:45:23 +0000 (18:45 +0000)
which included commits to RCS files with non-trunk default branches.

248 files changed:
src/BUILDNOTES
src/README
src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_conn.h
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/cm_ioctl.h
src/WINNT/afsd/fs.c
src/WINNT/afsd/smb_iocons.h
src/WINNT/afsd/smb_ioctl.c
src/WINNT/client_config/dlg_automap.cpp
src/WINNT/client_config/drivemap.cpp
src/WINNT/install/InstallShield5/GenFileGroups.bat
src/afs/DUX/osi_file.c
src/afs/DUX/osi_inode.c
src/afs/LINUX/osi_groups.c
src/afs/LINUX/osi_vfs.h
src/afs/LINUX/osi_vfsops.c
src/afs/LINUX/osi_vm.c
src/afs/Makefile
src/afs/SOLARIS/osi_file.c
src/afs/SOLARIS/osi_inode.c
src/afs/SOLARIS/osi_vfsops.c
src/afs/UKERNEL/afs_usrops.c
src/afs/VNOPS/afs_vnop_attrs.c
src/afs/VNOPS/afs_vnop_create.c
src/afs/VNOPS/afs_vnop_fid.c
src/afs/VNOPS/afs_vnop_flock.c
src/afs/VNOPS/afs_vnop_read.c
src/afs/VNOPS/afs_vnop_strategy.c
src/afs/VNOPS/afs_vnop_write.c
src/afs/afs_analyze.c
src/afs/afs_dcache.c
src/afs/afs_init.c
src/afs/afs_osi.c
src/afs/afs_osi_pag.c
src/afs/afs_prototypes.h
src/afs/afs_server.c
src/afs/afs_user.c
src/afs/afs_vcache.c
src/afs/afsincludes.h
src/afs/lock.h
src/afs/sysincludes.h
src/afsd/afsd.c
src/afsmonitor/Makefile
src/afsmonitor/afsmonitor.c
src/afsweb/Makefile
src/afsweb/weblog.c
src/audit/Makefile
src/auth/Makefile
src/auth/authcon.c
src/bozo/Makefile
src/bozo/bos.c
src/bozo/bosserver.c
src/bu_utils/Makefile
src/bubasics/Makefile
src/bucoord/Makefile
src/bucoord/ubik_db_if.c
src/bucoord/vol_sets.c
src/budb/Makefile
src/budb/db_text.c
src/butc/Makefile
src/butc/dump.c
src/butc/tcudbprocs.c
src/butm/Makefile
src/cmd/Makefile
src/cmd/cmd.c
src/cmd/cmd.p.h
src/comerr/Makefile
src/config/Makefile
src/config/Makefile.alpha_dux40
src/config/Makefile.alpha_dux50
src/config/Makefile.hp_ux110
src/config/Makefile.rs_aix42
src/config/Makefile.s390_linux22
src/config/Makefile.sgi_62
src/config/Makefile.sgi_63
src/config/Makefile.sgi_64
src/config/Makefile.sgi_65
src/config/Makefile.sun4x_55
src/config/Makefile.sun4x_56
src/config/Makefile.sun4x_57
src/config/Makefile.sun4x_58
src/config/Makefile.sunx86_54
src/config/Makefile.version-NOCML
src/config/NTMakefile
src/config/afs_sysnames.h
src/config/config.c
src/config/mc.c
src/config/mkvers.c
src/config/param.i386_linux22.h
src/config/param.i386_linux24_usr.h
src/dauth/Makefile
src/dauth/dlog.c
src/des/Makefile
src/des/andrew-conf.h
src/des/cbc_encrypt.c
src/des/cksum.c
src/des/des.c
src/des/key_sched.c
src/des/make_fp.c
src/des/make_ip.c
src/des/make_keyperm.c
src/des/make_p_table.c
src/des/make_s_table.c
src/des/misc.c
src/des/new_rnd_key.c
src/des/pcbc_encrypt.c
src/des/read_pssword.c
src/des/strng_to_key.c
src/des/tables.h
src/des/test/testit.c
src/des/test/verify.c
src/des/util.c
src/des/weak_key.c
src/des_stub/Makefile
src/dir/Makefile
src/dir/dir.c
src/export/Makefile
src/fsint/Makefile
src/fsint/afsaux.c
src/fsprobe/Makefile
src/gtx/Makefile
src/gtx/curseswindows.c
src/inetd/Makefile
src/kauth/Makefile
src/kauth/admin_tools.c
src/kauth/authclient.c
src/kauth/client.c
src/kauth/kaprocs.c
src/kauth/kaserver.c
src/kauth/kautils.c
src/kauth/klogin.c
src/kauth/kpasswd.c
src/kauth/krb_udp.c
src/kauth/user.c
src/kauth/user_nt.c
src/libacl/Makefile
src/libacl/aclprocs.c
src/libadmin/bos/afs_bosAdmin.c
src/libadmin/client/afs_clientAdmin.c
src/libafs/MakefileProto.HPUX
src/libafs/MakefileProto.SOLARIS
src/libafsauthent/Makefile
src/libafsrpc/Makefile
src/libafsrpc/afsrpc.def
src/libuafs/Makefile.common
src/log/Makefile
src/login/Makefile
src/login/login.c
src/lwp/Makefile
src/lwp/process.s
src/lwp/timer.c
src/lwp/waitkey.c
src/mpp/Makefile
src/ntp/Makefile
src/null/Makefile
src/package/Makefile
src/package/gram.y
src/package/test_gram.y
src/pam/Makefile
src/pam/test_pam.c
src/pinstall/Makefile
src/pinstall/install.c
src/procmgmt/Makefile
src/ptserver/Makefile
src/ptserver/pts.c
src/ptserver/ptserver.c
src/ptserver/ptserver.h
src/ptserver/ptuser.c
src/ptserver/ptutils.c
src/rcp/Makefile
src/rcp/rcp.c
src/rlogind/Makefile
src/rsh/Makefile
src/rsh/herror.c
src/rsh/rcmd.c
src/rx/Makefile
src/rx/rx.h
src/rx/rx_getaddr.c
src/rx/rx_kcommon.c
src/rx/rx_kcommon.h
src/rx/rx_lwp.c
src/rx/rx_packet.h
src/rx/rx_rdwr.c
src/rx/rxdebug.c
src/rx/test/generator.c
src/rxgen/Makefile
src/rxgen/rpc_main.c
src/rxkad/Makefile
src/rxkad/domestic/crypt_conn.c
src/rxkad/domestic/fcrypt.c
src/rxkad/rxkad_client.c
src/rxkad/rxkad_common.c
src/rxkad/rxkad_server.c
src/rxkad/test/stress_c.c
src/rxkad/ticket.c
src/rxstat/Makefile
src/scout/Makefile
src/sgistuff/Makefile
src/sia/Makefile
src/sys/Makefile
src/tbutc/Makefile
src/tbutc/NTMakefile
src/tsm41/Makefile
src/tviced/Makefile
src/ubik/Makefile
src/ubik/beacon.c
src/ubik/lock.c
src/ubik/remote.c
src/ubik/ubik.c
src/ubik/udebug.c
src/ubik/vote.c
src/update/Makefile
src/usd/Makefile
src/usd/usd_file.c
src/uss/Makefile
src/uss/uss_common.h
src/util/Makefile
src/util/afsutil.h
src/util/fileutil.c
src/util/flipbase64.c
src/util/hostparse.c
src/util/netutils.c
src/util/netutils.h
src/util/serverLog.c
src/util/snprintf.c
src/util/uuid.c
src/util/vice.h
src/venus/fs.c
src/venus/up.c
src/vfsck/Makefile
src/viced/Makefile
src/viced/afsfileprocs.c
src/viced/callback.c
src/viced/viced.c
src/vlserver/Makefile
src/vlserver/vlserver.c
src/vol/Makefile
src/vol/devname.c
src/vol/listinodes.c
src/vol/namei_ops.c
src/vol/vol-info.c
src/vol/vol-salvage.c
src/vol/volume.c
src/volser/Makefile
src/volser/vsutils.c
src/xstat/Makefile

index 7cf152937990e8470b8c88dfa0233fd1f5789818..52d9beea47737af2953cf09f3a8f50671ed7570e 100644 (file)
@@ -13,7 +13,15 @@ Redhat 7.0 (i386_linux22):
        source tree with a switch in include/linux/version.h.
 
 HPUX 11.0 (hp_ux110):
-       Does not currently build. However, you will need to make sure 
-       the KernDevKit package from the CoreOS media is installed if
-       you wish to work on it.
+       Does not currently build libafs, which means no afs client support,
+       however, the client tools, and all of the server code does get built.
+       
+       For future kernel development, the KernDevKit package from the CoreOS
+       media is required.
 
+HPUX 10.2 (hp_ux102):
+       Does not currently build libafs, which means no afs client support,
+       however, the client tools, and all of the server code does get built.
+       
+       Requires that the DCE-CoreTools and possible the KernDevKit package
+       from CoreOS media be installed.
index 27beaa75ed803d1eefad001b517885b7ddd129b8..c3a40097f3bf3bcd5fcb8898fdcdfa5fc57353ce 100644 (file)
@@ -27,16 +27,17 @@ A. Creating the proper directory structure.
       sun4x_56/
       sun4x_57/
       sun4x_58/
+      ppc_darwin_13/
+      alpha_linux_2216_22/ (DES does not work, will require one more change to
+                               compile)
+      hp_ux110/ (No client support, but db servers and utilities work)
+      hp_ux102/ (No client support, but db servers and utilities work)
 
       Example:
       % mkdir i386_linux22
       % ls -CF
       i386_linux22/     src/
 
-      Builds for the following platforms will not fully compile:
-
-      hp_ux110/
-
    2. Within each of those directories, create a dest/ and obj/ directory.
 
       Example:
index aba2900befabad59acc8c5a92c04e8e352d19b9c..f7c7feca5281058bf26f72c65dfeb606ddd98ad5 100644 (file)
@@ -31,6 +31,8 @@
 extern int RXAFSCB_ExecuteRequest();
 extern int RXSTATS_ExecuteRequest();
 
+extern afs_int32 cryptall;
+
 char AFSConfigKeyName[] =
        "SYSTEM\\CurrentControlSet\\Services\\TransarcAFSDaemon\\Parameters";
 
@@ -380,6 +382,16 @@ int afsd_InitCM(char **reasonP)
                afsi_log("Default sys name %s", cm_sysName);
        }
 
+       dummyLen = sizeof(cryptall);
+       code = RegQueryValueEx(parmKey, "SecurityLevel", NULL, NULL,
+                               (BYTE *) &cryptall, &dummyLen);
+       if (code == ERROR_SUCCESS)
+               afsi_log("SecurityLevel is %s", cryptall?"crypt":"clear");
+       else {
+               cryptall = rxkad_clear;
+               afsi_log("Default SecurityLevel is clear");
+       }
+
        RegCloseKey (parmKey);
 
        /* setup early variables */
index 704720c68d8c86e025db45eb76a22a1a2db668ef..c78bc66d090ec02b0e797612d718b5d8fc99470a 100644 (file)
@@ -23,6 +23,8 @@ osi_rwlock_t cm_connLock;
 
 long RDRtimeout = CM_CONN_DEFAULTRDRTIMEOUT;
 
+afs_int32 cryptall = 0;
+
 void cm_PutConn(cm_conn_t *connp)
 {
        lock_ObtainWrite(&cm_connLock);
@@ -329,6 +331,7 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp,
         int serviceID;
         int secIndex;
         struct rx_securityClass *secObjp;
+       afs_int32 level;
 
        if (serverp->type == CM_SERVER_VLDB) {
                port = htons(7003);
@@ -341,7 +344,13 @@ static void cm_NewRXConnection(cm_conn_t *tcp, cm_ucell_t *ucellp,
         }
        if (ucellp->flags & CM_UCELLFLAG_RXKAD) {
                secIndex = 2;
-                secObjp = rxkad_NewClientSecurityObject(rxkad_clear,
+               if (cryptall) {
+                       level = rxkad_crypt;
+                       tcp->cryptlevel = rxkad_crypt;
+               } else {
+                       level = rxkad_clear;
+               }
+                secObjp = rxkad_NewClientSecurityObject(level,
                        &ucellp->sessionKey, ucellp->kvno,
                        ucellp->ticketLen, ucellp->ticketp);
         }
@@ -382,11 +391,13 @@ long cm_ConnByServer(cm_server_t *serverp, cm_user_t *userp, cm_conn_t **connpp)
                 cm_HoldUser(userp);
                 lock_InitializeMutex(&tcp->mx, "cm_conn_t mutex");
                 tcp->serverp = serverp;
+               tcp->cryptlevel = rxkad_clear;
                cm_NewRXConnection(tcp, ucellp, serverp);
                tcp->refCount = 1;
         }
        else {
-               if (tcp->ucgen < ucellp->gen) {
+               if ((tcp->ucgen < ucellp->gen) || (tcp->cryptlevel != cryptall))
+               {
                        rx_DestroyConnection(tcp->callp);
                        cm_NewRXConnection(tcp, ucellp, serverp);
                }
index 2e2ab4dbf2930fb0c45254d00422f6e612531c59..e03bfe60174e7edc3062a05c38aa9df962c2c0f2 100644 (file)
@@ -23,6 +23,7 @@ typedef struct cm_conn {
         int refCount;                  /* locked by cm_connLock */
        int ucgen;                      /* ucellp's generation number */
         long flags;                    /* locked by mx */
+       int cryptlevel;                 /* encrytion status */
 } cm_conn_t;
 
 /* structure used for tracking RPC progress */
index 2764b6f66b10799ac08118884d327730636a29f3..db9346df5e92640223e109a089f49730e4d3921e 100644 (file)
@@ -35,6 +35,8 @@
 
 osi_mutex_t cm_Afsdsbmt_Lock;
 
+extern afs_int32 cryptall;
+
 void cm_InitIoctl(void)
 {
        lock_InitializeMutex(&cm_Afsdsbmt_Lock, "AFSDSBMT.INI Access Lock");
@@ -1788,3 +1790,19 @@ long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp)
        return 0;
 }
 
+long cm_IoctlGetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp)
+{
+       memcpy(ioctlp->outDatap, &cryptall, sizeof(cryptall));
+        ioctlp->outDatap += sizeof(cryptall);
+
+       return 0;
+}
+
+long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp)
+{
+       cm_SkipIoctlPath(ioctlp);
+
+       memcpy(&cryptall, ioctlp->inDatap, sizeof(cryptall));
+
+       return 0;
+}
index c0ce809a558b5a5744f8bc1be7a601e8252bc01e..0346d29c75e2b2d9b786c937c64f7ff2cff2f0bc 100644 (file)
@@ -119,6 +119,10 @@ extern long cm_IoctlDeletelink(smb_ioctl_t *ioctlp, cm_user_t *userp);
 
 extern long cm_IoctlMakeSubmount(smb_ioctl_t *ioctlp, cm_user_t *userp);
 
+extern long cm_IoctlGetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp);
+
+extern long cm_IoctlSetRxkcrypt(smb_ioctl_t *ioctlp, cm_user_t *userp);
+
 #endif /* __CM_IOCTL_INTERFACES_ONLY__ */
 
 #endif /*  __CM_IOCTL_H_ENV__ */
index a769464504f974cdd936747bb99d9b1918513d26..985c44400b181978db973eb057fab24dfed8ae0d 100644 (file)
@@ -2621,6 +2621,59 @@ struct cmd_syndesc *as; {
     return 0;
 }
 
+static afs_int32 SetCryptCmd(as)
+    struct cmd_syndesc *as;
+{
+    afs_int32 code = 0, flag;
+    struct ViceIoctl blob;
+    char *tp;
+    tp = as->parms[0].items->data;
+    if (strcmp(tp, "on") == 0)
+      flag = 1;
+    else if (strcmp(tp, "off") == 0)
+      flag = 0;
+    else {
+      fprintf (stderr, "%s: %s must be \"on\" or \"off\".\n", pn, tp);
+      return EINVAL;
+    }
+
+    blob.in = (char *) &flag;
+    blob.in_size = sizeof(flag);
+    blob.out_size = 0;
+    code = pioctl(0, VIOC_SETRXKCRYPT, &blob, 1);
+    if (code)
+      Die(code, (char *) 0);
+    return 0;
+}
+
+static afs_int32 GetCryptCmd(as)
+    struct cmd_syndesc *as;
+{
+    afs_int32 code = 0, flag;
+    struct ViceIoctl blob;
+    char *tp;
+    blob.in = (char *) 0;
+    blob.in_size = 0;
+    blob.out_size = sizeof(flag);
+    blob.out = space;
+
+    code = pioctl(0, VIOC_GETRXKCRYPT, &blob, 1);
+
+    if (code) Die(code, (char *) 0);
+    else {
+      tp = space;
+      bcopy(tp, &flag, sizeof(afs_int32));
+      printf("Security level is currently ");
+      if (flag == 1)
+        printf("crypt (data security).\n");
+      else
+        printf("clear.\n");
+    }
+    return 0;
+}
+
 main(argc, argv)
 int argc;
 char **argv; {
@@ -2838,7 +2891,12 @@ defect 3069
     cmd_AddParm(ts, "-files", CMD_LIST, CMD_OPTIONAL, "specific pathnames");
     cmd_AddParm(ts, "-allfiles", CMD_SINGLE, CMD_OPTIONAL, "new default (KB)");
     cmd_CreateAlias(ts, "sb");
-    
+
+    ts = cmd_CreateSyntax("setcrypt", SetCryptCmd, 0, "set cache manager encryption flag");
+    cmd_AddParm(ts, "-crypt", CMD_SINGLE, 0, "on or off");
+
+    ts = cmd_CreateSyntax("getcrypt", GetCryptCmd, 0, "get cache manager encryption flag");
+
     ts = cmd_CreateSyntax("trace", TraceCmd, 0, "enable or disable CM tracing");
     cmd_AddParm(ts, "-on", CMD_FLAG, CMD_OPTIONAL, "enable tracing");
     cmd_AddParm(ts, "-off", CMD_FLAG, CMD_OPTIONAL, "disable tracing");
index 78daaa6c92ff000b338221669119d7997fefeea1..4986e1f59673728b3b5bc112f9c7daba75c91ba8 100644 (file)
@@ -88,4 +88,7 @@ typedef struct cm_cacheParms {
 #define VIOC_DELSYMLINK                        0x25
 #define VIOC_MAKESUBMOUNT              0x26
 
+#define VIOC_GETRXKCRYPT               0x27
+#define VIOC_SETRXKCRYPT               0x28
+
 #endif /*  __SMB_IOCONS_H_ENV_ */
index 63cfe5c9cc510b8eff20a83805bc29ed0a987ca1..0e0f742f3eb12e3880575d5ed311f43e1dda73ef 100644 (file)
@@ -62,6 +62,8 @@ void smb_InitIoctl(void)
        smb_ioctlProcsp[VIOC_LISTSYMLINK] = cm_IoctlListlink;
        smb_ioctlProcsp[VIOC_DELSYMLINK] = cm_IoctlDeletelink;
        smb_ioctlProcsp[VIOC_MAKESUBMOUNT] = cm_IoctlMakeSubmount;
+       smb_ioctlProcsp[VIOC_GETRXKCRYPT] = cm_IoctlGetRxkcrypt;
+       smb_ioctlProcsp[VIOC_SETRXKCRYPT] = cm_IoctlSetRxkcrypt;
 }
 
 /* called to make a fid structure into an IOCTL fid structure */
index 0bc2869af97a05e3a379b569a77180004b4a7fa4..d179543a1d5ac443c570fc177638d2282530666c 100644 (file)
@@ -212,13 +212,14 @@ BOOL UpdateRegistry(DRIVEMAP *pDrive, BOOL bRemove)
    TCHAR szValueName[128];
    HKEY hKey;
    LONG result;
+   DWORD dwDispo;
 
    if (!pDrive)
       return FALSE;
 
    _stprintf(szKeyName, TEXT("%s\\GlobalAutoMapper"), AFSConfigKeyName);
 
-   if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_SET_VALUE, &hKey) != ERROR_SUCCESS)
+   if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, szKeyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, &hKey, &dwDispo) != ERROR_SUCCESS)
       return FALSE;
 
    _stprintf(szValueName, TEXT("%c:"), pDrive->chDrive);
index 0b08e8eae86b733c49c647ffbe4c7974d839d5f1..0acaed0a1e6d17a5a65221e63ea64fe1ab057643 100644 (file)
@@ -689,7 +689,7 @@ void AdjustAfsPath (LPTSTR pszTarget, LPCTSTR pszSource, BOOL fWantAFS, BOOL fWa
                                                                          (pszSource[4] == TEXT('\\')) ||
                                                                          (lstrlen(pszSource) == 4)))
       wsprintf (pszTarget, TEXT("/afs%s"), pszSource);
-   else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) || ((pszSource[4] == TEXT('/')) ||
+   else if (!fWantAFS && (!lstrncmpi (&pszSource[1], TEXT("afs"), 3) && ((pszSource[4] == TEXT('/')) ||
                                                                         (pszSource[4] == TEXT('\\')) ||
                                                                         (lstrlen(pszSource) == 4))))
       lstrcpy (pszTarget, &pszSource[4]);
index 600af60c8eb3125c49ee8d986320fc4188d11dca..ab12b9e4cd8295eff91570f3c0bf7c967375cc51 100644 (file)
@@ -1262,7 +1262,7 @@ echo file0=%IS5_INCL%\afs\afs_args.h >> Client_Afs_Header_Files.fgl
 echo file1=%IS5_INCL%\afs\debug.h >> Client_Afs_Header_Files.fgl
 echo file2=%IS5_INCL%\afs\param.h >> Client_Afs_Header_Files.fgl
 echo file3=%IS5_INCL%\afs\afs_sysnames.h >> Client_Afs_Header_Files.fgl
-echo file4=%IS5_INCL%\afs\permit_xprt.h >> Client_Afs_Header_Files.fgl
+echo file4=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl
 echo file5=%IS5_INCL%\afs\stds.h >> Client_Afs_Header_Files.fgl
 echo file6=%IS5_INCL%\afs\icl.h >> Client_Afs_Header_Files.fgl
 echo file7=%IS5_INCL%\afs\procmgmt.h >> Client_Afs_Header_Files.fgl
@@ -1349,7 +1349,6 @@ echo file87=%IS5_INCL%\afs\volser.h >> Client_Afs_Header_Files.fgl
 echo file88=%IS5_INCL%\afs\volint.h >> Client_Afs_Header_Files.fgl
 echo file89=%IS5_INCL%\afs\fs_stats.h >> Client_Afs_Header_Files.fgl
 echo file90=%IS5_INCL%\afs\bosint.h >> Client_Afs_Header_Files.fgl
-echo file91=%IS5_INCL%\afs\bnode.h >> Client_Afs_Header_Files.fgl
 echo. >> Client_Afs_Header_Files.fgl
 echo [General] >> Client_Afs_Header_Files.fgl
 echo Type=FILELIST >> Client_Afs_Header_Files.fgl
index 080f2340e8303430b041d269c79c5b90433ef6a8..7391e87d8c751ecc3dfe50952676e2c8136b15e4 100644 (file)
@@ -23,36 +23,82 @@ extern struct mount *afs_cacheVfsp;
 void *osi_UFSOpen(ainode)
     afs_int32 ainode;
 {
+    static struct vnode *tags_vnode = NULL;
     struct inode *ip;
     register struct osi_file *afile = NULL;
     extern int cacheDiskType;
     afs_int32 code = 0;
     int dummy;
     AFS_STATCNT(osi_UFSOpen);
-    if(cacheDiskType != AFS_FCACHE_TYPE_UFS) {
+    if(cacheDiskType != AFS_FCACHE_TYPE_UFS) 
        osi_Panic("UFSOpen called for non-UFS cache\n");
-    }
-    if (!afs_osicred_initialized) {
-       /* valid for alpha_osf, SunOS, Ultrix */
-       bzero((char *)&afs_osi_cred, sizeof(struct AFS_UCRED));
-       afs_osi_cred.cr_ref++;
-       afs_osicred_initialized = 1;
-    }
+
     afile = (struct osi_file *) osi_AllocSmallSpace(sizeof(struct osi_file));
     AFS_GUNLOCK();
-    code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &ip, &dummy);
-    AFS_GLOCK();
-    if (code) {
-       osi_FreeSmallSpace(afile);
-       osi_Panic("UFSOpen: igetinode failed");
+
+    switch(afs_cacheVfsp->m_stat.f_type) {
+    case MOUNT_UFS:
+       code = igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev, (ino_t)ainode, &ip, &dummy);
+       if (code) {
+           osi_FreeSmallSpace(afile);
+           osi_Panic("UFSOpen: igetinode failed");
+       }
+       IN_UNLOCK(ip);
+       afile->vnode = ITOV(ip);
+       afile->size = VTOI(afile->vnode)->i_size;
+       afile->offset = 0;
+       afile->proc = NULL;
+       afile->inum = ainode;        /* for hint validity checking */
+       break;
+    case MOUNT_MSFS: {
+       char path[1024];
+       struct nameidata nd, *ndp = &nd;
+       struct utask_nd utnd = { NULL, NULL };
+       struct vattr attr;
+
+       bzero(&nd, sizeof(nd));
+       ndp->ni_utnd = &utnd;
+       ndp->ni_nameiop = LOOKUP;
+       ndp->ni_cred = &afs_osi_cred;
+       ndp->ni_segflg  = UIO_SYSSPACE;
+
+       /* get hold of a vnode for the .tags directory, so we can
+           lookup files relative to it */
+       if(tags_vnode == NULL) {
+           ndp->ni_cdir = afs_cacheVfsp->m_vnodecovered;
+           strcpy(path, afs_cacheVfsp->m_stat.f_mntonname);
+           strcat(path, "/.tags");
+           ndp->ni_dirp = path;
+           if((code = namei(ndp)))
+               osi_Panic("failed to lookup %s (%d)", path, code);
+           tags_vnode = ndp->ni_vp;
+       }
+       sprintf(path, "%d", ainode);
+       ndp->ni_dirp = path;
+       ndp->ni_cdir = tags_vnode;
+       if((code = namei(ndp)))
+           osi_Panic("failed to lookup %s (%d)", path, code);
+
+       /* XXX this sucks, chances are we're going to do this again right
+          away, but apparently we can't just set the size to 0 */
+       VOP_GETATTR(ndp->ni_vp, &attr, &afs_osi_cred, code);
+       if(code) 
+           osi_Panic("failed to stat %s (%d)", path, code);
+
+       afile->vnode = ndp->ni_vp;
+       afile->size = attr.va_size;
+       afile->offset = 0;
+       afile->proc = NULL;
+       afile->inum = ainode;        /* for hint validity checking */
+       break;
     }
-    IN_UNLOCK(ip);
-    afile->vnode = ITOV(ip);
-    afile->size = VTOI(afile->vnode)->i_size;
-    afile->offset = 0;
-    afile->proc = (int (*)()) 0;
-    afile->inum = ainode;        /* for hint validity checking */
-    return (void *)afile;
+    default:
+       osi_Panic("UFSOpen called for unknown cache-type (%d)", 
+                 afs_cacheVfsp->m_stat.f_type);
+    }
+
+    AFS_GLOCK();
+    return afile;
 }
 
 afs_osi_Stat(afile, astat)
@@ -121,7 +167,9 @@ osi_UFSTruncate(afile, asize)
 void osi_DisableAtimes(avp)
 struct vnode *avp;
 {
-   struct inode *ip = VTOI(avp);
+   struct inode *ip;
+   assert(avp->v_tag == VT_UFS);
+   ip = VTOI(avp);
    ip->i_flag &= ~IACC;
 }
 
index 0679b2a1859675f2991178d39f1a113a70fd7f2d..9e777616026f44f4b8651abd2d5eac9c80e67a0d 100644 (file)
 #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;
@@ -67,6 +103,7 @@ getinode(fs, dev, inode, ipp, perror)
     }
     vp = (struct vnode *) fake_vnode;
     fake_inode_init(vp, fs);
+    assert(vp->v_tag == VT_UFS);
     code = iget(VTOI(vp), inode, &ip, 0);
     if (code != 0) {
        *perror = BAD_IGET;
index d89069381c444bdd97b03a7cc2b96e86283e38f7..760e8a5334d43322a810873fa292c73aeb80183d 100644 (file)
@@ -126,7 +126,39 @@ asmlinkage int afs_xsetgroups(int gidsetsize, gid_t *grouplist)
     return code;
 }
 
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_LINUX24_ENV)
+/* Intercept the standard uid32 system call. */
+extern int (*sys_setgroups32p)(int gidsetsize, gid_t *grouplist);
+asmlinkage int afs_xsetgroups32(int gidsetsize, gid_t *grouplist)
+{
+    int code;
+    cred_t *cr = crref();
+    afs_uint32 junk;
+    int old_pag;
+    
+    lock_kernel();
+    old_pag = PagInCred(cr);
+    crfree(cr);
+    unlock_kernel();
+
+    code = (*sys_setgroups32p)(gidsetsize, grouplist);
+    if (code) {
+       return code;
+    }
+
+    lock_kernel();
+    cr = crref();
+    if (old_pag != NOPAG && PagInCred(cr) == NOPAG) {
+       /* re-install old pag if there's room. */
+       code = setpag(&cr, old_pag, &junk, 0);
+    }
+    crfree(cr);
+    unlock_kernel();
+
+    return code;
+}
+#endif
+#if defined(AFS_SPARC64_LINUX20_ENV)
 asmlinkage int afs_xsetgroups32(int gidsetsize, __kernel_gid_t32 *grouplist)
 {
     gid_t gl[NGROUPS];
index 3e795caf257be45a486462896a4e6e7b8282addb..ac09f995add1eb13c5aa87c271e8009ba15a659f 100644 (file)
@@ -49,6 +49,9 @@ typedef struct vnode {
        unsigned long           i_version;
 #if !defined(AFS_LINUX24_ENV)
        unsigned long           i_nrpages;
+#endif
+#ifdef STRUCT_INODE_HAS_I_BYTES
+        unsigned short          i_bytes;
 #endif
        struct semaphore        i_sem;
 #if defined(AFS_LINUX24_ENV)
index f471d0819bbb79536ae14db92519318b6ffee544..36dd7aa7ec90e4a5f2714a49f57c632983bd2d6f 100644 (file)
@@ -89,6 +89,9 @@ struct super_block *afs_read_super(struct super_block *sb, void *data,
     sb->s_blocksize_bits = 10;
     sb->s_magic = AFS_VFSMAGIC;
     sb->s_op = &afs_sops;      /* Super block (vfs) ops */
+#if defined(MAX_NON_LFS)
+    sb->s_maxbytes = MAX_NON_LFS;
+#endif
     code = afs_root(sb);
     if (code)
        MOD_DEC_USE_COUNT;
@@ -134,7 +137,7 @@ static int afs_root(struct super_block *afsp)
                /* setup super_block and mount point inode. */
                afs_globalVp = tvp;
 #if defined(AFS_LINUX24_ENV)
-               afsp->s_root = d_alloc_root((struct inode*)tvp);
+               afsp->s_root = d_alloc_root((struct inode*)&tvp->v);
 #else
                afsp->s_root = d_alloc_root((struct inode*)tvp, NULL);
 #endif
@@ -255,8 +258,10 @@ void afs_put_super(struct super_block *sbp)
     AFS_GLOCK();
     AFS_STATCNT(afs_unmount);
 
-    if (!suser())
+    if (!suser()) {
+       AFS_GUNLOCK();
        return;
+    }
 
     afs_globalVFS = 0;
     afs_globalVp = 0;
index 2b8fbb7939f3b80bd8282955209e0dd096c04e20..73ba8561f25b3f982e78028a47ef0f88e7fb6256 100644 (file)
@@ -45,7 +45,13 @@ int osi_VM_FlushVCache(struct vcache *avc, int *slept)
     if (avc->opens != 0)
        return EBUSY;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    truncate_inode_pages(&ip->i_data, 0);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    truncate_inode_pages(ip, 0);
+#else
     invalidate_inode_pages(ip);
+#endif
     return 0;
 }
 
@@ -88,7 +94,17 @@ void osi_VM_StoreAllSegments(struct vcache *avc)
  */
 void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(&ip->i_data, 0);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(ip, 0);
+#else
     invalidate_inode_pages((struct inode*)avc);
+#endif
 }
 
 /* Purge pages beyond end-of-file, when truncating a file.
@@ -99,5 +115,15 @@ void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp)
  */
 void osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(&ip->i_data, alen);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+    struct inode *ip = (struct inode*)avc;
+
+    truncate_inode_pages(ip, alen);
+#else
     invalidate_inode_pages((struct inode*)avc);
+#endif
 }
index a73f40f7b2060fa4b40d7c7adcf8aa13f7fb54ff..efc6126af6309acd57f38b7a743a2aa1fe3deafb 100644 (file)
@@ -6,7 +6,6 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 SHELL=/bin/sh
-INSTALL = ${SRCDIR}bin/install
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
 
@@ -34,11 +33,13 @@ kinstall: AFS_component_version_number.c
                        gencat -m afszcm.cat afs_trace.msf ;; \
                *_linux* ) \
                        gencat --new afszcm.cat afs_trace.msf ;; \
+               ppc_darwin* | i386_fbsd*) \
+                       echo No gencat for ${SYS_NAME} ;; \
                * ) \
                        gencat afszcm.cat afs_trace.msf ;; \
        esac
-       
-       
+
+
 
 ukinstall webinstall: AFS_component_version_number.c
        set ${UKERNELDIR}afs; $(MKDIR_IF_NEEDED)
@@ -58,7 +59,7 @@ install install.noversion: kinstall ukinstall
                        ${INSTALL} longc_procs.h ${DESTDIR}include/afs ;; \
        esac
        case ${SYS_NAME} in \
-               next_mach30 | vax_ul43) \
+               next_mach30 | vax_ul43 | ppc_darwin* | i386_fbsd* ) \
                        echo skipping afszcm.cat install for ${SYS_NAME} ;; \
                * ) \
                        ${INSTALL} afszcm.cat ${DESTDIR}root.client/usr/vice/etc/C ;; \
index fd9d1248f2b0adf70195f7e0df8075c739462a46..0366f6f4bc14c06e25b1bd0e4fcd92b8f77112c6 100644 (file)
@@ -263,7 +263,11 @@ struct vnode *avp;
 {
    if (afs_CacheFSType == AFS_SUN_UFS_CACHE) {
        struct inode *ip = VTOI(avp);
+       rw_enter(&ip->i_contents, RW_READER);
+       mutex_enter(&ip->i_tlock);
        ip->i_flag &= ~IACC;
+       mutex_exit(&ip->i_tlock);
+       rw_exit(&ip->i_contents);
    }
 }
 
index 42bdc89dc6ecc6872cb0bb7257f450928744ee93..2f2437b64a6aef93d3d0745cfbd67bdc69ddc55b 100644 (file)
 #include "../afs/osi_inode.h"
 #include "../afs/afs_stats.h" /* statistics stuff */
 
-extern int (*ufs_iputp)(), (*ufs_iallocp)(), (*ufs_iupdatp)(),  (*ufs_igetp)();
+extern int (*ufs_iallocp)(), (*ufs_iupdatp)(), (*ufs_igetp)(),
+           (*ufs_itimes_nolockp)();
+
+#define AFS_ITIMES(ip) { \
+        mutex_enter(&(ip)->i_tlock); \
+        (*ufs_itimes_nolockp)(ip); \
+        mutex_exit(&(ip)->i_tlock); \
+}
 
 getinode(vfsp, dev, inode, ipp, credp,perror)
      struct vfs *vfsp;
@@ -34,6 +41,7 @@ getinode(vfsp, dev, inode, ipp, credp,perror)
     struct vnode *vp;
     struct fs *fs;
     struct inode *pip;
+    struct ufsvfs *ufsvfsp;
     
     AFS_STATCNT(getinode);
     
@@ -48,7 +56,17 @@ getinode(vfsp, dev, inode, ipp, credp,perror)
        ) {
        return (ENODEV);
     }
-    if (code = (*ufs_igetp)(vfsp, inode, &ip, credp)) {
+    ufsvfsp = (struct ufsvfs *)vfsp->vfs_data;
+
+#if defined(AFS_SUN57_ENV)
+    rw_enter(&ufsvfsp->vfs_dqrwlock, RW_READER);
+#endif
+    code = (*ufs_igetp)(vfsp, inode, &ip, credp);
+#if defined(AFS_SUN57_ENV)
+    rw_exit(&ufsvfsp->vfs_dqrwlock);
+#endif
+
+    if (code) {
        *perror = BAD_IGET;
        return code;
     }
@@ -81,14 +99,16 @@ igetinode(vfsp, dev, inode, ipp, credp,perror)
     
     if (ip->i_mode == 0) {
        /* Not an allocated inode */
+       AFS_ITIMES(ip);
        rw_exit(&ip->i_contents);
-       (*ufs_iputp)(ip);
+       VN_RELE(ITOV(ip));
        return (ENOENT);
     }
     
     if (ip->i_nlink == 0 || (ip->i_mode&IFMT) != IFREG) {
+       AFS_ITIMES(ip);
        rw_exit(&ip->i_contents);
-       (*ufs_iputp)(ip);
+       VN_RELE(ITOV(ip));
        return (ENOENT);
     }
     
@@ -122,6 +142,7 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp)
     struct inode *ip, *newip;
     register int code;
     dev_t newdev;
+    struct ufsvfs *ufsvfsp;
 
     AFS_STATCNT(afs_syscall_icreate);
     
@@ -142,11 +163,26 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp)
     if (code) {
        return (code);
     }
-    if (code = (*ufs_iallocp)(ip, near_inode, 0, &newip, credp)) {     
-       (*ufs_iputp)(ip);
+
+    ufsvfsp = ip->i_ufsvfs;
+    rw_enter(&ip->i_rwlock, RW_WRITER);
+#if defined(AFS_SUN57_ENV)
+    rw_enter(&ufsvfsp->vfs_dqrwlock, RW_READER);
+#endif
+    rw_enter(&ip->i_contents, RW_WRITER);
+    code = (*ufs_iallocp)(ip, near_inode, 0, &newip, credp);
+#if defined(AFS_SUN57_ENV)
+    rw_exit(&ufsvfsp->vfs_dqrwlock);
+#endif
+    rw_exit(&ip->i_rwlock);
+
+    AFS_ITIMES(ip);
+    rw_exit(&ip->i_contents);
+    VN_RELE(ITOV(ip));
+
+    if (code) {
        return (code);
     }
-    (*ufs_iputp)(ip);
     rw_enter(&newip->i_contents, RW_WRITER);
     mutex_enter(&newip->i_tlock);
     newip->i_flag |= IACC|IUPD|ICHG;
@@ -184,8 +220,9 @@ afs_syscall_icreate(dev, near_inode, param1, param2, param3, param4, rvp, credp)
      */
     if (CrSync)
        (*ufs_iupdatp)(newip, 1);
+    AFS_ITIMES(newip);
     rw_exit(&newip->i_contents);
-    (*ufs_iputp)(newip);
+    VN_RELE(ITOV(newip));
     return (code);
 }
 
@@ -224,7 +261,10 @@ afs_syscall_iopen(dev, inode, usrmod, rvp, credp)
     }
     code = falloc((struct vnode *)NULL, FWRITE|FREAD, &fp, &fd);
     if (code) {
-       (*ufs_iputp)(ip);
+       rw_enter(&ip->i_contents, RW_READER);
+       AFS_ITIMES(ip);
+       rw_exit(&ip->i_contents);
+       VN_RELE(ITOV(ip));
        return (code);
     }
     
@@ -284,9 +324,13 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp)
     if (code) {
        return (code);
     }
-    if (!IS_VICEMAGIC(ip))
+    if (!IS_VICEMAGIC(ip)) {
        code = EPERM;
-    else {
+       rw_enter(&ip->i_contents, RW_READER);
+       AFS_ITIMES(ip);
+       rw_exit(&ip->i_contents);
+       VN_RELE(ITOV(ip));
+    } else {
        rw_enter(&ip->i_contents, RW_WRITER);
        ip->i_nlink += amount;
        if (ip->i_nlink == 0) {
@@ -300,9 +344,10 @@ afs_syscall_iincdec(dev, inode, inode_p1, amount, rvp, credp)
        /* We may want to force the inode to the disk in case of crashes, other references, etc. */
        if (IncSync)
            (*ufs_iupdatp)(ip, 1);
+       AFS_ITIMES(ip);
        rw_exit(&ip->i_contents);
+       VN_RELE(ITOV(ip));
     }
-    (*ufs_iputp)(ip);
     return (code);
 }
 
index 40d72507b3ad6b6536d20ff66869c1dd003b8e3b..a16dea180449f4083fc8e4c333ac4eb8bc5fdbde 100644 (file)
@@ -231,10 +231,10 @@ struct vfsops Afs_vfsops = {
 /*
  * afsinit - intialize VFS
  */
-void (*ufs_iputp)();
 int (*ufs_iallocp)();
 void (*ufs_iupdatp)();
 int (*ufs_igetp)();
+void (*ufs_itimes_nolockp)();
 
 struct streamtab *udp_infop = 0;
 struct ill_s *ill_g_headp = 0;
@@ -302,14 +302,14 @@ afsinit(struct vfssw *vfsswp, int fstype)
     nfs_checkauth = (int (*)()) modlookup("nfssrv", "checkauth");
     if ( !nfs_checkauth ) afs_warn("nfs_checkauth not initialised");
 #endif
-    ufs_iputp = (int (*)()) modlookup("ufs", "ufs_iput");    
     ufs_iallocp = (int (*)()) modlookup("ufs", "ufs_ialloc");    
     ufs_iupdatp = (int (*)()) modlookup("ufs", "ufs_iupdat");
     ufs_igetp = (int (*)()) modlookup("ufs", "ufs_iget");    
+    ufs_itimes_nolockp = (void (*)()) modlookup("ufs", "ufs_itimes_nolock");
     udp_infop = (struct streamtab *) modlookup("udp", "udpinfo");    
     ill_g_headp = (struct ill_s *) modlookup("ip", "ill_g_head");    
 
-    if ( !ufs_iputp || !ufs_iallocp || !ufs_iupdatp ||
+    if ( !ufs_iallocp || !ufs_iupdatp || !ufs_itimes_nolockp ||
         !ufs_igetp || !udp_infop || !ill_g_headp )
        afs_warn("AFS to UFS mapping cannot be fully initialised\n");
 
index 5bff120ba34dcf28b079f95c30bbc002c94b0ee5..2d93e7c88adab169115d6ebccaae94e72012519c 100644 (file)
@@ -1845,7 +1845,7 @@ void uafs_Init(
        iob.out = tbuffer;
        iob.out_size = sizeof(tbuffer);
 
-#if defined(AFS_USR_SUN5_ENV) || defined(AFS_USR_OSF_ENV) || defined(AFS_USR_HPUX_ENV) || defined(AFS_USR_LINUX22_ENV)
+#if defined(AFS_USR_SUN5_ENV) || defined(AFS_USR_OSF_ENV) || defined(AFS_USR_HPUX_ENV) || defined(AFS_USR_LINUX22_ENV) || defined(AFS_USR_DARWIN_ENV) || defined(AFS_USR_FBSD_ENV)
        rc = syscall(AFS_SYSCALL, AFSCALL_PIOCTL, 0, _VICEIOCTL(8), &iob, 0);
 #elif defined(AFS_USR_SGI_ENV)
        rc = syscall(AFS_PIOCTL, 0, _VICEIOCTL(8), &iob, 0);
index 34675191dcbb530d7cc0eea3a8348facb245d272..311f2161f8d4969ada61f053fe258edabae7d7c7 100644 (file)
@@ -97,11 +97,11 @@ afs_CopyOutAttrs(avc, attrs)
      * anyway, so the difference between 512K and 1000000 shouldn't matter
      * much, and "&" is a lot faster than "%".
      */
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     attrs->va_atime.tv_nsec = attrs->va_mtime.tv_nsec =
        attrs->va_ctime.tv_nsec =
            (hgetlo(avc->m.DataVersion) & 0x7ffff) * 1000;
-#ifdef AFS_AIX41_ENV
+#if defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     attrs->va_blocksize = PAGESIZE;            /* XXX Was 8192 XXX */
 #else
     attrs->va_blksize = PAGESIZE;              /* XXX Was 8192 XXX */
@@ -137,7 +137,7 @@ afs_CopyOutAttrs(avc, attrs)
     attrs->va_flags = 0;
 #endif /* AFS_OSF_ENV */
 
-#if !defined(AFS_OSF_ENV)
+#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #if !defined(AFS_HPUX_ENV)
 #ifdef AFS_SUN5_ENV
     attrs->va_nblocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) << 1 : 0);
@@ -151,7 +151,7 @@ afs_CopyOutAttrs(avc, attrs)
 #else /* !defined(AFS_HPUX_ENV) */
     attrs->va_blocks = (attrs->va_size? ((attrs->va_size + 1023)>>10) : 0);
 #endif /* !defined(AFS_HPUX_ENV) */
-#else  /* ! AFS_OSF_ENV */
+#else  /* ! AFS_OSF_ENV && !AFS_FBSD_ENV */
     attrs->va_bytes = (attrs->va_size? (attrs->va_size + 1023) : 1024);
 #ifdef va_bytes_rsv
     attrs->va_bytes_rsv = -1;
@@ -232,7 +232,7 @@ afs_getattr(OSI_VC_ARG(avc), attrs, acred)
                  return EACCES;
              }
              if (avc->mvstat == 2) {
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
                  attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000); 
 #else
                  attrs->va_mtime.tv_usec += ++avc->xlatordv; 
@@ -359,7 +359,7 @@ register struct AFSStoreStatus *as; {
 #endif
        mask |= AFS_SETMODTIME;
 #ifndef        AFS_SGI_ENV
-#if    defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
        if (av->va_mtime.tv_nsec == -1)
 #else
        if (av->va_mtime.tv_usec == -1)
index 9a1ba19ffec852c090403f41be9533e8516cd266..b8deaf20102ea2d116a9da13aad19e091f7acdca 100644 (file)
@@ -287,7 +287,7 @@ tagain:
       (afs_Analyze(tc, code, &adp->fid, &treq,
                   AFS_STATS_FS_RPCIDX_CREATEFILE, SHARED_LOCK, (struct cell *)0));
 
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
     if (code == EEXIST && aexcl == NONEXCL) {
        /* This lookup was handled in the common vn_open code in the
           vnode layer */
index 2516273f3a7fe3bb23b38a59092f7931350f74f3..57819b5d1bc2639ed9a7fb3735db4174736210fd 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include "../afs/param.h"      /* Should be always first */
-#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_DUX40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 #include "../afs/afsincludes.h"        /* Afs-based standard headers */
 #include "../afs/afs_stats.h" /* statistics */
index 518186300d32b6316ecda73f4ad15d8bb798541b..35375b51162c7498d75ba0ffc82fd84efdcc1e7e 100644 (file)
@@ -40,7 +40,7 @@ void lockIdSet(flock, slp, clid)
 #if    defined(AFS_SUN5_ENV)
     register proc_t *procp = ttoproc(curthread);    
 #else
-#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV)
+#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #ifdef AFS_SGI_ENV
     struct proc *procp = OSI_GET_CURRENT_PROCP();
 #else
@@ -80,7 +80,7 @@ void lockIdSet(flock, slp, clid)
 #endif
         slp->pid = clid;
 #else
-#if    defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
+#if    defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
        slp->pid = clid;
 #else
 #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
@@ -119,7 +119,7 @@ void lockIdSet(flock, slp, clid)
 #endif
         flock->l_pid = clid;
 #else
-#if    defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
+#if    defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
        flock->l_pid = clid;
 #else
 #if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
@@ -154,7 +154,7 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid)
 #if    defined(AFS_SUN5_ENV)
     register proc_t *procp = ttoproc(curthread);    
 #else
-#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV)
+#if !defined(AFS_AIX41_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_SGI65_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #ifdef AFS_SGI64_ENV
     struct proc *procp = curprocp;
 #else /* AFS_SGI64_ENV */
@@ -171,7 +171,7 @@ static int lockIdcmp2(flock1, vp, alp, onlymine, clid)
       }
 #endif
       if ((flock1->l_pid == alp->pid) || 
-#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
+#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
          (!onlymine && (flock1->l_pid == getppid()))
 #else
 #if defined(AFS_SGI65_ENV)
@@ -481,7 +481,7 @@ int flag;
 pid_t clid;
 off_t offset;
 #else
-#if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV))
+#if defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 afs_lockctl(avc, af, acmd, acred, clid)
 pid_t clid;
 #else
@@ -536,6 +536,10 @@ struct AFS_UCRED *acred; {
           this way at least, they can get work done */
        if (af->l_len == 0x7fffffff)
            af->l_len = 0;      /* since some systems indicate it as EOF */
+#ifdef AFS_LINUX_64BIT_KERNEL
+       if (af->l_len == LONG_MAX)
+           af->l_len = 0;      /* since some systems indicate it as EOF */
+#endif
        /* next line makes byte range locks always succeed,
           even when they should block */
        if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) {
@@ -824,7 +828,7 @@ static int GetFlockCount(struct vcache *avc, struct vrequest *areq)
 #endif
 
 
-#if    !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV)
+#if    !defined(AFS_AIX_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(UKERNEL) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 /* Flock not support on System V systems */
 #ifdef AFS_OSF_ENV
 extern struct fileops afs_fileops;
@@ -852,7 +856,11 @@ afs_xflock () {
     uap = (struct a *)args;
     getf(&fd, uap->fd, FILE_FLAGS_NULL, &u.u_file_state);
 #else /* AFS_OSF_ENV */
+#if defined(AFS_FBSD_ENV)
+    uap = (struct a *)u.u_ap;
+#else
     uap = (struct a *)u.u_ap;
+#endif /* AFS_FBSD_ENV */
     fd = getf(uap->fd);
 #endif
     if (!fd) return;
index 70c7521767e570616f1f2c6e24cd589a684c050c..2d06f6379494df3ce6dafc306d44c117a18d06f0 100644 (file)
@@ -419,6 +419,13 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock)
            AFS_GUNLOCK();
            code = osi_file_uio_rdwr(tfile, auio, UIO_READ);
            AFS_GLOCK();
+#else
+#if defined(AFS_DARWIN_ENV)
+            AFS_GUNLOCK();
+            VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
+            code = VOP_READ(tfile->vnode, auio, 0, &afs_osi_cred);
+            VOP_UNLOCK(tfile->vnode, 0, current_proc());
+            AFS_GLOCK();
 #else
            code = VOP_RDWR(tfile->vnode, auio, UIO_READ, 0, &afs_osi_cred);
 #endif
@@ -426,6 +433,7 @@ afs_UFSReadFast(avc, auio, acred, albn, abpp, noLock)
 #endif
 #endif
 #endif
+#endif
 #endif
            auio->afsio_offset += avc->quick.minLoc;
            osi_UFSClose(tfile);
@@ -749,6 +757,13 @@ tagain:
            AFS_GUNLOCK();
            code = osi_file_uio_rdwr(tfile, &tuio, UIO_READ);
            AFS_GLOCK();
+#else
+#if defined(AFS_DARWIN_ENV)
+            AFS_GUNLOCK();
+            VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
+            code = VOP_READ(tfile->vnode, &tuio, 0, &afs_osi_cred);
+            VOP_UNLOCK(tfile->vnode, 0, current_proc());
+            AFS_GLOCK();
 #else
            code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, &afs_osi_cred);
 #endif
@@ -758,6 +773,7 @@ tagain:
 #endif
 #endif
 #endif
+#endif
 
 #ifdef IHINT
             if (!tdc->ihint && nihints < maxIHint) {
index 0868f00a7e61f99fefcb8b7cbaa3f20f7c7bc8ab..aa62ffd19bf4e5b104be64cad06424ef674189df 100644 (file)
@@ -25,7 +25,7 @@
 
 
 
-#if    defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 afs_ustrategy(abp, credp)
     struct AFS_UCRED *credp;
 #else
@@ -36,14 +36,14 @@ afs_ustrategy(abp)
     struct uio tuio;
     register struct vcache *tvc = (struct vcache *) abp->b_vp;
     register afs_int32 len = abp->b_bcount;
-#if    !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV)
+#if    !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #ifdef AFS_AIX41_ENV
     struct ucred *credp;
 #else
     struct AFS_UCRED *credp = u.u_cred;
 #endif
 #endif
-#if    defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
+#if    defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     int async = abp->b_flags & B_ASYNC;
 #endif
     struct iovec tiovec[1];
@@ -71,7 +71,7 @@ afs_ustrategy(abp)
        */
        tuio.afsio_iov = tiovec;
        tuio.afsio_iovcnt = 1;
-#if    defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#if    defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
        tuio.afsio_offset = (u_int) dbtob(abp->b_blkno);
 #if    defined(AFS_SUN5_ENV)
        tuio._uio_offset._p._u = 0;
@@ -84,7 +84,11 @@ afs_ustrategy(abp)
        tuio.afsio_fmode = 0;
 #endif
        tuio.afsio_resid = abp->b_bcount;
+#if defined(AFS_FBSD_ENV)
+       tiovec[0].iov_base = abp->b_saveaddr;
+#else
        tiovec[0].iov_base = abp->b_un.b_addr;
+#endif /* AFS_FBSD_ENV */
        tiovec[0].iov_len = abp->b_bcount;
        /* are user's credentials valid here?  probably, but this
             sure seems like the wrong things to do. */
@@ -95,7 +99,11 @@ afs_ustrategy(abp)
 #endif
        if (code == 0) {
            if (tuio.afsio_resid > 0)
+#if defined(AFS_FBSD_ENV)
+               bzero(abp->b_saveaddr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid);
+#else
                bzero(abp->b_un.b_addr + abp->b_bcount - tuio.afsio_resid, tuio.afsio_resid);
+#endif /* AFS_FBSD_ENV */
 #ifdef AFS_AIX32_ENV
            /*
             * If we read a block that is past EOF and the user was not storing
@@ -140,7 +148,11 @@ afs_ustrategy(abp)
        len = MIN(abp->b_bcount, ((struct vcache *)abp->b_vp)->m.Length - dbtob(abp->b_blkno));
 #endif /* AFS_ALPHA_ENV */
        tuio.afsio_resid = len;
+#if defined(AFS_FBSD_ENV)
+       tiovec[0].iov_base = abp->b_saveaddr;
+#else
        tiovec[0].iov_base = abp->b_un.b_addr;
+#endif /* AFS_FBSD_ENV */
        tiovec[0].iov_len = len;
        /* are user's credentials valid here?  probably, but this
             sure seems like the wrong things to do. */
index e73c1f47b9db9c8b6d832e6c76e81dde0647dc16..77b56aa00a44dbe2ad0208831bf1dd3141fb4726 100644 (file)
@@ -528,8 +528,16 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
        AFS_GUNLOCK();
        code = osi_file_uio_rdwr(tfile, &tuio, UIO_WRITE);
        AFS_GLOCK();
+#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+        AFS_GUNLOCK();
+        VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
+        code = VOP_WRITE(tfile->vnode, &tuio, 0, &afs_osi_cred);
+        VOP_UNLOCK(tfile->vnode, 0, current_proc());
+        AFS_GLOCK();
 #else
        code = VOP_RDWR(tfile->vnode, &tuio, UIO_WRITE, 0, &afs_osi_cred);
+#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
 #endif /* AFS_LINUX20_ENV */
 #endif /* AFS_HPUX100_ENV */
 #endif /* AFS_OSF_ENV */
@@ -601,6 +609,9 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
      * If write is implemented via VM, afs_fsync() is called from the high-level
      * write op.
      */
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+     if (noLock && (aio & IO_SYNC)) {
+#else 
 #ifdef AFS_HPUX_ENV
     /* On hpux on synchronous writes syncio will be set to IO_SYNC. If
      * we're doing them because the file was opened with O_SYNCIO specified,
@@ -609,6 +620,7 @@ afs_UFSWrite(avc, auio, aio, acred, noLock)
     if (noLock && ((aio & IO_SYNC) | (auio->uio_fpflags & FSYNCIO))) {    
 #else
     if (noLock && (aio & FSYNC)) {
+#endif
 #endif
        if (!AFS_NFSXLATORREQ(acred))
            afs_fsync(avc, acred);
@@ -638,7 +650,7 @@ struct vrequest *areq; {
 
 
 
-#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined (AFS_AIX_ENV) && !defined (AFS_HPUX_ENV) && !defined (AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #ifdef AFS_DUX50_ENV
 #define vno_close(X) vn_close((X), 0, NOCRED)
 #elif defined(AFS_DUX40_ENV)
index 32bfc5cbac4bc57b8703033a8c552ac54e309959..849eb03fff7747060c4b289783870b0b944485c2 100644 (file)
@@ -15,7 +15,7 @@
 #include "../afs/sysincludes.h"        /* Standard vendor system headers */
 
 #ifndef UKERNEL
-#ifndef AFS_LINUX20_ENV
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
 #include <net/if.h>
 #include <netinet/in.h>
 #endif
@@ -23,7 +23,7 @@
 #ifdef AFS_SGI62_ENV
 #include "../h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
 #include <netinet/in_var.h>
 #endif
 #endif /* !UKERNEL */
index 56c5c83e13488db11936ce0dae0fee72c530b030..9c7018f1feabf65d66c7171cf65a4a23a25a7845 100644 (file)
@@ -1237,7 +1237,7 @@ static int afs_UFSCacheStoreProc(acall, afile, alen, avc, shouldWake,
        tlen = (alen > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : alen);
        got = afs_osi_Read(afile, -1, tbuffer, tlen);
        if ((got < 0) 
-#if    !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
+#if    !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
            || (got != tlen && getuerror())
 #endif
            ) {
@@ -1718,6 +1718,7 @@ struct dcache *afs_GetDCache(avc, abyte, areq, aoffset, alen, aflags)
        updateV2DC(setLocks,avc,tdc,567);
        return tdc;     /* check if we're done */
     }
+    osi_Assert(setLocks || WriteLocked(&avc->lock));
 
     if (setLocks) ObtainReadLock(&avc->lock);
     if (!hsame(avc->m.DataVersion, tdc->f.versionNo)) {
@@ -2299,7 +2300,7 @@ struct dcache *afs_UFSGetDSlot(aslot, tmpdc)
        tdc->f.chunk = -1;
        hones(tdc->f.versionNo);
        tdc->flags |= DFEntryMod;
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
        last_error = getuerror();
 #endif
        lasterrtime = osi_Time();
@@ -2473,11 +2474,7 @@ int afs_InitCacheFile(afile, ainode)
        tdc->f.inode = VTOI(filevp->d_inode)->i_number;
        dput(filevp);
 #else
-#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
-       tdc->f.inode = VnodeToIno(filevp);
-#else
-       tdc->f.inode = VTOI(filevp)->i_number;
-#endif
+       tdc->f.inode = afs_vnodeToInumber(filevp);
 #ifdef AFS_DEC_ENV
        grele(filevp);
 #else
index 765f5660f351c0ce647ce59222a8d8e847badd1d..9cfb2614cb30cfe3f88932e9e3cfa6eac52d9276 100644 (file)
@@ -97,7 +97,7 @@ extern afs_lock_t afs_ftf;
 /* Exported variables */
 struct osi_dev cacheDev;           /*Cache device*/
 afs_int32 cacheInfoModTime;                    /*Last time cache info modified*/
-#if    defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV)
 struct mount *afs_cacheVfsp=0;
 #elif defined(AFS_LINUX20_ENV)
 struct super_block *afs_cacheSBp = 0;
@@ -325,11 +325,7 @@ afs_InitVolumeInfo(afile)
 #else
     code = gop_lookupname(afile, AFS_UIOSYS, 0, (struct vnode **) 0, &filevp);
     if (code) return ENOENT;
-#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
-    fce.inode = volumeInode = VnodeToIno(filevp);
-#else
-    fce.inode = volumeInode = VTOI(filevp)->i_number;
-#endif
+    fce.inode = volumeInode = afs_vnodeToInumber(filevp);
 #ifdef AFS_DEC_ENV
     grele(filevp);
 #else
@@ -436,7 +432,11 @@ afs_InitCacheInfo(afile)
              TO_KERNEL_SPACE();
          }
 #else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+        if (!VFS_STATFS(filevp->v_mount, &st, current_proc()))
+#else 
        if (!VFS_STATFS(filevp->v_vfsp, &st))  
+#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
 #endif /* AFS_LINUX20_ENV */
 #endif /* AIX41 */
 #endif /* OSF */
@@ -449,17 +449,14 @@ afs_InitCacheInfo(afile)
 #endif
     }
 #ifdef AFS_LINUX20_ENV
-      cacheInode = filevp->i_ino;
-      afs_cacheSBp = filevp->i_sb;
+    cacheInode = filevp->i_ino;
+    afs_cacheSBp = filevp->i_sb;
 #else
-#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS)
+#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
     afs_InitDualFSCacheOps(filevp);
-    cacheInode = VnodeToIno(filevp);
-    cacheDev.dev = VnodeToDev(filevp);
-#else
-    cacheInode = VTOI(filevp)->i_number;
-    cacheDev.dev = VTOI(filevp)->i_dev;
 #endif
+    cacheInode = afs_vnodeToInumber(filevp);
+    cacheDev.dev = afs_vnodeToDev(filevp);
     afs_cacheVfsp = filevp->v_vfsp;
 #endif /* AFS_LINUX20_ENV */
     AFS_RELE((struct vnode *)filevp);
index 2b2fd206d441974bdfec3bf1148c5af5b1897e5f..e36f9b8190cdd993def0f864965d64a79b65e67d 100644 (file)
@@ -50,6 +50,9 @@ void osi_Init()
 #elif defined(AFS_OSF_ENV)
     usimple_lock_init(&afs_global_lock);
     afs_global_owner = (thread_t)0;
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    lockinit(&afs_global_lock, PLOCK, "afs global lock", 0, 0);
+    afs_global_owner = (thread_t)0;
 #elif defined(AFS_AIX41_ENV)
     lock_alloc((void*)&afs_global_lock, LOCK_ALLOC_PIN, 1, 1);
     simple_lock_init((void *)&afs_global_lock);
@@ -77,7 +80,7 @@ void osi_Init()
 osi_Active(avc)
 register struct vcache *avc; {
     AFS_STATCNT(osi_Active);
-#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV)
+#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     if ((avc->opens > 0) || (avc->states & CMAPPED))   return 1;   /* XXX: Warning, verify this XXX  */
 #else
 #if    defined(AFS_MACH_ENV)
@@ -292,12 +295,16 @@ void afs_osi_Invisible() {
 #if    defined(AFS_HPUX101_ENV)
     set_system_proc(u.u_procp);
 #else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    current_proc()->p_flag |= P_SYSTEM;
+#else
 #if !defined(AFS_SGI64_ENV) && !defined(AFS_LINUX20_ENV)
     u.u_procp->p_flag |= SSYS;
 #endif /* AFS_SGI64_ENV */
 #endif
 #endif
 #endif
+#endif
 #endif
     AFS_STATCNT(osi_Invisible);
 }
@@ -343,6 +350,11 @@ afs_osi_SetTime(atv)
     sta.time = atv->tv_sec;
     stime(&sta);
     AFS_GLOCK();
+#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    AFS_GUNLOCK();
+    setthetime(atv);
+    AFS_GLOCK();
 #else
     /* stolen from kern_time.c */
 #ifndef        AFS_AUX_ENV
@@ -367,6 +379,7 @@ afs_osi_SetTime(atv)
 #ifdef AFS_AUX_ENV
     logtchg(atv->tv_sec);
 #endif
+#endif  /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
 #endif /* AFS_SGI_ENV */
 #endif /* AFS_SUN55_ENV */
 #endif /* AFS_SUN5_ENV */
@@ -729,6 +742,22 @@ extern int npid;
 }
 #endif
 
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+void afs_osi_TraverseProcTable()
+{   
+    struct proc *p;
+    LIST_FOREACH(p, &allproc, p_list) {
+        if (p->p_stat == SIDL)
+            continue;
+        if (p->p_stat == SZOMB)
+            continue;
+        if (p->p_flag & P_SYSTEM)
+            continue;
+          afs_GCPAGs_perproc_func(p);
+    }
+}   
+#endif
+
 /* return a pointer (sometimes a static copy ) to the cred for a
  * given AFS_PROC.
  * subsequent calls may overwrite the previously returned value.
@@ -885,6 +914,31 @@ const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
 
     return rv;
 }
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
+{   
+    struct AFS_UCRED *rv=NULL;
+    static struct AFS_UCRED cr;
+
+    if(pr == NULL) {
+       return NULL;
+    }
+   
+    if((pr->p_stat == SSLEEP) ||
+       (pr->p_stat == SRUN) ||
+       (pr->p_stat == SSTOP)) {
+       pcred_readlock(pr);
+       cr.cr_ref=1;
+       cr.cr_uid=pr->p_cred->pc_ucred->cr_uid;
+       cr.cr_ngroups=pr->p_cred->pc_ucred->cr_ngroups;
+       bcopy(pr->p_cred->pc_ucred->cr_groups, cr.cr_groups,NGROUPS *
+             sizeof(gid_t));
+       pcred_unlock(pr);
+       rv = &cr;
+    }
+    
+    return rv;
+}  
 #else
 const struct AFS_UCRED *afs_osi_proc2cred(AFS_PROC *pr)
 {
index c193f3a44d239829a6e0ee2d19180cae4837e2f4..a1b6cec7e38dd11dc5758bef38c2b5f675e901ed 100644 (file)
@@ -100,7 +100,7 @@ afs_uint32 getpag(void) {
 int
 #if    defined(AFS_SUN5_ENV)
 afs_setpag (struct AFS_UCRED **credpp)
-#elif  defined(AFS_OSF_ENV)
+#elif  defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 afs_setpag (struct proc *p, void *args, int *retval)
 #else
 afs_setpag (void) 
@@ -127,7 +127,7 @@ afs_setpag (void)
 
 #if    defined(AFS_SUN5_ENV)
     code = AddPag(genpag(), credpp);
-#elif  defined(AFS_OSF_ENV)
+#elif  defined(AFS_OSF_ENV) || defined(AFS_FBSD_ENV)
     code = AddPag(p, genpag(), &p->p_rcred);
 #elif  defined(AFS_AIX41_ENV)
     {
@@ -159,12 +159,18 @@ afs_setpag (void)
        code = AddPag(genpag(), &credp);
        crfree(credp);
     }
+#elif defined(AFS_DARWIN_ENV)  || defined(AFS_FBSD_ENV)
+    {
+       struct ucred *credp=crdup(p->p_cred->pc_ucred);
+       code=AddPag(p, genpag(), &credp);
+       crfree(credp);
+    }
 #else
     code = AddPag(genpag(), &u.u_cred);
 #endif
 
     afs_Trace1(afs_iclSetp, CM_TRACE_SETPAG, ICL_TYPE_INT32, code);
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #if defined(AFS_SGI53_ENV) && defined(MP)
     AFS_GUNLOCK();
 #endif /* defined(AFS_SGI53_ENV) && defined(MP) */    
@@ -176,20 +182,20 @@ afs_setpag (void)
 #endif
 }
 
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp)
-#else  /* AFS_OSF_ENV */
+#else  /* AFS_OSF_ENV || AFS_FBSD_ENV */
 int AddPag(afs_int32 aval, struct AFS_UCRED **credpp)
 #endif
 {
     afs_int32 newpag, code;
     AFS_STATCNT(AddPag);
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     if (code = setpag(p, credpp, aval, &newpag, 0))
 #else  /* AFS_OSF_ENV */
     if (code = setpag(credpp, aval, &newpag, 0))
 #endif
-#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
+#if    defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
        return (code);
 #else
        return (setuerror(code), code);
@@ -211,7 +217,12 @@ afs_InitReq(av, acred)
         * think it's ok to use the real uid to make setuid
          * programs (without setpag) to work properly.
          */
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+        av->uid = acred->cr_uid;    /* default when no pag is set */
+                                    /* bsd creds don't have ruid */
+#else
        av->uid = acred->cr_ruid;    /* default when no pag is set */
+#endif
     }
     av->initd = 0;
     return 0;
@@ -268,17 +279,27 @@ afs_int32 PagInCred(const struct AFS_UCRED *cred)
     if (cred == NULL) {
        return NOPAG;
     }
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    if (cred == NOCRED || cred == FSCRED) {
+        return NOPAG;
+    }
+    if (cred->cr_ngroups < 3) return NOPAG;
+    /* gid is stored in cr_groups[0] */
+    g0 = cred->cr_groups[1];
+    g1 = cred->cr_groups[2];
+#else
 #ifdef AFS_AIX_ENV
     if (cred->cr_ngrps < 2) {
        return NOPAG;
     }
 #else
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DUX40_ENV) || defined(AFS_LINUX_ENV) || defined(AFS_FBSD_ENV)
     if (cred->cr_ngroups < 2) return NOPAG;
 #endif
 #endif
     g0 = cred->cr_groups[0];
     g1 = cred->cr_groups[1];
+#endif
     pag = (afs_int32)afs_get_pag_from_groups(g0, g1);
     return pag;
 }
index 91ff82c5ecc6734f6770cbcffc0188d5d63e19cd..bd100abd8f7d79df8669e2d9eca832b5513ece3c 100644 (file)
@@ -38,9 +38,9 @@ extern void afs_osi_TraverseProcTable(void);
 /* afs_osi_pag.c */
 extern afs_uint32 genpag(void);
 extern afs_uint32 getpag(void);
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 extern int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp);
-#else  /* AFS_OSF_ENV */
+#else  /* AFS_OSF_ENV || AFS_FBSD_ENV */
 extern int AddPag(afs_int32 aval, struct AFS_UCRED **credpp);
 #endif
 extern afs_uint32 afs_get_pag_from_groups(gid_t g0, gid_t g1);
@@ -119,7 +119,7 @@ extern void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
                         int acell, struct cell *tcell, struct vrequest *areq);
 extern void afs_ResetVolumeInfo(struct volume *tv);
 
-#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_AIX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #include "../afs/osi_prototypes.h"
 #endif
 
index 84a3b35ba9742f57070ac48553a942176c8ceff4..e8dfc7fa820d86ecb07a181fa8be269e2998cd58 100644 (file)
@@ -1202,6 +1202,13 @@ static afs_SetServerPrefs(sa)
 #ifdef AFS_SGI62_ENV
     (void) hash_enum(&hashinfo_inaddr, afsi_enum_set_rank, HTF_INET, NULL,
                     (caddr_t)sa, NULL);
+#elif defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    {
+        struct in_ifaddr *ifa;
+        TAILQ_FOREACH(ifa , &in_ifaddrhead, ia_link) {
+            afsi_SetServerIPRank(sa, ifa);
+        }
+    }
 #else
     {
        extern struct in_ifaddr *in_ifaddr;
index 18c317d572b66c096fd15121915358bf1499b151..3c2a5d5a65a13db58e05570b667c0783f08368a8 100644 (file)
@@ -606,7 +606,11 @@ void afs_GCPAGs_perproc_func(AFS_PROC *pproc)
     afs_GCPAGs_cred_count++;
 
     pag = PagInCred(pcred);
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV)
+    uid = (pag != NOPAG ? pag : pcred->cr_uid);
+#else
     uid = (pag != NOPAG ? pag : pcred->cr_ruid);
+#endif
     hash = UHash(uid);
 
     /* if this token is PAG based, or it's UID based and 
index 699f5919b60c6e4ca4b58b56bdee20a8c39df1f6..a238e5c1f9012a321673b173766ece47568de985 100644 (file)
@@ -66,6 +66,8 @@ extern struct vcache *afs_globalVp;
 #ifdef AFS_OSF_ENV
 extern struct mount *afs_globalVFS;
 extern struct vnodeops Afs_vnodeops;
+#elif defined(AFS_DARWIN_ENV)
+extern struct mount *afs_globalVFS;
 #else
 extern struct vfs *afs_globalVFS;
 #endif /* AFS_OSF_ENV */
@@ -703,6 +705,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
           else if (QNext(uq) != tq)
                refpanic("VLRU inconsistent");
 
+#ifdef AFS_DARWIN_ENV
+          if (tvc->opens == 0 && ((tvc->states & CUnlinkedDel) == 0) &&
+                tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) {
+               osi_VM_TryReclaim(tvc, &fv_slept);
+               if (fv_slept) {
+                  uq = VLRU.prev;
+                  i = 0;
+                  continue;  /* start over - may have raced. */
+               }
+            }
+#endif
           if (tvc->vrefCount == 0 && tvc->opens == 0
               && (tvc->states & CUnlinkedDel) == 0) {
                code = afs_FlushVCache(tvc, &fv_slept);
@@ -867,6 +880,17 @@ struct vcache *afs_NewVCache(struct VenusFid *afid, struct server *serverp,
 #else
     SetAfsVnode((struct vnode *)tvc);
 #endif /* AFS_SGI64_ENV */
+#ifdef AFS_DARWIN_ENV
+    tvc->v.v_ubcinfo = UBC_INFO_NULL;
+    lockinit(&tvc->rwlock, PINOD, "vcache rwlock", 0, 0);
+    cache_purge((struct vnode *)tvc); 
+    tvc->v.v_data=tvc;
+    tvc->v.v_tag=VT_AFS;
+    /* VLISTNONE(&tvc->v); */
+    tvc->v.v_freelist.tqe_next=0;
+    tvc->v.v_freelist.tqe_prev=(struct vnode **)0xdeadb;
+    /*tvc->vrefCount++;*/
+#endif 
     /*
      * The proper value for mvstat (for root fids) is setup by the caller.
      */
@@ -1113,6 +1137,12 @@ afs_FlushActiveVcaches(doflocks)
                    crfree(cred);
                }
            }          
+#ifdef AFS_DARWIN_ENV
+            if (tvc->vrefCount == 1 && UBCINFOEXISTS(&tvc->v)) {
+               if (tvc->opens) panic("flushactive open, hasubc, but refcnt 1");
+               osi_VM_TryReclaim(tvc,0);
+           }
+#endif
        }
     }
     ReleaseReadLock(&afs_xvcache);
@@ -1601,6 +1631,9 @@ loop:
        vcache2inode(tvc);
 #endif
        ReleaseWriteLock(&tvc->lock);
+#ifdef AFS_DARWIN_ENV
+        osi_VM_Setup(tvc);
+#endif
        return tvc;
     }
 
@@ -1657,6 +1690,9 @@ loop:
     }
 
     ReleaseWriteLock(&tvc->lock);
+#ifdef AFS_DARWIN_ENV
+    osi_VM_Setup(avc);
+#endif
     return tvc;
 
 } /*afs_GetVCache*/
@@ -1812,6 +1848,9 @@ struct vcache *afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq,
     afs_ProcessFS(tvc, &OutStatus, areq);
 
     ReleaseWriteLock(&tvc->lock);
+#ifdef AFS_DARWIN_ENV
+    osi_VM_Setup(tvc);
+#endif
     return tvc;
 
 }
@@ -2116,6 +2155,7 @@ else {     /* used to undo the local callback, but that's too extreme.
 return code;
 }
 
+#if 0
 /*
  * afs_StuffVcache
  *
@@ -2254,6 +2294,7 @@ afs_StuffVcache(afid, OutStatus, CallBack, tc, areq)
      */
     afs_PutVCache(tvc, WRITE_LOCK);
 } /*afs_StuffVcache*/
+#endif
 
 /*
  * afs_PutVCache
@@ -2376,6 +2417,10 @@ struct vcache *afs_FindVCache(struct VenusFid *afid, afs_int32 lockit,
 #ifdef AFS_LINUX22_ENV
     if (tvc && (tvc->states & CStatd))
        vcache2inode(tvc); /* mainly to reset i_nlink */
+#endif
+#ifdef AFS_DARWIN_ENV
+    if (tvc)
+        osi_VM_Setup(tvc);
 #endif
     return tvc;
 } /*afs_FindVCache*/
index 97e51b42c7d66bcae0e7669f8a0e7bbf9a6196f8..834b45fd432df4b6d0bc1d0d126ea8a6d6687a05 100644 (file)
@@ -51,6 +51,6 @@
 #include "../afs/afs_axscache.h"
 #include "../afs/icl.h"
 #include "../afs/afs_prototypes.h"
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #include "../afs/osi_machdep.h"
 #endif
index 86893a252afa4e61da93b7efc7009e00e1a13431..4318a66ecedf7e84e1e69d13d8088e78b6760a1f 100644 (file)
@@ -109,7 +109,11 @@ extern tid_t thread_self();
 #ifdef AFS_LINUX20_ENV
 #define MyPidxx current->pid
 #else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#define MyPidxx (current_proc()->p_pid )
+#else
 #define MyPidxx (u.u_procp->p_pid )
+#endif /* AFS_DARWIN_ENV */
 #endif /* AFS_LINUX20_ENV */
 #endif /* AFS_SGI64_ENV */
 #endif /* AFS_HPUX101_ENV */
index 6139b6a9a6ceb9d4f5dfe6ae4345f2cf795f5151..0475cedf9d5d672ca5f6c4c04d99d50033e36d33 100644 (file)
@@ -41,6 +41,10 @@ struct xfs_inode_info {};
 #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"
@@ -128,7 +132,7 @@ struct xfs_inode_info {};
 #include "../h/socketvar.h"
 #include "../h/protosw.h"
 
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
 #  include "../h/dirent.h"
 #  ifdef       AFS_SUN5_ENV
 #    include "../h/sysmacros.h"
@@ -180,6 +184,31 @@ struct vfspage;                    /* for vnode.h compiler warnings */
 #    include "../h/swap.h"     /* for struct swpdbd, for vnode.h compiler warnings */
 #    include "../h/dbd.h"      /* for union idbd, for vnode.h compiler warnings */
 #  endif /* AFS_HPUX_ENV */
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD40_ENV)
+#  include <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
@@ -193,6 +222,7 @@ struct vfspage;                     /* for vnode.h compiler warnings */
 #      endif /* !AFS_HPUX_ENV */
 #    endif /* !AFS_AIX32_ENV */
 #  endif /* AFS_SUN5_ENV */
+#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
 #endif /* AFS_DEC_ENV */
 
 /* These mainly deal with networking and rpc headers */
@@ -213,7 +243,9 @@ struct vfspage;                     /* for vnode.h compiler warnings */
 
 /* Miscellaneous headers */
 #include "../h/proc.h"
+#if !defined(AFS_FBSD_ENV)
 #include "../h/ioctl.h"
+#endif /* AFS_FBSD_ENV */
 
 #if    defined(AFS_HPUX101_ENV)
 #include "../h/proc_iface.h"
@@ -225,7 +257,8 @@ struct vfspage;                     /* for vnode.h compiler warnings */
 #include "../h/tty.h"
 #endif
 
-#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+
 #  include "../h/text.h"
 #endif 
 
index 0ca577e397c0587d93a0f36adf4782aa53c0f863..bf4b9aa159970758bc1227d080b1c623af7a516a 100644 (file)
@@ -93,7 +93,7 @@
 #endif
 #endif
 
-#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #include <sys/mount.h>
 #else
 #include <sys/vfs.h>
@@ -132,7 +132,7 @@ void set_staticaddrs(void);
 #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
@@ -601,6 +601,12 @@ int SweepAFSCache(vFilesFound)
        }
        else  if ((strcmp(currp->d_name,          ".") == 0) ||
                  (strcmp(currp->d_name,         "..") == 0) ||
+#ifdef AFS_DECOSF_ENV
+                 /* these are magic AdvFS files */
+                 (strcmp(currp->d_name,         ".tags") == 0) ||
+                 (strcmp(currp->d_name,         "quota.user") == 0) ||
+                 (strcmp(currp->d_name,         "quota.group") == 0) ||
+#endif
                  (strcmp(currp->d_name, "lost+found") == 0)) {
            /*
             * Don't do anything - this file is legit, and is to be left alone.
@@ -1337,6 +1343,9 @@ mainproc(as, arock)
 #ifdef AFS_DEC_ENV
     if ((mount("AFS",cacheMountDir,mountFlags,GT_AFS,(caddr_t) 0)) < 0) {
 #else
+#ifdef AFS_FBSD_ENV
+    if ((mount("AFS",cacheMountDir,mountFlags,(caddr_t) 0)) < 0) {
+#else
 #ifdef AFS_AUX_ENV
     if ((fsmount(MOUNT_AFS,cacheMountDir,mountFlags,(caddr_t) 0)) < 0) {
 #else
@@ -1374,7 +1383,6 @@ mainproc(as, arock)
 #else
 #if defined(AFS_SGI_ENV)
     mountFlags = MS_FSS;
-
     if ((mount(MOUNT_AFS,cacheMountDir,mountFlags,(caddr_t) MOUNT_AFS)) < 0) {
 #else
 #ifdef AFS_LINUX20_ENV
@@ -1389,6 +1397,7 @@ mainproc(as, arock)
 #endif /* AFS_HPUX_ENV */
 #endif /* AFS_AIX_ENV */
 #endif /* AFS_AUX_ENV */
+#endif /* AFS_FBSD_ENV */
 #endif /* AFS_DEC_ENV */
          printf("%s: Can't mount AFS on %s(%d)\n",
                   rn, cacheMountDir, errno);
index c3b231e84f9c37e5b0e87df3599d6f4c5645ea17..c535dc120b946e22fec42df9e00658f72229269d 100644 (file)
@@ -13,8 +13,6 @@ SRCDIR=DEST/
 COMPONENT=afsmonitor
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
-
 CFLAGS=-g -I. \
        -I${SRCDIR}include \
        -I${SRCDIR}include/afs \
index 0951a928de1112b8e5a0b1a844997047705e0b8b..89d9c2cc05e84306a6ace2014c757a79ad3394ad 100644 (file)
@@ -1722,7 +1722,7 @@ int a_newProbeCycle;      /* start of a new probe cycle ? */
    }
 
    /* copy connection information */
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
    bcopy(&(xstat_fs_Results.connP->skt), &(tmp_fsPR->connP->skt), 
                sizeof(struct sockaddr_in));
 #else
@@ -2454,7 +2454,7 @@ int a_newProbeCycle;      /* start of new probe cycle ? */
 
 
    /* copy connection information */
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
    bcopy(&(xstat_cm_Results.connP->skt), &(tmp_cmPR->connP->skt), 
                sizeof(struct sockaddr_in));
 #else
index e5e3593c06728241a58547d4aab1aca6b3626c57..6c61a6205890d0a93e59b754f0dc6b5e183b9bb7 100644 (file)
@@ -11,7 +11,6 @@ COMPONENT=nsafs
 include ../config/Makefile.${SYS_NAME}
 
 UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET=${SRCDIR}bin/compile_et
 
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
@@ -160,7 +159,7 @@ INCLS=${SRCDIR}include/ubik.h \
              ${SRCDIR}include/rx/xdr.h \
              ${SRCDIR}include/rx/rxkad.h \
              ${SRCDIR}include/afs/com_err.h \
-           weblog_errors.h $(DCE_DLOG_INCLUDES)
+            weblog_errors.h $(DCE_DLOG_INCLUDES)
 deslib=${SRCDIR}lib/libdes.a
 rxkadlib=${SRCDIR}lib/librxkad.a
 authlib=${SRCDIR}lib/afs/libauth.a
index 9fe9e80be45ab454995b7a078234f0a49b24b65e..d2654905a22db17cd84674fd61d474f93d6b94e5 100644 (file)
@@ -274,7 +274,6 @@ static int makeNewPAG()
 
 #include "adkint.h"
 #include "assert.h"
-#include <permit_xprt.h>
 #include <des.h>
 #include <afs/afsutil.h>
 
index b784985762d197720230f506d36f53379351092e..618af14cf7b55a34249c96ce5b1a0b2ac9a88590 100644 (file)
@@ -20,7 +20,6 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 UKERNELDIR = ../libuafs/
 LOCALDIR = ${DESTDIR}root.server/usr/afs/local/
-INSTALL = ${SRCDIR}bin/install
 
 audobjs = audit.o
 
index a6afaf105f378738cda88a5a0cf7da0a81e41046..17ef837746dcc496e71e84b84883aadb0aba3ad9 100644 (file)
@@ -12,7 +12,6 @@ include ../config/Makefile.${SYS_NAME}
 
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
-INSTALL = ${SRCDIR}bin/install
 COMPILE_ET = ${SRCDIR}bin/compile_et
 OBJS= cellconfig.o ktc.o userok.o writeconfig.o authcon.o \
     acfg_errors.o ktc_errors.o # comktc.o comvice.o comauth.o 
@@ -48,8 +47,7 @@ setkey.o: setkey.c ${INCLS} AFS_component_version_number.o
 #comauth.o: comauth.c ${INCLS} ${SRCDIR}include/afs/vice.h
 
 ktc.krb.o: ktc.c ${INCLS} ${SRCDIR}include/afs/vice.h
-       ${CC} ${CFLAGS} -DMAYBE_NO_KTC -DAFS_KERBEROS_ENV -c ktc.c
-       mv ktc.o ktc.krb.o
+       ${CC} ${CFLAGS} -DMAYBE_NO_KTC -DAFS_KERBEROS_ENV -c ktc.c -o ktc.krb.o
 
 ktc.o: ktc.c ${INCLS} ${SRCDIR}include/afs/vice.h
        ${CC} ${CFLAGS} -DMAYBE_NO_KTC -c ktc.c
index ac8d81e1b3dc68c81e8cc246789f6bf499c824e8..1a838f20302268349de862979d972f122c187990 100644 (file)
@@ -7,19 +7,6 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-/*
- * Revision 2.3  90/08/31  16:11:49
- * Move permit_xprt.h.
- * 
- * Revision 2.2  90/08/20  10:05:54
- * Include permit_xprt.h.
- * Use stds.h.
- * 
- * Revision 2.1  90/08/07  18:51:45
- * Start with clean version to sync test and dev trees.
- * */
-/* See RCS log for older history. */
-
 #if defined(UKERNEL)
 #include "../afs/param.h"
 #include "../afs/sysincludes.h"
@@ -60,20 +47,6 @@ extern int afsconf_GetKey();
 extern struct rx_securityClass *rxkad_NewServerSecurityObject();
 extern struct rx_securityClass *rxkad_NewClientSecurityObject();
 
-/*
- * Note: it is necessary for the #include of permit_xprt.h occur
- * AFTER the above declaration of rxkad_NewClientSecurityObject() --
- * otherwise, depending on the version of permit_xprt.h that gets
- * included, there might be a syntax error.
- */
-
-#if defined(UKERNEL)
-#include "../afs/permit_xprt.h"
-#else /* defined(UKERNEL) */
-#include "../permit_xprt.h"
-#endif /* defined(UKERNEL) */
-
-
 /* return a null security object if nothing else can be done */
 static afs_int32 QuickAuth(astr, aindex)
 struct rx_securityClass **astr;
index 0a7887f87fcdc96d3dd4f73c5945fbdb27ff6de4..adc108054473a6236f3a4f12a9ebd3ff3f079e9c 100644 (file)
@@ -9,7 +9,6 @@ SHELL=/bin/sh
 COMPONENT=bozo
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET=$(SRCDIR)bin/compile_et
 CFLAGS=-g -I${SRCDIR}include ${XCFLAGS}
 RPCINCLS=${SRCDIR}include/lwp.h ${SRCDIR}include/rx/rx.h bosint.h
index 9659b1328b5416ff0624e1e1fb820d086eb22b80..75ce0c30849c9d269b8ebecf4ae4193dab8e201a 100644 (file)
@@ -53,7 +53,6 @@ static IStatServer();
 static DoStat();
 
 #include "bosint.h"
-#include "../permit_xprt.h"
 
 #define MRAFS_OFFSET  9
 #define ADDPARMOFFSET 26
index 0fce29aebdd02fa3a82b15b33cde1344241b2769..347a9309040daa2d7618eb334ee3212ddd98f942 100644 (file)
@@ -24,6 +24,7 @@
 #else
 #include <unistd.h>
 #include <netinet/in.h>
+#include <syslog.h>
 #endif /* AFS_NT40_ENV */
 #include <afs/cellconfig.h>
 #include <rx/rx.h>
@@ -55,6 +56,10 @@ FILE *bozo_logFile;
 extern int rx_stackSize;    /* for rx_SetStackSize macro */
 
 int DoLogging = 0;
+int DoSyslog = 0;
+#ifndef AFS_NT40_ENV
+int DoSyslogFacility = LOG_DAEMON;
+#endif
 static afs_int32 nextRestart;
 static afs_int32 nextDay;
 
@@ -117,6 +122,20 @@ bozo_ReBozo() {
        i++;
     }
 
+#ifndef AFS_NT40_ENV
+    /* if syslog logging is on, pass "-syslog" to new bosserver */
+    if (DoSyslog) {
+       char *arg=(char *)malloc(40); /* enough for -syslog=# */
+       if ( DoSyslogFacility != LOG_DAEMON ) {
+           snprintf(arg, 40, "-syslog=%d", DoSyslogFacility);
+       } else {
+           strcpy(arg, "-syslog");
+       }
+       argv[i] = arg;
+       i++;
+    }
+#endif
+
     /* null-terminate argument list */
     argv[i] = NULL;
 
@@ -714,6 +733,16 @@ char **envp;
            /* set extra logging flag */
            DoLogging = 1;
        }
+#ifndef AFS_NT40_ENV
+       else if (strcmp(argv[code], "-syslog")==0) {
+           /* set syslog logging flag */
+           DoSyslog = 1;
+       } 
+       else if (strncmp(argv[code], "-syslog=",8)==0) {
+           DoSyslog = 1;
+           DoSyslogFacility = atoi(argv[code]+8);
+       }
+#endif
        else if (strcmp(argv[code], "-enable_peer_stats")==0) {
            rx_enablePeerRPCStats();
        }
@@ -730,6 +759,9 @@ char **envp;
            /* hack to support help flag */
 
            printf("Usage: bosserver [-noauth] [-log] "
+#ifndef AFS_NT40_ENV
+                  "[-syslog[=FACILITY]] "
+#endif
                   /* "[-enable_peer_stats] [-enable_process_stats] " */
                   "[-help]\n");
            fflush(stdout);
@@ -772,21 +804,24 @@ char **envp;
     background();
 #endif /* ! AFS_NT40_ENV */
 
-    /* switch to logging information to the BosLog file */
-    strcpy(namebuf, AFSDIR_BOZLOG_FILE);
-    strcat(namebuf, ".old");
-    renamefile(AFSDIR_BOZLOG_FILE, namebuf);   /* try rename first */
-    bozo_logFile = fopen(AFSDIR_BOZLOG_FILE, "a");
-    if (!bozo_logFile) {
-       printf("bosserver: can't initialize log file (%s).\n",
-              AFSDIR_SERVER_BOZLOG_FILEPATH);
-       exit(1);
+    if (!DoSyslog) {
+       strcpy(namebuf, AFSDIR_BOZLOG_FILE);
+       strcat(namebuf, ".old");
+       renamefile(AFSDIR_BOZLOG_FILE, namebuf);    /* try rename first */
+       bozo_logFile = fopen(AFSDIR_BOZLOG_FILE, "a");
+       if (!bozo_logFile) {
+           printf("bosserver: can't initialize log file (%s).\n",
+                  AFSDIR_SERVER_BOZLOG_FILEPATH);
+           exit(1);
+       }
+        /* keep log closed normally, so can be removed */
+        fclose(bozo_logFile);
+    } else {
+#ifndef AFS_NT40_ENV
+       openlog("bosserver", LOG_PID, DoSyslogFacility);
+#endif
     }
 
-    /* keep log closed normally, so can be removed */
-
-    fclose(bozo_logFile);
-
     /* Write current state of directory permissions to log file */
     DirAccessOK ();
 
@@ -881,30 +916,33 @@ char *a, *b, *c, *d, *e, *f; {
     char tdate[26];
     time_t myTime;
 
-    myTime = time(0);
-    strcpy(tdate, ctime(&myTime));     /* copy out of static area asap */
-    tdate[24] = ':';
+    if (DoSyslog) {
+#ifndef AFS_NT40_ENV
+       syslog(LOG_INFO, a, b, c, d, e, f);
+#endif
+    } else {
+       myTime = time(0);
+       strcpy(tdate, ctime(&myTime));  /* copy out of static area asap */
+       tdate[24] = ':';
 
-    /* log normally closed, so can be removed */
+       /* log normally closed, so can be removed */
 
-    bozo_logFile=fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a");
-    if(bozo_logFile == NULL)
-    {
-       printf("bosserver: WARNING: problem with %s", AFSDIR_SERVER_BOZLOG_FILEPATH);
-       fflush(stdout);
-    }
+       bozo_logFile=fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a");
+       if(bozo_logFile == NULL) {
+           printf("bosserver: WARNING: problem with %s", AFSDIR_SERVER_BOZLOG_FILEPATH);
+           fflush(stdout);
+       }
 
-    if (bozo_logFile) {
-       fprintf(bozo_logFile, "%s ", tdate);
-       fprintf(bozo_logFile, a, b, c, d, e, f);
-       fflush(bozo_logFile);
-    }
-    else {
-       printf("%s ", tdate);
-       printf(a, b, c, d, e, f);
+       if (bozo_logFile) {
+           fprintf(bozo_logFile, "%s ", tdate);
+           fprintf(bozo_logFile, a, b, c, d, e, f);
+           fflush(bozo_logFile);
+       } else {
+           printf("%s ", tdate);
+           printf(a, b, c, d, e, f);
+       }
+       
+       /* close so rm BosLog works */
+       fclose(bozo_logFile);
     }
-
-    /* close so rm BosLog works */
-
-    fclose(bozo_logFile);
 }
index 62adef93210a08123064c43631472c9b1c3bda2e..7ccf9153f02fc024591b33b3e4ab9478c7a81305 100644 (file)
@@ -9,7 +9,6 @@ SHELL = /bin/sh
 COMPONENT=bu_utils
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET = ${DESTDIR}/bin/compile_et
 CFLAGS= -g -w -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS}
 LDFLAGS = ${XLDFLAGS}
index 0df9aa5c64c3c6e6f7c05fb7cdd2fb64fa304746..91420e14c2e038655e1a553115db815d76bd4dba 100644 (file)
@@ -9,7 +9,6 @@ SHELL = /bin/sh
 COMPONENT=bubasics
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 RXGEN=${SRCDIR}bin/rxgen
 COMPILE_ET = ${SRCDIR}bin/compile_et
 
index d97cbc7a936aa0edc4b497655d2ae1723da8dea3..517708a9feb4902806883c1163cde02dbcaf1bd6 100644 (file)
@@ -9,7 +9,6 @@ SHELL = /bin/sh
 COMPONENT=bucoord
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET = ${SRCDIR}bin/compile_et
 
 CFLAGS= ${DBUG} -w -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS}
index 45ceef830e29c02b7dfbe9e7dda84e13927be8f1..017fe01461c9928a1828e47de1f9ec688539185d 100644 (file)
@@ -1395,7 +1395,11 @@ int bc_openTextFile(udbClientTextP ctPtr, char *tmpFileName)
     fclose(ctPtr->textStream);
   
   sprintf(tmpFileName, "%s/bu_XXXXXX", gettmpdir());
+#ifdef AFS_LINUX20_ENV
+  mkstemp(tmpFileName);
+#else
   mktemp(tmpFileName);
+#endif
   ctPtr->textStream = fopen(tmpFileName, "w+");
   if ( ctPtr->textStream == NULL )
     ERROR(BUDB_INTERNALERROR);
index 0d4fadd62125227a35fc1e4b326a7a5ce0999a0a..e3515991527c27831407eca70a6e76ff3a4d2270 100644 (file)
@@ -188,6 +188,12 @@ afs_int32 bc_DeleteVolEntryCmd(as, arock)
 
     vsname = as->parms[0].items->data;
 
+    code = bc_UpdateVolumeSet();
+    if (code) {
+       com_err(whoami, code, "; Can't retrieve volume sets");
+       return(code);
+    }
+
     /* lock schedules and check validity */
     ctPtr = &bc_globalConfig->configText[TB_VOLUMESET];
 
index c375f3e1a5ed3760d8b3da619a733c26a48e1408..ac0b03378d438d65a521f558c8434e464ad91a3e 100644 (file)
@@ -12,7 +12,6 @@ SHELL = /bin/sh
 COMPONENT=budb
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET = ${SRCDIR}bin/compile_et
 RXGEN=${SRCDIR}bin/rxgen
 
index 48097a44e22f53c033a7837413bb5345e9054c0b..7d453ea72246f0a9758f40493213d57b1acccd2d 100644 (file)
@@ -518,7 +518,11 @@ mkstemp(st)
 {
     int retval = -1;
 
+#ifdef AFS_LINUX20_ENV
+    retval = open(mkstemp(st), O_RDWR|O_CREAT|O_EXCL, 0600);
+#else
     retval = open(mktemp(st), O_RDWR|O_CREAT|O_EXCL, 0600);
+#endif
 
 error_exit:
     return(retval);
index 105d3f5ab808eccbdb772c6ff924b56dcd6343bb..edfddbba5ec71b0f3865eb91260a3d89caad8506 100644 (file)
@@ -9,8 +9,6 @@ SHELL = /bin/sh
 COMPONENT=butc
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
-
 CFLAGS=-g -w ${INCDIRS} ${XCFLAGS}
 
 INCDIRS= -I${SRCDIR}include/afs -I${SRCDIR}include/rx -I${SRCDIR}include
index db7df4f4cea83506bdc38f4a6265c74e0d48269d..cc5eae34d88bd7ba92fc3aef5f3287b027a201d4 100644 (file)
@@ -97,7 +97,7 @@ afs_int32 tapeblocks;      /* Number of 16K tape datablocks in buffer (!CONF_XBS
    else \
      sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId);
 
-#ifdef AFS_NT40_ENV
+#if defined(AFS_NT40_ENV) || defined(AFS_DARWIN_ENV)
 localtime_r(t, tm)
    time_t *t;
    struct tm *tm;
index 932dadd6457a25dec27cd5a1970821d8142cab05..8b70406f6c8e1dace498e3128295086214a341c5 100644 (file)
@@ -1386,7 +1386,11 @@ restoreText(tapeInfo, rstTapeInfoPtr, nextHeader)
 
     /* open the text file */
     sprintf(filename, "%s/bu_XXXXXX", gettmpdir());
+#ifdef AFS_LINUX20_ENV
+    fid = open(mkstemp(filename), O_RDWR|O_CREAT|O_EXCL, 0600);
+#else
     fid = open(mktemp(filename), O_RDWR|O_CREAT|O_EXCL, 0600);
+#endif
     if (fid < 0) 
     {
         ErrorLog(0, rstTapeInfoPtr->taskId, errno, 0, 
index c56fbb25f17e53ee9ba41540be8278774185bfd2..9e12ce2e86ad7baaca780dd72c8ca81e319cfcc6 100644 (file)
@@ -10,7 +10,6 @@
 SHELL = /bin/sh
 SRCDIR=DEST/
 DESTDIR=DEST/
-INSTALL=${SRCDIR}bin/install
 
 CFLAGS = -g -w -I${SRCDIR}include ${XCFLAGS}
 LDFLAGS = -g ${XLDFLAGS}
index cd5ac4a454d49cd8651fb26af33708d6c4e734be..61dcd34589b2b7c228c26e9d35da6067fcaa78d9 100644 (file)
@@ -11,7 +11,6 @@ SHELL = /bin/sh
 COMPONENT=cmd
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET = ${SRCDIR}bin/compile_et
 
 INCLS=cmd.h ${XINCLS}
index 253586972bd5240ba31cebfc4de490abb256579b..934bba8e8cb2152f2310b006b57335bfd9d262eb 100644 (file)
@@ -223,7 +223,7 @@ register struct cmd_syndesc *as; {
     }
 }
 
-static AproposProc(as, arock)
+static int AproposProc(as, arock)
 char *arock;
 register struct cmd_syndesc *as; {
     register struct cmd_syndesc *ts;
@@ -249,7 +249,7 @@ register struct cmd_syndesc *as; {
     return 0;
 }
 
-static HelpProc(as, arock)
+static int HelpProc(as, arock)
 char *arock;
 register struct cmd_syndesc *as; {
     register struct cmd_syndesc *ts;
@@ -294,7 +294,7 @@ register struct cmd_syndesc *as; {
     return(code);
 }
 
-cmd_SetBeforeProc(aproc, arock)
+int cmd_SetBeforeProc(aproc, arock)
 int (*aproc)();
 char *arock; {
     beforeProc = aproc;
@@ -302,7 +302,7 @@ char *arock; {
     return 0;
 }
 
-cmd_SetAfterProc(aproc, arock)
+int cmd_SetAfterProc(aproc, arock)
 int (*aproc)();
 char *arock; {
     afterProc = aproc;
@@ -311,7 +311,7 @@ char *arock; {
 }
 
 /* thread on list in alphabetical order */
-static SortSyntax(as)
+static int SortSyntax(as)
 struct cmd_syndesc *as; {
     register struct cmd_syndesc **ld, *ud;
 
@@ -440,7 +440,7 @@ afs_int32 aflags;{
 }
 
 /* add a text item to the end of the parameter list */
-static AddItem(aparm, aval)
+static int AddItem(aparm, aval)
 register struct cmd_parmdesc *aparm;
 register char *aval; {
     register struct cmd_item *ti, *ni;
@@ -450,7 +450,7 @@ register char *aval; {
     assert(ti->data);
     strcpy(ti->data, aval);
     /* now put ti at the *end* of the list */
-    if (ni=aparm->items) {
+    if ((ni=aparm->items)) {
        for(;ni;ni=ni->next) if (ni->next == 0) break;  /* skip to last one */
        ni->next = ti;
     }
@@ -459,7 +459,7 @@ register char *aval; {
 }
 
 /* skip to next non-flag item, if any */
-static AdvanceType(as, aval)
+static int AdvanceType(as, aval)
 register afs_int32 aval;
 register struct cmd_syndesc *as; {
     register afs_int32 next;
@@ -504,7 +504,7 @@ register struct cmd_syndesc *as; {
 }
 
 /* move the expands flag to the last one in the list */
-static SetupExpandsFlag(as)
+static int SetupExpandsFlag(as)
 register struct cmd_syndesc *as; {
     register struct cmd_parmdesc *tp;
     register int last, i;
@@ -563,7 +563,7 @@ char **aargv;
 
 } /*InsertInitOpcode*/
 
-static NoParmsOK(as)
+static int NoParmsOK(as)
 register struct cmd_syndesc *as; {
     register int i;
     register struct cmd_parmdesc *td;
@@ -580,7 +580,7 @@ register struct cmd_syndesc *as; {
 }
 
 /* Call the appropriate function, or return syntax error code.  Note: if no opcode is specified, an initialization routine exists, and it has NOT been called before, we invoke the special initialization opcode*/
-cmd_Dispatch(argc, argv)
+int cmd_Dispatch(argc, argv)
 int argc;
 char **argv;
  {
@@ -831,7 +831,7 @@ char **argv;
 }
 
 /* free token list returned by parseLine */
-static FreeTokens(alist)
+static int FreeTokens(alist)
     register struct cmd_token *alist; {
     register struct cmd_token *nlist;
     for(; alist; alist = nlist) {
@@ -843,7 +843,7 @@ static FreeTokens(alist)
 }
 
 /* free an argv list returned by parseline */
-cmd_FreeArgv(argv)
+int cmd_FreeArgv(argv)
 register char **argv; {
     register char *tp;
     for(tp = *argv; tp; argv++, tp = *argv)
@@ -855,7 +855,7 @@ register char **argv; {
     data is still malloc'd, and will be freed when the caller calls cmd_FreeArgv
     later on */
 #define INITSTR ""
-static CopyBackArgs(alist, argv, an, amaxn)
+static int CopyBackArgs(alist, argv, an, amaxn)
 register struct cmd_token *alist;
 register char **argv;
 afs_int32 amaxn;
@@ -887,25 +887,25 @@ afs_int32 *an; {
     return 0;
 }
 
-static quote(x)
+static int quote(x)
 register int x; {
     if (x == '"' || x == 39 /* single quote */) return 1;
     else return 0;
 }
 
-static space(x)
+static int space(x)
 register int x; {
     if (x == 0 || x == ' ' || x == '\t' || x== '\n') return 1;
     else return 0;
 }
 
-cmd_ParseLine(aline, argv, an, amaxn)
+int cmd_ParseLine(aline, argv, an, amaxn)
 char **argv;
 afs_int32 *an;
 afs_int32 amaxn;
 char *aline; {
     char tbuffer[256];
-    register char *tptr;
+    register char *tptr = 0;
     int inToken, inQuote;
     struct cmd_token *first, *last;
     register struct cmd_token *ttok;
@@ -920,7 +920,10 @@ char *aline; {
        if (tc == 0 || (!inQuote && space(tc))) {    /* terminating null gets us in here, too */
            if (inToken) {
                inToken = 0;    /* end of this token */
-               *tptr++ = 0;
+               if ( !tptr )
+                   return -1; /* should never get here */
+               else
+                   *tptr++ = 0;
                ttok = (struct cmd_token *) malloc(sizeof(struct cmd_token));
                assert(ttok);
                ttok->next = (struct cmd_token *) 0;
index a4a77bff248201127d26d65b9bb9fce9c7cbc585..8595d8e67bf4ea3712f4d1522e8dd29da99534cb 100644 (file)
@@ -66,12 +66,12 @@ extern struct cmd_syndesc *cmd_CreateSyntax(
   char *helpp
 );
 
-extern cmd_SetBeforeProc(
+extern int cmd_SetBeforeProc(
   int (*aproc)(),
   char *arock
 );
 
-extern cmd_SetAfterProc(
+extern int cmd_SetAfterProc(
   int (*aproc)(),
   char *arock
 );
@@ -94,16 +94,16 @@ extern int cmd_AddParm(
   char *ahelp
 );
 
-extern cmd_Dispatch(
+extern int cmd_Dispatch(
   int argc,
   char **argv
 );
 
-extern cmd_FreeArgv(
+extern int cmd_FreeArgv(
   char **argv
 );
 
-extern cmd_ParseLine(
+extern int cmd_ParseLine(
   char *aline,
   char **argv,
   afs_int32 *an,
index d0575c64e55d92144fe4d86af1c0be31ffa701ac..b895d19fe919bb30f1c617ca05d45bdce818462c 100644 (file)
@@ -17,7 +17,6 @@ LINTFILES= error_msg.c et_name.c com_err.c
 LIBOBJS= error_msg.o et_name.o com_err.o
 
 UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
 
 CFLAGS= ${OPTMZ} -I${DESTDIR}include ${XCFLAGS}
 FILES= Makefile et_name.c error_msg.c compile_et.c \
index 6ea8484b773d9e64dad2efd1001f34be1a1d8ac4..125069c1d72cf4c8817d8bd2324dc3ff8d9083e9 100644 (file)
@@ -68,7 +68,7 @@ ${KERNELDIR}/afs/param.h ${DESTDIR}include/afs/param.h :: param.${SYS_NAME}.h
 ${KERNELDIR}/afs/afs_sysnames.h ${DESTDIR}include/afs/afs_sysnames.h :: afs_sysnames.h
        $(RM) -f $@; $(CP) $? $@
 
-DESTINCLS = ${DESTDIR}include/afs/afs_args.h ${DESTDIR}include/afs/venus.h ${DESTDIR}include/afs/debug.h ${DESTDIR}include/afs/afs_sysnames.h  ${DESTDIR}include/afs/param.h  ${DESTDIR}include/afs/stds.h  ${DESTDIR}include/afs/icl.h ../permit_xprt.h
+DESTINCLS = ${DESTDIR}include/afs/afs_args.h ${DESTDIR}include/afs/venus.h ${DESTDIR}include/afs/debug.h ${DESTDIR}include/afs/afs_sysnames.h  ${DESTDIR}include/afs/param.h  ${DESTDIR}include/afs/stds.h  ${DESTDIR}include/afs/icl.h 
 
 ${KERNELDIR}/afs/stds.h ${DESTDIR}include/afs/stds.h :: stds.h
        $(RM) -f $@; $(CP) $? $@
@@ -88,24 +88,6 @@ ${DESTDIR}include/afs/venus.h :: venus.h
 ${DESTDIR}include/afs/debug.h :: debug.h 
        $(RM) -f $@; $(CP) $? $@
 
-${KERNELDIR}/afs/permit_xprt.h ../permit_xprt.h:
-       $(RM) -f ${KERNELDIR}/afs/permit_xprt.h ../permit_xprt.h
-       if [ -f SRC/../xprt/permit_xprt.h ] ; then \
-          echo "XPRT" ; \
-          perm_src=`pwd`/../xprt ; \
-          echo "perm_src='$$perm_src'" ; \
-          set -x ; \
-          $(CP) $$perm_src/permit_export.h ${KERNELDIR}/afs/permit_xprt.h ; \
-          ln -s $$perm_src/permit_xprt.h   ../permit_xprt.h ; \
-       else \
-          echo "CONFIG" ; \
-          perm_src=`pwd` ; \
-          echo "perm_src='$$perm_src'" ; \
-          set -x ; \
-          $(CP) $$perm_src/permit_xprt.h   ${KERNELDIR}/afs/permit_xprt.h ; \
-          ln -s $$perm_src/permit_xprt.h   ../permit_xprt.h ; \
-       fi                   
-
 $(UKDIRS): 
        set $@; $(MKDIR_IF_NEEDED)
 
@@ -133,19 +115,6 @@ ${UKERNELDIR}/afs/venus.h :: venus.h
 ${UKERNELDIR}/afs/afs_args.h :: afs_args.h 
        $(RM) -f $@; $(CP) $? $@
 
-${UKERNELDIR}/afs/permit_xprt.h:
-       $(RM) -f ${UKERNELDIR}/afs/permit_xprt.h
-       if [ -f SRC/../xprt/permit_xprt.h ] ; then \
-          echo "XPRT" ; \
-          perm_src=`pwd`/../xprt ; \
-       else \
-          echo "CONFIG" ; \
-          perm_src=`pwd`/../config ; \
-       fi; \
-       echo "perm_src='$$perm_src'" ; \
-       set -x ; \
-       ln -s $$perm_src/permit_xprt.h   ${UKERNELDIR}/afs/permit_xprt.h
-
 # lkversion is the target the Linux build uses to verify the build machine
 # has headers in the right place for the requested kernel builds.
 #
@@ -161,8 +130,6 @@ lkversion:
        esac
 
 install.noversion: $(KDIRS) noversionMakef all $(DESTINCLS) venus.h
-       $(RM) -f ${DESTDIR}/include/afs/permit_xprt.h
-       $(CP) permit_xprt.h ${DESTDIR}/include/afs/
 
 system: install
 install: version install.noversion kinstall ukinstall
@@ -174,14 +141,14 @@ install: version install.noversion kinstall ukinstall
 
 kinstall: lkversion config $(KDIRS) ${KERNELDIR}/afs/param.h \
        ${KERNELDIR}/afs/stds.h \
-       ${KERNELDIR}/afs/permit_xprt.h ${KERNELDIR}/afs/afs_sysnames.h \
+       ${KERNELDIR}/afs/afs_sysnames.h \
        ${KERNELDIR}/config/Makefile.${SYS_NAME} \
        ${KERNELDIR}/afs/afs_args.h \
        ${KERNELDIR}/afs/icl.h \
        ${KERNELDIR}/afs/AFS_component_version_number.c
 
 ukinstall webinstall: $(DESTINCLS) config $(UKDIRS) ${UKERNELDIR}/afs/param.h ${UKERNELDIR}/afs/stds.h \
-       ${UKERNELDIR}/afs/permit_xprt.h ${UKERNELDIR}/afs/afs_sysnames.h \
+       ${UKERNELDIR}/afs/afs_sysnames.h \
        ${UKERNELDIR}/config/Makefile.${SYS_NAME} \
        ${UKERNELDIR}/afs/afs_args.h \
        ${UKERNELDIR}/afs/icl.h \
index d9567006b53a549628b798bcf69953ec490fb46e..3e364770e99e7e46b326ec90be61510551431dd3 100644 (file)
@@ -21,8 +21,8 @@ OPTMZ=-O2
 DBG=-g3
 CSTATIC=-non_shared
 RANLIB=/bin/true
-WASHTOOL=${SRCDIR}bin/washtool
-INSTALL=${SRCDIR}bin/install
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 
 #this is for the vol package
 FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D
index 7bc6378de2f4f521a1a8bece21e3537b7f97713a..39abb115e426bede24b5156a18023567c67c6d11 100644 (file)
@@ -22,8 +22,8 @@ DBG=-g3
 CP=cp
 CSTATIC=-non_shared
 RANLIB=/bin/true
-WASHTOOL=${SRCDIR}bin/washtool
-INSTALL=${SRCDIR}bin/install
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 
 #this is for the vol package
 FS_CONV_OSF40D= $(DESTDIR)root.server/usr/afs/bin/fs_conv_dux40D
index 3064e51d6fb38f58d0a44c74bed56807c1c48538..caab152fafc930640c94e7696da14f7e0b2c4bc4 100644 (file)
@@ -21,8 +21,8 @@ LWP_OPTMZ=-O
 OPTMZ=-O
 DBG=-g
 RANLIB=ranlib
-INSTALL=${SRCDIR}bin/install
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 RM=/bin/rm
 CP=/bin/cp
 AR=/bin/ar
index c2074b6c7f880136bd12845a054caf8c7c337c78..cb0c2e33cacf323a12c53b33ca8b2d3b99b85a64 100644 (file)
@@ -29,13 +29,13 @@ MT_CC=xlc_r
 AR=ar
 AS=as
 CP=cp
-INSTALL=${SRCDIR}bin/install
 LD=ld   
 LEX=lex
 MV=mv
 RANLIB=ranlib
 RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # This is the XBSA make flag and pathname to XBSA header files (xbsa.h)
 XBSA_FLAGS=-Dxbsa
index 2c213bc7d831467040240c08a7d993cb7473b442..9104a6efc3636ee20050a976b51f98fe85d68e46 100644 (file)
@@ -35,13 +35,13 @@ XLIBS=
 AR=ar
 AS=as
 CP=cp
-INSTALL=${SRCDIR}bin/install
 LD=gcc
 MT_CC=gcc
 MV=mv
 RANLIB=ranlib
 RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # Other OS specific requirements
 #
index 964b0ccb520f8c7cf7b31ab39bf70e4b91669de5..15185cac7b27ad442111d84aca87b51da9f8a459 100644 (file)
@@ -33,13 +33,13 @@ AR=ar
 AS=as
 CP=cp
 MT_CC=cc
-INSTALL=${SRCDIR}bin/install
 LD=ld   
 LEX=lex
 MV=mv
 RANLIB=/bin/true
 RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # This is for the vol package
 XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check
index 4caf1b5edcf74f17514697b0ae19fb0512313e2f..11f274664e83f960e188ec49757920ed8b294a65 100644 (file)
@@ -33,10 +33,10 @@ AR=ar
 AS=as
 CP=cp
 MT_CC=cc
-INSTALL=${SRCDIR}bin/install
 LD=ld   
 LEX=lex
 MV=mv
 RANLIB=/bin/true
 RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
index 3d63a167bf0d1894f703afb3a6490e972e544264..421d8017156ed2ea092b97721988e6ddee9d894c 100644 (file)
@@ -34,13 +34,13 @@ AR=ar
 AS=as
 CP=cp
 MT_CC=cc
-INSTALL=${SRCDIR}bin/install
 LD=ld   
 LEX=lex
 MV=mv
 RANLIB=/bin/true
 RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # This is for the vol package
 XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check
index 07d163f14046b8ec8ea16b75645720397025dd01..604028ec97374e814694d74f5e709b1b6516b041 100644 (file)
@@ -34,13 +34,13 @@ AR=ar
 AS=as
 CP=cp
 MT_CC=/usr/bin/cc
-INSTALL=${SRCDIR}bin/install
 LD=/usr/bin/ld   
 LEX=lex
 MV=mv
 RANLIB=/bin/true
 RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # This is for the vol package
 XFS_SIZE_CHECK = $(DESTDIR)root.server/usr/afs/bin/xfs_size_check
index a02e8b681b46ca1ae202fd838d6529a982fadd48..b69193d54cd2041314325d319fa057d26a76668a 100644 (file)
@@ -32,7 +32,6 @@ AS=as
 CC=/opt/SUNWspro/bin/cc
 MT_CC=/opt/SUNWspro/bin/cc
 CP=/bin/cp
-INSTALL=${SRCDIR}bin/install
 LEX=lex
 LD= /usr/ccs/bin/ld
 LORDER = /usr/ccs/bin/lorder
@@ -40,7 +39,8 @@ MV=mv
 RANLIB=/bin/true
 RM=rm
 STRIP= /usr/ccs/bin/strip
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # this is for the vol package
 FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
index f048a0efd7c48375065e27eaffe203913b31cbbc..74e144e4bce275a36f7fa25efdb3b827b22021e2 100644 (file)
@@ -36,7 +36,6 @@ AS=as
 CC=/opt/SUNWspro/bin/cc
 MT_CC=/opt/SUNWspro/bin/cc
 CP=/bin/cp
-INSTALL=${SRCDIR}bin/install
 LEX=lex
 LD= /usr/ccs/bin/ld
 LORDER = /usr/ccs/bin/lorder
@@ -44,7 +43,8 @@ MV=mv
 RANLIB=/bin/true
 RM=rm
 STRIP= /usr/ccs/bin/strip
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # this is for the vol package
 FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
index bcc4897142027c68aa4a736e8f7aec45e7c4a5e3..0003637bfdb9569688a4fb3a1359b0b59ebb1721 100644 (file)
@@ -40,7 +40,6 @@ AS=as
 CC=/opt/SUNWspro/bin/cc
 MT_CC=/opt/SUNWspro/bin/cc
 CP=/bin/cp
-INSTALL=${SRCDIR}bin/install
 LEX=lex
 LD= /usr/ccs/bin/ld
 LORDER = /usr/ccs/bin/lorder
@@ -48,7 +47,8 @@ MV=mv
 RANLIB=/bin/true
 RM=rm
 STRIP= /usr/ccs/bin/strip
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # this is for the vol package
 FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
index 3701bfda60243ce8b1558dc7c5fefa64378cb31c..5d07dfbe483dfa49f9d0accc8d2c2e49139589ab 100644 (file)
@@ -33,7 +33,6 @@ AS=as
 CC=/opt/SUNWspro/bin/cc
 MT_CC=/opt/SUNWspro/bin/cc
 CP=/bin/cp
-INSTALL=${SRCDIR}bin/install
 LEX=lex
 LD= /usr/ccs/bin/ld
 LORDER = /usr/ccs/bin/lorder
@@ -41,7 +40,8 @@ MV=mv
 RANLIB=/bin/true
 RM=rm
 STRIP= /usr/ccs/bin/strip
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
 #
 # this is for the vol package
 FS_CONV_SOL26= $(DESTDIR)root.server/usr/afs/bin/fs_conv_sol26
index 51c15e4978f0b9568b1b66aacd01d74d6eeb8d84..ab8e0cf589770e2a09d83b2b52d785c4cd573b97 100644 (file)
@@ -18,3 +18,5 @@ AR = /usr/ccs/bin/ar
 LD = /usr/ccs/bin/ld
 LORDER = /usr/ccs/bin/lorder
 STRIP= /usr/ccs/bin/strip
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
index fc692ef5e1a7276f9d77dcde9449051be09484f8..81e6ac5c41530263458fca17a882ed905d6f92b8 100644 (file)
@@ -8,8 +8,8 @@
 AFS_component_version_number.o: AFS_component_version_number.c
 
 AFS_component_version_number.c: 
-       echo 'char cml_version_number[]="@(#) OpenAFS stable 1.0.3 built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c;
-       echo 'char* AFSVersion = "openafs stable 1.0.3"; ' >>AFS_component_version_number.c;
+       echo 'char cml_version_number[]="@(#) OpenAFS stable 1.0.4 built ' `date +"%Y-%m-%d"` '";' >AFS_component_version_number.c;
+       echo 'char* AFSVersion = "openafs stable 1.0.4"; ' >>AFS_component_version_number.c;
 
 noversion: install
 
index a5ef7dbae117778a984bfb55f808fb96d69a8490..917e8cbfee88cf2c75426775f544db540a8bf60d 100644 (file)
@@ -26,26 +26,13 @@ INCFILES =\
        $(INCFILEDIR)\debug.h \
        $(INCFILEDIR)\param.h \
        $(INCFILEDIR)\afs_sysnames.h \
-       $(INCFILEDIR)\permit_xprt.h \
        $(INCFILEDIR)\stds.h \
-       $(INCFILEDIR)\icl.h \
-       ..\permit_xprt.h
+       $(INCFILEDIR)\icl.h 
 
 
 $(INCFILEDIR)\param.h: param.$(SYS_NAME).h
        $(COPY) $? $@
 
-!IF (EXIST($(SRCROOT)\xprt\permit_xprt.h))
-..\permit_xprt.h: $(SRCROOT)\xprt\permit_xprt.h
-       $(DEL) ..\permit_xprt.h
-       $(COPY) $(SRCROOT)\xprt\permit_xprt.h ..\permit_xprt.h
-!ELSE
-..\permit_xprt.h: .\permit_xprt.h
-       $(DEL) ..\permit_xprt.h
-       $(COPY) .\permit_xprt.h ..\permit_xprt.h
-!ENDIF
-
-
 idirs: doclink
 !      IF (!EXIST($(DESTDIR)\include))
                $(MKDIR) $(DESTDIR)\include
index ada6df6f3939a825e98ca922629739631576b5ad..0b4ebec6e51ea0d2ce89bf16d20526d2e4d3c812 100644 (file)
@@ -47,6 +47,8 @@
 #define SYS_NAME_ID_mac2_51             500    
 #define SYS_NAME_ID_mac_aux10           501
 #define SYS_NAME_ID_mac_mach51          502
+#define SYS_NAME_ID_ppc_darwin_12        503
+#define SYS_NAME_ID_ppc_darwin_13        504
 
 #define SYS_NAME_ID_next_mach20                 601
 #define SYS_NAME_ID_next_mach30                 602
 #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 
index c29bd71bfc495248d6465f4f552fffd49a3ac476..46f4610a1e59f5fec81daa740ddade6dc823fdbc 100644 (file)
 
 #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];
index 4df6283382cb519465c1cce32223c1aaec62edef..ac1dba55f38a21785e098602f1c0e52d8484d94b 100644 (file)
 #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 {
@@ -26,7 +23,7 @@ struct token {
 };
 
 /* free token list returned by parseLine */
-static FreeTokens(alist)
+static int FreeTokens(alist)
     register struct token *alist; {
     register struct token *nlist;
     for(; alist; alist = nlist) {
@@ -38,11 +35,11 @@ static FreeTokens(alist)
 }
 
 #define        space(x)    ((x) == ' ' || (x) == '\t' || (x) == '<' || (x) == '>')
-static ParseLine(aline, alist)
+static int ParseLine(aline, alist)
     char *aline;
     struct token **alist; {
     char tbuffer[MAXTOKLEN+1];
-    register char *tptr;
+    register char *tptr = NULL;
     int inToken;
     struct token *first, *last;
     register struct token *ttok;
@@ -57,7 +54,10 @@ static ParseLine(aline, alist)
        if (tc == 0 || space(tc)) {    /* terminating null gets us in here, too */
            if (inToken) {
                inToken = 0;    /* end of this token */
-               *tptr++ = 0;
+               if ( !tptr )
+                   return -1; /* should never get here */
+               else
+                   *tptr++ = 0;
                ttok = (struct token *) malloc(sizeof(struct token));
                ttok->next = (struct token *) 0;
                if (dontUse) {
@@ -101,7 +101,7 @@ static ParseLine(aline, alist)
 }
 /* read a line into a buffer, putting in null termination and stopping on appropriate
     end of line char.  Returns 0 at eof, > 0 at normal line end, and < 0 on error */
-static GetLine(afile, abuffer, amax)
+static int GetLine(afile, abuffer, amax)
     FILE *afile;
     int amax;
     register char *abuffer; {
@@ -124,7 +124,8 @@ static GetLine(afile, abuffer, amax)
        }
     }
 }
-mc_copy(ain, aout, alist)
+
+int mc_copy(ain, aout, alist)
     register FILE *ain;
     register FILE *aout;
     char *alist[]; {
index f785b7269b786749a851b88830e6bc89a1290618..0eb60b0434b9ea1c805c90b557885a01f2e6c8b6 100644 (file)
@@ -16,7 +16,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
+#ifndef __APPLE_CC__
 #include <malloc.h>
+#endif
 #include <assert.h>
 #include <string.h>
 
index 7f3277e9fc9d0a3c9b4de41a4012c4bb0b05d979..85506a61cf59897c510f63391019fbe7898eb564 100644 (file)
@@ -25,7 +25,6 @@
 
 #define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
 #define AFS_SYSCALL 137
-#define AFS_64BIT_ENV
 #define AFS_64BIT_IOPS_ENV  1
 #define AFS_NAMEI_ENV     1   /* User space interface to file system */
 #include <afs/afs_sysnames.h>
index 01c1ab1ccce6332b5738ce6e3416de01130f2105..394d1a9884c10a6ff1f3eadc641f799104c1cc97 100644 (file)
@@ -17,6 +17,7 @@
 
 #define AFS_MOUNT_AFS "afs"    /* The name of the filesystem type. */
 #define AFS_SYSCALL 137
+#define AFS_64BIT_ENV
 #define AFS_64BIT_IOPS_ENV  1
 #define AFS_NAMEI_ENV     1   /* User space interface to file system */
 #include <afs/afs_sysnames.h>
index 27ac5bd9715d1edf704d07038fe5db39b9676716..9fd72fc9236f6dffaf1d5e6f88b5102cb7f61f45 100644 (file)
@@ -9,7 +9,6 @@ SHELL =         /bin/sh
 COMPONENT=     dauth
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=       ${SRCDIR}bin/install
 COMPILE_ET =   ${SRCDIR}bin/compile_et
 OPTMZ= -g
 
@@ -17,11 +16,11 @@ CFLAGS =    ${OPTMZ} -I${SRCDIR}include ${XCFLAGS}
 LDFLAGS =      ${OPTMZ} ${XLDFLAGS}
 
 INCLS=         ${SRCDIR}include/ubik.h \
-               ${SRCDIR}include/lwp.h \
-               ${SRCDIR}include/lock.h  \
-               ${SRCDIR}include/rx/rx.h \
-               ${SRCDIR}include/rx/xdr.h \
-               ${SRCDIR}include/afs/com_err.h
+               ${SRCDIR}include/lwp.h \
+               ${SRCDIR}include/lock.h  \
+               ${SRCDIR}include/rx/rx.h \
+               ${SRCDIR}include/rx/xdr.h \
+               ${SRCDIR}include/afs/com_err.h
 
 VERSION =      AFS_component_version_number.o
 OBJS =         adkint.cs.o adkint.xdr.o
@@ -71,7 +70,7 @@ dpass:                dpass.o $(VERSION) $(LIBS)
 dlog_test:     dlog.c $(OBJS) $(LIBS)
                $(CC) $(LDFLAGS) -DDLOG_TEST -o dlog_test dlog.c $(OBJS) \
                        $(LIBS) ${XLIBS}
-       
+
 system:        install
 
 ${DESTDIR}bin/dlog: dlog
index 02c56fc3dc0d4cd76d4e3c5cef7c27a67dc3b57e..afce5ec553a9155a9b55b4d87776ef751d903319 100644 (file)
@@ -89,9 +89,6 @@
 #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
index 3d58d53807838cbea80b0dfbbb8556a8770b7a92..a3c6b06a75557109b208246154fd4de7e6e28a7d 100644 (file)
@@ -26,7 +26,6 @@ SHELL = /bin/sh
 include ../config/Makefile.${SYS_NAME}
 
 UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
 SRC    =.
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
@@ -209,9 +208,6 @@ ${DES_LIB}: ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
        ar r ${DES_LIB} ${TARGOBJS} ${COMMONOBJS} AFS_component_version_number.o
        $(RANLIB) ${DES_LIB}
 
-# export stuff
-des.o cbc_encrypt.o pcbc_encrypt.o new_rnd_key.o cksum.o testit.o verify.o: ../permit_xprt.h
-
 #      host system stuff
 make_ip: make_ip.o misc.o
        ${CC} make_ip.o misc.o ${LDFLAGS} -o make_ip
index 99ec3cde22309baae0f0ff1a67e719bf473eba9f..0f9d238e47c238c24b9920fd41001c9152554158 100644 (file)
@@ -31,7 +31,7 @@
 #if defined(sgi)
 #include "conf-sgi.h"
 #else
-#ifdef __alpha
+#if defined(__alpha) && !defined(AFS_ALPHA_LINUX20_ENV)
 #include "conf-bsd-alpha.h"
 #else
 #if    defined(AFS_X86_ENV)
 #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 */
index 740821dd3bf3921f76afe374f9a55137a5457fa3..7b52e51440eadf6679ece716816c4a7163d3f185 100644 (file)
 #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
@@ -47,7 +47,7 @@ extern int des_debug_print();
  * cleartext.
  */
 
-AFS_HIDE afs_int32
+afs_int32
 des_cbc_encrypt(in,out,length,key,iv,encrypt)
     des_cblock *in;            /* >= length bytes of input text */
     des_cblock *out;           /* >= length bytes of output text */
index c9a6457bf95c8b75a3f090dbf76051965c93b5c0..e85add71030da932fedc160a7f5306edfe0b5e28 100644 (file)
 #include "des_internal.h"
 
 #define XPRT_CKSUM
-#include "../permit_xprt.h"
 
 extern int des_debug;
 extern int des_debug_print();
+extern int des_ecb_encrypt();
 
 /*
  * This routine performs DES cipher-block-chaining checksum operation,
@@ -50,7 +50,7 @@ extern int des_debug_print();
  * multiple of eight bytes.
  */
 
-AFS_HIDE afs_uint32
+afs_uint32
 des_cbc_cksum(in,out,length,key,iv)
     des_cblock *in;            /* >= length bytes of inputtext */
     des_cblock *out;           /* >= length bytes of outputtext */
index b1381f2a5d5b739004d24b31c2e19be9ed48786d..0e2b020c634e486693f4d47e2211274a81c70639 100644 (file)
@@ -48,7 +48,6 @@
 #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;
index 65fd76ea0d456176230adf0c4fa8e789f6655ff7..47717cafdd059518805cfbcd2980e09e20766b64 100644 (file)
 #include "stats.h"
 
 extern int des_debug;
-extern rev_swap_bit_pos_0();
+extern int rev_swap_bit_pos_0();
+extern int des_check_key_parity(des_cblock);
+extern int des_is_weak_key(des_cblock);
 
 typedef char key[64];
 /* the following are really void but cc86 doesnt allow it */
 static int make_key_sched();
 
+
 #ifdef AFS_DUX40_ENV
 #pragma weak des_key_sched = afs_des_key_sched
 int afs_des_key_sched(k,schedule)
@@ -246,4 +249,6 @@ make_key_sched(Key,Schedule)
        fprintf(stderr,"\n");
     }
 #endif
+
+       return(0);
 }
index 336bdb42958ff69fb9dc3d2e6c4d3d3193d4c36c..c11e55687618f06d1957251d6caf42b6d4896be7 100644 (file)
 #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));
 
index 2a8b6bc914a37004b8a46d1a5203a5d179d45801..3c5de48de3dc6aded02ff6f4636b2218770925c7 100644 (file)
 #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))
 
index cf25d38cb340b407b93b544d49a7218ae04b8d37..60791fcedf2a0dd77f77f08e5d884b258ec43185 100644 (file)
@@ -186,9 +186,10 @@ void gen(stream)
         }
 
         /* now output the resulting key permutation */
-        fprintf(stream, "    /* ks permutation iteration = %2d */",
+        fprintf(stream, "\n    /* ks permutation iteration = %2d */",
                 iter);
         for (i = 1; i <= 6; i++) {
+                       if ( i == 1 ) fprintf(stream, "\n    {");
             fprintf(stream, "\n    ");
             for (j = 1; j <= 8; j++) {
                 /*
@@ -197,11 +198,16 @@ void gen(stream)
                  */
                 fprintf(stream, "%d", ks_perm[iter][(i-1)*8+j]-1);
                 /* omit last comma */
-                if ((j != 8) || (i != 6) || (iter != 16)) {
+                if ((j != 8) || (i != 6)) {
                     fprintf(stream,", ");
                 }
             }
         }
+               if ( iter != 16) {
+                       fprintf(stream, "\n    }, ");
+               } else {
+                       fprintf(stream, "\n    }");
+               }
     }
     fprintf(stream,"\n};\n");
 }
index 9e40687b22ed8a62ef0ab2afa8f416009f09a2b8..d2248ffd3542e0809131989941aee9128b35b1e9 100644 (file)
@@ -9,6 +9,8 @@
 #include <mit-cpyright.h>
 #include <stdio.h>
 #include "des_internal.h"
+
+#define WANT_P_TABLE
 #include "tables.h"
 
 extern afs_uint32 swap_byte_bits();
@@ -25,7 +27,7 @@ void gen(stream)
 #ifdef BIG
     /* flip p into p_temp */
     for (i = 0; i<32; i++)
-       P_temp[P[rev_swap_bit_pos_0(i)]] = rev_swap_bit_pos_0(i);
+       P_temp[(int) P[rev_swap_bit_pos_0(i)]] = rev_swap_bit_pos_0(i);
 
     /*
      * now for each byte of input, figure out all possible combinations
@@ -47,11 +49,13 @@ void gen(stream)
     fprintf(stream,
            "\n\tstatic afs_uint32 const P_prime[4][256] = {\n\t");
     for (i = 0; i < 4; i++) {
-       fprintf(stream,"\n");
+       fprintf(stream,"\n");
        for (j = 0; j < 64; j++) {
            fprintf(stream,"\n");
            for (k = 0; k < 4; k++) {
                fprintf(stream,"0x%08X",P_prime[i][j*4+k]);
+               if ((j == 63) && (k == 3))
+                   fprintf(stream, "}");
                if ((i == 3) && (j == 63) && (k == 3))
                    fprintf(stream,"\n};");
                else
index e28f859e39525f1cd77f5ac955a1b46da268c9eb..3dfe74b49496b8e928b80c81c3f848fdf96fd848 100644 (file)
@@ -8,6 +8,8 @@
 #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();
@@ -51,12 +53,16 @@ void gen(stream)
     }
 
     for (i = 0; i<=7; i++) {
-        fprintf(stream,"\n");
+        fprintf(stream,"\n");
         k =0;
         for (j = 0; j<= 3; j++) {
             fprintf(stream,"\n");
             for (m = 0; m <= 15; m++) {
                 fprintf(stream,"%2d",temp[i][k]);
+               if (k==63)
+               {
+                   fprintf(stream,"\n}");
+               }
                 if ((k++ != 63) || (i !=7)) {
                     fprintf(stream,", ");
                 }
index d3ab60e61ae34febec6032efff1c7686a8203cee..10f2d82b77978c1e7f8b8ff97ad48938c4806a41 100644 (file)
@@ -238,7 +238,7 @@ afs_uint32 swap_byte_bits(x)
 #endif /* LSBFIRST */
 }
 
-swap_long_bytes_bit_number(x)
+int swap_long_bytes_bit_number(x)
     afs_uint32 x;
 {
     /*
@@ -290,7 +290,7 @@ char const *whoami;
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
+int main(argc, argv)
     int argc;
     char *argv[];
 {
index 98f2ec8d898d18b319c9765ec9297d8b5820fa1b..b4206267b54380c9a0cbf4fc19e461f8063f9305 100644 (file)
 #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
@@ -93,7 +95,7 @@ des_random_key(key)
  *
  * Note: this routine calls des_set_random_generator_seed.
  */
-#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(BSDUNIX) && !defined(AFS_SGI_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
   you lose...   (aka, you get to implement an analog of this for your
                 system...)
 #else
@@ -104,6 +106,7 @@ des_random_key(key)
 #include <afs/afsutil.h>
 #else
 #include <sys/time.h>
+#include <unistd.h>
 #endif
 
 void des_init_random_number_generator(key)
index c14b9d7c5aa66f2266470f4660f287c05411eefb..79b0eceec0a4ae1e6d62b7dd561b05d9952af821 100644 (file)
 #include "des_internal.h"
 
 #define XPRT_PCBC_ENCRYPT
-#include "../permit_xprt.h"
 
 extern int des_debug;
 extern int des_debug_print();
+extern int des_ecb_encrypt();
 
 /*
  * pcbc_encrypt is an "error propagation chaining" encrypt operation
@@ -62,7 +62,7 @@ extern int des_debug_print();
  *
  */
 
-AFS_HIDE afs_int32
+afs_int32
 des_pcbc_encrypt(in,out,length,key,iv,encrypt)
     des_cblock *in;            /* >= length bytes of inputtext */
     des_cblock *out;           /* >= length bytes of outputtext */
index d632f18f017745fc03fc50b4cedecb0a27c45f4c..4fd9e8175b67943f0062ff8c85ed4b21ee336d7d 100644 (file)
 #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
@@ -48,6 +52,9 @@ static int intrupt;
 #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
@@ -70,9 +77,11 @@ typedef int sigtype;
 #endif
 static sigtype sig_restore();
 static push_signals(), pop_signals();
-int des_read_pw_string();
 #endif
 
+int des_read_pw_string(char *, int, char *, int);
+int des_string_to_key(char *, des_cblock *);
+
 /*** Routines ****************************************************** */
 int
 des_read_password(k,prompt,verify)
@@ -94,12 +103,14 @@ des_read_password(k,prompt,verify)
     if (ok == 0)
        des_string_to_key(key_string, k);
 
+#ifdef BSDUNIX
 lose:
+#endif
     bzero(key_string, sizeof (key_string));
     return ok;
 }
 
-#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV)
+#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 static void catch(int);
 #endif
 
@@ -121,11 +132,14 @@ des_read_pw_string(s,maxa,prompt,verify)
 {
     int ok = 0, cnt1=0;
     char *ptr;
-#ifdef AFS_HPUX_ENV
+#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     register int fno;
     struct sigaction newsig, oldsig;
     struct termios save_ttyb, ttyb;
 #endif
+#if defined(AFS_DARWIN_ENV)
+    FILE *fi;
+#endif
 #if    defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
     struct termios ttyb;
     struct sigaction osa, sa;
@@ -156,7 +170,7 @@ des_read_pw_string(s,maxa,prompt,verify)
        return -1;
     }
 
-#ifdef AFS_HPUX_ENV
+#if defined(AFS_HPUX_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     if ((fi = fopen("/dev/tty", "r")) == NULL)
         return -1;
     setbuf(fi, (char *)NULL);                  /* We don't want any buffering for our i/o. */
@@ -288,7 +302,9 @@ des_read_pw_string(s,maxa,prompt,verify)
        ok = 1;
     }
 
+#ifdef BSDUNIX
 lose:
+#endif
     if (!ok)
        bzero(s, maxa);
     printf("\n");
@@ -382,7 +398,7 @@ sig_restore()
 #endif
 
 
-#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV)
+#if    defined (AFS_AIX_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 static void
 catch(int junk)
 {
index f539f7d481a3962e77cd4e86f3ca11226e2c88e0..d821e1696256e41d91429bc4555348628171fa14 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <mit-cpyright.h>
 #include <stdio.h>
+#include <string.h>
 #include <afs/param.h>
 #include <des.h>
 #include "des_internal.h"
@@ -31,12 +32,13 @@ extern int des_debug_print();
 extern void des_fixup_key_parity();
 extern afs_uint32 des_cbc_cksum();
 
-#include "../permit_xprt.h"
+/* prototypes */
+int des_key_sched(register des_cblock *k, des_key_schedule schedule);
 
 /*
  * convert an arbitrary length string to a DES key
  */
-int
+void
 des_string_to_key(str,key)
     char *str;
     register des_cblock *key;
index b3c01398e1f69b4f1fa281cf12b0857d7a2e3575..dac5ff7cd5d6ddc509eb00a1128bcd9626258c52 100644 (file)
@@ -12,6 +12,7 @@
 /*
  * Initial permutation, adjust to zero based subscript
  */
+#ifdef WANT_IP_TABLE
 static char    IP[] = {
        58-1, 50-1, 42-1, 34-1, 26-1, 18-1, 10-1,  2-1, 
        60-1, 52-1, 44-1, 36-1, 28-1, 20-1, 12-1,  4-1, 
@@ -22,10 +23,12 @@ static      char    IP[] = {
        61-1, 53-1, 45-1, 37-1, 29-1, 21-1, 13-1,  5-1, 
        63-1, 55-1, 47-1, 39-1, 31-1, 23-1, 15-1,  7-1, 
 };
+#endif
 
 /*
  * Final permutation,  FP = IP^(-1) adjust to zero based subscript
  */
+#ifdef WANT_FP_TABLE
 static char    FP[] = {
        40-1,  8-1, 48-1, 16-1, 56-1, 24-1, 64-1, 32-1, 
        39-1,  7-1, 47-1, 15-1, 55-1, 23-1, 63-1, 31-1, 
@@ -36,8 +39,10 @@ static       char    FP[] = {
        34-1,  2-1, 42-1, 10-1, 50-1, 18-1, 58-1, 26-1, 
        33-1,  1-1, 41-1,  9-1, 49-1, 17-1, 57-1, 25-1, 
 };
+#endif
 
 /* the E selection function, adjusted to zero based subscripts */
+#ifdef WANT_E_TABLE
 static char    E[] = {
        32-1,   1-1,    2-1,    3-1,    4-1,    5-1,
         4-1,   5-1,    6-1,    7-1,    8-1,    9-1,
@@ -48,8 +53,10 @@ static       char    E[] = {
        24-1,   25-1,   26-1,   27-1,   28-1,   29-1,
        28-1,   29-1,   30-1,   31-1,   32-1,   1-1,
 };
+#endif
 
 /* the P permutation, adjusted to zero based subscripts */
+#ifdef WANT_P_TABLE
 static char    P[] = {
        16-1,    7-1,   20-1,   21-1,   
        29-1,   12-1,   28-1,   17-1,   
@@ -60,46 +67,49 @@ static      char    P[] = {
        19-1,   13-1,   30-1,    6-1,   
        22-1,   11-1,    4-1,   25-1,   
 };
+#endif
 
 /* S tables, original form */
+#ifdef WANT_S_TABLE
 static char    S[8][64] = {
-       14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7,
+{      14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7,
         0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8,
         4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0,
-       15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13,
+       15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13, },
 
-       15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10,
+{      15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10,
         3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5,
         0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15,
-       13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9,
+       13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9, },
 
-       10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8,
+{      10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8,
        13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1,
        13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7,
-        1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12,
+        1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12, },
 
-        7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
+{       7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15,
        13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9,
        10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4,
-        3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14,
+        3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14, },
 
-        2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9,
+{       2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9,
        14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6,
         4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14,
-       11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3,
+       11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3, },
 
-       12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11,
+{      12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11,
        10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8,
         9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6,
-        4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13,
+        4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13, },
 
-        4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1,
+{       4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1,
        13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6,
         1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2,
-        6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12,
+        6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12, },
 
-       13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7,
+{      13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7,
         1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2,
         7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8,
-        2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11,
+        2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11 }
 };
+#endif
index e2bdbe2f73fa8ab4494be398eab203444a34226d..b7d2610b2339ce6dbb8b58368281c495d80df4c6 100644 (file)
@@ -30,8 +30,6 @@ extern int des_ecb_encrypt();
 extern int des_cbc_encrypt();
 extern int des_pcbc_encrypt();
 
-#include "../../permit_xprt.h"
-
 char *progname;
 int sflag;
 int vflag;
index 4a1b8e80fdfd6967eb3ac52476b270e338e97cf8..dd485823de9f47c4dc2e4751187db3c5ef78ea06 100644 (file)
@@ -27,8 +27,6 @@ extern int des_key_sched();
 extern int des_ecb_encrypt();
 extern int des_cbc_encrypt();
 
-#include "../../permit_xprt.h"
-
 char *progname;
 int nflag = 2;
 int vflag;
index f0d683dee284ea0fca0b2fab38dcc1ac653ff71a..9be7e5d9de0697023060aa58eeeb67604da28e59 100644 (file)
@@ -12,7 +12,7 @@
 #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;
 {
@@ -26,6 +26,8 @@ des_cblock_print_file(x, fp)
            fprintf(fp,", ");
     }
     fprintf(fp," }");
+
+       return(0);
 }
 
 #ifdef DEBUG
index 491fdcb148c67e80e11edb0bd8391ad67d651ccb..0ebe45aaabee87665f717fba46283c896e8a1d15 100644 (file)
@@ -12,6 +12,7 @@
  * Originally written 8/85 by Steve Miller, MIT Project Athena.
  */
 
+#include <string.h>
 #include <des.h>
 #include "des_internal.h"
 
index 9ac3745cd06c7f850dd24841923259638c3af720..c1ce9904af8047048f8b2bfee0eab6e03c5bc417 100644 (file)
@@ -14,7 +14,6 @@ include ../config/Makefile.${SYS_NAME}
 
 RM     = /bin/rm
 UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
 SRC    =.
 DESPAR =../../../DESLIB/dest/
 DESINC =${DESPAR}include/
index d2c60b66d79b8e1392089a3e2b000e36ccf3002a..69e9aa33fb30013b73981973a8d05f75be90927a 100644 (file)
@@ -11,7 +11,6 @@ include ../config/Makefile.${SYS_NAME}
 
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
-INSTALL = ${SRCDIR}bin/install
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 INCDIRS= -I${DESTDIR}include ${XINCLS}
index df9fb35cb03f74976c93086acd35a536ca270dce..8ea21ddc0091881751fda93d245c13ce68951b77 100644 (file)
@@ -20,7 +20,7 @@
 #include "../h/errno.h"
 #endif
 #include "../h/time.h"
-#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV)
 #include "../h/errno.h"
 #else
 #if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV)
 #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"
index d95326227af0e41e44de5b3a4ca9a2db19366b48..35990273a175dc541ae097a6ac0c5d0be9f18935 100644 (file)
@@ -13,7 +13,6 @@
 COMPONENT=export
 include ../config/Makefile.${SYS_NAME}
 
-  INSTALL = ${SRCDIR}bin/install
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
      DEFS =
index 375eb3aaaaf671bde7a7b6caf2c413da3f33519c..ee8288e1fb727130880f7f86d7bb4500c0d9db4f 100644 (file)
@@ -10,7 +10,6 @@ include ../config/Makefile.${SYS_NAME}
 SHELL = /bin/sh
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
-INSTALL = ${SRCDIR}bin/install
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 OBJS=afsaux.o afscbint.cs.o afscbint.ss.o afscbint.xdr.o afsint.cs.o afsint.ss.o afsint.xdr.o
index a97394d99df1655aacf4bd203fd5975a5868664f..ce8c592a2a1625c9fa0716b752b8d83e4112c6d4 100644 (file)
@@ -16,7 +16,7 @@
 #include "../afs/afsincludes.h"
 #include "../rx/xdr.h"
 #else /* defined(UKERNEL) */
-#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
 #else
@@ -57,12 +57,13 @@ static afs_int32 bslosers = 0;
 /* these things are defined in R (but not RX's) library.  For now, we add them
     only for the kernel system.  Later, when R is expunged, we'll remove the ifdef */
 #ifdef KERNEL
+#ifndef AFS_USR_DARWIN_ENV
 #ifdef AFS_AIXNFS11
 #define        AUTH_DES 1
 #endif
 #if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV)
 #ifndef        AFS_AIX32_ENV
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
 /*
  * XDR chars; from user mode xdr package.
  */
@@ -145,6 +146,7 @@ xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem)
        }
        return(TRUE);   
 }
+#endif
 #endif /* KERNEL */
 
 #ifndef KERNEL
index 39fb6b8f88a7ef23fdd8b7d192f786fa8d87bb41..a91c240d3f3b6687fe08c60d58d5d39433495263 100644 (file)
@@ -12,8 +12,6 @@ SHELL = /bin/sh
 COMPONENT=fsprobe
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
-
 CFLAGS=-g -I. \
        -I${SRCDIR}include \
        -I${SRCDIR}include/afs \
index 8196c90a0df2a3843c778fec19bc61a5f7f10e2e..ce627b301bdbf7c4d716deb736f7d81e72a9389f 100644 (file)
@@ -12,7 +12,6 @@ SHELL=/bin/sh
 COMPONENT=gtx
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET=$(SRCDIR)bin/compile_et
 CFLAGS= ${DBUG} -I. -I${SRCDIR}include -I${SRCDIR}include/afs ${XCFLAGS}
 LDFLAGS = ${XLDFLAGS}
index 8ae20cecd9efd39a8d55963cd90e2f025d5663ee..0757bd00495525d48b4bed3e10f18f6ffe53301e 100644 (file)
@@ -754,8 +754,13 @@ int gator_cursesgwin_getdimensions(gwp, aparms)
     struct gator_cursesgwin *cwp;      /*Curses-specific data*/
 
     cwp = (struct gator_cursesgwin *)(gwp->w_data);
+#ifdef AFS_DARWIN_ENV
+    aparms->maxx = cwp->wp->maxx;
+    aparms->maxy = cwp->wp->maxy;
+#else
     aparms->maxx = cwp->wp->_maxx;
     aparms->maxy = cwp->wp->_maxy;
+#endif
 
     return(0);
 
index 853a6ed239e54889c39586ecdabd9bd8314e7d52..531847a700a2655850d30c93987142e7fc5602ff 100644 (file)
@@ -4,7 +4,6 @@ include ../config/Makefile.${SYS_NAME}
 
 INCLUDES = -I${DESTDIR}include
 DEFINES = ${INCLUDES}
-INSTALL = ${DESTDIR}bin/install
 LIBDIR = ${DESTDIR}lib/
 AFSLIBS =  ${LIBDIR}afs/libkauth.a ${LIBDIR}libubik.a\
                   ${LIBDIR}afs/libauth.a ${LIBDIR}afs/libsys.a \
index 92d1ff1227e2d96984491282db7da41a43c4cc8e..5f2e4a7b7853fd37b650eecbb41765e54306468f 100644 (file)
@@ -13,13 +13,11 @@ COMPONENT=kauth
 include ../config/Makefile.${SYS_NAME}
 
 UKERNELDIR = ../libuafs/
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET = ${SRCDIR}bin/compile_et
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 CFLAGS = ${OPTMZ} -I${SRCDIR}include ${XCFLAGS}
 LDFLAGS = ${OPTMZ} ${XLDFLAGS}
-PE = ../permit_xprt.h
 INCLS=${SRCDIR}include/ubik.h \
              ${SRCDIR}include/lwp.h \
              ${SRCDIR}include/lock.h  \
@@ -94,10 +92,10 @@ xkaprocs: kaprocs.c ${INCLS}
 # tightly controlled.
 #      ${CC} ${CFLAGS} -c kaprocs.c -DSPECIAL=1 -DGETPASSWORD
 
-kaprocs.o: kaprocs.c ${INCLS} ${PE} kaport.h
+kaprocs.o: kaprocs.c ${INCLS} kaport.h
        ${CC} ${CFLAGS} -c kaprocs.c -DSPECIAL=1
 
-authclient.o: authclient.c ${INCLS} ${PE}
+authclient.o: authclient.c ${INCLS}
 
 
 #authserver.o: authserver.c ${INCLS}
@@ -190,8 +188,7 @@ kpwvalid: kpwvalid.o $(LIBS)
        ${CC} ${LDFLAGS} -o kpwvalid kpwvalid.o ${LIBS} ${XLIBS}
 
 user.krb.o: user.c ${INCLS} ${SRCDIR}include/afs/vice.h
-       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c user.c
-       mv user.o user.krb.o
+       ${CC} ${CFLAGS} -DAFS_KERBEROS_ENV -c user.c -o user.krb.o
 
 user.o: user.c ${INCLS} ${SRCDIR}include/afs/vice.h
        ${CC} ${CFLAGS} -c user.c
@@ -201,7 +198,7 @@ kdb: kdb.o ${INCLS}
 kdb.o: kdb.c AFS_component_version_number.o
 
 krb_udp.o: krb_udp.c kaserver.h kautils.h kauth.h prot.h \
-          ${SRCDIR}include/lwp.h ${PE} AFS_component_version_number.o
+          ${SRCDIR}include/lwp.h AFS_component_version_number.o
 
 krb_udp: krb_udp.o libkauth.a
        ${CC} ${LDFLAGS} -o krb_udp krb_udp.o libkauth.a ${SRCDIR}lib/liblwp.a ${deslib} ${rxkadlib} ${SRCDIR}lib/afs/libcom_err.a ${utilib} ${auditlib}
index 46c6300f146ea436d7150f9a042d4f29785d00dc..dc68cb09c62574e4396e53cb8ce7e5c5071ef6ba 100644 (file)
@@ -707,6 +707,13 @@ int StringToKey (
     ka_PrintBytes ((char *)&key, sizeof(key));
     printf ("'.\n");
 
+    des_string_to_key (as->parms[0].items->data, &key);
+      
+    printf ("Converting %s with the DES string to key yields key='",
+           as->parms[0].items->data);
+    ka_PrintBytes (&key, sizeof(key));
+    printf ("'.\n");
+
     return 0;
 }
 
@@ -1329,6 +1336,11 @@ static int MyBeforeProc(
          ka_StringToKey (passwd, cell, &key);
          code = ka_GetAdminToken (name, instance, cell, &key, KA_SIXHOURS,
                                   &token, 0/* !new */);
+         if (code == KABADREQUEST) {
+             des_string_to_key (passwd, &key);
+             code = ka_GetAdminToken (name, instance, cell, &key, KA_SIXHOURS,
+                                      &token, 0/* !new */);
+         }
          if ((code == KABADREQUEST) && (strlen(passwd) > 8)) {
             /* try with only the first 8 characters incase they set
              * their password with an old style passwd program. */
index e21a01ddc428ea4cfee07dc1bfc83e45fed458a4..c48868f2c0d5a306e8f405d77f8486cd9ab59db0 100644 (file)
@@ -43,7 +43,6 @@
 #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>
@@ -63,8 +62,6 @@
 #include <afs/afsutil.h>
 #include "kauth.h"
 #include "kautils.h"
-
-#include "../permit_xprt.h"
 #endif /* defined(UKERNEL) */
 
 
index 4e7f3c4e3d794e88e95c82eda211f359f2b63b1a..db91476cce836bbec55b80a146de2630eb4b97ab 100644 (file)
@@ -7,13 +7,6 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-/*
- * Revision 2.2  90/08/20  11:15:39
- * Include permit_xprt.h.
- * Cleanup line length.
- *  */
-/* See RCS log for older history. */
-
 #if defined(UKERNEL)
 #include "../afs/param.h"
 #include "../afs/sysincludes.h"
@@ -28,7 +21,6 @@
 #include "../afs/pthread_glock.h"
 #include "../des/des.h"
 
-#include "../afs/permit_xprt.h"
 #else /* defined(UKERNEL) */
 #include <afs/param.h>
 #include <afs/stds.h>
@@ -43,8 +35,6 @@
 #include <afs/afsutil.h>
 #include "kauth.h"
 #include "kautils.h"
-
-#include "../permit_xprt.h"
 #endif /* defined(UKERNEL) */
 
 
index 562fba91b7fe4ec6ffc740f042e00bb3432fff02..9667a6e0a1577089b39448ae6247130c519a8fc4 100644 (file)
@@ -41,9 +41,6 @@
 #include "kaport.h"
 #include "afs/audit.h"
 
-#include "../permit_xprt.h"
-
-
 extern struct ubik_dbase *KA_dbase;
 struct kaheader cheader;
 Date           cheaderReadTime;        /* time cheader last read in */
index 3bb2cf37bb89885e095e637d656c42c5fa692785..f0f96262fd5169f61f1d58594beea86ad13586ff 100644 (file)
@@ -63,7 +63,7 @@ int MinHours = 0;
 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
index 3a27fe648a62c1318dbca1375c80bcd76500e8b5..1a2b1bc0e5203359607be1564c0eb5c28d46f919 100644 (file)
@@ -42,9 +42,6 @@
 #include "kauth.h"
 #include "kautils.h"
 
-#include "../permit_xprt.h"
-
-
 
 /* This should match the behavior of ParseLoginName on input so that the output
  * and input are compatible.  In names "." should show as \056 and in names and
@@ -184,12 +181,14 @@ void ka_timestr (
   afs_int32 tlen)
 {
     char tbuffer[32]; /* need at least 26 bytes */
+    time_t passtime; /* modern systems have 64 bit time */
 
     if (!time) strcpy (tstr, "no date");/* special case this */
     else if (time == NEVERDATE) strcpy(tstr, "never");
     else {
+       passtime = time;
        strncpy(tstr,
-               afs_ctime((time_t *)&time, tbuffer, sizeof(tbuffer)), tlen);
+               afs_ctime(&passtime, tbuffer, sizeof(tbuffer)), tlen);
        tstr[strlen(tstr)-1] = '\0';    /* punt the newline character */
     }
 }
index 34988c80882bdbf018dc366fa2f50cf284ed2b8a..95ecbfa261513c16e0d9ec1ed76376c0c95c7138 100644 (file)
@@ -29,7 +29,7 @@ static char sccsid[] = "@(#)login.c   5.15 (Berkeley) 4/12/86";
  * 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
index d6e0d6bdda0d34f4f3dd6a39622ed6bd34cbbcd6..96d682db9dd0690e4a62faa0e1d228066acb5204 100644 (file)
@@ -198,7 +198,9 @@ CommandProc (as, arock)
 
     struct ubik_client *conn = 0;
     struct ktc_encryptionKey key;
+    struct ktc_encryptionKey mitkey;
     struct ktc_encryptionKey newkey;
+    struct ktc_encryptionKey newmitkey;
 
     struct ktc_token    token;
 
@@ -211,6 +213,13 @@ CommandProc (as, arock)
     int        foundPassword = 0;              /*Not yet, anyway*/
     int        foundNewPassword = 0;           /*Not yet, anyway*/
     int        foundExplicitCell = 0;          /*Not yet, anyway*/
+#ifdef DEFAULT_MITV4_STRINGTOKEY
+    int dess2k = 1;
+#elif DEFAULT_AFS_STRINGTOKEY
+    int dess2k = 0;
+#else
+    int dess2k = -1;
+#endif
 
     /* blow away command line arguments */
     for (i=1; i<zero_argc; i++) bzero (zero_argv[i], strlen(zero_argv[i]));
@@ -352,6 +361,7 @@ CommandProc (as, arock)
            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");
@@ -360,6 +370,7 @@ CommandProc (as, arock)
        }
     } 
     ka_StringToKey (passwd, realm, &key);
+    des_string_to_key(passwd, &mitkey);
     give_to_child(passwd);
 
     /* Get new password if it wasn't provided. */
@@ -407,6 +418,7 @@ CommandProc (as, arock)
        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);
@@ -422,26 +434,40 @@ CommandProc (as, arock)
 
     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) {
@@ -454,8 +480,12 @@ CommandProc (as, arock)
        code = ka_AuthServerConn (realm, KA_MAINTENANCE_SERVICE, &token, &conn);
        if (code) com_err (rn, code, "contacting Admin Server");
        else {
-           code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newkey);
+           if (dess2k == 1)
+               code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newmitkey);
+           else
+               code = ka_ChangePassword (pw->pw_name, instance, conn, 0, &newkey);
            bzero (&newkey, sizeof(newkey));
+           bzero (&newmitkey, sizeof(newmitkey));
            if (code) {
              char * reason;
              reason = (char *) error_message(code);
@@ -465,6 +495,7 @@ CommandProc (as, arock)
        }
     }
     bzero (&newkey, sizeof(newkey));
+    bzero (&newmitkey, sizeof(newmitkey));
 
     /* Might need to close down the ubik_Client connection */
     if (conn) {
index d8f8db245f4c6bd5ff1ad358b23ee4933fc74fdb..d5e5ad7b08b824668be4b856b599bd85e4aa6dd1 100644 (file)
@@ -41,9 +41,6 @@
 #include "afs/audit.h"
 #include "kalog.h"
 
-#include "../permit_xprt.h"
-
-
 /* my kerberos error codes */
 #define KERB_ERR_BAD_MSG_TYPE  99
 #define KERB_ERR_BAD_LIFETIME  98
@@ -446,7 +443,10 @@ afs_int32 UDP_GetTicket (ksoc, pkt, kvno, authDomain, ticket, ticketLen, auth, a
       code = KERB_ERR_PKT_VER; /* was KABADTICKET */
       goto abort;
     }
-    if (celllen == 0) strcpy (cell, lrealm);
+    if (celllen == 0) {
+       strncpy (cell, lrealm, MAXKTCREALMLEN-1);
+       cell[MAXKTCREALMLEN-1] = 0;
+    };
 
     if (krb_udp_debug) {
        printf ("UGetTicket: got ticket from '%s'.'%s'@'%s'\n",
index b2a822a103281c3575d644cd696ee6f85c8c03ad..23fd0cca9364d00ce6d80b6a88a363feee620f94 100644 (file)
@@ -179,7 +179,7 @@ afs_int32 ka_UserAuthenticateGeneral (
     }
 #endif
 
-#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV)
+#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_USR_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
     /* handle smoothly the case where no AFS system calls exists (yet) */
     old = (int (*)())signal(SIGSYS, SIG_IGN);
 #endif
index f70cbd41b80344b2b052d762a0bd99869c55a933..4fd2ed45befc23ad051e39c91bcf32294248d0f0 100644 (file)
@@ -23,7 +23,6 @@
 #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);
index 6be8a6514f39147389d89542a52d836c4c370164..116a66aa0309120d29b6edf56da90280cefc40cb 100644 (file)
@@ -9,7 +9,6 @@ SHELL = /bin/sh
 COMPONENT=libacl
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL = ${SRCDIR}bin/install
 INCDIRS= -I${DESTDIR}include -I.. -I${BACKDIR}include -I${DESTDIR}include/afs 
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
@@ -26,7 +25,7 @@ libacl.a: $(LIBOBJS)  AFS_component_version_number.o
        rm -f libacl.a
        ar rv libacl.a $(LIBOBJS) AFS_component_version_number.o
        $(RANLIB) libacl.a
-       
+
 aclprocs.o: aclprocs.c acl.h
 
 netprocs.o: netprocs.c acl.h
index 4a140818062a2cb56d8d7c514f9a0dae528addc7..de7d0031b449a44708e5bb9528af0311ea44de4c 100644 (file)
@@ -248,13 +248,15 @@ struct acl_accessList **acl;
        if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[i], &k) != 2)
            return(-1);
        (*acl)->entries[i].rights = k;
-       nextc = (char *) (1 + index(nextc, '\n'));
+       nextc = (char *) (index(nextc, '\n'));
+       nextc ++;       /* 1 + index can cast ptr to integer */
     }
     j=i;
     for (i = (*acl)->total - 1; i >= (*acl)->total -  (*acl)->negative; i--,j++) {
        if (sscanf(nextc, "%s\t%d\n", lnames.namelist_val[j], &((*acl)->entries[j].rights)) != 2)
            return(-1);
-       nextc = (char *) (1 + index(nextc, '\n'));
+       nextc = (char *) (index(nextc, '\n'));
+       nextc ++;
     }
     lids.idlist_len = 0;
     lids.idlist_val = 0;
index 8c44ea79480fdc14f1e49ec3633acc6bdb230a18..ea6ead4314c4b8cd2b8279b167f8640dd8dcd60b 100644 (file)
@@ -23,7 +23,6 @@
 #ifdef AFS_NT40_ENV
 #include <io.h>
 #endif
-#include "../../permit_xprt.h"
 
 
 /*
index 56e90464f0fb0fe67d07c9f1f0500733311c4c8f..c415298d88f7267ac520f467ab6a01b1cb4d8954 100644 (file)
@@ -40,9 +40,6 @@
 #include <afs/vlserver.h>
 #include <afs/pthread_glock.h>
 
-
-#include "../../permit_xprt.h"
-
 /*
  * AFS client administration functions.
  *
index d80386e13219b50d10b22dafe852e7ec99847ce8..d52ce7d87516e27b19c0bf068833d3941bef521a 100644 (file)
@@ -100,6 +100,7 @@ setup:
 
 # Compile the clients.
 ${COMPDIRS}:
+       if false; then \
        for b in $(BITS); do \
            for t in $(KOBJ); do \
                dir=$$t.$$b; \
@@ -109,10 +110,11 @@ ${COMPDIRS}:
                64)     bopts="$(KDEFS_64)"; bsuff="64";; \
                esac; \
                cd $$dir; \
-               $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=../${DESTDIR} libafs || exit $$?; \
+               $(MAKE) BITSUFFIX=$$bsuff CPU_KDEFS="$$bopts" DESTDIR=${DESTDIR} libafs || exit $$?; \
                cd ..; \
            done; \
-       done
+       done; \
+       fi
 
 
 # Below this line are targets when in the static directory:
index d6592bcac6e4d05a2c02a13f4f838c8afeb0ce8f..1c7847d0f46e3fcc18cd79adf40d6aebf4da8b4f 100644 (file)
@@ -111,6 +111,8 @@ LIBAFSNONFS = libafs.nonfs.o
 DEST_LIBAFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFS}
 DEST_LIBAFSNONFS = ${DESTDIR}/root.client/usr/vice/etc/modload/${LIBAFSNONFS}
 
+# Without this line, gmake tries to build libafs.o
+.PHONY: libafs
 
 # libafs:      $(DEST_LIBAFS) $(DEST_LIBAFSNONFS)
 libafs:        $(DEST_LIBAFSNONFS)
index 304260c6a280945be20c54eae2a42f2e7ae107c2..33be0bcd9b9defe3c9513d0e9e1ebbd746055f31 100644 (file)
@@ -12,7 +12,6 @@ COMPONENT=libafsauthent
 include ../config/Makefile.${SYS_NAME}
 
 CC=${MT_CC}
-INSTALL = ${SRCDIR}bin/install
 CFLAGS = ${OPTMZ} ${DBG} -I${SRCDIR}include ${MT_CFLAGS} 
 CCRULE = ${CC} ${CFLAGS} -c $?
 
index fbc53ab83535190a6c929d3519e6303be2a8b20a..e411bd77378fa7c911bcd8d071009c30f7599b8d 100644 (file)
@@ -11,7 +11,6 @@ SHELL = /bin/sh
 COMPONENT=libafsrpc
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL = ${SRCDIR}bin/install
 CC=${MT_CC}
 INCLUDES = -I${SRCDIR}include -I.. -I../rx
 CFLAGS = ${OPTMZ} ${DBG} ${INCLUDES} -DRXDEBUG ${MT_CFLAGS}
@@ -242,7 +241,7 @@ xdr_afsuuid.o: ${RX}/xdr_afsuuid.c
 #
 #   $ what /opt/langtools/bin/pxdb32
 #   /opt/langtools/bin/pxdb32:
-#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.4 $
+#           HP92453-02 A.10.0A HP-UX SYMBOLIC DEBUGGER (PXDB) $Revision: 1.1.1.5 $
 #
 # The problem occurs when -g and -O are both used when compiling des.c.
 # The simplest way to work around the problem is to leave out either -g or -O.
@@ -321,12 +320,14 @@ syscall.o: ${SYS}/syscall.s
                /usr/ccs/lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
                rm syscall.ss;;                         \
-        sgi_* ) \
+        sgi_* | ppc_darwin* ) \
                 ${CC} ${CFLAGS} -c ${SYS}/syscall.s;;          \
         alpha_dux?? ) \
                ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER ${SYS}/syscall.s; \
                ${AS} -o syscall.o syscall.i; \
                rm -f syscall.ss syscall.i;; \
+        *fbsd* ) \
+               touch syscall.o ;; \
         *) \
                /lib/cpp  ${SFLAGS} ${SYS}/syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
index 85394554599b159a44af5e999deae22c2805096b..95ec3c9926b9e4816161991dc9245d53f0dbfc00 100644 (file)
@@ -196,3 +196,5 @@ EXPORTS
        rx_SetRxStatUserOk                      @201
        rx_RxStatUserOk                         @202
        rx_enable_hot_thread                    @203 DATA
+       xdr_int64                               @204
+       xdr_uint64                              @205
index 3957c7faac4f9110a77f54cd6a1d22a70f64ba89..c57974a28ffb99796f566c72b16ca39d4d9304e2 100644 (file)
@@ -9,7 +9,6 @@
 #
 
 SHELL=/bin/sh
-INSTALL = ${SRCDIR}bin/install
 INCLUDE=  -I. -I/usr/include
 UOBJ   =../UAFS
 WEBOBJ =../AFSWEB
@@ -28,16 +27,22 @@ webinstall: AFSWEB/$(LIBAFSWEB) AFSWEB/$(LIBAFSWEBKRB)
        ${INSTALL} AFSWEB/$(LIBAFSWEB) ${DESTDIR}root.afsweb/usr/lib
        ${INSTALL} AFSWEB/$(LIBAFSWEBKRB) ${DESTDIR}root.afsweb/usr/lib
 
-ukinstall: UAFS/$(LIBUAFS)
+ukinsthdrs:
        ${INSTALL} afs/param.h ${DESTDIR}root.perf/include/afs
        ${INSTALL} afs/stds.h ${DESTDIR}root.perf/include/afs
        ${INSTALL} afs/afs_sysnames.h ${DESTDIR}root.perf/include/afs
        ${INSTALL} afs/afs_stats.h ${DESTDIR}root.perf/include/afs
        ${INSTALL} afs/sysincludes.h ${DESTDIR}root.perf/include/afs
        ${INSTALL} afs/afs_usrops.h ${DESTDIR}root.perf/include/afs
+
+ukinstlibs:
        ${INSTALL} des/libdes.a ${DESTDIR}root.perf/lib
-       ${INSTALL} UAFS/$(LIBUAFS) ${DESTDIR}root.perf/lib
-       $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${DESTDIR}include -I${DESTDIR}include/rx -I${DESTDIR}root.perf/include ${DESTDIR}root.perf/lib/$(LIBUAFS) ${DESTDIR}root.perf/lib/libdes.a $(TEST_LIBS)
+       ${INSTALL} UAFS/$(LIBUAFS) ${DESTDIR}root.perf/lib      
+
+ukinstall: ukinsthdrs UAFS/$(LIBUAFS) linktest ukinstlibs
+
+linktest: UAFS/$(LIBUAFS) des/libdes.a
+       $(CC) $(TEST_CFLAGS) $(TEST_LDFLAGS) -o linktest linktest.c -I${DESTDIR}include -I${DESTDIR}include/rx -I${DESTDIR}root.perf/include UAFS/$(LIBUAFS) des/libdes.a $(TEST_LIBS)
 
 CRULE1=        $(CC) $(OPTF) -DKERNEL $(CFLAGS) -c $?
 CRULE2=        $(CC) $(OPTF) $(WEBOPTS) -DKERNEL $(CFLAGS) -c $?
index b15bee887c249b556001a1a7ef3e14ff433896d5..f053437d3cd1df99084d0c5af81c4e968b6f7592 100644 (file)
@@ -15,9 +15,6 @@ CFLAGS = ${OPTMZ} ${INCDIRS} ${XCFLAGS} ${DBUG}
 
 PROGRAMS=      unlog tokens tokens.krb kseal
 
-INSTALL = ${SRCDIR}bin/install
-INSTALLro = ${SRCDIR}bin/install -m 644
-
 INCLS=${SRCDIR}include/afs/auth.h ${SRCDIR}include/rx/rx.h \
 ${SRCDIR}include/rx/xdr.h ${SRCDIR}include/des.h ${SRCDIR}include/rx/rxkad.h \
 ${SRCDIR}include/afs/cellconfig.h
index c14e56ecca0d836e6bdfce235724f35bf4be75d5..53f1bc672b5902bb773a826ab913bb8ea506ba73 100644 (file)
@@ -21,7 +21,6 @@ COMPONENT=login
 include ../config/Makefile.${SYS_NAME}
 
 LIBDIR = ${DESTDIR}lib/
-INSTALL=${SRCDIR}bin/install
 AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a \
          ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \
          ${DESTDIR}lib/libdes.a ${LIBDIR}librx.a ${LIBDIR}liblwp.a \
index 56ba397770dfdbd0fb3303f4fe38f08efce610b2..52905245cf3666019ce329b9cc4bc023afcd1265 100644 (file)
@@ -53,6 +53,8 @@ char copyright[] =
 #if  !defined(AFS_HPUX_ENV) && !defined(AFS_AIX_ENV)
 #if defined(AFS_SUN_ENV) || (defined(AFS_ATHENA_STDENV) && !defined(AFS_DEC_ENV)) || defined(AFS_OSF_ENV)
 #include <ufs/quota.h>
+#elif defined(AFS_FBSD_ENV)
+#include <ufs/ufs/quota.h>
 #else
 #include <sys/quota.h>
 #endif
@@ -71,6 +73,10 @@ char copyright[] =
 #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>
@@ -79,7 +85,7 @@ char copyright[] =
 #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>
index 4111dc46894a1c2d0c3b654f28ec957a648100b4..9e44ef5c4e449663137316544dde69976ed4e377 100644 (file)
@@ -9,9 +9,6 @@ SHELL = /bin/sh
 COMPONENT=lwp
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL = ${SRCDIR}bin/install
-
-include ../config/Makefile.${SYS_NAME}
 # this is important code, so let's optimize it.  The optimizer aggravates any
 # subtle bugs that may have been introduced in process.s, be warned!
 OPTIMIZE=${LWP_OPTMZ}
@@ -70,7 +67,13 @@ process.o    : process.s process.c
                                        /lib/cpp -P -I${SRCDIR}include process.s >process.ss; \
                                        ${AS} -ahlns process.ss -o process.o >process.lst; \
                                        rm process.ss ;; \
-                               hp* | *_linux* | sgi_64 | sgi_65) \
+                               ppc_darwin* ) \
+                                       $(CC) -c ${XCFLAGS} -I${SRCDIR}include process.s;; \
+                               i386_fbsd* ) \
+                                       /usr/bin/cpp -P process.fbsd.s > process.ss; \
+                                       ${AS} -o process.o process.ss; \
+                                       rm process.ss ;; \
+                               hp* | *_linux* | sgi_64 | sgi_65 ) \
                                        ${CC} ${CFLAGS} -c process.c;; \
                                ncrx86_*) \
                                        /usr/ccs/lib/cpp -P -I${SRCDIR}include process.s process.ss; \
index 899e3842c6d8ad7f36e0b4667ab52a07d025eb28..6412af6937803a9ff4c604163f1d851f5775ef61 100644 (file)
@@ -202,7 +202,7 @@ savecontext:
               .long   PRE_Block
       .L0:
               l       %r5,0(%r5)              /* Get A(PRE_Block) */
-              mvi     0(%r5),1                /* Set it */
+              mvi     3(%r5),1                /* Set it */
               lr      %r6,%r3                 /* Get base of savearea */
               st      %r15,0(%r3)             /* Save stack pointer */
               ltr     %r4,%r4                 /* If new sp is 0 */
@@ -236,8 +236,9 @@ returnto:
                  .long          PRE_Block
       .L3:
               l       %r5,0(%r5)              /* Get A(PRE_Block) */
-              xc      0(4,%r5),0(%r5)         /* Clear it */
-              l       %r15,0(%r15)
+              /*xc      0(4,%r5),0(%r5)         /* Clear it */
+             mvi     3(%r5),0                /* Clear it */ 
+             l       %r15,0(%r15)
               lm      %r6,%r15,24(%r15)       /* Restore registers */
               br      %r14                    /* Return */
 
@@ -1231,4 +1232,159 @@ returnto:
 
 
 #endif /* AFS_NCR_ENV */
+#ifdef AFS_PPC_ENV
+/* Comments:
+ *    1. Registers R10..R31 and CR0..CR7 are saved
+ *    2. "struct savearea" must hold at least 3 pointers (long)
+ *    3. This code will only work on 32 bit machines (601..604), not 620
+ *    4. No floating point registers are saved
+ *    5. The save stack "frame" is bigger than absolutely necessary.  The
+ *       PowerPC [AIX] ABI needs this extra space.
+ */
+
+
+/* Mach-O assemblers */
+#if !defined(NeXT) && !defined(__APPLE__)
+#define r0    0
+#define r1    1
+#define r2    2
+#define r3    3
+#define r4    4
+#define r5    5
+#define r6    6
+#define r7    7
+#define r8    8
+#define r9    9
+#define r10   10
+#define r11   11
+#define r12   12
+#define r13   13
+#define r14   14
+#define r15   15
+#define r16   16
+#define r17   17
+#define r18   18
+#define r19   19
+#define r20   20
+#define r21   21
+#define r22   22
+#define r23   23
+#define r24   24
+#define r25   25
+#define r26   26
+#define r27   27
+#define r28   28
+#define r29   29
+#define r30   30
+#define r31   31
+#endif /* !NeXT && !__APPLE__ */
+
+
+/*
+ * savecontext(int (*f)(), struct savearea *save, char *newsp)
+ */
+
+#define FRAME_SIZE    (32*4)+(8*4)
+#define FRAME_OFFSET  (8*4)
+#define TOP_OF_STACK  (0*4)
+#define RETURN                (1*4)
+#define CCR           (2*4)
+
+#if defined(NeXT) || defined(__APPLE__)
+      .globl  _savecontext
+_savecontext:
+      lis     r9,ha16(_PRE_Block)     /* Disable interrupt fiddling */
+      li      r8,1
+      stb     r8,lo16(_PRE_Block)(r9)
+#else
+      .globl  savecontext
+savecontext:
+      lis     r9,PRE_Block@ha         /* Disable interrupt fiddling */
+      li      r8,1
+      stb     r8,PRE_Block@l(r9)
+#endif /* NeXT || __APPLE__ */
+      subi    r1,r1,FRAME_SIZE
+      mfcr    r9
+      stw     r9,CCR(r4)
+      stw     r10,10*4+FRAME_OFFSET(r1)       /* Save registers */
+      stw     r11,11*4+FRAME_OFFSET(r1)
+      stw     r12,12*4+FRAME_OFFSET(r1)
+      stw     r13,13*4+FRAME_OFFSET(r1)
+      stw     r14,14*4+FRAME_OFFSET(r1)
+      stw     r15,15*4+FRAME_OFFSET(r1)
+      stw     r16,16*4+FRAME_OFFSET(r1)
+      stw     r17,17*4+FRAME_OFFSET(r1)
+      stw     r18,18*4+FRAME_OFFSET(r1)
+      stw     r19,19*4+FRAME_OFFSET(r1)
+      stw     r20,20*4+FRAME_OFFSET(r1)
+      stw     r21,21*4+FRAME_OFFSET(r1)
+      stw     r22,22*4+FRAME_OFFSET(r1)
+      stw     r23,23*4+FRAME_OFFSET(r1)
+      stw     r24,24*4+FRAME_OFFSET(r1)
+      stw     r25,25*4+FRAME_OFFSET(r1)
+      stw     r26,26*4+FRAME_OFFSET(r1)
+      stw     r27,27*4+FRAME_OFFSET(r1)
+      stw     r28,28*4+FRAME_OFFSET(r1)
+      stw     r29,29*4+FRAME_OFFSET(r1)
+      stw     r30,30*4+FRAME_OFFSET(r1)
+      stw     r31,31*4+FRAME_OFFSET(r1)
+      stw     r1,TOP_OF_STACK(r4)
+      cmpi    0,r5,0                          /* New stack specified? */
+      mflr    r0
+      stw     r0,RETURN(r4)
+      mtlr    r3
+      beq     L1                             /* No - don't muck with pointer */
+
+      mr      r1,r5
+L1:       blr                                     /* Return */
 
+/*
+ * returnto(struct savearea *area)
+ */
+#if defined(NeXT) || defined(__APPLE__)
+      .globl  _returnto
+_returnto:
+#else
+      .globl  returnto
+returnto:
+#endif /* NeXT || __APPLE__ */
+      lwz     r1,TOP_OF_STACK(r3)             /* Update stack pointer */
+      lwz     r0,RETURN(r3)                   /* Get return address */
+      mtlr    r0
+      lwz     r4,CCR(r3)
+      mtcrf   0xFF,r4
+      lwz     r10,10*4+FRAME_OFFSET(r1)       /* Restore registers */
+      lwz     r11,11*4+FRAME_OFFSET(r1)
+      lwz     r12,12*4+FRAME_OFFSET(r1)
+      lwz     r13,13*4+FRAME_OFFSET(r1)
+      lwz     r14,14*4+FRAME_OFFSET(r1)
+      lwz     r15,15*4+FRAME_OFFSET(r1)
+      lwz     r16,16*4+FRAME_OFFSET(r1)
+      lwz     r17,17*4+FRAME_OFFSET(r1)
+      lwz     r18,18*4+FRAME_OFFSET(r1)
+      lwz     r19,19*4+FRAME_OFFSET(r1)
+      lwz     r20,20*4+FRAME_OFFSET(r1)
+      lwz     r21,21*4+FRAME_OFFSET(r1)
+      lwz     r22,22*4+FRAME_OFFSET(r1)
+      lwz     r23,23*4+FRAME_OFFSET(r1)
+      lwz     r24,24*4+FRAME_OFFSET(r1)
+      lwz     r25,25*4+FRAME_OFFSET(r1)
+      lwz     r26,26*4+FRAME_OFFSET(r1)
+      lwz     r27,27*4+FRAME_OFFSET(r1)
+      lwz     r28,28*4+FRAME_OFFSET(r1)
+      lwz     r29,29*4+FRAME_OFFSET(r1)
+      lwz     r30,30*4+FRAME_OFFSET(r1)
+      lwz     r31,31*4+FRAME_OFFSET(r1)
+#if defined(NeXT) || defined(__APPLE__)
+      lis     r9,ha16(_PRE_Block)         /* Re-enable interrupt fiddling */
+      li      r8,0
+      stb     r8,lo16(_PRE_Block)(r9)
+#else
+      lis     r9,PRE_Block@ha         /* Re-enable interrupt fiddling */
+      li      r8,0
+      stb     r8,PRE_Block@l(r9)
+#endif /* NeXT || __APPLE__ */
+      addi    r1,r1,FRAME_SIZE
+      blr
+#endif
+       
index 1efa91b2300460a978a7807bb8d99cacf9c5e314..09de7e6ea71618038c500dcfd27b28ba94505f68 100644 (file)
@@ -52,7 +52,7 @@ typedef unsigned char bool;
 
 static globalInitDone = 0;
 
-#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_HPUX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_FBSD_ENV)
 extern insque();
 #endif
 
@@ -256,7 +256,7 @@ struct TM_Elem *TM_GetEarliest(tlist)
     return (e == tlist ? NULL : e);
 }
 
-#if defined(AFS_HPUX_ENV) || defined(AFS_NT40_ENV)
+#if defined(AFS_HPUX_ENV) || defined(AFS_NT40_ENV) || defined(AFS_FBSD_ENV)
 /* This used to be in hputils.c, but it's only use is in the LWP package. */
 /*
  * Emulate the vax instructions for queue insertion and deletion, somewhat.
@@ -285,4 +285,4 @@ void remque(struct TM_Elem *elementp)
     elementp->Prev = elementp->Next = (struct TM_Elem*)0;
 }
 
-#endif /* AFS_HPUX_ENV || AFS_NT40_ENV */
+#endif /* AFS_HPUX_ENV || AFS_NT40_ENV || AFS_FBSD_ENV */
index 74d58bc9b673613e1d7cc3b44be7f3561f18abbe..fc7be400a969fcf83fe6a8b175b9634c46b8390e 100644 (file)
@@ -153,10 +153,15 @@ int LWP_WaitForKeystroke(int seconds)
 #ifdef AFS_LINUX20_ENV
     if (stdin->_IO_read_ptr < stdin->_IO_read_end)
        return 1;
+#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    if (stdin->_bf._size > 0)
+        return 1;
 #else
     if (stdin->_cnt > 0)
        return 1;
 #endif
+#endif
 
 
     FD_ZERO(&rdfds);
index 13bd903b0d222a9d847bac9d45dcb273f4079e6e..403dbdddfe29f18f10efed752c82e3a1e23d1e30 100644 (file)
@@ -5,7 +5,6 @@ SHELL = /bin/sh
 DESTDIR=DEST/
 SRCDIR=DEST/
 CFLAGS= ${OPTMZ} ${XCFLAGS}
-INSTALL=${SRCDIR}bin/install
 LIBS = ${XLIBS}
 
 PROGRAM=mpp
index ff773628f1fdd863d6a05f1cc16fd16d1c65c483..93fd206ef900a5cd4c25c7c7b6da75deaf0be88a 100644 (file)
@@ -9,7 +9,6 @@ SHELL = /bin/sh
 COMPONENT=ntp
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 INCPATH= -I${DESTDIR}include
 BINDIR=/usr/local/etc
 LINKDIR=/etc
index 513c7c3fd4dffbadcad7ef27b5c2168e44ce5599..7ab2cda573257fe4148ce0ef2e33c103f60bbe8c 100644 (file)
@@ -8,7 +8,6 @@
 # Makefile for the null library.
 DESTDIR=DEST/
 SRCDIR=DEST/
-INSTALL=${SRCDIR}bin/install
 SHELL=/bin/sh
 
 COMPONENT=null
index 606607341a035b4ebe235bca58ff101772ad27bd..2cfcbdff85aa6dea0082ae6626d5f6464c558811 100644 (file)
@@ -15,7 +15,6 @@ CFLAGS   = ${DBUG} -DKFLAG -DANDREW -DVICE $(DBGFLAG) $(INCLUDES) $(XCFLAGS)
 YFLAGS   = -vd
 #LFLAGS  = -ll
 LINT     = lint -hp
-INSTALL  = ${SRCDIR}bin/install
 
 HFILES = package.h \
         validupdates.h \
index 711072166d84fe27d68020da0c13d83fcfb35f68..4dd02e3377bc0f25bf74eed7829873fc226273fc 100644 (file)
@@ -26,7 +26,7 @@
 
 char *emalloc();
 
-#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV)
 int test_linecounter;  /*Line number currently being parsed*/
 char *ch2str();
 char *appendchtostr();
index 2d52a9919c7e367d8b9d41bbb44463db0fd93b54..6bc69c8b7efa7a68b4a3e17895344415e25c6438 100644 (file)
@@ -28,7 +28,7 @@
 
 char *emalloc();
 
-#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_AIX41_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV)
 int test_linecounter;  /*Line number currently being parsed*/
 
 char *ch2str();
index 03d0d4c212045bf39df287441ce2cb10b98ae947..9b218cb9dba091824afaac58c41b5af9bb86fb4d 100644 (file)
@@ -6,14 +6,12 @@
 # directory or online at http://www.openafs.org/dl/license10.html
 
 SHELL=/bin/sh
-INSTALL = ${SRCDIR}bin/install
 KERNELDIR = ../libafs/
 
 COMPONENT=afs
 include ../config/Makefile.${SYS_NAME}
 
 LIBDIR = ${DESTDIR}lib/
-INSTALL=${SRCDIR}bin/install
   LIBSA = ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a
 AFSLIBS = ${DESTDIR}lib/librxkad.a         \
          ${LIBDIR}afs/libsys.a ${DESTDIR}lib/libdes.a      \
@@ -54,6 +52,8 @@ pam_afs.so.1: $(SHOBJS) afs_setcred.o
                        $(SHOBJS) $(LIBS) ;; \
        *linux*) \
                $(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\
+       *fbsd*) \
+               $(CC) $(LDFLAGS) -o $@ afs_setcred.o $(SHOBJS) $(LIBS) ;;\
        * ) \
                echo No link line for system $(SYS_NAME). ;; \
        esac
@@ -69,6 +69,8 @@ pam_afs.krb.so.1: $(SHOBJS) afs_setcred_krb.o
                        afs_setcred_krb.o $(SHOBJS) $(LDFLAGS) $(KLIBS) ;; \
        *linux*) \
                $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\
+       *fbsd*) \
+               $(CC) $(LDFLAGS) -o $@ afs_setcred_krb.o $(SHOBJS) $(KLIBS) ;;\
        * ) \
                echo No link line for system $(SYS_NAME). ;; \
        esac
@@ -82,6 +84,8 @@ test_pam: test_pam.o
                $(CC) $(CFLAGS) -o $@ test_pam.o ${PAMLIBS};; \
        *linux*) \
                $(CC) $(CFLAGS) -rdynamic -o $@ test_pam.o -lpam -ldl;; \
+       *fbsd*) \
+               $(CC) $(CFLAGS) -rdynamic -o $@ test_pam.o -lpam ;; \
        *) \
                echo No link line for system $(SYS_NAME). ;; \
        esac
index f5c928e5076d8eb2d943dffa7fc9be94c18f6caf..1939437ab78a095d5a75ac53cbc8c762b6e077b3 100644 (file)
@@ -29,7 +29,7 @@ static const char *service = "afstest";
 static const char *new_envstring = "GOTHEREVIATESTPAM=1";
 static const char *new_homestring = "HOME=/tmp";
 
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_FBSD_ENV)
 #define getpassphrase getpass
 #endif
 
index 165bbe4a4f6ed676cbefddb2efaeab618a6ad07d..d5d3b5723abaa7a423f9d4bd95addbf7219480af 100644 (file)
@@ -47,7 +47,12 @@ pinstall: install.c  AFS_component_version_number.c
        - [ -d test ] && ./test/test_install
 
 ${DESTDIR}bin/install: pinstall
-       ./pinstall -f pinstall ${DESTDIR}bin/install
+       case ${SYS_NAME} in \
+               ppc_darwin*) \
+                       ./pinstall -f pinstall ${DESTDIR}bin/pinstall ;;\
+               *) \
+                       ./pinstall -f pinstall ${DESTDIR}bin/install ;;\
+       esac
 
 # Note: Some rule needs to appear here so that OSF's make does not try to
 # compile install from install.c. A ";" will not work since other platforms
index 004a9c1107597e1033d15a9a80a7fd0cef2eebe6..36b3e265e91eb892e878826754aa1e25adbc3cf3 100644 (file)
@@ -66,21 +66,29 @@ Generic install command.  Options are:
 #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
@@ -110,9 +118,9 @@ static char *strrpbrk (s, set)
     int  i;
 
     bzero (sets, sizeof(sets));
-    while (*set) sets[*set++] = 1;
+    while (*set) sets[(int) *set++] = 1;
     i = strlen (s);
-    while (i > 0) if (sets[s[--i]]) return &s[i];
+    while (i > 0) if (sets[(int)s[--i]]) return &s[i];
     return 0;
 }
 
@@ -121,35 +129,38 @@ char *ErrorString(aerrno)
     static char tbuffer[100];
     if (aerrno < 0 || aerrno >= sys_nerr) {
        sprintf(tbuffer, "undefined error code %d", aerrno);
-       return tbuffer;
+    } else {
+       strcpy(tbuffer, sys_errlist[aerrno]);
     }
-    return sys_errlist[aerrno];
+    return tbuffer;
 }
 
+int
 stripName(aname)
     char *aname;
     {if (rindex(aname, '.') == 0) return 1;
     else return 0;
     }
 
+int
 atoo(astr)
     register char *astr;
     {register afs_int32 value;
     register char tc;
     value = 0;
-    while (tc = *astr++)
+    while ((tc = *astr++))
        {value <<= 3;
        value += tc-'0';
        }
     return value;
     }
 
-#if    defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
+#if    defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
 /*
  * Implementation lifted from that for AIX 3.1, since there didn't seem to be any
  * reason why it wouldn't work.
  */
-static
+static int
 quickStrip (iname, oname, ignored, copy_only)
 char *iname, *oname; {
        int pid, status;
@@ -211,7 +222,7 @@ char *iname, *oname; {
                strip[1] = oname;
 #ifdef AFS_SUN5_ENV
 #define        STRIP_BIN       "/usr/ccs/bin/strip"
-#elif defined(AFS_LINUX20_ENV)
+#elif defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #define STRIP_BIN      "/usr/bin/strip"
 #else
 #define        STRIP_BIN       "/bin/strip"
@@ -243,6 +254,7 @@ char *iname, *oname; {
  *     Since /bin/strip will make that call for us, we will lie so that
  *     it has a chance.
  */
+int
 AIXobject(ignored) {
 
        return !0;
@@ -446,16 +458,17 @@ static int quickStrip (afd, asize)
 
 #include "AFS_component_version_number.c"
 
+int
 main (argc, argv)
     int argc;
     char **argv;
 {
     int setOwner, setMode, setGroup, ifd, ofd;
-    afs_int32 mode, owner, group;
+    afs_int32 mode=0, owner, group;
     struct passwd *tpw;
     struct group *tgp;
     char *fnames[MAXFILES], *newNames[MAXFILES];
-    afs_int32 rcode, code, newcode;
+    afs_int32 rcode, code;
     char *dname;
     char pname[1024];
 #if defined (AFS_HPUX_ENV)
@@ -463,7 +476,10 @@ main (argc, argv)
 #endif /* AFS_HPUX_ENV */
     char pnametmp[1024];
     int pnamelen;
+#if defined (AFS_AIX_ENV) || defined(AFS_FBSD_ENV)
+    afs_int32 newcode;
     static char diskBuffer[BUFSIZE];   /* must be static to avoid compiler bugs for large stuff */
+#endif
     char myHostName[100];
     struct timeval tvp[2];
     int isDir;
@@ -671,10 +687,10 @@ main (argc, argv)
                continue;
            }
        }
-#if    defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
+#if    defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
        stripcalled = 0;
        if (strip == 1 ||
-           (strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i]))
+           ((strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i])))
            stripcalled = 1;
        if (!stripcalled) {
            /* Simply copy target to dest */
index 058aa1701faa6ca5be41e21a93ea9170eb3def6e..82c35dbdd0816a27b8d0dcd7cd09596555f580fb 100644 (file)
@@ -8,7 +8,6 @@
 include ../config/Makefile.${SYS_NAME}
 include ../config/Makefile.version
 
-INSTALL=${SRCDIR}bin/install
 CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS}
 
 ########################################################################
index af05c4eab5c7e383234182a15ffd32dce9cf308d..3a0308fa4c7f76f88de5769918fe098ae273b8ef 100644 (file)
@@ -10,13 +10,11 @@ COMPONENT=ptserver
 include ../config/Makefile.${SYS_NAME}
 
 UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
 RXGEN=${SRCDIR}bin/rxgen
 COMPILE_ET = ${SRCDIR}bin/compile_et
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 CFLAGS = $(DBUG) -I${SRCDIR}include ${XCFLAGS}
-PE = ../permit_xprt.h
 INCLS=${SRCDIR}include/ubik.h \
        ${SRCDIR}include/lock.h  \
        ${SRCDIR}include/lwp.h \
@@ -99,7 +97,7 @@ ptclient: ptclient.o display.o libprot.a $(LIBS)
 
 ptclient.o: ptclient.c ${INCLS} AFS_component_version_number.c
 
-ptuser.o: ptuser.c ${LINCLS} ${PE}
+ptuser.o: ptuser.c ${LINCLS}
 
 pterror.h pterror.c: pterror.et
        $(RM) -f pterror.h pterror.c; ${COMPILE_ET} pterror
@@ -125,7 +123,12 @@ readpwd: readpwd.o libprot.a $(LIBS)
 readpwd.o: readpwd.c ${LINCLS} AFS_component_version_number.c
 
 testpt: testpt.o libprot.a ${SRCDIR}lib/afs/libcmd.a $(LIBS)
-       $(CC) ${CFLAGS} -o testpt testpt.o -lm ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ${XLIBS}
+       case "$(SYS_NAME)" in \
+       ppc_darwin_12 ) \
+               $(CC) ${CFLAGS} -o testpt testpt.o ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ;; \
+       * ) \
+               $(CC) ${CFLAGS} -o testpt testpt.o -lm ${SRCDIR}lib/afs/libcmd.a libprot.a $(LIBS) ${XLIBS} ;; \
+       esac
 
 testpt.o: testpt.c ${INCLS} ${SRCDIR}include/afs/cmd.h AFS_component_version_number.c
 
index 23b98840885d7d02e0597129084a175f132bb911..bb19f1e79b39fa93268006d75949f9c3e2c4cc7c 100644 (file)
@@ -125,8 +125,11 @@ CreateGroup (as)
        if (code) {
            if (owner || id) 
                com_err (whoami, code,
-                        "; unable to create group %s with id %d owned by '%s' %s",
-                        namei->data, id, owner, (force?"(ignored)":""));
+                        "; unable to create group %s with id %d%s%s%s%s",
+                        namei->data, id, owner ? " owned by '" : "",
+                        owner ? owner : "",
+                        owner ? "'" : "",
+                        (force ? " (ignored)" : ""));
            else com_err (whoami, code,
                         "; unable to create group %s %s", namei->data, (force?"(ignored)":""));
            if (!force)
index e29fe7cfd1e62beddf86d0e54b1f916eb3d2c187..56371f6be6a9ce7058b28176e6228aab0d4ce39b 100644 (file)
@@ -143,13 +143,26 @@ void main (argc, argv)
        else if (strncmp (arg, "-enable_process_stats", alen) == 0) {
            rx_enableProcessRPCStats();
        }
+#ifndef AFS_NT40_ENV
+       else if (strncmp(arg, "-syslog", alen)==0) {
+           /* set syslog logging flag */
+           serverLogSyslog = 1;
+       } 
+       else if (strncmp(arg, "-syslog=", MIN(8,alen))==0) {
+           serverLogSyslog = 1;
+           serverLogSyslogFacility = atoi(arg+8);
+       }
+#endif
        else if (*arg == '-') {
          usage:
 
                /* hack in help flag support */
 
                printf ("Usage: ptserver [-database <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);
index 0e5c59ceb95151ff14c8e8e713ac603e276d4421..45e7f4688f8905cdcf21da616f2d499bc5dc1eb1 100644 (file)
@@ -20,6 +20,7 @@
 
 #define        PRBADID         0x80000000
 
+#define SYSVIEWERID     -203
 #define        SYSADMINID      -204
 #define SYSBACKUPID     -205
 #define        ANYUSERID       -101
index d85805d90ddc1fcb83bb52b461327bd060abbf67..7d3382c55b85bbeca156a11d731ed827a473c97e 100644 (file)
@@ -23,7 +23,6 @@
 #include "../afs/ptclient.h"
 #include "../afs/pterror.h"
 
-#include "../afs/permit_xprt.h"
 #else /* defined(UKERNEL) */
 #include <afs/param.h>
 #include <afs/stds.h>
@@ -43,8 +42,6 @@
 #include <afs/afsutil.h>
 #include "ptclient.h"
 #include "pterror.h"
-
-#include "../permit_xprt.h"
 #endif /* defined(UKERNEL) */
 
 
index bcaef4bb9e8be427c32787a602cf498a8ae25fdf..e4596d48ab08ee1364a98fad09affa32d9f7bb05 100644 (file)
@@ -167,6 +167,8 @@ int AccessOK (ut, cid, tentry, mem, any)
     } else if (aid < 0) {              /* checking on group */
        if ((flags & mem) && IsAMemberOf (ut, cid, aid)) return 1;
     }
+    /* Allow members of SYSVIEWERID to get membership and status only */
+    if (((mem == PRP_STATUS_MEM)||(mem == PRP_MEMBER_MEM))&&(IsAMemberOf (ut, cid, SYSVIEWERID))) return 1;
     if (IsAMemberOf (ut, cid, SYSADMINID)) return 1;
     return 0;                          /* no access */
 }
@@ -1048,6 +1050,7 @@ afs_int32 Initdb()
     InitialGroup (SYSBACKUPID, "system:backup");
     InitialGroup (ANYUSERID, "system:anyuser");
     InitialGroup (AUTHUSERID, "system:authuser");
+    InitialGroup (SYSVIEWERID, "system:ptsviewers");
     InitialGroup (ANONYMOUSID, "anonymous");
 
     /* Well, we don't really want the max id set to anonymousid, so we'll set
index 9525c2024180c5093c3d289c527d47b28f09d0a5..2fbf5ccebc5e64ff7360ac29ecb3c6ddf328621d 100644 (file)
@@ -24,7 +24,6 @@ SRCS= rcp.c
 OBJS=   rcp.o ../rsh/rcmd.o ../rsh/herror.o ../inetd/ta-rauth.o
 COMPONENT=rcp
 
-INSTALL = ${DESTDIR}bin/install
 CFLAGS = ${OPTMZ} -I${DESTDIR}include ${XCFLAGS}
 LIBDIR = ${DESTDIR}lib/
 AFSLIBS =  ${LIBDIR}afs/libkauth.a ${LIBDIR}libubik.a\
index 951efe244f353a55d5dd0ad2ed337b4f6762c246..a11c525bbb6e95b1b44d546cadda9f5568c3dae1 100644 (file)
@@ -78,7 +78,7 @@ static char sccsid[] = "@(#)rcp.c     5.11 (Berkeley) 9/22/88";
 int    rem;
 char   *colon(), *index(), *rindex(), *malloc(), *strcpy();
 int    errs;
-#ifndef AFS_LINUX20_ENV
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 extern char *sys_errlist[];
 #endif
 void   lostconn();
index 1b399bf2883f584abb852200f51e157af53a9ef4..7d8f9fa261b14a79d305c9d7b2bc5cc46bb46f5d 100644 (file)
@@ -25,7 +25,6 @@ LIBC= /lib/libc.a
 SRCS=  rlogind.c ../rsh/rcmd.c ../rsh/herror.c ../inetd/ta-rauth.c
 OBJS=  rlogind.o ../rsh/rcmd.o ../rsh/herror.o ../inetd/ta-rauth.o
 MAN=
-INSTALL = ${DESTDIR}bin/install
 LIBDIR = ${DESTDIR}lib/
 AFSLIBS =  ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a\
                   ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \
index a76f1083161f3078e1f5a0f785a88a862e5ea2a5..e85445e2ea1a8a66e80b07261dd482729669d8ab 100644 (file)
@@ -20,7 +20,6 @@ SHELL=/bin/sh
 COMPONENT=rsh
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL = ${SRCDIR}bin/install
 LIBDIR = ${DESTDIR}lib/
 INCLUDES= -I${SRCDIR}include
 CFLAGS=        ${DBUG} ${INCLUDES} ${XCFLAGS}
index 1ce5e57b88148a1eec3df92752d4429b2e8128d7..eebe2c686f437283fd191ac87aa69df66b757118 100644 (file)
@@ -20,6 +20,7 @@ static char sccsid[] = "@(#)herror.c  6.4 (Berkeley) 10/30/88";
 #endif /* LIBC_SCCS and not lint */
 
 #include <afs/param.h>
+#ifndef AFS_DARWIN_ENV
 #include <sys/types.h>
 #include <sys/uio.h>
 
@@ -64,3 +65,4 @@ herror(s)
        v->iov_len = 1;
        writev(2, iov, (v - iov) + 1);
 }
+#endif
index 9772e04392f8d0ed3e69f920c126a17bd6f09d2f..c043e1c697c0101bb046d55a653c946a0b279a90 100644 (file)
@@ -97,7 +97,7 @@ rcmd(ahost, rport, locuser, remuser, cmd, fd2p)
 #endif
        char **ahost;
         u_short rport;
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
        const char *locuser, *remuser, *cmd;
 #else
        char *locuser, *remuser, *cmd;
@@ -359,7 +359,7 @@ rresvport(alport)
 
 int    _check_rhosts_file = 1;
 
-#if defined(AFS_HPUX102_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_HPUX102_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 ruserok(rhost, superuser, ruser, luser)
         const char *rhost;
         int superuser;
index f4af3525261cdccc5bb52824d9a3c30bf75331b8..1056e225cae60f78742b84601bf808d99e9756d9 100644 (file)
@@ -11,7 +11,6 @@ include ../config/Makefile.${SYS_NAME}
 
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
-INSTALL=${SRCDIR}bin/install
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 #CC=pcc
@@ -82,8 +81,8 @@ rx_trace.o: rx_trace.h
 
 rxdumptrace: rx_trace.c
        rm -f rxdumptrace
-       $(CC) $(CFLAGS) -DDUMPTRACE -o rxdumptrace rx_trace.c  ${LIBS} ${XLIBS}
-       rm -f rx_trace.o
+       $(CC) $(CFLAGS) -DDUMPTRACE -c -o rxdumptrace.o rx_trace.c
+       $(CC) $(CFLAGS) -o rxdumptrace rxdumptrace.o  ${LIBS} ${XLIBS}
 
 rx_getaddr.o: rx.h rx_getaddr.c
 
@@ -123,14 +122,16 @@ kinstall: includes
        case ${SYS_NAME} in \
        alpha_dux* ) \
                $(INSTALL) DUX/*.[ch] $(KERNELDIR)rx;; \
-       hp_ux* ) \
-               $(INSTALL) HPUX/*.[ch] $(KERNELDIR)rx;; \
+       i386_fbsd* ) \
+               $(INSTALL) FBSD/*.[ch] $(KERNELDIR)rx;; \
        *_linux* ) \
                $(INSTALL) LINUX/*.[ch] $(KERNELDIR)rx;; \
        rs_aix* ) \
                $(INSTALL) AIX/*.[ch] $(KERNELDIR)rx;; \
        sgi_* ) \
                $(INSTALL) IRIX/*.[ch] $(KERNELDIR)rx;; \
+       ppc_darwin* ) \
+               $(INSTALL) DARWIN/*.[ch]  $(KERNELDIR)rx;; \
        sun4x_5* ) \
                $(INSTALL) SOLARIS/*.[ch]  $(KERNELDIR)rx;; \
        * ) \
index 9f7d24b53b8c30748b2c0c4769e39efcdd4587a7..7820cb0687e757c0db2dbfe31013aac34498c047 100644 (file)
@@ -690,6 +690,8 @@ struct rx_ackPacket {
 #define        RX_ACK_PING             6   /* This is a keep-alive ack */
 #define        RX_ACK_PING_RESPONSE    7   /* Ack'ing because we were pinged */
 #define        RX_ACK_DELAY            8   /* Ack generated since nothing has happened since receiving packet */
+#define RX_ACK_IDLE             9   /* Similar to RX_ACK_DELAY, but can 
+                                             be */
 
 /* Packet acknowledgement type */ 
 #define        RX_ACK_TYPE_NACK        0   /* I Don't have this packet */
index 37381895f699c9608b0826954cdf1638a0e47dd8..1432d6e68f48cd4a3c0596a4f4ff477469f48dd0 100644 (file)
 #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.
@@ -100,12 +106,219 @@ afs_int32 rxi_getaddr ()
 #undef socket
 #endif /* UKERNEL */
 
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#define ROUNDUP(a) \
+        ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
+
+static void
+rt_xaddrs(cp, cplim, rtinfo)
+        caddr_t cp, cplim;
+        struct rt_addrinfo *rtinfo;
+{
+        struct sockaddr *sa;
+        int i;
+
+        memset(rtinfo->rti_info, 0, sizeof(rtinfo->rti_info));
+        for (i = 0; (i < RTAX_MAX) && (cp < cplim); i++) {
+                if ((rtinfo->rti_addrs & (1 << i)) == 0)
+                        continue;
+                rtinfo->rti_info[i] = sa = (struct sockaddr *)cp;
+                ADVANCE(cp, sa);
+        }
+}
+#endif
+
+
 /* this function returns the total number of interface addresses 
 ** the buffer has to be passed in by the caller
 */
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 int rx_getAllAddr (buffer,maxSize)
 afs_int32      buffer[];
 int    maxSize;        /* sizeof of buffer in afs_int32 units */
+{
+     size_t needed;
+     int mib[6];
+     struct  if_msghdr *ifm, *nextifm;
+     struct  ifa_msghdr *ifam;
+     struct  sockaddr_dl *sdl;
+     struct  rt_addrinfo info;
+     char    *buf, *lim, *next;
+     int count=0,addrcount=0;
+     
+     mib[0] = CTL_NET;
+     mib[1] = PF_ROUTE;
+     mib[2] = 0;
+     mib[3] = AF_INET;     /* address family */
+     mib[4] = NET_RT_IFLIST;
+     mib[5] = 0;
+     if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
+          return 0;
+     if ((buf = malloc(needed)) == NULL)
+          return 0;
+     if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
+          free(buf);
+          return 0;
+     }
+     lim = buf + needed;
+     next = buf;
+     while (next < lim) {
+          ifm = (struct if_msghdr *)next;
+          if (ifm->ifm_type != RTM_IFINFO) {
+               printf("out of sync parsing NET_RT_IFLIST\n");
+               free(buf);
+               return 0;
+          }
+          sdl = (struct sockaddr_dl *)(ifm + 1);
+          next += ifm->ifm_msglen;
+          ifam = NULL;
+          addrcount = 0;
+          while (next < lim) {
+               nextifm = (struct if_msghdr *)next;
+               if (nextifm->ifm_type != RTM_NEWADDR)
+                    break;
+               if (ifam == NULL)
+                    ifam = (struct ifa_msghdr *)nextifm;
+               addrcount++;
+               next += nextifm->ifm_msglen;
+          }
+          if ((ifm->ifm_flags & IFF_UP) == 0)
+               continue; /* not up */
+          if (ifm->ifm_flags & IFF_LOOPBACK) {
+               continue;        /* skip aliased loopbacks as well. */
+          }
+          while (addrcount > 0) {
+               struct sockaddr_in *a;
+               
+               info.rti_addrs = ifam->ifam_addrs;
+               
+               /* Expand the compacted addresses */
+               rt_xaddrs((char *)(ifam + 1), ifam->ifam_msglen + (char *)ifam,
+                         &info);
+               if (info.rti_info[RTAX_IFA]->sa_family != AF_INET)
+                    continue;
+               a=info.rti_info[RTAX_IFA];
+               
+               if ( count >= maxSize )  /* no more space */
+                    printf("Too many interfaces..ignoring 0x%x\n",
+                           a->sin_addr.s_addr);
+               else
+                    buffer[count++] = a->sin_addr.s_addr;
+               addrcount--;
+               ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen);
+          }
+     }
+     free(buf);
+     return count;
+}
+int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize)
+   afs_int32   addrBuffer[];   /* the network addrs in net byte order */
+   afs_int32   maskBuffer[];   /* the subnet masks */
+   afs_int32   mtuBuffer[];    /* the MTU sizes */
+   int     maxSize;        /* sizeof of buffer in afs_int32 units */
+{
+    int     s;
+     
+     size_t needed;
+     int mib[6];
+     struct  if_msghdr *ifm, *nextifm;
+     struct  ifa_msghdr *ifam;
+     struct  sockaddr_dl *sdl;
+     struct  rt_addrinfo info;
+     char    *buf, *lim, *next;
+     int count=0,addrcount=0;
+
+     mib[0] = CTL_NET;
+     mib[1] = PF_ROUTE;
+     mib[2] = 0;
+     mib[3] = AF_INET;     /* address family */
+     mib[4] = NET_RT_IFLIST;
+     mib[5] = 0;
+     if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
+          return 0;
+     if ((buf = malloc(needed)) == NULL)
+          return 0;
+     if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
+          free(buf);
+          return 0;
+     }
+     s=socket(PF_INET, SOCK_DGRAM, 0);
+     if (s < 0)
+          return 0;
+     lim = buf + needed;
+     next = buf;
+     while (next < lim) {
+          ifm = (struct if_msghdr *)next;
+          if (ifm->ifm_type != RTM_IFINFO) {
+               printf("out of sync parsing NET_RT_IFLIST\n");
+               free(buf);
+               return 0;
+          }
+          sdl = (struct sockaddr_dl *)(ifm + 1);
+          next += ifm->ifm_msglen;
+          ifam = NULL;
+          addrcount = 0;
+          while (next < lim) {
+               nextifm = (struct if_msghdr *)next;
+               if (nextifm->ifm_type != RTM_NEWADDR)
+                    break;
+               if (ifam == NULL)
+                    ifam = (struct ifa_msghdr *)nextifm;
+               addrcount++;
+               next += nextifm->ifm_msglen;
+          }
+          if ((ifm->ifm_flags & IFF_UP) == 0)
+               continue; /* not up */
+          if (ifm->ifm_flags & IFF_LOOPBACK) {
+               continue;        /* skip aliased loopbacks as well. */
+          }
+          while (addrcount > 0) {
+               struct sockaddr_in *a;
+               
+               info.rti_addrs = ifam->ifam_addrs;
+               
+               /* Expand the compacted addresses */
+               rt_xaddrs((char *)(ifam + 1), ifam->ifam_msglen + (char *)ifam,
+                         &info);
+               if (info.rti_info[RTAX_IFA]->sa_family != AF_INET)
+                    continue;
+               a=info.rti_info[RTAX_IFA];
+               
+               if ( count >= maxSize ) {  /* no more space */
+                    printf("Too many interfaces..ignoring 0x%x\n",
+                           a->sin_addr.s_addr);
+               } else {
+                    struct ifreq ifr;
+                    
+                    addrBuffer[count] = a->sin_addr.s_addr;
+                    a=info.rti_info[RTAX_NETMASK];
+                    if (a)
+                         maskBuffer[count]=a->sin_addr.s_addr;
+                    else
+                         maskBuffer[count] = htonl(0xffffffff);
+                    memset(&ifr, sizeof(ifr), 0);
+                    ifr.ifr_addr.sa_family=AF_INET;
+                    strncpy(ifr.ifr_name, sdl->sdl_data, sdl->sdl_nlen);
+                    if (ioctl(s, SIOCGIFMTU, (caddr_t)&ifr) < 0)
+                         mtuBuffer[count]=1500;
+                    else
+                         mtuBuffer[count]=ifr.ifr_mtu;
+                    count++;
+               }
+               addrcount--;
+               ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen);
+          }
+     }
+     free(buf);
+     return count;
+}
+
+     
+#else
+int rx_getAllAddr (buffer,maxSize)
+afs_int32      buffer[];
+int    maxSize;        /* sizeof of buffer in afs_int32 units */
 {
     int     s;
     int     i, len, count=0;
@@ -125,13 +338,18 @@ int       maxSize;        /* sizeof of buffer in afs_int32 units */
     len = ifc.ifc_len / sizeof(struct ifreq);
     if (len > NIFS)
        len = NIFS;
-#if    defined(AFS_AIX41_ENV)
+#if    defined(AFS_AIX41_ENV) || defined (AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     if ( ifc.ifc_len > sizeof(ifs) )   /* safety check */
        ifc.ifc_len = sizeof(ifs); 
     for ( cp = (char *)ifc.ifc_buf, 
                cplim= ifc.ifc_buf+ifc.ifc_len;
                cp < cplim;
-               cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))){
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+               cp += _SIZEOF_ADDR_IFREQ(*ifr))
+#else
+                cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)))
+#endif
+       {
        ifr = (struct ifreq *)cp;
 #else
     for (i = 0; i < len; ++i) {
@@ -258,6 +476,7 @@ int rxi_getAllAddrMaskMtu (addrBuffer, maskBuffer, mtuBuffer, maxSize)
    return count;
 #endif /* AFS_USERSPACE_IP_ADDR */
 }
+#endif
 
 #endif /* ! AFS_NT40_ENV */
 #endif /* !KERNEL || UKERNEL */
index 005664ddc9bda6a7e75e19b8741fe3a27d61ed0d..73a140e7c258865948cf33c7f8816c2232c5a2bd 100644 (file)
@@ -423,7 +423,7 @@ register struct rx_peer *pp;
  */
 
 
-#if ! defined(AFS_AIX_ENV) && ! defined(AFS_SUN5_ENV) && ! defined(UKERNEL) && ! defined(AFS_LINUX20_ENV)
+#if ! defined(AFS_AIX_ENV) && ! defined(AFS_SUN5_ENV) && ! defined(UKERNEL) && ! defined(AFS_LINUX20_ENV) && !defined (AFS_DARWIN_ENV) && !defined (AFS_FBSD_ENV)
 /* Routine called during the afsd "-shutdown" process to put things back to
  * the initial state.
  */
@@ -548,7 +548,7 @@ afs_int32 rxi_Findcbi(addr)
 
 #else /* AFS_USERSPACE_IP_ADDR */
 
-#if !defined(AFS_AIX41_ENV) && !defined(AFS_DUX40_ENV)
+#if !defined(AFS_AIX41_ENV) && !defined(AFS_DUX40_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 #define IFADDR2SA(f) (&((f)->ifa_addr))
 #else /* AFS_AIX41_ENV */
 #define IFADDR2SA(f) ((f)->ifa_addr)
@@ -569,10 +569,20 @@ int rxi_GetIFInfo()
     bzero(addrs, sizeof(addrs));
     bzero(mtus, sizeof(mtus));
 
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    TAILQ_FOREACH(ifn, &ifnet, if_link) {
+      if (i >= ADDRSPERSITE) break;
+#else 
     for (ifn = ifnet; ifn != NULL && i < ADDRSPERSITE; ifn = ifn->if_next) {
+#endif
       rxmtu = (ifn->if_mtu - RX_IPUDP_SIZE);
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+      TAILQ_FOREACH(ifad, &ifn->if_addrhead, ifa_link) {
+      if (i >= ADDRSPERSITE) break;
+#else
       for (ifad = ifn->if_addrlist; ifad != NULL && i < ADDRSPERSITE;
           ifad = ifad->ifa_next){
+#endif
        if (IFADDR2SA(ifad)->sa_family == AF_INET) {
          ifinaddr = ntohl(((struct sockaddr_in *) IFADDR2SA(ifad))->sin_addr.s_addr);
          if (myNetAddrs[i] != ifinaddr) { 
@@ -626,14 +636,26 @@ rxi_FindIfnet(addr, pifad)
 
   /* if we're given an address, skip everything until we find it */
   if (!*pifad)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    *pifad = TAILQ_FIRST(&in_ifaddrhead);
+#else 
     *pifad = in_ifaddr;
+#endif
   else {
     if (((ppaddr & (*pifad)->ia_subnetmask) == (*pifad)->ia_subnet))
       match_value = 2; /* don't find matching nets, just subnets */
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    *pifad = TAILQ_NEXT(*pifad, ia_link);
+#else   
     *pifad = (*pifad)->ia_next;
+#endif
   }
     
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+  for (ifa = *pifad; ifa; ifa = TAILQ_NEXT(ifa, ia_link) ) {
+#else
   for (ifa = *pifad; ifa; ifa = ifa->ia_next ) {
+#endif
     if ((ppaddr & ifa->ia_netmask) == ifa->ia_net) {
       if ((ppaddr & ifa->ia_subnetmask) == ifa->ia_subnet) {
        sin=IA_SIN(ifa);
@@ -691,6 +713,9 @@ struct osi_socket *rxk_NewSocket(short aport)
 #endif
 
     AFS_STATCNT(osi_NewSocket);
+#if (defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)) && defined(KERNEL_FUNNEL)
+    thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
+#endif
 #if    defined(AFS_HPUX102_ENV)
 #if     defined(AFS_HPUX110_ENV)
     /* blocking socket */
@@ -701,11 +726,13 @@ struct osi_socket *rxk_NewSocket(short aport)
 #else
 #ifdef AFS_SGI65_ENV
     code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP);
+#elif defined(AFS_FBSD_ENV)
+    code = socreate(AF_INET, &newSocket, SOCK_DGRAM,IPPROTO_UDP, curproc);
 #else
     code = socreate(AF_INET, &newSocket, SOCK_DGRAM, 0);
 #endif /* AFS_SGI65_ENV */
 #endif /* AFS_HPUX102_ENV */
-    if (code) return (struct osi_socket *) 0;
+    if (code) goto bad;
 
     myaddr.sin_family = AF_INET;
     myaddr.sin_port = aport;
@@ -715,7 +742,7 @@ struct osi_socket *rxk_NewSocket(short aport)
     bindnam = allocb_wait((addrsize+SO_MSGOFFSET+1), BPRI_MED);
     if (!bindnam) {
        setuerror(ENOBUFS);
-       return(struct osi_socket *) 0;
+       goto bad;
     }
     bcopy((caddr_t)&myaddr, (caddr_t)bindnam->b_rptr+SO_MSGOFFSET, addrsize);
     bindnam->b_wptr = bindnam->b_rptr + (addrsize+SO_MSGOFFSET+1);
@@ -724,7 +751,7 @@ struct osi_socket *rxk_NewSocket(short aport)
     if (code) {
        soclose(newSocket);
        m_freem(nam);
-       return(struct osi_socket *) 0;
+       goto bad;
     }
 
     freeb(bindnam);
@@ -735,16 +762,29 @@ struct osi_socket *rxk_NewSocket(short aport)
        if (code)
            osi_Panic("osi_NewSocket: last attempt to reserve 32K failed!\n");
     }
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    myaddr.sin_len = sizeof(myaddr);
+#if defined(AFS_FBSD_ENV)
+    code = sobind(newSocket, (struct sockaddr *)&myaddr, curproc);
+#else
+    code = sobind(newSocket, (struct sockaddr *)&myaddr);
+#endif
+    if (code) {
+        printf("sobind fails\n");
+        soclose(newSocket);
+        goto bad;
+    }
+#else
 #ifdef  AFS_OSF_ENV
     nam = m_getclr(M_WAIT, MT_SONAME);
 #else   /* AFS_OSF_ENV */
     nam = m_get(M_WAIT, MT_SONAME);
 #endif
     if (nam == NULL) {
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV)
        setuerror(ENOBUFS);
 #endif
-       return (struct osi_socket *) 0;
+       goto bad;
     }
     nam->m_len = sizeof(myaddr);
 #ifdef  AFS_OSF_ENV
@@ -755,6 +795,8 @@ struct osi_socket *rxk_NewSocket(short aport)
     BHV_PDATA(&bhv) = (void*)newSocket;
     code = sobind(&bhv, nam);
     m_freem(nam);
+#elif defined(AFS_FBSD_ENV)
+    code = sobind(newSocket, nam, curproc);
 #else
     code = sobind(newSocket, nam);
 #endif
@@ -763,11 +805,21 @@ struct osi_socket *rxk_NewSocket(short aport)
 #ifndef AFS_SGI65_ENV
        m_freem(nam);
 #endif
-       return (struct osi_socket *) 0;
+       goto bad;
     }
+#endif /* else AFS_DARWIN_ENV */
 #endif /* else AFS_HPUX110_ENV */
 
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+    thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+#endif
     return (struct osi_socket *) newSocket;
+
+bad:
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+    thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+#endif
+    return (struct osi_socket *) 0;
 }
 
 
@@ -776,7 +828,13 @@ int rxk_FreeSocket(asocket)
     register struct socket *asocket;
 {
     AFS_STATCNT(osi_FreeSocket);
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+    thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL);
+#endif
     soclose(asocket);
+#if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL)
+    thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL);
+#endif
     return 0;
 }
 #endif /* !SUN5 && !LINUX20 */
@@ -938,6 +996,9 @@ void rxk_Listener(void)
 #ifdef AFS_SUN5_ENV
     rxk_ListenerPid = ttoproc(curthread)->p_pidp->pid_id;
 #endif /* AFS_SUN5_ENV */
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+    rxk_ListenerPid = current_proc()->p_pid;
+#endif
 #if defined(RX_ENABLE_LOCKS) && !defined(AFS_SUN5_ENV)
     AFS_GUNLOCK();
 #endif /* RX_ENABLE_LOCKS && !AFS_SUN5_ENV */
@@ -977,7 +1038,7 @@ void rxk_Listener(void)
 #endif /* AFS_SUN5_ENV */
 }
 
-#if !defined(AFS_LINUX20_ENV) && !defined(AFS_SUN5_ENV)
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 /* The manner of stopping the rx listener thread may vary. Most unix's should
  * be able to call soclose.
  */
index 7f99e4b4db865f730af32c46102e4b7fcf0ddfe3..389d66a49d32fd2bbd573f875328e81518950b24 100644 (file)
 #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
@@ -100,4 +114,8 @@ extern struct ifnet *rxi_FindIfnet();
 
 extern int rxk_initDone;
 
+#if defined(AFS_FBSD_ENV)
+extern struct domain inetdomain;
+#endif /* AFS_FBSD_ENV */
+
 #endif /* _RX_KCOMMON_H_ */
index f54df1a66e9999e522ac6e790421908db1aa3f63..63ad212fe4f606102159c9e3377e65dcb2e373ac 100644 (file)
@@ -36,6 +36,9 @@
 
 #define MAXTHREADNAMELENGTH 64
 
+extern int (*registerProgram)();
+extern int (*swapNameProgram)();
+
 int debugSelectFailure;        /* # of times select failed */
 /*
  * Sleep on the unique wait channel provided.
@@ -54,8 +57,8 @@ void rxi_Wakeup(void *addr)
     LWP_NoYieldSignal(addr);
 }
 
-PROCESS rx_listenerPid;        /* LWP process id of socket listener process */
-static void rx_ListenerProc(void *dummy);
+PROCESS rx_listenerPid = 0;    /* LWP process id of socket listener process */
+void rx_ListenerProc(void *dummy);
 
 /*
  * Delay the current thread the specified number of seconds.
@@ -97,8 +100,14 @@ void rxi_StartServerProc(proc, stacksize)
     long (*proc)();
 {
     PROCESS scratchPid;
+    static int number = 0;
+    char name[32];
+
+    sprintf(name, "srv_%d", ++number);
     LWP_CreateProcess(proc, stacksize, RX_PROCESS_PRIORITY,
                      0, "rx_ServerProc", &scratchPid);
+    if (registerProgram)
+       (*registerProgram)(scratchPid, name);
 }
 
 void rxi_StartListener() {
@@ -106,6 +115,8 @@ void rxi_StartListener() {
 #define        RX_LIST_STACK   24000
     LWP_CreateProcess(rx_ListenerProc, RX_LIST_STACK, LWP_MAX_PRIORITY, 0,
                      "rx_Listener", &rx_listenerPid);
+    if (registerProgram)
+       (*registerProgram)(rx_listenerPid, "listener");
 }
 
 /* The main loop which listens to the net for datagrams, and handles timeouts
@@ -151,7 +162,8 @@ void rxi_ListenerProc(rfds, tnop, newcallp)
         exit(1);
     }
     rx_listenerPid = pid;
-    swapthreadname(pid, "listener", &name);
+    if (swapNameProgram)
+       (*swapNameProgram)(pid, "listener", &name);
 
     for (;;) {
        /* Grab a new packet only if necessary (otherwise re-use the old one) */
@@ -245,6 +257,10 @@ void rxi_ListenerProc(rfds, tnop, newcallp)
                            if (p) {
                                rxi_FreePacket(p);
                            }
+                           if (swapNameProgram) {
+                               (*swapNameProgram)(rx_listenerPid, &name, 0);
+                               rx_listenerPid = 0;
+                           }
                            return;
                        }
                    }
@@ -261,6 +277,10 @@ void rxi_ListenerProc(rfds, tnop, newcallp)
                            if (p) {
                                rxi_FreePacket(p);
                            }
+                           if (swapNameProgram) {
+                               (*swapNameProgram)(rx_listenerPid, &name, 0);
+                               rx_listenerPid = 0;
+                           }
                            return;
                        }
                    }
index 6323b49a2a8b4b2c1d3bc0b0c919bc2bb6a77dd3..cb49d1e477ef04b1310a5545a3d734674e65dcb1 100644 (file)
@@ -40,7 +40,9 @@
 #define MAX(a,b)  ((a)>(b)?(a):(b))
 #endif
 #else /* AFS_NT40_ENV */
+#if !defined(AFS_DARWIN_ENV) && !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_FBSD_ENV) && !defined(AFS_USR_FBSD_ENV)
 #include <sys/sysmacros.h>      /* MIN, MAX on Solaris */
+#endif
 #include <sys/param.h>          /* MIN, MAX elsewhere */
 #endif /* AFS_NT40_ENV */
 
index b1bbadd13a6e1eb6a925b56ef1227e1b8b378284..0b409905cd027b728d78ccb4478335a981984769 100644 (file)
@@ -1,4 +1,4 @@
-/*
+ /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
  * 
@@ -10,6 +10,9 @@
 #ifdef KERNEL
 #include "../afs/param.h"
 #ifndef UKERNEL
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include "../afs/sysincludes.h"
+#else
 #include "../h/types.h"
 #include "../h/time.h"
 #include "../h/stat.h"
@@ -23,6 +26,7 @@
 #if defined(AFS_SGI_ENV)
 #include "../afs/sysincludes.h"
 #endif
+#endif
 #include "../afs/afs_args.h"
 #include "../afs/afs_osi.h"
 #if    (defined(AFS_AUX_ENV) || defined(AFS_AIX_ENV))
@@ -34,7 +38,6 @@
 #ifdef RXDEBUG
 #undef RXDEBUG     /* turn off debugging */
 #endif /* RXDEBUG */
-#include "../afsint/afsint.h"
 
 #include "../rx/rx_kmutex.h"
 #include "../rx/rx_kernel.h"
index c9ec3fcdfa4d96f8a28ee43a6ae1eb7ed00405a7..1cd7ffddd99392f2f5ac5bde28a32e80cb6b4efa 100644 (file)
@@ -463,6 +463,9 @@ struct cmd_syndesc *as;
                break;
            }
 
+           if ((onlyHost != -1) && (onlyHost != tpeer.host)) continue;
+           if ((onlyPort != -1) && (onlyPort != tpeer.port)) continue;
+
            /* now display the peer */
            hostAddr.s_addr = tpeer.host;
            printf("Peer at host %s, port %hu\n",
@@ -475,6 +478,10 @@ struct cmd_syndesc *as;
                   tpeer.bytesSent.high, tpeer.bytesSent.low);
            printf("\tbytes received high %d low %d\n",
                   tpeer.bytesReceived.high, tpeer.bytesReceived.low);
+           printf("\trtt %d msec, rtt_dev %d msec\n",
+                  tpeer.rtt >> 3, tpeer.rtt_dev >> 2);
+           printf("\ttimeout %d.%03d sec\n",
+                  tpeer.timeout.sec, tpeer.timeout.usec / 1000);
        }
     }
     exit(0);
index 7974cf68457402ae7cdcdc154ce9a77ff616ce13..7a7154fcfd0fca21b9636cc7c81cfece59635c55 100644 (file)
@@ -930,7 +930,6 @@ PRIVATE void WriteCltHeader(char *serverName, int srv_no, FILE *itl_h)
            "#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);
@@ -1264,7 +1263,6 @@ PRIVATE void WriteServHeader(FILE *srv_h, char *serverName, int 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"
index 4cb495ccc735b8952d7bfd4804873ec056d0ddf7..830f527ef9eea62c50648b9ec64f0c286f4b5624 100644 (file)
@@ -9,7 +9,6 @@ COMPONENT=rxgen
 include ../config/Makefile.${SYS_NAME}
 
 UKERNELDIR=../libuafs/
-INSTALL =${SRCDIR}bin/install
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 SRCS= rpc_main.c rpc_hout.c rpc_cout.c rpc_parse.c rpc_scan.c rpc_util.c \
index 15d771ff99114966d6983bfb831f4cb35604c38c..e96aba4881ba67183b7005c4ca8427b09d8a9190 100644 (file)
@@ -88,8 +88,12 @@ int debug = 0;
 static char *cmdname;
 #ifdef AFS_SUN5_ENV
 static char CPP[] = "/usr/ccs/lib/cpp";
+#elif defined(AFS_FBSD_ENV)
+static char CPP[] = "/usr/bin/cpp";
 #elif defined(AFS_NT40_ENV)
 static char CPP[MAXCMDLINE];
+#elif defined(AFS_DARWIN_ENV)
+static char CPP[] = "cc -E";
 #else
 static char CPP[] = "/lib/cpp";
 #endif
index 0c2a7b95420cb3c892da778df95b1fa02ce15859..be08e3dc257d28897a027660ee3a90228392e2c0 100644 (file)
@@ -14,15 +14,13 @@ include ../config/Makefile.${SYS_NAME}
 
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET = ${SRCDIR}bin/compile_et
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 CFLAGS = ${OPTMZ} -I${SRCDIR}include ${XCFLAGS}
-PE = ../permit_xprt.h
 INCLS= ${SRCDIR}include/rx/rx.h \
        ${SRCDIR}include/rx/xdr.h \
-       rxkad.h ${PE}
+       rxkad.h
 
 OBJS= rxkad_client.o rxkad_server.o rxkad_common.o ticket.o rxkad_errs.o
 
@@ -63,7 +61,7 @@ rxkad_errs.c rxkad.h: rxkad_errs.et rxkad.p.h
 
 ticket.o: ticket.c lifetimes.h ${INCLS}
 
-fcrypt.o: fcrypt.c fcrypt.h sboxes.h rxkad.h ${PE}
+fcrypt.o: fcrypt.c fcrypt.h sboxes.h rxkad.h
        ${CC} ${CFLAGS} -c fcrypt.c
 
 kinstall: ${KSRCS}
index ecf42def508a2e6ff9a5473b8e3c165b133375b0..1bd7cb7d3f7b09392b379f5c358d22544cb92952 100644 (file)
 
 #include "private_data.h"
 #define XPRT_RXKAD_CRYPT
-#ifdef KERNEL
-#include "../afs/permit_xprt.h"
-#else
-#include "../permit_xprt.h"
-#endif
-
 
-AFS_HIDE
 afs_int32 rxkad_DecryptPacket (conn, schedule, ivec, len, packet)
   IN struct rx_connection *conn;
   IN fc_KeySchedule *schedule;
@@ -60,7 +53,6 @@ afs_int32 rxkad_DecryptPacket (conn, schedule, ivec, len, packet)
     char * data;
     int i,tlen;
 
-    if (!xprt_CryptOK (conn)) return RXKADILLEGALLEVEL;
     obj = rx_SecurityObjectOf(conn);
     tp = (struct rxkad_cprivate *)obj->privateData;
     LOCK_RXKAD_STATS
@@ -84,7 +76,6 @@ afs_int32 rxkad_DecryptPacket (conn, schedule, ivec, len, packet)
     return 0;
 }
 
-AFS_HIDE
 afs_int32 rxkad_EncryptPacket (conn, schedule, ivec, len, packet)
   IN struct rx_connection *conn;
   IN fc_KeySchedule *schedule;
@@ -98,7 +89,6 @@ afs_int32 rxkad_EncryptPacket (conn, schedule, ivec, len, packet)
     char *data;
     int i,tlen;
 
-    if (!xprt_CryptOK (conn)) return RXKADILLEGALLEVEL;
     obj = rx_SecurityObjectOf(conn);
     tp = (struct rxkad_cprivate *)obj->privateData;
     LOCK_RXKAD_STATS
index ba0b0ce7fbb367b4c108a387c2dd8affd6af348e..a07a10081aaf5aece3802d2e53c45aa3d7ddf4a6 100644 (file)
@@ -56,11 +56,6 @@ int ROUNDS = 16;
 #endif
 
 #define XPRT_FCRYPT
-#ifdef KERNEL
-#include "../afs/permit_xprt.h"
-#else
-#include "../permit_xprt.h"
-#endif
 
 int fc_keysched (key, schedule)
   IN struct ktc_encryptionKey *key;
@@ -104,7 +99,6 @@ int fc_keysched (key, schedule)
     return 0;
 }
 
-AFS_HIDE
 afs_int32 fc_ecb_encrypt(clear, cipher, schedule, encrypt)
   IN afs_uint32  *clear;
   OUT afs_uint32 *cipher;
@@ -194,7 +188,6 @@ afs_int32 fc_ecb_encrypt(clear, cipher, schedule, encrypt)
  * NOTE: fc_cbc_encrypt now modifies its 5th argument, to permit chaining over
  * scatter/gather vectors.
  */
-AFS_HIDE
 afs_int32 fc_cbc_encrypt (input, output, length, key, xor, encrypt)
   char         *input;
   char         *output;
index 2fd46b1a9475b5ff10635deb5bfb5c5d4953dad7..19bae16122a99f6a6b55c7b043b0d6b7a76f5446 100644 (file)
 
 #include "private_data.h"
 #define XPRT_RXKAD_CLIENT
-#ifdef KERNEL
-#include "../afs/permit_xprt.h"
-#else
-#include "../permit_xprt.h"
-#endif
-
 
 char *rxi_Alloc();
 
@@ -185,7 +179,7 @@ rxkad_NewClientSecurityObject(level, sessionkey, kvno, ticketLen, ticket)
     bzero ((void *)tcp, size);
     tsc->privateData = (char *) tcp;
     tcp->type |= rxkad_client;
-    tcp->level = xprt_CoerceLevel(level);
+    tcp->level = level;
     code = fc_keysched (sessionkey, tcp->keysched);
     if (code) return 0;                        /* bad key */
     bcopy ((void *)sessionkey, (void *)tcp->ivec, sizeof(tcp->ivec));
index 2991f1d9bcf3ecbc43bc01f2bbf20da5b618a2b0..8e00127098dd957ee3907b74fa6806f9d03e8ec0 100644 (file)
@@ -19,7 +19,6 @@
 #endif
 #include "../h/types.h"
 #include "../h/time.h"
-#include "../netinet/in.h"
 #ifndef AFS_LINUX22_ENV
 #include "../rpc/types.h"
 #include "../rpc/xdr.h"
 
 #include "private_data.h"
 #define XPRT_RXKAD_COMMON
-#ifdef KERNEL
-#include "../afs/permit_xprt.h"
-#else
-#include "../permit_xprt.h"
-#endif
-
 
 char *rxi_Alloc();
 
index 43c232a6026d6f07664dff6ade32bbfb775b2e27..add3e7b03e28b63fdf214dda589d105a592ad530 100644 (file)
@@ -26,8 +26,6 @@
 #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.
index 21ae378e9d32d127432ff86362026211f71139b5..85bcf7af4c5335b6b291e08c68716900b6c152a6 100644 (file)
 #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)
index b9219f990efabc93469f2318affb6a9ca8ff2d1e..d0b14ddd204d1fd6e6a31c85223e68da4a0e076c 100644 (file)
@@ -7,18 +7,6 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-/*
- * Revision 2.3  90/08/31  16:19:53
- * Move permit_xprt.h.
- * 
- * Revision 2.2  90/08/20  10:21:25
- * Include permit_xprt.h.
- * Cleanup; prune log, flush andrew style ticket functions.
- * 
- * Revision 2.1  90/08/07  19:33:44
- * Start with clean version to sync test and dev trees.
- * */
-
 #if defined(UKERNEL)
 #include "../afs/param.h"
 #include "../afs/sysincludes.h"
@@ -29,8 +17,6 @@
 #include "../des/des.h"
 #include "../afs/lifetimes.h"
 #include "../afs/rxkad.h"
-
-#include "../afs/permit_xprt.h"
 #else /* defined(UKERNEL) */
 #include <afs/param.h>
 #include <afs/stds.h>
@@ -45,8 +31,6 @@
 #include <des.h>
 #include "lifetimes.h"
 #include "rxkad.h"
-
-#include "../permit_xprt.h"
 #endif /* defined(UKERNEL) */
 
 
index c07f38557b24cb89d3477bf76c8548fa9758e542..8f81ed8a293147e8b555c30ff4a5d365c7c1359c 100644 (file)
@@ -11,7 +11,6 @@ include ../config/Makefile.version
 
 KERNELDIR = ../libafs/
 UKERNELDIR = ../libuafs/
-INSTALL=${SRCDIR}bin/install
 RXGEN=${SRCDIR}bin/rxgen
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
index 87395535fdeca58df657f2e810740edab2d4430f..83006ed528a8535390ae4e7b49bd31c20b59bf38 100644 (file)
@@ -10,8 +10,6 @@ SHELL = /bin/sh
 COMPONENT=scout
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
-
 CFLAGS= ${DBUG} -I. \
        -I${SRCDIR}include \
        -I${SRCDIR}include/afs \
index 8ec1c4c98046561563b2f74cc9f2672dc2972794..5a42979ac29fba532ed227374df230885e4fb5a8 100644 (file)
@@ -17,7 +17,6 @@ OPTIMIZE=-g
 CFLAGS = ${OPTIMIZE} -I${SRCDIR}include ${XCFLAGS}
 LDFLAGS = ${OPTIMIZE} ${XLDFLAGS}
 LIBDIR = ${DESTDIR}lib/
-INSTALL=${SRCDIR}bin/install
 AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a \
          ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \
          ${DESTDIR}lib/libdes.a ${LIBDIR}librx.a ${LIBDIR}liblwp.a \
index 856d7cebb002d53ea831d0ddd7bf025ae008718b..74403e866104444cd9cfd962ce4c3a7e89f45ed1 100644 (file)
@@ -27,8 +27,6 @@ KLIBS = ${DESTDIR}/lib/afs/libkauth.krb.a ${LIBS1} ${DESTDIR}/lib/afs/libauth.kr
 
 all: test-reauth ${DESTDIR}/lib/afs/libafssiad.so ${DESTDIR}/lib/afs/libafssiad.krb.so
 
-INSTALL=${SRCDIR}bin/install
-
 CFLAGS = $(DEBUG) -I${SRCDIR}include ${XCFLAGS}
 
 ${DESTDIR}/lib/afs/libafssiad.so: libafssiad.so
index d94d9040e283020734a8271eb01f17c4707e186d..72267e6e0518834a04a0e2bf47663fe0279dc0a9 100644 (file)
@@ -14,7 +14,6 @@ include ../config/Makefile.${SYS_NAME}
 MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 UKERNELDIR=../libuafs/
-INSTALL = ${SRCDIR}bin/install
 CFLAGS= ${DBUG}  -I${SRCDIR}include  ${XCFLAGS} ${DBG_DEFS}
 SFLAGS=-P -I${SRCDIR}include  
 LIBS= libsys.a ${SRCDIR}lib/librx.a libsys.a ${SRCDIR}lib/liblwp.a ${SRCDIR}lib/afs/util.a ${XLIBS}
@@ -80,7 +79,7 @@ syscall.o: syscall.s
                /usr/ccs/lib/cpp  ${SFLAGS} syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
                rm syscall.ss;;                         \
-        sgi_* ) \
+        sgi_* |ppc_darwin* ) \
                 ${CC} ${CFLAGS} -c syscall.s;;          \
         alpha_osf1 | alpha_osf20 |  alpha_osf30 | alpha_osf32 | alpha_osf32c | alpha_dux?? ) \
                ${AS} -P ${CFLAGS} -D_NO_PROTO -DMACH -DOSF -nostdinc -traditional -DASSEMBLER syscall.s; \
@@ -88,6 +87,8 @@ syscall.o: syscall.s
                rm -f syscall.ss syscall.i;; \
         hp_ux11? ) \
                touch syscall.o;; \
+       i386_fbsd* ) \
+               touch syscall.o;; \
         *) \
                /lib/cpp  ${SFLAGS} syscall.s syscall.ss; \
                as -o syscall.o syscall.ss;             \
index 47615cd40aad0dda0691db6b0aa49e21ab666172..dfd2516c7589768fc087484920b5a825e959b826 100644 (file)
@@ -15,7 +15,6 @@ COMPONENT=tbutc
 include ../config/Makefile.${SYS_NAME}
 
 CC      =${MT_CC}
-INSTALL =${SRCDIR}bin/install
 CFLAGS  = ${DBG} -w ${MT_CFLAGS}
 
 LDFLAGS = ${DBG} ${XLDFLAGS}
index d6c739abefa74c449fa3a839a9dd8389a4ce4575..52bbe47e656c1f44fe01245b8205fd5962cbcabd 100644 (file)
@@ -47,7 +47,7 @@ BUTMINCLUDE = -I$(DESTDIR)\include
 BUTCOBJS   = dbentries.obj tcprocs.obj lwps.obj tcmain.obj list.obj recoverDb.obj \
             tcudbprocs.obj dump.obj tcstatus.obj butc_xbsa.obj \
              $(LWPOBJS) $(BUCOORDOBJS)
-BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)\ 
+BUTCINCLUDE= -I. -I$(DESTDIR)\include -I$(XBSADIR)\
 BUTCLIBS   = $(DESTDIR)\lib\afs\afsbudb.lib \
             $(DESTDIR)\lib\afs\afsbubasics.lib \
             $(VOLSERLIBS) \
@@ -57,6 +57,7 @@ BUTCLIBS   = $(DESTDIR)\lib\afs\afsbudb.lib \
             $(DESTDIR)\lib\afsubik.lib \
             $(DESTDIR)\lib\afs\afsauth.lib \
 \
+            $(DESTDIR)\lib\afsrpc.lib \
              $(DESTDIR)\lib\afsrxkad.lib \
             $(DESTDIR)\lib\afsrx.lib \
              $(DESTDIR)\lib\afslwp.lib \
@@ -64,7 +65,6 @@ BUTCLIBS   = $(DESTDIR)\lib\afs\afsbudb.lib \
              $(DESTDIR)\lib\afs\afsutil.lib \
              $(DESTDIR)\lib\afs\afsusd.lib \
             $(DESTDIR)\lib\afs\afspioctl.lib \
-            $(DESTDIR)\lib\afsrpc.lib \
              $(DESTDIR)\lib\afs\afscmd.lib \
              $(DESTDIR)\lib\afs\afscom_err.lib \
             $(DESTDIR)\lib\afs\afsreg.lib \
index e5550c70cd7644397408172357d20cbc45146720..efb9f64fd5578c5b47bd4a645c58c1499fb10141 100644 (file)
@@ -9,7 +9,6 @@ include ../config/Makefile.${SYS_NAME}
 OPTIMIZE=-g
 CFLAGS = ${OPTIMIZE} -I${SRCDIR}include ${XCFLAGS}
 LIBDIR = ${DESTDIR}lib/
-INSTALL=${SRCDIR}bin/install
 AFSLIBS = ${LIBDIR}afs/libkauth.a ${LIBDIR}afs/libprot.a ${LIBDIR}libubik.a \
          ${LIBDIR}afs/libauth.a ${DESTDIR}lib/librxkad.a ${LIBDIR}afs/libsys.a \
          ${DESTDIR}lib/libdes.a ${LIBDIR}librx.a ${LIBDIR}liblwp.a \
index 0d37a57367c304cfb68535ffa1f6a53aae1d7dec..a7bab2ad15ddc3b54cdccdbfb3e3a7d34281f9db 100644 (file)
@@ -10,7 +10,6 @@ COMPONENT=tviced
 include ../config/Makefile.${SYS_NAME}
 
 CC=${MT_CC}
-INSTALL=${SRCDIR}bin/install
 INCLUDES=-I. -I.. -I${SRCDIR}include -I${SRCDIR}include/afs
 CFLAGS=${DBG} ${OPTMZ} -DNINTERFACE ${INCLUDES} ${MT_CFLAGS} -DRXDEBUG
 LDFLAGS=${DBG} ${XLDFLAGS}
@@ -183,14 +182,7 @@ afsint.xdr.o: ${FSINT}/afsint.xdr.c
        ${CC} -c ${CFLAGS} ${FSINT}/afsint.xdr.c
 
 fileserver: callback_clean1 viced.o ${objects} ${LIBS}
-       case ${SYS_NAME} in \
-       *linux*) \
-           ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS} \
-           ${MTLIBS} ${XLIBS} ;; \
-       *) \
-           ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS} \
-           ${MTLIBS} ${XLIBS} ;; \
-       esac;
+       ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS} ${MTLIBS} ${XLIBS}
 
 ${DESTDIR}root.server/usr/afs/bin/fileserver : fileserver
        ${INSTALL} -ns fileserver ${DESTDIR}root.server/usr/afs/bin/fileserver
index aaf6be9f9d7f84328b0ac42a5024be2247aa427b..7a89360c7e2d8b67b5a4e2bd46517bbef0a331da 100644 (file)
@@ -12,7 +12,6 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 CFLAGS=${OPTMZ} -I./ -I${SRCDIR}include ${XCFLAGS}
 UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
 LIBOBJS=disk.o  remote.o beacon.o recovery.o ubik.o  vote.o lock.o phys.o \
        ubik_int.cs.o ubik_int.ss.o ubik_int.xdr.o ubikcmd.o \
        ubikclient.o uerrors.o
index 59fb4c8d63f9c5b0d1d1b6ef955905ea004f9f51..fe8ac9ec34ed765ed14cd3b4ecebbf5aab5f8843 100644 (file)
@@ -211,12 +211,16 @@ ubeacon_InitServerListCommon(ame, info, clones, aservers)
                 }
                 ++nServers;
             }
-           ts->vote_rxcid = rx_NewConnection(servAddr, ubik_callPortal, 
-               VOTE_SERVICE_ID, 
-               ubikSecClass, ubikSecIndex);            /* for vote reqs */
-           ts->disk_rxcid = rx_NewConnection(servAddr, ubik_callPortal, 
-               DISK_SERVICE_ID, ubikSecClass, 
-               ubikSecIndex);                          /* for disk reqs */
+           /* for vote reqs */
+           ts->vote_rxcid = rx_NewConnection(info->hostAddr[i].sin_addr.s_addr,
+                                             ubik_callPortal, 
+                                             VOTE_SERVICE_ID, 
+                                             ubikSecClass, ubikSecIndex);
+           /* for disk reqs */
+           ts->disk_rxcid = rx_NewConnection(info->hostAddr[i].sin_addr.s_addr,
+                                             ubik_callPortal, 
+                                             DISK_SERVICE_ID, ubikSecClass, 
+                                             ubikSecIndex);                 
            ts->up = 1;
        }
     } else {
@@ -611,9 +615,8 @@ afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR];
                code = UBADHOST; /* remote CellServDB inconsistency */
                ubik_print("Inconsistent Cell Info on server: ");
                for ( j=0; j < UBIK_MAX_INTERFACE_ADDR && ts->addr[j]; j++)
-                   printf("%s ", afs_inet_ntoa(ts->addr[j]));
-               printf("\n");
-               fflush(stdout); fflush(stderr);     
+                   ubik_print("%s ", afs_inet_ntoa(ts->addr[j]));
+               ubik_print("\n");
            }
            else {
                ts->up= 0;      /* mark the remote server as down */
index c7773a413c541c0cb2af92cbcc8939a318779314..a81150ceed120887f5225072549ee9195fbe8e0d 100644 (file)
@@ -74,7 +74,7 @@ ulock_getLock(atrans, atype, await)
      return UDONE;
 
   if (atrans->locktype != 0) {
-     printf("Ubik: Internal Error: attempted to take lock twice\n");
+     ubik_print("Ubik: Internal Error: attempted to take lock twice\n");
      abort();
   }
 
index eeb10202219d4c4bac15f5db418a7e39a79d7538..4ed4dc8fac1ea7f7f9f41d6743c70c8a787405c7 100644 (file)
@@ -592,8 +592,8 @@ UbikInterfaceAddr   *inAddr, *outAddr;
     {
        ubik_print("Inconsistent Cell Info from server: ");
        for ( i=0; i < UBIK_MAX_INTERFACE_ADDR && inAddr->hostAddr[i]; i++)
-           printf("%s ", afs_inet_ntoa(htonl(inAddr->hostAddr[i])));
-       printf("\n");
+           ubik_print("%s ", afs_inet_ntoa(htonl(inAddr->hostAddr[i])));
+       ubik_print("\n");
        printServerInfo();
         return UBADHOST;
     }
@@ -604,9 +604,8 @@ UbikInterfaceAddr   *inAddr, *outAddr;
     
     ubik_print("ubik: A Remote Server has addresses: ");
     for ( i=0; i < UBIK_MAX_INTERFACE_ADDR && ts->addr[i]; i++)
-       printf("%s ", afs_inet_ntoa(ts->addr[i]));
-    printf("\n");
-    fflush(stdout); fflush(stderr);
+       ubik_print("%s ", afs_inet_ntoa(ts->addr[i]));
+    ubik_print("\n");
 
     return 0;
 }
@@ -619,12 +618,11 @@ printServerInfo()
     ubik_print("Local CellServDB:");
     for ( ts=ubik_servers; ts; ts= ts->next, j++)
     {
-       printf("Server %d: ", j);
+       ubik_print("Server %d: ", j);
        for ( i=0; (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)
index 79116338213e0a446779b0e6af1d166ae2fcafc3..7b1238d383fe378cfa2483e7cb9d27589503dd76 100644 (file)
@@ -500,7 +500,7 @@ int ubik_EndTrans(transPtr)
            to us, or timeout.  Put safety check in anyway */
        if (now - realStart > 10 * BIGTIME) {
            ubik_stats.escapes++;
-           printf("ubik escaping from commit wait\n");
+           ubik_print("ubik escaping from commit wait\n");
            break;
        }
        for(ts = ubik_servers; ts; ts=ts->next) {
@@ -824,9 +824,9 @@ int panic(a, b, c, d)
     char *a, *b, *c, *d;
 {
     ubik_print("Ubik PANIC: ");
-    printf(a, b, c, d);
+    ubik_print(a, b, c, d);
     abort();
-    printf("BACK FROM ABORT\n");    /* shouldn't come back */
+    ubik_print("BACK FROM ABORT\n");    /* shouldn't come back */
     exit(1);                       /* never know, though  */
 }
 
index 25862484596b68ea18bb94f3ed233dc4299c104d..7145036b82cba3f030ece0c36f338803909525de 100644 (file)
@@ -318,7 +318,7 @@ main(argc, argv)
     sigaction(SIGSEGV, &nsa, NULL);
 #endif
     ts = cmd_CreateSyntax((char *) 0, CommandProc, 0, "probe ubik server");
-    cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine");
+    cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "server machine");
     cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port");
     cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info");
 
index ebf831a4f518ddf93ec9f4de98a0243930a39be3..49e9c49dca97257f609376f3139fdb678b3ab74e 100644 (file)
@@ -236,7 +236,7 @@ SVOTE_Beacon(rxcall, astate, astart, avers, atid)
        he's lowest, these loops don't occur.  because if someone knows he's
        lowest, he will send out beacons telling others to vote for him. */
     if (!amIClone &&
-        (ntohl((afs_uint32) ubik_host) <= ntohl((afs_uint32) lowestHost)
+        (ntohl((afs_uint32) ubik_host[0]) <= ntohl((afs_uint32) lowestHost)
         || lowestTime + BIGTIME < now)) {
        lowestTime = now;
        lowestHost = ubik_host[0];
@@ -294,9 +294,8 @@ SVOTE_Beacon(rxcall, astate, astart, avers, atid)
            (otherHost != lastYesHost) ||
            (lastYesState != astate)) {
           /* A new vote or a change in the vote or changed quorum */
-          ubik_dprint("Ubik: vote 'yes' for %d.%d.%d.%d %s\n",
-                      ((otherHost>>24)&0xff), ((otherHost>>16)&0xff),
-                      ((otherHost>> 8)&0xff), (otherHost      &0xff),
+          ubik_dprint("Ubik: vote 'yes' for %s %s\n",
+                               afs_inet_ntoa(otherHost),
                       (astate?"(in quorum)":"(NOT in quorum)"));
        }
 
index 447d7f4e48896294376d5b5457360954e177c2db..19d6b921dcdf1ed3d9beb340906c6bc39f61cec3 100644 (file)
@@ -9,7 +9,6 @@ SHELL = /bin/sh
 COMPONENT=update
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 LIBRX=${SRCDIR}lib/librx.a
 LIBS = ${SRCDIR}lib/afs/libauth.a ${SRCDIR}lib/librxkad.a \
        ${SRCDIR}lib/libdes.a ${LIBRX} ${SRCDIR}lib/liblwp.a \
index bee2956dc2675dc7273df131318d555608cedf00..fa048526b12c47394c2ad71a4e965447d21fd925 100644 (file)
@@ -9,7 +9,6 @@ SHELL = /bin/sh
 COMPONENT=ptserver
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 RXGEN=${SRCDIR}bin/rxgen
 COMPILE_ET = ${SRCDIR}bin/compile_et
 
index a2b497349e22f5987d84678745acef643ea95349..fb08d4f773c042d20d5c0573a4f36a9362d7c412 100644 (file)
@@ -17,6 +17,9 @@
 #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
@@ -333,8 +336,10 @@ static int usd_FileOpen(
 
     oflags = (flags & USD_OPEN_RDWR) ? O_RDWR : O_RDONLY;
 
+#ifdef O_SYNC /* AFS_DARWIN_ENV XXX */
     if (flags & USD_OPEN_SYNC)
        oflags |= O_SYNC;
+#endif
 
     if (flags & USD_OPEN_CREATE)
        oflags |= O_CREAT;
index 7dbb0a4ef05c430def707b7896fc3510b9fd8f8d..1e979e46f3b66351846ecdae28e12b99fbc4abb5 100644 (file)
@@ -12,8 +12,6 @@ SHELL=/bin/sh
 COMPONENT=uss
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL = ${SRCDIR}bin/install
-
 #
 # This makefile creates the following things:
 #
index 1d681ca3a251289a7bf78e774b31e2716c55c9f5..0b22fac399523574e75165eba39ab553ebc9ea40 100644 (file)
@@ -60,7 +60,7 @@
 #define uss_VolumeLen          300
 #define uss_DirPoolLen         300
 
-#ifndef AFS_LINUX20_ENV
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 extern char *sys_errlist[];
 #endif
 
index 86eadede21c84de47071b846084e3ee28c9dac3d..cb021f4215a83c0564b267c672c443407c80ac54 100644 (file)
@@ -11,12 +11,11 @@ include ../config/Makefile.${SYS_NAME}
 
 CFLAGS = ${OPTMZ} -I$(SRCDIR)include ${XCFLAGS}
 LDFLAGS = ${OPTMZ} ${XLDFLAGS}
-INSTALL = ${SRCDIR}bin/install
 
 objects = assert.o base64.o casestrcpy.o ktime.o volparse.o hostparse.o \
         hputil.o kreltime.o isathing.o get_krbrlm.o uuid.o serverLog.o \
         dirpath.o fileutil.o netutils.o flipbase64.o \
-        afs_atomlist.o afs_lhash.o snprintf.o
+        afs_atomlist.o afs_lhash.o snprintf.o ${REGEX_OBJ}
 
 headers = assert.h potpourri.h itc.h errors.h afsutil.h pthread_glock.h \
          dirpath.h afs_atomlist.h afs_lhash.h
@@ -34,6 +33,7 @@ install0: ${DESTDIR}include/afs/dirpath.h \
        ${DESTDIR}include/afs/pthread_nosigs.h \
        ${objects} util.a ${DESTDIR}bin/sys ${someheaders} doc 
        ${INSTALL} util.a ${DESTDIR}lib/afs
+       ${INSTALL} util.a ${DESTDIR}lib/afs/libafsutil.a
        ${INSTALL} assert.h errors.h vice.h remote.h ktime.h fileutil.h \
                netutils.h packages.h afsutil.h pthread_glock.h \
                afs_atomlist.h afs_lhash.h \
@@ -61,10 +61,10 @@ ukinstall webinstall: install0
 
 ${DESTDIR}include/afs/dirpath.h: dirpath.h
        ${INSTALL} dirpath.h  ${DESTDIR}include/afs
-       
+
 ${DESTDIR}include/afs/pthread_nosigs.h: pthread_nosigs.h
        ${INSTALL} pthread_nosigs.h  ${DESTDIR}include/afs
-       
+
 doc:
        echo no documents in this directory
 
index c152a65f1f50a75c8f7cfa67489e9353ac417df2..faf82464991d0fa84b18d7fb2dc6a023df2137b0 100644 (file)
 #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)
 
@@ -53,7 +57,7 @@ extern char *vctime(const time_t *atime);
 
 
 /* Convert a 4 byte integer to a text string. */
-extern char*   afs_inet_ntoa(afs_int32 addr);
+extern char*   afs_inet_ntoa(afs_uint32 addr);
 
 
 /* copy strings, converting case along the way. */
@@ -108,9 +112,15 @@ int base32_to_int(char *s);
  * early in name.
  */
 typedef char lb64_string_t[12];
+#ifdef AFS_64BIT_ENV
+#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (afs_int64)(A))
+char *int64_to_flipbase64(b64_string_t s, afs_int64 a);
+afs_int64 flipbase64_to_int64(char *s);
+#else
+#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (u_int64_t)(A))
 char *int64_to_flipbase64(b64_string_t s, u_int64_t a);
 int64_t flipbase64_to_int64(char *s);
-#define int32_to_flipbase64(S, A) int64_to_flipbase64(S, (u_int64_t)(A))
+#endif
 #endif
 
 /* This message preserves our ability to license AFS to the U.S. Government
index 1c842032c2fdad2f3e727dab73dd56429a12ed72..f35b2c6e142ae5b7d820c45701f2429b5e72fb82 100644 (file)
@@ -18,6 +18,7 @@
 
 #ifdef AFS_NT40_ENV
 #include <windows.h>
+#include <io.h>
 #include "errmap_nt.h"
 #else
 #include <unistd.h>
@@ -105,14 +106,16 @@ FilepathNormalize(char *path)
 bufio_p BufioOpen(char *path, int oflag, int mode)
 {
     bufio_p bp;
-    BUFIO_FD fd;
 
     bp = (bufio_p)malloc(sizeof(bufio_t));
     if (bp == NULL) {
        return NULL;
     }
-
+#ifdef AFS_NT40_ENV
+    bp->fd = _open(path, oflag, mode);
+#else
     bp->fd = open(path, oflag, mode);
+#endif
     if (bp->fd == BUFIO_INVALID_FD) {
        free(bp);
        return NULL;
@@ -144,7 +147,11 @@ int BufioGets(bufio_p bp, char *buf, int buflen)
     len = bp->len;
     while (1) {
        if (pos >= len) {
+#ifdef AFS_NT40_ENV
+           rc = _read(bp->fd, bp->buf, BUFIO_BUFSIZE);
+#else
            rc = read(bp->fd, bp->buf, BUFIO_BUFSIZE);
+#endif
            if (rc < 0) {
                bp->eof = 1;
                return -1;
@@ -190,7 +197,11 @@ int BufioClose(bufio_p bp)
     }
     fd = bp->fd;
     free(bp);
+#ifdef AFS_NT40_ENV
+    rc = _close(fd);
+#else
     rc = close(fd);
+#endif
 
     return rc;
 }
index 27af4f8a2ad3bc74ea2b692a2b9608392c3b919d..20c3c09638a83a54c6dfad5f1ffebc69a7276292 100644 (file)
@@ -27,10 +27,18 @@ static char c_xlate[80] =
  * The supplied string 's' must be at least 12 bytes long.
  * lb64_string in stds.h provides a typedef to get the length.
  */
+#ifdef AFS_64BIT_ENV
+char *int64_to_flipbase64(lb64_string_t s, afs_int64 a)
+#else
 char *int64_to_flipbase64(lb64_string_t s, u_int64_t a)
+#endif
 {
     int i, j;
-    int64_t n;
+#ifdef AFS_64BIT_ENV
+    afs_int64 n;
+#else
+    u_int64_t n;
+#endif
 
     i = 0;
     if (a==0)
@@ -46,10 +54,19 @@ char *int64_to_flipbase64(lb64_string_t s, u_int64_t a)
 
 
 /* Mapping: +=0, ==1, 0-9 = 2-11, A-Z = 12-37, a-z = 38-63 */
+#ifdef AFS_64BIT_ENV
+afs_int64 flipbase64_to_int64(char *s)
+#else
 int64_t flipbase64_to_int64(char *s)
+#endif
 {
+#ifdef AFS_64BIT_ENV
+    afs_int64 n = 0;
+    afs_int64 result = 0;
+#else
     int64_t n = 0;
     int64_t result = 0;
+#endif
     int shift;
 
     for (shift = 0; *s; s++, shift += 6) {
index c9d32e4621dc4ba9bda2e9d742c39abb9585b2c9..f0ba15769827d983672e77fd9a7a860308e707ea 100644 (file)
@@ -41,7 +41,7 @@ register char *ahost; {
     static char *addrp[2];
     static char addr[4];
     register char *ptr = ahost;
-    afs_int32 tval, numeric=0;
+    afs_uint32 tval, numeric=0;
     int dots=0;
 
     tc = *ahost;    /* look at the first char */
@@ -103,7 +103,7 @@ register char *ahost; {
  * variable addr is in network byte order.
  */
 char *hostutil_GetNameByINet(addr)
-  afs_int32 addr;
+  afs_uint32 addr;
 {
   struct hostent *th;
   static char    tbuffer[256];
@@ -130,7 +130,7 @@ char *hostutil_GetNameByINet(addr)
 ** w.x.y.z     # machineName
 ** returns the network interface in network byte order 
 */
-afs_int32
+afs_uint32
 extractAddr(line, maxSize)
 char* line;
 int maxSize;
@@ -138,8 +138,8 @@ int maxSize;
        char byte1[32], byte2[32], byte3[32], byte4[32];
        int i=0;
        char*   endPtr;
-       afs_int32 val1, val2, val3, val4;
-       afs_int32 val=0;
+       afs_uint32 val1, val2, val3, val4;
+       afs_uint32 val=0;
 
        /* skip empty spaces */
        while ( isspace(*line) && maxSize ) 
@@ -224,7 +224,7 @@ int maxSize;
 ** On Solaris, if we pass a 4 byte integer directly into inet_ntoa(), it
 ** causes a memory fault. 
 */
-char* afs_inet_ntoa(afs_int32 addr)
+char* afs_inet_ntoa(afs_uint32 addr)
 {
     struct in_addr temp;
     temp.s_addr = addr;
index c10a4e1c0152970e44a1b32d942c3170e3176fea..684ebc74fe09cbb9f70a8ea4c6769c1dd074bba2 100644 (file)
 
 #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"
@@ -38,7 +41,7 @@
 ** w.x.y.z     # machineName
  * returns the network interface IP Address in NBO
  */
-u_long
+afs_uint32
 extract_Addr(line, maxSize)
 char* line;
 int maxSize;
@@ -46,8 +49,8 @@ int maxSize;
   char bytes[4][32];
   int i=0,n=0;
   char*   endPtr;
-  u_long val[4];
-  u_long retval=0;
+  afs_uint32 val[4];
+  afs_uint32 retval=0;
   
   /* skip empty spaces */
   while ( isspace(*line) && maxSize ) {
@@ -96,8 +99,8 @@ int maxSize;
  * parsed by extract_Addr().
  */
 int parseNetRestrictFile(outAddrs, mask, mtu, maxAddrs, nAddrs, reason, fileName)
-  afs_int32  outAddrs[];           /* output address array */
-  afs_int32  *mask, *mtu;          /* optional mask and mtu */
+  afs_uint32  outAddrs[];           /* output address array */
+  afs_uint32  *mask, *mtu;          /* optional mask and mtu */
   afs_uint32 maxAddrs;            /* max number of addresses */
   afs_uint32 *nAddrs;              /* number of Addresses in output array */
   char       reason[];             /* reason for failure */
@@ -107,7 +110,7 @@ int parseNetRestrictFile(outAddrs, mask, mtu, maxAddrs, nAddrs, reason, fileName
   char   line[MAX_NETFILE_LINE];
   int lineNo, usedfile;
   afs_uint32 i, neaddrs, nfaddrs, nOutaddrs;
-  afs_int32  addr, eAddrs[MAXIPADDRS], eMask[MAXIPADDRS], eMtu[MAXIPADDRS];
+  afs_uint32  addr, eAddrs[MAXIPADDRS], eMask[MAXIPADDRS], eMtu[MAXIPADDRS];
 
   assert(outAddrs);
   assert(reason);
@@ -196,17 +199,17 @@ int parseNetRestrictFile(outAddrs, mask, mtu, maxAddrs, nAddrs, reason, fileName
  */
 int
 ParseNetInfoFile(final, mask, mtu, max, reason, fileName)
-afs_int32   *final, *mask, *mtu;
+afs_uint32   *final, *mask, *mtu;
 int    max;                    /* max number of interfaces */
 char reason[];
 const char *fileName;
 {
 
-  afs_int32  existingAddr[MAXIPADDRS], existingMask[MAXIPADDRS], existingMtu[MAXIPADDRS];
+  afs_uint32  existingAddr[MAXIPADDRS], existingMask[MAXIPADDRS], existingMtu[MAXIPADDRS];
   char   line[MAX_NETFILE_LINE];
   FILE*  fp;
   int    i, existNu, count = 0;
-  afs_int32  addr;
+  afs_uint32  addr;
   int    lineNo=0;
   int    l;
   
@@ -294,13 +297,13 @@ const char *fileName;
  * entries.
  */
 int filterAddrs(addr1,addr2,mask1,mask2,mtu1,mtu2,n1,n2)
-u_long addr1[],addr2[];
-afs_int32  mask1[], mask2[];
-afs_int32  mtu1[], mtu2[];
+afs_uint32 addr1[],addr2[];
+afs_uint32  mask1[], mask2[];
+afs_uint32  mtu1[], mtu2[];
 {
-  u_long taddr[MAXIPADDRS];
-  afs_int32  tmask[MAXIPADDRS];
-  afs_int32  tmtu[MAXIPADDRS];
+  afs_uint32 taddr[MAXIPADDRS];
+  afs_uint32  tmask[MAXIPADDRS];
+  afs_uint32  tmtu[MAXIPADDRS];
   int count=0,i=0,j=0,found=0;
   
   assert(addr1);
@@ -349,16 +352,16 @@ afs_int32  mtu1[], mtu2[];
  * set of IP addresses to use
  */
 int parseNetFiles(addrbuf, maskbuf,mtubuf,max,reason, niFileName, nrFileName)
-afs_int32  addrbuf[];
-afs_int32  maskbuf[];
-afs_int32  mtubuf[];
-u_long max;        /* Entries in addrbuf, maskbuf and mtubuf */
+afs_uint32  addrbuf[];
+afs_uint32  maskbuf[];
+afs_uint32  mtubuf[];
+afs_uint32 max;        /* Entries in addrbuf, maskbuf and mtubuf */
 char reason[];
 const char *niFileName;
 const char *nrFileName;
 {
-  afs_int32    addrbuf1[MAXIPADDRS],maskbuf1[MAXIPADDRS], mtubuf1[MAXIPADDRS];
-  afs_int32     addrbuf2[MAXIPADDRS],maskbuf2[MAXIPADDRS], mtubuf2[MAXIPADDRS];
+  afs_uint32   addrbuf1[MAXIPADDRS],maskbuf1[MAXIPADDRS], mtubuf1[MAXIPADDRS];
+  afs_uint32     addrbuf2[MAXIPADDRS],maskbuf2[MAXIPADDRS], mtubuf2[MAXIPADDRS];
   int nAddrs1=0;
   afs_uint32 nAddrs2=0;
   int code,i;
index 9faedeb17a682f3bb5cc4e8745a396f73e2323d7..a7d938f7974a6c9f2d9b65477241fe6582f55be0 100644 (file)
@@ -17,9 +17,9 @@
 /* Network and IP address utility and file parsing functions */
 
 extern int parseNetRestrictFile(
-                               afs_int32 outAddrs[], 
-                               afs_int32 mask[], 
-                               afs_int32 mtu[],
+                               afs_uint32 outAddrs[], 
+                               afs_uint32 mask[], 
+                               afs_uint32 mtu[],
                                afs_uint32 maxAddrs,
                                afs_uint32 *nAddrs, 
                                char reason[], 
@@ -27,16 +27,16 @@ extern int parseNetRestrictFile(
                                );
 
 extern int filterAddrs(
-                      u_long addr1[],u_long addr2[],
-                      afs_int32  mask1[], afs_int32 mask2[],
-                      afs_int32  mtu1[], afs_int32 mtu2[]
+                      afs_uint32 addr1[],afs_uint32 addr2[],
+                      afs_uint32  mask1[], afs_uint32 mask2[],
+                      afs_uint32  mtu1[], afs_uint32 mtu2[]
                       );
 
 extern int parseNetFiles(
-                        afs_int32  addrbuf[],
-                        afs_int32  maskbuf[],
-                        afs_int32  mtubuf[],
-                        u_long max,
+                        afs_uint32  addrbuf[],
+                        afs_uint32  maskbuf[],
+                        afs_uint32  mtubuf[],
+                        afs_uint32 max,
                         char reason[],
                         const char *niFilename,
                         const char *nrFilename
index 3d3ed3e7418e61ec7c9289baf10759ab85580680..079c7d2007d22b6a7707f2c4a542f25c18453ab5 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 #include <sys/param.h>
 #include <sys/time.h>
+#include <syslog.h>
 #endif
 #include <afs/procmgmt.h>  /* signal(), kill(), wait(), etc. */
 #include <fcntl.h>
@@ -60,26 +61,21 @@ static pthread_mutex_t serverLogMutex;
 #define F_OK 0
 #endif
 
-char *threadname();
+char *(*threadNameProgram)();
 
 static int serverLogFD = -1;
 
+#ifndef AFS_NT40_ENV
+int serverLogSyslog = 0;
+int serverLogSyslogFacility = LOG_DAEMON;
+#endif
+
 #include <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, ...)
 {
@@ -99,7 +95,7 @@ void FSLog (const char *format, ...)
     info = &timeStamp[25];
 
     if (mrafsStyleLogs) {
-       name = threadname();
+       name = (*threadNameProgram)();
        sprintf(info, "[%s] ", name);
        info += strlen(info);
     }
@@ -110,13 +106,20 @@ void FSLog (const char *format, ...)
 
     len = strlen(tbuffer);
     LOCK_SERVERLOG();
-    if (serverLogFD > 0)
-       write(serverLogFD, tbuffer, len);
+#ifndef AFS_NT40_ENV
+    if ( serverLogSyslog ){
+       syslog(LOG_INFO, "%s", info);
+    } else 
+#endif
+       if (serverLogFD > 0)
+           write(serverLogFD, tbuffer, len);
     UNLOCK_SERVERLOG();
 
-#if !defined(AFS_PTHREAD_ENV)
-    fflush(stdout);
-    fflush(stderr);     /* in case they're sharing the same FD */
+#if !defined(AFS_PTHREAD_ENV) && !defined(AFS_NT40_ENV)
+    if ( ! serverLogSyslog ) {
+        fflush(stdout);
+        fflush(stderr);     /* in case they're sharing the same FD */
+    }
 #endif
 }
 
@@ -189,6 +192,13 @@ int OpenLog(const char *fileName)
     struct tm *TimeFields;
     char FileName[MAXPATHLEN]; 
 
+#ifndef AFS_NT40_ENV
+    if ( serverLogSyslog ) {
+       openlog(NULL, LOG_PID, serverLogSyslogFacility);
+       return;
+    }
+#endif
+
     if (mrafsStyleLogs) {
         TM_GetTimeOfDay(&Start, 0);
         TimeFields = localtime(&Start.tv_sec);
@@ -244,6 +254,12 @@ int ReOpenLog(const char *fileName)
     if (access(fileName, F_OK)==0)
        return 0; /* exists, no need to reopen. */
 
+#if !defined(AFS_NT40_ENV)
+    if ( serverLogSyslog ) {
+       return 0;
+    }
+#endif
+
 #if defined(AFS_PTHREAD_ENV)
     LOCK_SERVERLOG();
     if (serverLogFD > 0)
index 4141de3e45d35ccae289d975e634b9a573f476eb..0b716f2b8a736d84eb951af8e0f9dc24c4dd96f1 100644 (file)
@@ -1,8 +1,7 @@
 /* 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>
index fa2a4a6bd38dbe864a32062f77de9facc24282c8..c73fe3ed7847053a62656924a82e8e072371c75e 100644 (file)
@@ -294,7 +294,8 @@ void uuid__get_os_time (uuid_time_t *os_time)
 char hostName1[128] = "localhost";
 static int uuid_get_address (uuid_address_p_t addr)
 {
-    afs_int32 code, addr1;
+    afs_int32 code;
+    afs_uint32 addr1;
     struct hostent *he;
 
     code = gethostname(hostName1, 64);
index 4cd72deb2657fa16735a5dd052b058631e4a9208..d28e4b62e092d8b977adfdb9ea703c9593314342 100644 (file)
@@ -62,7 +62,7 @@ struct ViceIoctl {
  * version of _IOW() to check the size of user space arguments -- except
  * on Digital Unix.
  */
-#if defined(KERNEL) && !defined(AFS_OSF_ENV)
+#if defined(KERNEL) && !defined(AFS_OSF_ENV) && !defined(AFS_ALPHA_LINUX20_ENV)
 #define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl32))
 #else
 #define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
index 2f92a09fc267f6033660090c194b03e4bd4a0899..9de42c6d0c2bc794d4da8a4b20416cef5b1d88cc 100644 (file)
@@ -3045,6 +3045,8 @@ defect 3069
     ts = cmd_CreateSyntax("setcrypt", SetCryptCmd, 0, "set cache manager encryption flag");
     cmd_AddParm(ts, "-crypt", CMD_SINGLE, 0, "on or off");
 
+    ts = cmd_CreateSyntax("getcrypt", GetCryptCmd, 0, "set cache manager encryption flag");
+
     ts = cmd_CreateSyntax("rxstatproc", RxStatProcCmd, 0,
                          "Manage per process RX statistics");
     cmd_AddParm(ts, "-enable", CMD_FLAG, CMD_OPTIONAL,
index f1bc646ec6a989973a55b2cc6bfa4f6df34ae36f..de24918264c5293d63ca79b091165d991749f0a5 100644 (file)
@@ -42,7 +42,7 @@
 
 extern char *index ();
 extern char *rindex ();
-#ifndef AFS_LINUX20_ENV
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 extern sys_nerr;
 extern char *sys_errlist[];
 #endif
index a040798baf56a98e65eecfc154ca776bf305c61f..fd97f8213dfa0c2fc1d2843625b34c4e9454e517 100644 (file)
@@ -19,7 +19,6 @@
 COMPONENT=vfsck
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
 CFLAGS=        ${DBUG} -w -I${SRCDIR}include ${XCFLAGS}
 LIBC=  /lib/libc.a
 SRCS=  dir.c inode.c main.c pass1.c pass1b.c pass2.c pass3.c pass4.c \
@@ -44,7 +43,7 @@ ${OBJS}:      ${SRCS}
            ${CC} -o vfsck -I/usr/old/usr/include ${DBUG} -w -I${SRCDIR}include ${SRCS} ${NON_SHARED} +DA1.0 -Wl,-a,archive -D_FILE64 \
                        ;;                                      \
          hp?00_ux101 | hp_ux10? )                              \
-           ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS} -D_FILE64\
+           ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS} -D_FILE64\
                        ;;                                      \
            * )                                                 \
            ${CC} -o vfsck ${CFLAGS} ${SRCS} ${NON_SHARED} ${XLIBS}\
index e17d1d34f90bfdf8d321dcd8249682a25aab641d..d9f42f7e06b43d933b1cf45d3dd062359dd567e9 100644 (file)
@@ -10,7 +10,6 @@ COMPONENT=viced
 include ../config/Makefile.${SYS_NAME}
 
 DBUG = -g
-INSTALL = ${SRCDIR}bin/install
 CFLAGS =  -DNINTERFACE ${DBUG} -I. -I${SRCDIR}include -I${SRCDIR}include/afs \
         ${XCFLAGS} ${DBG_DEFS} -DRXDEBUG
 LDFLAGS = ${DBUG} ${XLDFLAGS}
@@ -70,7 +69,7 @@ viced.o: AFS_component_version_number.o
 check_sysid: check_sysid.c
        ${CC} ${CFLAGS} -IDEST/include -o check_sysid check_sysid.c
 
-fileserver: callback_clean1 viced.o ${objects} ${headers} ${LIBS}
+fileserver: viced.o ${objects} ${headers} ${LIBS}
        set -x; \
        case ${SYS_NAME} in \
        *linux*) \
@@ -84,10 +83,17 @@ fileserver: callback_clean1 viced.o ${objects} ${headers} ${LIBS}
            ${auditlib} ${LIBS} ${XLIBS} ;; \
        esac
 
-fsprobe: fsprobe.c  AFS_component_version_number.c
-       ${CC} ${CFLAGS} -DINTERPRET_DUMP -o fsprobe fsprobe.c ${LIBS} ${XLIBS}  
-cbd: callback_clean2 callback.c AFS_component_version_number.c
-       ${CC} ${CFLAGS} -DINTERPRET_DUMP -o cbd callback.c ${LIBS} ${XLIBS}  
+fsprobe.o: fsprobe.c  AFS_component_version_number.c
+       ${CC} ${CFLAGS} -DINTERPRET_DUMP -c fsprobe.c
+
+fsprobe: fsprobe.o
+       ${CC} ${CFLAGS} -o fsprobe fsprobe.o ${LIBS} ${XLIBS}  
+
+cbd.o: callback.c AFS_component_version_number.c
+       ${CC} ${CFLAGS} -DINTERPRET_DUMP -c -o cbd.o callback.c
+
+cbd: cbd.o
+       ${CC} ${CFLAGS} -DINTERPRET_DUMP -o cbd cbd.o ${LIBS} ${XLIBS}  
 
 lint:
        lint -uvn  -I${SRCDIR}include viced.c afsfileprocs.c host.c physio.c callback.c ${SRCDIR}lib/afs/llib-lutil.ln
@@ -106,13 +112,6 @@ install: all  ${DESTDIR}root.server/usr/afs/bin/fileserver
 
 system: install
 
-callback_clean1 callback_clean2: 
-       case ${SYS_NAME} in \
-       ncrx86_*) \
-               ${RM}  -f callback.o;\
-               echo ${RM} callback.o;;\
-       esac;
-
 clean:
        rm -f *.o llib-lvice.ln fileserver core AFS_component_version_number.c
 
index d92e55b372d17d963f6f9d134d985b2841384aaa..9bfb3951ee271eeb84431249cd54e324d3a32867 100644 (file)
@@ -74,7 +74,7 @@
 #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)
@@ -85,7 +85,7 @@
 #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
@@ -314,7 +314,18 @@ retry:
     else if (thost->hostFlags & VENUSDOWN) {
       if (BreakDelayedCallBacks_r(thost)) {
        ViceLog(0,("BreakDelayedCallbacks FAILED for host %08x which IS UP.  Possible network or routing failure.\n",thost->host));
-       code = -1;
+       if ( MultiProbeAlternateAddress_r (thost) ) {
+           ViceLog(0, ("MultiProbe failed to find new address for host %x.%d\n",
+                       thost->host, thost->port));
+           code = -1;
+       } else {
+           ViceLog(0, ("MultiProbe found new address for host %x.%d\n",
+                       thost->host, thost->port));
+           if (BreakDelayedCallBacks_r(thost)) {
+               ViceLog(0,("BreakDelayedCallbacks FAILED AGAIN for host %08x which IS UP.  Possible network or routing failure.\n",thost->host));
+               code = -1;
+           }
+       }
       }
     } else {
        code =  0;
index 23a637e53d4889c7fe483f08a1d3b90aadba8cd6..c197140ace1f4050e46c58cfc4c96bef399c7a09 100644 (file)
@@ -141,7 +141,7 @@ struct FileEntry {
     u_short        ncbs;
     u_short        firstcb;
     u_short        spare;
-#ifdef AFS_ALPHA_ENV
+#if defined(AFS_ALPHA_ENV) || defined(AFS_ALPHA_LINUX20_ENV)
     u_short        spare1;
     u_short        spare2;
 #endif
index add63db5c9bc81972d7f1eec6f489bbe70d362c2..06bfa9f2c243801c92808b5322eab2fcbba74286 100644 (file)
@@ -563,8 +563,8 @@ main(argc, argv)
     assert(pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED) == 0);
     /* Block signals in the threads */
     AFS_SIGSET_CLEAR();
-    assert(pthread_create(&serverPid, &tattr, FiveMinuteCheckLWP, &fiveminutes) == 0);
-    assert(pthread_create(&serverPid, &tattr, HostCheckLWP, &fiveminutes) == 0);
+    assert(pthread_create(&serverPid, &tattr, (void *)FiveMinuteCheckLWP, &fiveminutes) == 0);
+    assert(pthread_create(&serverPid, &tattr, (void *)HostCheckLWP, &fiveminutes) == 0);
     AFS_SIGSET_RESTORE();
 #else /* AFS_PTHREAD_ENV */
     assert(LWP_CreateProcess(FiveMinuteCheckLWP, stack*1024, LWP_MAX_PRIORITY - 2,
@@ -1177,6 +1177,18 @@ static ParseArgs(argc, argv)
            if (!strcmp(argv[i], "-enable_process_stats")) {
                rx_enableProcessRPCStats();
            }
+#ifndef AFS_NT40_ENV
+        else 
+           if (strcmp(argv[i], "-syslog")==0) {
+               /* set syslog logging flag */
+               serverLogSyslog = 1;
+           } 
+       else 
+           if (strncmp(argv[i], "-syslog=", 8)==0) {
+               serverLogSyslog = 1;
+               serverLogSyslogFacility = atoi(argv[i]+8);
+           }
+#endif
        else {
            return(-1);
        }
index c1caf2326b481527e6b7be8008e6a5310aabe757..aefc0a786d381c90d0d3ecceddfca6e7369a95e4 100644 (file)
@@ -12,7 +12,6 @@ MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
 
 KERNELDIR=../libafs/
 UKERNELDIR=../libuafs/
-INSTALL=${SRCDIR}bin/install
 COMPILE_ET = ${SRCDIR}bin/compile_et
 
 CFLAGS = ${DBUG} -I. -I.. -I${SRCDIR}include ${XCFLAGS}
index 6f17df50d02b2be5e23ddb1a5bc5ac2bce7ac458..2ca67961c193f22ef5fd76a3298d172a203eafed 100644 (file)
@@ -164,9 +164,20 @@ char       **argv;
            rx_enablePeerRPCStats();
        } else if (strcmp(argv[index], "-enable_process_stats") == 0) {
            rx_enableProcessRPCStats();
+#ifndef AFS_NT40_ENV
+       } else if (strcmp(argv[index], "-syslog")==0) {
+           /* set syslog logging flag */
+           serverLogSyslog = 1;
+       } else if (strncmp(argv[index], "-syslog=", 8)==0) {
+           serverLogSyslog = 1;
+           serverLogSyslogFacility = atoi(argv[index]+8);
+#endif
        } else {
            /* support help flag */
            printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
+#ifndef AFS_NT40_ENV
+                  "[-syslog[=FACILITY]] "
+#endif
                   /*" [-enable_peer_stats] [-enable_process_stats] " */
                   "[-help]\n");
            fflush(stdout);
index 711de2b776d760d941c349c393deca23fd090b81..72592096eeb67da34d68b8068b22064712cd16fc 100644 (file)
@@ -11,7 +11,6 @@ include ../config/Makefile.${SYS_NAME}
 include ../config/Makefile.version
 
 INCDIRS= -I. -I${DESTDIR}include ${FSINCLUDES}
-INSTALL = ${SRCDIR}bin/install
 LDFLAGS = ${OPTMZ} ${PROF} ${LDIRS} ${XLDFLAGS}
 
 LIBS= ${DESTDIR}lib/afs/libcmd.a vlib.a ${SRCDIR}lib/afs/util.a \
@@ -77,14 +76,7 @@ vlib.a:      ${VLIBOBJS} AFS_component_version_number.o
 
 # new salvager:  remove references to /vice by linking with novice.o
 salvager: vol-salvage.o physio.o vlib.a
-       case ${SYS_NAME} in \
-                *linux* ) \
-                        ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \
-                               ${LIBS}  ;; \
-                *) \
-                        ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o \
-                               ${LIBS};; \
-        esac
+       ${CC} ${LDFLAGS} -o salvager vol-salvage.o physio.o ${LIBS}
 
 vol-salvage: vol-salvage.o
 vol-info: vol-info.o physio.o ihandle.o
@@ -100,7 +92,7 @@ listinodes.o: listinodes.c AFS_component_version_number.c
 
 gi: ${DESTDIR}/lib/afs/libsys.a
        case ${SYS_NAME} in \
-                *linux* | sgi_* ) \
+                *linux* | sgi_* | *fbsd* ) \
                        echo "Don't build gi on ${SYS_NAME}";; \
                 *) \
                        ${CC} ${CFLAGS} -c gi.c ; \
index 1dc43091128369b8eeeedcb1e698a5c4ebc471fc..3af8874fa6ffb7c87d3ca0ea16ba34f2a55043e7 100644 (file)
 #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 */
index 8e9bf01a61d7ed20a237933e7a918b378d17fcfd..5222b8c1b2c451d95c0b5d7117289238a96f16ef 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef lint
 #endif
 /*
+
        System:         VICE-TWO
        Module:         listinodes.c
        Institution:    The Information Technology Center, Carnegie-Mellon University
@@ -49,8 +50,14 @@ int *forcep, forceR;
 #ifdef   AFS_SUN5_ENV
 #include <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>
@@ -65,8 +72,10 @@ int *forcep, forceR;
 #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>
@@ -1243,7 +1252,7 @@ int ListViceInodes(devname, mountedOn, resultFile, judgeInode, judgeParam, force
    if (
       (super.fs.fs_magic != FS_MAGIC)
    || (super.fs.fs_ncg < 1)
-#if    defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
+#if    defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
    || (super.fs.fs_cpg < 1)
 #else
    || (super.fs.fs_cpg < 1 || super.fs.fs_cpg > MAXCPG)
@@ -1279,8 +1288,12 @@ int ListViceInodes(devname, mountedOn, resultFile, judgeInode, judgeParam, force
 #else
    for (c = 0; c < super.fs.fs_ncg; c++) {
        daddr_t dblk1;
-#ifdef AFS_SUN5_ENV
+#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV)
        daddr_t f1;
+#if defined(AFS_DARWIN_ENV)
+#define offset_t off_t
+#define llseek lseek
+#endif
        offset_t off;
 #endif /* AFS_SUN5_ENV */
        i = c*super.fs.fs_ipg; e = i+super.fs.fs_ipg;
@@ -1288,7 +1301,7 @@ int ListViceInodes(devname, mountedOn, resultFile, judgeInode, judgeParam, force
        dblk1 = fsbtodb(&super.fs, itod(&super.fs, i));
        if (lseek(pfd, (off_t) ((off_t)dblk1 * DEV_BSIZE), L_SET) == -1) {
 #else
-#ifdef AFS_SUN5_ENV 
+#if defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV)
        f1 = fsbtodb(&super.fs,itod(&super.fs,i));
        off = (offset_t)f1 << DEV_BSHIFT;
        if (llseek(pfd, off, L_SET) == -1) {
@@ -1445,6 +1458,11 @@ out1:
 #endif         /* !AFS_SGI_ENV */
 #endif /* !AFS_AIX31_ENV       */
 
+#ifdef AFS_DARWIN_ENV
+#undef dbtob
+#define dbtob(db) ((unsigned)(db) << DEV_BSHIFT)
+#endif
+
 int bread(fd, buf, blk, size)
        int fd;
        char *buf;
index 3432719e2129761fa5dbb0581d029f4f1877d8ca..4694ed363d58c06fadacdb494b5cdf5854ecf403 100644 (file)
 #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"
@@ -805,7 +811,11 @@ int namei_GetLinkCount(FdHandle_t *h, Inode ino, int lockit)
     namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index);
 
     if (lockit) {
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
+        if (lockf(h->fd_fd, F_LOCK, 0) < 0)
+#else
        if (flock(h->fd_fd, LOCK_EX)<0)
+#endif
            return -1;
     }
 
@@ -820,7 +830,11 @@ int namei_GetLinkCount(FdHandle_t *h, Inode ino, int lockit)
 
  bad_getLinkByte:
     if (lockit)
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
+       lockf(h->fd_fd, F_ULOCK, 0);
+#else
        flock(h->fd_fd, LOCK_UN);
+#endif
     return -1;
 }
 
@@ -840,7 +854,11 @@ static int GetFreeTag(IHandle_t *ih, int vno)
        return -1;
 
     /* Only one manipulates at a time. */
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
+    if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) {
+#else
     if (flock(fdP->fd_fd, LOCK_EX)<0) {
+#endif
        FDH_REALLYCLOSE(fdP);
        return -1;
     }
@@ -858,11 +876,10 @@ static int GetFreeTag(IHandle_t *ih, int vno)
     }
        
     /* Now find a free column in this row and claim it. */
-    coldata = 0x7;
     for (col = 0; col<NAMEI_MAXVOLS; col++) {
-       coldata <<= col * 3;
-       if ((row & coldata) == 0)
-           break;
+        coldata = 7 << (col * 3);
+        if ((row & coldata) == 0)
+            break;
     }
     if (col >= NAMEI_MAXVOLS)
        goto badGetFreeTag;
@@ -877,12 +894,20 @@ static int GetFreeTag(IHandle_t *ih, int vno)
        goto badGetFreeTag;
     }
     FDH_SYNC(fdP);
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
+    lockf(fdP->fd_fd, F_ULOCK, 0);
+#else
     flock(fdP->fd_fd, LOCK_UN);
+#endif
     FDH_REALLYCLOSE(fdP);
     return col;;
 
  badGetFreeTag:
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
+    lockf(fdP->fd_fd, F_ULOCK, 0);
+#else
     flock(fdP->fd_fd, LOCK_UN);
+#endif
     FDH_REALLYCLOSE(fdP);
     return -1;
 }
@@ -902,9 +927,12 @@ int namei_SetLinkCount(FdHandle_t *fdP, Inode ino, int count, int locked)
 
     namei_GetLCOffsetAndIndexFromIno(ino, &offset, &index);
 
-
     if (!locked) {
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
+        if (lockf(fdP->fd_fd, F_LOCK, 0) < 0) {
+#else
        if (flock(fdP->fd_fd, LOCK_EX)<0) {
+#endif
            return -1;
        }
     }
@@ -943,7 +971,11 @@ int namei_SetLinkCount(FdHandle_t *fdP, Inode ino, int count, int locked)
 
     
 bad_SetLinkCount:
+#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
+    lockf(fdP->fd_fd, F_ULOCK, 0);
+#else
     flock(fdP->fd_fd, LOCK_UN);
+#endif
 
     return code;
 }
index 65a26f7b3b80893b0f9eea74b02d494a160bde9f..770f06d2d2ec2df3e5f43bc48f41c8facfc9cae6 100644 (file)
@@ -58,6 +58,9 @@ int DumpVnodes = 0;   /* Dump everything, i.e. summary of all vnodes */
 int DumpInodeNumber = 0;       /* Dump inode numbers with vnodes */
 int DumpDate = 0;              /* Dump vnode date (server modify date) with vnode */
 int InodeTimes = 0;            /* Dump some of the dates associated with inodes */
+#if defined(AFS_NAMEI_ENV)
+int PrintFileNames = 0;
+#endif
 int online = 0;
 int dheader=0;
 int dsizeOnly = 0, totvolsize=0, Vauxsize = 0, Vdiskused = 0, Vvnodesize = 0;
@@ -74,8 +77,13 @@ void HandleVolume(struct DiskPartition *partP, char *name);
 struct DiskPartition *FindCurrentPartition(void);
 Volume *AttachVolume(struct DiskPartition *dp, char *volname,
                     register struct VolumeHeader *header);
+#if defined(AFS_NAMEI_ENV)
+void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber,
+               Inode ino, Volume* vp);
+#else
 void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber,
                Inode ino);
+#endif
 void PrintVnodes(Volume *vp, VnodeClass class);
 
 char *date(time_t date)
@@ -256,6 +264,12 @@ static int handleit(struct cmd_syndesc *as)
        orphaned = 1;
        DumpVnodes = 1;
     } else    
+#if defined(AFS_NAMEI_ENV)
+    if (as->parms[12].items) {
+       PrintFileNames = 1;
+       DumpVnodes = 1;
+    } else    
+#endif
        orphaned = 0;    
 
     DInit(10);
@@ -593,6 +607,9 @@ char **argv;
     cmd_AddParm(ts, "-fixheader", CMD_FLAG, CMD_OPTIONAL, "Try to fix header");    
     cmd_AddParm(ts, "-saveinodes", CMD_FLAG, CMD_OPTIONAL, "Try to save all inodes");    
     cmd_AddParm(ts, "-orphaned", CMD_FLAG, CMD_OPTIONAL, "List all dir/files without a parent");    
+#if defined(AFS_NAMEI_ENV)
+    cmd_AddParm(ts, "-filenames", CMD_FLAG, CMD_OPTIONAL, "Print filenames");    
+#endif
     code = cmd_Dispatch(argc, argv);
     return code;
 }
@@ -769,16 +786,33 @@ void PrintVnodes(Volume *vp, VnodeClass class)
                       ino, nfile, total);
            }
        } else {
+#if defined(AFS_NAMEI_ENV)
+           PrintVnode(offset, vnode,
+                      bitNumberToVnodeNumber(vnodeIndex, class), ino, vp);
+#else
            PrintVnode(offset, vnode,
                       bitNumberToVnodeNumber(vnodeIndex, class), ino);
+#endif
        }
     }
     STREAM_CLOSE(file);
     FDH_CLOSE(fdP);
 }
 
+#if defined(AFS_NAMEI_ENV)
+void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, Inode ino, Volume *vp)
+#else
 void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, Inode ino)
+#endif
 {
+#if defined(AFS_NAMEI_ENV)
+    IHandle_t *ihtmpp;
+#if !defined(AFS_NT40_ENV)
+    namei_t filename;
+#else
+    char filename[MAX_PATH];
+#endif
+#endif
     Vvnodesize += vnode->length;
     if (dsizeOnly) return;
     if (orphaned && (vnode->length ==0 || vnode->parent || !offset)) return;
@@ -788,5 +822,17 @@ void PrintVnode(int offset, VnodeDiskObject *vnode, int vnodeNumber, Inode ino)
        printf(" inode: %s", PrintInode(NULL, ino));
     if (DumpDate)
        printf(" ServerModTime: %s", date(vnode->serverModifyTime));
+#if defined(AFS_NAMEI_ENV)
+    if(PrintFileNames) {
+           IH_INIT(ihtmpp, V_device(vp), V_parentId(vp), ino);
+#if !defined(AFS_NT40_ENV)
+           namei_HandleToName(&filename, ihtmpp);
+           printf(" UFS-Filename: %s",filename.n_path);
+#else
+           nt_HandleToName(filename, ihtmpp);
+           printf(" NTFS-Filename: %s",filename);
+#endif
+    }
+#endif
     printf("\n");
 }
index 1d8a25d14f5a7ea73a04b1b24d75c86c550f77e6..5bed33b0ea50002409506a5760514fa5a865fc2f 100644 (file)
@@ -120,13 +120,18 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
 #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
@@ -166,6 +171,9 @@ Vnodes with 0 inode pointers in RW volumes are now deleted.
 #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"
@@ -207,6 +215,12 @@ int     ShowSuid = 0;              /* -showsuid flag */
 int     ShowMounts = 0;                /* -showmounts flag */
 int     orphans = ORPH_IGNORE;  /* -orphans option */
 int    Showmode = 0;
+
+#ifndef AFS_NT40_ENV
+int useSyslog = 0;     /* -syslog flag */
+int useSyslogFacility = LOG_DAEMON; /* -syslogfacility option */
+#endif
+
 #define        MAXPARALLEL     32
 
 int    OKToZap;                /* -o flag */
@@ -547,8 +561,19 @@ static handleit(as)
          orphans = ORPH_ATTACH;
     }
 
+#ifndef AFS_NT40_ENV /* ignore options on NT */
+       if ( ti = as->parms[16].items) { /* -syslog */
+               useSyslog = 1;
+               ShowLog = 0;
+       }
+       if ( ti = as->parms[17].items) { /* -syslogfacility */
+               useSyslogFacility = atoi(ti->data);
+       }
+#endif
+
+
 #ifdef FAST_RESTART
-    if (ti = as->parms[16].items) {  /* -DontSalvage */
+    if (ti = as->parms[18].items) {  /* -DontSalvage */
       printf("Exiting immediately without salvage. Look into the FileLog");
       printf(" to find volumes which really need to be salvaged!\n");
       Exit(0);
@@ -721,6 +746,12 @@ char **argv;
     cmd_AddParm(ts, "-showsuid", CMD_FLAG,CMD_OPTIONAL, "Report on suid/sgid files");
     cmd_AddParm(ts, "-showmounts", CMD_FLAG,CMD_OPTIONAL, "Report on mountpoints");
     cmd_AddParm(ts, "-orphans", CMD_SINGLE, CMD_OPTIONAL, "ignore | remove | attach");
+
+       /* note - syslog isn't avail on NT, but if we make it conditional, have
+               to deal with screwy offsets for cmd params */
+    cmd_AddParm(ts, "-syslog", CMD_FLAG, CMD_OPTIONAL, "Write salvage log to syslogs");
+    cmd_AddParm(ts, "-syslogfacility", CMD_SINGLE, CMD_OPTIONAL, "Syslog facility number to use");
+
 #ifdef FAST_RESTART
     cmd_AddParm(ts, "-DontSalvage", CMD_FLAG, CMD_OPTIONAL, "Don't salvage. This my be set in BosConfig to let the fileserver restart immediately after a crash. Bad volumes will be taken offline");
 #endif /* FAST_RESTART */
@@ -745,7 +776,11 @@ void ObtainSalvageLock(void)
 #else
     salvageLock = open(AFSDIR_SERVER_SLVGLOCK_FILEPATH, O_CREAT|O_RDWR, 0666);
     assert(salvageLock >= 0);
+#ifdef AFS_DARWIN_ENV
+    if (flock(salvageLock, LOCK_EX) == -1) {
+#else
     if (lockf(salvageLock, F_LOCK, 0) == -1) {
+#endif
        fprintf(stderr,
                "salvager:  There appears to be another salvager running!  Aborted.\n");
        Exit(1);
@@ -1001,8 +1036,15 @@ void SalvageFileSysParallel(struct DiskPartition *partP)
             ShowLog = 0;
             for (fd =0; fd < 16; fd++) close(fd);
             open("/", 0); dup2(0, 1); dup2(0, 2);
-            sprintf(logFileName, "%s.%d", AFSDIR_SERVER_SLVGLOG_FILEPATH, jobs[startjob]->jobnumb);
-            logFile = fopen(logFileName, "w");
+#ifndef AFS_NT40_ENV
+                if ( useSyslog ) {
+                       openlog(NULL, LOG_PID, useSyslogFacility);
+                } else
+#endif
+                {
+              sprintf(logFileName, "%s.%d", AFSDIR_SERVER_SLVGLOG_FILEPATH, jobs[startjob]->jobnumb);
+              logFile = fopen(logFileName, "w");
+                }
             if (!logFile) logFile = stdout;
 
             SalvageFileSys1(jobs[startjob]->partP, 0);
@@ -1013,6 +1055,9 @@ void SalvageFileSysParallel(struct DiskPartition *partP)
     } /* while ( thisjob || (!partP && numjobs > 0) ) */
 
     /* If waited for all jobs to complete, now collect log files and return */
+#ifndef AFS_NT40_ENV
+       if ( ! useSyslog ) /* if syslogging - no need to collect */
+#endif
     if (!partP) {
        for (i=0; i<jobcount; i++) {
          sprintf(logFileName, "%s.%d", AFSDIR_SERVER_SLVGLOG_FILEPATH, i);
@@ -1025,8 +1070,8 @@ void SalvageFileSysParallel(struct DiskPartition *partP)
          (void)unlink(logFileName);
        }
        fflush(logFile);
-       return;
     }
+       return;
 }
 
 
@@ -3513,6 +3558,13 @@ void CheckLogFile(void)
 {
   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) {
@@ -3534,6 +3586,14 @@ void showlog(void)
 {
     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);
 
@@ -3553,18 +3613,35 @@ void Log(a,b,c,d,e,f,g,h,i,j,k)
 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);
index 87398c4b91f24b38e2c5284f7628c8d0a4caffee..2032ff2ff865600994deb0ce5ee83d650aa03306 100644 (file)
 #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 */
index 95b909c6aa1ea72877ab422ea140de0a229313c1..fb63eb63a8e75e6d34bfa47b7dbe238dc2f931c6 100644 (file)
@@ -9,8 +9,6 @@ SHELL=/bin/sh
 COMPONENT=volser
 include ../config/Makefile.${SYS_NAME}
 
-INSTALL=${SRCDIR}bin/install
-
 COMPILE_ET=${SRCDIR}bin/compile_et
 CFLAGS=${DBG} ${OPTMZ} -I${SRCDIR}include ${XCFLAGS} ${DBG_DEFS}
 LDFLAGS=${DBG} ${OPTMZ} ${XLDFLAGS}
index eff6a022386c4a0b579b8282e7df212bb31a887e..0c0a33a50ce024ac4712091b7aa232378dd93d08 100644 (file)
@@ -359,7 +359,7 @@ afs_int32 subik_Call(aproc, aclient, aflags, p1, p2, p3, p4, p5, p6, p7, p8, p9,
        }
     }
 }
-#endif notdef
+#endif /* notdef */
 
 
 /*
index d481018fd511c5a87a5cb28d436aa2c488268878..5d487b6a86dbdd8f0868d4f26a5350e4b8b83e77 100644 (file)
@@ -10,7 +10,6 @@
 SHELL = /bin/sh
 COMPONENT=xstat
 include ../config/Makefile.${SYS_NAME}
-INSTALL=${SRCDIR}bin/install
 
 CFLAGS= ${DBUG} -I. \
        -I${SRCDIR}include \