[8801] in Athena Bugs

home help back first fref pref prev next nref lref last post

More patches to AFS 3.1b

daemon@ATHENA.MIT.EDU (Richard Basch)
Mon Jan 6 05:25:54 1992

Date: Mon, 6 Jan 92 05:23:28 -0500
To: afs-bugs@transarc.com
Cc: bug-afs@Athena.MIT.EDU, bugs@MIT.EDU
From: "Richard Basch" <basch@MIT.EDU>


Enclosed is the complete ChangeLog and more patches (mainly pertaining
to the bug reports I previously sent in).

-Richard


91/12/30   ./afs/RCS/afs_cache.c,v;  1.2
Allow compilation without memcache code
Make sure we do not overflow the cache partition
Added another standard error message (access denied)

91/12/30   ./afs/RCS/afs_nfssrv.c,v;  1.2
Allow compilation on VFS 3.0 systems

91/12/30   ./afs/RCS/afs_osi.c,v;  1.2
binval() takes a gnode under ultrix 4.0

91/12/30   ./afs/RCS/afs_memcache.c,v;  1.2
Allow compilation without memcache code

91/12/30   ./afs/RCS/afs_osinet.c,v;  1.2
stack checking applies to all DECstation Ultrix systems

91/12/30   ./afs/RCS/afs_physio.c,v;  1.2
Allow compilation without memcache code

91/12/30   ./afs/RCS/afs_stats.h,v;  1.2
Allow compilation without stats

91/12/30   ./afs/RCS/afs_resource.c,v;  1.2
Added subnet biasing
Changed a few print statements
Reset the time server if the server goes down
Allow compilation without memcache code

91/12/30   ./afs/RCS/afs_vnodeops.c,v;  1.2
Allow compilation without memcache code
Changed NFS mode mapping semantics for Athena
Use FIXUPSTUPIDINODE() routine rather than hardcoding...

91/12/30   ./afsd/RCS/afsd.c,v;  1.2
mtab handling also applies to vax_bsd43

91/12/30   ./auth/RCS/auth.p.h,v;  1.2
Changed the AFS superuser, because we have a user "afs"

91/12/30   ./auth/RCS/cellconfig.c,v;  1.2
Make cell comparisons case-insensitive, like the rest of AFS...

91/12/30   ./auth/RCS/userok.c,v;  1.2
Fix syntax error and improve local realm determination by caching it...

91/12/30   ./bozo/RCS/bosoprocs.c,v;  1.2
Relaxed the permissions a bit for the directory check
Be a bit more intelligent about indicating what is amiss
Open files with a bit more stringent permission

91/12/30   ./bubasics/RCS/butc.xg,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bubasics/RCS/tcdata.p.h,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/Makefile,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/bc.h,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/commands.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/config.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/dsstub.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/dsvs.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/dump.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/main.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/restore.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./bucoord/RCS/volstub.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./butc/RCS/lwps.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./butc/RCS/tcmain.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./butc/RCS/tcprocs.c,v;  1.2
Athena enhancements (-dbdir, -cell)

91/12/30   ./cmd/RCS/cmd.c,v;  1.2
Missing quote

91/12/30   ./comerr/RCS/compile_et.c,v;  1.2
Some systems require sys/types.h

91/12/30   ./config/RCS/Makefile,v;  1.2
Install param.h files also as param.${SYS_NAME}
Fixed xprt.both dependency list

91/12/30   ./config/RCS/param.rt_aos4,v;  1.2
Athena configuration

91/12/30   ./config/RCS/param.pmax_ul4,v;  1.2
Athena configuration

91/12/30   ./config/RCS/param.rs_aix31,v;  1.2
Athena configuration

91/12/30   ./config/RCS/param.vax_bsd43,v;  1.2
Athena configuration

92/01/01   ./libafs/RCS/MakefileProto,v;  1.2
Don't require afs.ext to have been built perfectly
The translator afs.ext requires DES library
Removed -g and -DAFSDEBUG

92/01/01   ./lwp/RCS/iomgr.c,v;  1.2
Include sys/types.h (so more systems can compile code - A/UX)

92/01/01   ./lwp/RCS/fasttime.c,v;  1.2
A/UX patches

92/01/01   ./lwp/RCS/process.s,v;  1.2
Added A/UX 2.0 support

91/12/30   ./pinstall/RCS/install.c,v;  1.2
Added code to support A/UX
Create directories according to user's umask

92/01/01   ./ptserver/RCS/ptutils.c,v;  1.2
Don't deny system administrators group creation

91/12/30   ./ptserver/RCS/testpt.c,v;  1.2
Include afs/param.h
Wrong name "testpr" vs. "testpt"

91/12/30   ./rx/RCS/rx_user.c,v;  1.2
Retry the bind() a few times, in case we are in time_wait on the port.

92/01/01   ./rxgen/RCS/rpc_main.c,v;  1.2
Include sys/types.h (A/UX needs it)

92/01/01   ./sys/RCS/ilib.s,v;  1.2
Added A/UX support

92/01/01   ./sys/RCS/rmtsysc.c,v;  1.2
Allow compilation without rmtsys code

92/01/01   ./sys/RCS/pioctl.s,v;  1.2
Added A/UX support

92/01/01   ./sys/RCS/setpag.s,v;  1.2
Added A/UX support

91/12/30   ./tools/RCS/washtool.c,v;  1.2
Allow the RCS directory to actually be a directory
Relax the permissions of the mkdir to use the user's umask
Don't try to print out the bad SYS_NAME (probably unprintable).
Allow compilation outside of AFS (don't rely on @sys indirection)

92/01/01   ./util/RCS/malloc.c,v;  1.2
A/UX support added

92/01/01   ./util/RCS/vice.h,v;  1.2
A/UX support added

92/01/01   ./util/RCS/strtol.c,v;  1.2
Added strtol() [strtol.c] for systems that lack it.

92/01/01   ./util/RCS/Makefile,v;  1.2
Added strtol() [strtol.c] for systems that lack it.

91/12/30   ./venus/RCS/fs.c,v;  1.2
Better -cell handling
Better use of exit values (don't return status 0, if there were errors)
Changed various print statements to use pn[], not explicitly "fs"

91/12/30   ./viced/RCS/Makefile,v;  1.2
Build/install fileserver.group

91/12/30   ./viced/RCS/afsfileprocs.c,v;  1.2
Don't allow regular user's to create suid/sgid files
(their afs id might not be their unix id)

92/01/01   ./volser/RCS/Makefile,v;  1.2
Also install vos in bin (a lot of users seem to use it)

91/12/30   ./wash/RCS/rcsmkdir.c,v;  1.2
Create directories according to user's umask

91/12/30   ./RCS/Makefile,v;  1.2
Added "athena" rule
Improved vfsckaix31 rule to look for bos directory
Fixed various dependencies

*** Patches sent to Transarc (92/01/02)

92/01/05   ./vfsck/RCS/main.c,v;  1.2
Re-added logging to /etc/vfsck.log feature...

92/01/05   ./vfsck/RCS/dir.c,v;  1.2
Re-added logging to /etc/vfsck.log feature...

92/01/05   ./vfsck/RCS/inode.c,v;  1.2
Re-added logging to /etc/vfsck.log feature...

92/01/05   ./vfsck/RCS/pass1.c,v;  1.2
Re-added logging to /etc/vfsck.log feature...

92/01/05   ./vfsck/RCS/utilities.c,v;  1.2
Re-added logging to /etc/vfsck.log feature...

92/01/05   ./afs/RCS/volerrors.h,v;  1.2
Not all EDQUOT symbols are the same, so we hardcode the common one...

92/01/05   ./viced/RCS/viced.c,v;  1.2
ChangYd references from /vice/file to /usr/afs/local.
Added ability to gather certain statistics without needing R_SUPPORT
Changed some logging to higher level for startup messages.

92/01/05   ./viced/RCS/afsfileprocs.c,v;  1.3
Fixed a couple security holes:
- Make RO/BK volumes truly readonly
- Don't allow directory owners to have special privileges (if they stop
  working on a project, it requires a sysadmin to find all dirs...)

92/01/06   ./viced/RCS/afsfileprocs.c,v;  1.4
This security problem is more general than just an Athena concern...

92/01/06   ./util/RCS/errors.h,v;  1.2
Not all EDQUOT symbols are the same, so we hardcode the common one...

92/01/06   ./afs/RCS/afs_resource.c,v;  1.3
Also check for VDISKFULL as an error code

92/01/06   ./afs/RCS/afs_resource.c,v;  1.4
Needed to add more mapping to afs_CheckCode (VOVERQUOTA, VDISKFULL)

*** Patches sent to Transarc (92/01/06)



*** /tmp/,RCSt1ES4C%I	Mon Jan  6 05:21:02 1992
--- src/vfsck/dir.c	Sun Jan  5 22:32:23 1992
***************
*** 93,99 ****
--- 93,103 ----
                          pathname, dp->di_size, DIRBLKSIZ);
                  dp->di_size = roundup(dp->di_size, DIRBLKSIZ);
                  if (preen)
+ #ifdef VICE
+                         vprintf(" (ADJUSTED)\n");
+ #else
                          printf(" (ADJUSTED)\n");
+ #endif
                  if (preen || reply("ADJUST") == 1)
                          inodirty();
          }
***************
*** 236,242 ****
--- 240,250 ----
  
          pwarn("%s ", errmesg);
          pinode(ino);
+ #ifdef VICE
+         vprintf("\n");
+ #else
          printf("\n");
+ #endif
          if (ino < ROOTINO || ino > maxino) {
                  pfatal("NAME=%s\n", pathname);
                  return;
***************
*** 263,276 ****
--- 271,296 ----
                  pwarn("LINK COUNT %s", (lfdir == idesc->id_number) ? lfname :
                          ((dp->di_mode & IFMT) == IFDIR ? "DIR" : "FILE"));
                  pinode(idesc->id_number);
+ #ifdef VICE
+                 vprintf(" COUNT %d SHOULD BE %d",
+ #else
                  printf(" COUNT %d SHOULD BE %d",
+ #endif
                          dp->di_nlink, dp->di_nlink - lcnt);
                  if (preen) {
                          if (lcnt < 0) {
+ #ifdef VICE
+                                 vprintf("\n");
+ #else
                                  printf("\n");
+ #endif
                                  pfatal("LINK COUNT INCREASING");
                          }
+ #ifdef VICE
+                         vprintf(" (ADJUSTED)\n");
+ #else
                          printf(" (ADJUSTED)\n");
+ #endif
                  }
                  if (preen || reply("ADJUST") == 1) {
                          dp->di_nlink -= lcnt;
***************
*** 334,340 ****
--- 354,364 ----
          if (preen && dp->di_size == 0)
                  return (0);
          if (preen)
+ #ifdef VICE
+                 vprintf(" (RECONNECTED)\n");
+ #else
                  printf(" (RECONNECTED)\n");
+ #endif
          else
                  if (reply("RECONNECT") == 0)
                          return (0);
***************
*** 356,367 ****
--- 380,399 ----
                                  if (lfdir != 0) {
                                          if (makeentry(ROOTINO, lfdir, lfname) != 0) {
                                                  if (preen)
+ #ifdef VICE
+                                                         vprintf(" (CREATED)\n");
+ #else
                                                          printf(" (CREATED)\n");
+ #endif
                                          } else {
                                                  freedir(lfdir, ROOTINO);
                                                  lfdir = 0;
                                                  if (preen)
+ #ifdef VICE
+                                                         vprintf("\n");
+ #else
                                                          printf("\n");
+ #endif
                                          }
                                  }
                          }
***************
*** 368,374 ****
--- 400,410 ----
                  }
                  if (lfdir == 0) {
                          pfatal("SORRY. CANNOT CREATE lost+found DIRECTORY");
+ #ifdef VICE
+                         vprintf("\n\n");
+ #else
                          printf("\n\n");
+ #endif
                          return (0);
                  }
          }
***************
*** 409,415 ****
--- 445,455 ----
          len = lftempname(tempname, orphan);
          if (makeentry(lfdir, orphan, tempname) == 0) {
                  pfatal("SORRY. NO SPACE IN lost+found DIRECTORY");
+ #ifdef VICE
+                 vprintf("\n\n");
+ #else
                  printf("\n\n");
+ #endif
                  return (0);
          }
          lncntp[orphan]--;
***************
*** 430,438 ****
--- 470,486 ----
                  inodirty();
                  lncntp[lfdir]++;
                  pwarn("DIR I=%u CONNECTED. ", orphan);
+ #ifdef VICE
+                 vprintf("PARENT WAS I=%u\n", parentdir);
+ #else
                  printf("PARENT WAS I=%u\n", parentdir);
+ #endif
                  if (preen == 0)
+ #ifdef VICE
+                         vprintf("\n");
+ #else
                          printf("\n");
+ #endif
          }
          return (1);
  }
***************
*** 509,515 ****
--- 557,567 ----
          bcopy((char *)&emptydir, bp->b_un.b_buf, sizeof emptydir);
          pwarn("NO SPACE LEFT IN %s", pathname);
          if (preen)
+ #ifdef VICE
+                 vprintf(" (EXPANDED)\n");
+ #else
                  printf(" (EXPANDED)\n");
+ #endif
          else if (reply("EXPAND") == 0)
                  goto bad;
          dirty(bp);
*** /tmp/,RCSt1ES4FrL	Mon Jan  6 05:21:03 1992
--- src/vfsck/inode.c	Sun Jan  5 22:32:25 1992
***************
*** 176,184 ****
--- 176,192 ----
          if (blk < cgdmin(&sblock, c)) {
                  if ((blk + cnt) > cgsblock(&sblock, c)) {
                          if (debug) {
+ #ifdef VICE
+                                 vprintf("blk %d < cgdmin %d;",
+ #else
                                  printf("blk %d < cgdmin %d;",
+ #endif
                                      blk, cgdmin(&sblock, c));
+ #ifdef VICE
+                                 vprintf(" blk + cnt %d > cgsbase %d\n",
+ #else
                                  printf(" blk + cnt %d > cgsbase %d\n",
+ #endif
                                      blk + cnt, cgsblock(&sblock, c));
                          }
                          return (1);
***************
*** 186,194 ****
--- 194,210 ----
          } else {
                  if ((blk + cnt) > cgbase(&sblock, c+1)) {
                          if (debug)  {
+ #ifdef VICE
+                                 vprintf("blk %d >= cgdmin %d;",
+ #else
                                  printf("blk %d >= cgdmin %d;",
+ #endif
                                      blk, cgdmin(&sblock, c));
+ #ifdef VICE
+                                 vprintf(" blk + cnt %d > sblock.fs_fpg %d\n",
+ #else
                                  printf(" blk + cnt %d > sblock.fs_fpg %d\n",
+ #endif
                                      blk+cnt, sblock.fs_fpg);
                          }
                          return (1);
***************
*** 237,243 ****
--- 253,263 ----
          }
          if (preen || reply("CLEAR") == 1) {
                  if (preen)
+ #ifdef VICE
+                         vprintf(" (CLEARED)\n");
+ #else
                          printf(" (CLEARED)\n");
+ #endif
                  n_files--;
                  (void)ckinode(dp, idesc);
  #ifdef  VICE
***************
*** 284,304 ****
--- 304,356 ----
          struct passwd *pw;
          char *ctime();
  
+ #ifdef VICE
+         vprintf(" I=%u ", ino);
+ #else
          printf(" I=%u ", ino);
+ #endif
          if (ino < ROOTINO || ino > maxino)
                  return;
          dp = ginode(ino);
+ #ifdef VICE
+         vprintf(" OWNER=");
+ #else
          printf(" OWNER=");
+ #endif
          if ((pw = getpwuid((int)dp->di_uid)) != 0)
+ #ifdef VICE
+                 vprintf("%s ", pw->pw_name);
+ #else
                  printf("%s ", pw->pw_name);
+ #endif
          else
+ #ifdef VICE
+                 vprintf("%d ", dp->di_uid);
+ #else
                  printf("%d ", dp->di_uid);
+ #endif
+ #ifdef VICE
+         vprintf("MODE=%o\n", dp->di_mode);
+ #else
          printf("MODE=%o\n", dp->di_mode);
+ #endif
          if (preen)
+ #ifdef VICE
+                 vprintf("%s: ", devname);
+ #else
                  printf("%s: ", devname);
+ #endif
+ #ifdef VICE
+         vprintf("SIZE=%ld ", dp->di_size);
+ #else
          printf("SIZE=%ld ", dp->di_size);
+ #endif
          p = ctime(&dp->di_mtime);
+ #ifdef VICE
+         vprintf("MTIME=%12.12s %4.4s ", p + 4, p + 20);
+ #else
          printf("MTIME=%12.12s %4.4s ", p + 4, p + 20);
+ #endif
  }
  
  blkerror(ino, type, blk)
***************
*** 308,314 ****
--- 360,370 ----
  {
  
          pfatal("%ld %s I=%u", blk, type, ino);
+ #ifdef VICE
+         vprintf("\n");
+ #else
          printf("\n");
+ #endif
          switch (statemap[ino]) {
  
  #ifdef VICE
*** /tmp/,RCSt1ES4J9g	Mon Jan  6 05:21:04 1992
--- src/vfsck/main.c	Sun Jan  5 22:33:02 1992
***************
*** 580,586 ****
                  n_blks += cgsblock(&sblock, 0) - cgbase(&sblock, 0);
                  n_blks += howmany(sblock.fs_cssize, sblock.fs_fsize);
                  if (n_blks -= maxfsblock - (n_ffree + sblock.fs_frag * n_bfree))
!                         printf("%d blocks missing\n", n_blks);
                  if (duplist != NULL) {
                          msgprintf("The following duplicate blocks remain:");
                          for (dp = duplist; dp; dp = dp->next)
--- 580,586 ----
                  n_blks += cgsblock(&sblock, 0) - cgbase(&sblock, 0);
                  n_blks += howmany(sblock.fs_cssize, sblock.fs_fsize);
                  if (n_blks -= maxfsblock - (n_ffree + sblock.fs_frag * n_bfree))
!                         msgprintf("%d blocks missing\n", n_blks);
                  if (duplist != NULL) {
                          msgprintf("The following duplicate blocks remain:");
                          for (dp = duplist; dp; dp = dp->next)
***************
*** 661,667 ****
              if (mount(devname, pname, 0) < 0) {
  #endif /* AFS_GFS_ENV */
  #endif AFS_VFS_ENV
!                 printf("Couldn't mount %s on %s to force FULL SALVAGE; continuing anyway (%d)!\n", devname, pname, errno);
              } else {
                  strcpy(fname, pname);
                  strcat(fname, "/FORCESALVAGE");
--- 661,667 ----
              if (mount(devname, pname, 0) < 0) {
  #endif /* AFS_GFS_ENV */
  #endif AFS_VFS_ENV
!                 msgprintf("Couldn't mount %s on %s to force FULL SALVAGE; continuing anyway (%d)!\n", devname, pname, errno);
              } else {
                  strcpy(fname, pname);
                  strcat(fname, "/FORCESALVAGE");
***************
*** 780,785 ****
--- 780,789 ----
  vprintf(s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
  {
      printf(s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+ 
+     if (!logfile && !hotroot)
+         logfile = fopen("/etc/vfsck.log", "w+");
+     
      if (logfile) {
          fprintf(logfile, s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
          fflush(logfile);
*** /tmp/,RCSt1ES4N9w	Mon Jan  6 05:21:05 1992
--- src/vfsck/pass1.c	Sun Jan  5 22:33:04 1992
***************
*** 101,107 ****
--- 101,111 ----
                          if (dp->di_size < 0 ||
                              dp->di_size + sblock.fs_bsize - 1 < 0) {
                                  if (debug)
+ #ifdef VICE
+                                         vprintf("bad size %d:", dp->di_size);
+ #else
                                          printf("bad size %d:", dp->di_size);
+ #endif
                                  goto unknown;
                          }
                          if (!preen && (dp->di_mode & IFMT) == IFMT &&
***************
*** 129,135 ****
--- 133,143 ----
  #endif  AFS_NEXT_ENV
                          if (ndb < 0) {
                                  if (debug)
+ #ifdef VICE
+                                         vprintf("bad size %d ndb %d:",
+ #else
                                          printf("bad size %d ndb %d:",
+ #endif
                                                  dp->di_size, ndb);
                                  goto unknown;
                          }
***************
*** 139,145 ****
--- 147,157 ----
                          for (j = ndb; j < NDADDR; j++)
                                  if (dp->di_db[j] != 0) {
                                          if (debug)
+ #ifdef VICE
+                                                 vprintf("bad direct addr: %d\n",
+ #else
                                                  printf("bad direct addr: %d\n",
+ #endif
                                                          dp->di_db[j]);
                                          goto unknown;
                                  }
***************
*** 148,154 ****
--- 160,170 ----
                          for (; j < NIADDR; j++)
                                  if (dp->di_ib[j] != 0) {
                                          if (debug)
+ #ifdef VICE
+                                                 vprintf("bad indirect addr: %d\n",
+ #else
                                                  printf("bad indirect addr: %d\n",
+ #endif
                                                          dp->di_ib[j]);
                                          goto unknown;
                                  }
***************
*** 189,195 ****
--- 205,215 ----
                                  pwarn("INCORRECT BLOCK COUNT I=%u (%ld should be %ld)",
                                      inumber, dp->di_blocks, idesc.id_entryno);
                                  if (preen)
+ #ifdef VICE
+                                         vprintf(" (CORRECTED)\n");
+ #else
                                          printf(" (CORRECTED)\n");
+ #endif
                                  else if (reply("CORRECT") == 0)
                                          continue;
                                  dp->di_blocks = idesc.id_entryno;
***************
*** 227,233 ****
--- 247,257 ----
                          pwarn("EXCESSIVE BAD BLKS I=%u",
                                  idesc->id_number);
                          if (preen)
+ #ifdef VICE
+                                 vprintf(" (SKIPPING)\n");
+ #else
                                  printf(" (SKIPPING)\n");
+ #endif
                          else if (reply("CONTINUE") == 0)
                                  errexit("");
                          return (STOP);
***************
*** 245,251 ****
--- 269,279 ----
                                  pwarn("EXCESSIVE DUP BLKS I=%u",
                                          idesc->id_number);
                                  if (preen)
+ #ifdef VICE
+                                         vprintf(" (SKIPPING)\n");
+ #else
                                          printf(" (SKIPPING)\n");
+ #endif
                                  else if (reply("CONTINUE") == 0)
                                          errexit("");
                                  return (STOP);
*** /tmp/,RCSt1ES4Rdd	Mon Jan  6 05:21:07 1992
--- src/vfsck/utilities.c	Sun Jan  5 22:33:06 1992
***************
*** 21,26 ****
--- 21,28 ----
  
  #include <afs/param.h>
  
+ #define VICE
+ 
  #include <sys/param.h>
  #include <sys/time.h>
  #ifdef AFS_VFSINCL_ENV
***************
*** 60,66 ****
--- 62,72 ----
  
          default:
                  if (debug)
+ #ifdef VICE
+                         vprintf("bad file type 0%o\n", dp->di_mode);
+ #else
                          printf("bad file type 0%o\n", dp->di_mode);
+ #endif
                  return (0);
          }
  }
***************
*** 91,97 ****
--- 97,107 ----
                          if (feof(stdin))
                                  return (0);
          } while (c != 'y' && c != 'Y' && c != 'n' && c != 'N');
+ #ifdef VICE
+         vprintf("\n");
+ #else
          printf("\n");
+ #endif
          if (c == 'y' || c == 'Y')
                  return (1);
          return (0);
***************
*** 215,221 ****
--- 225,235 ----
  {
  
          if (preen == 0)
+ #ifdef VICE
+                 vprintf("\n");
+ #else
                  printf("\n");
+ #endif
          pfatal("CANNOT %s: BLK %ld", mesg, blk);
          if (reply("CONTINUE") == 0)
                  errexit("Program terminated\n");
***************
*** 251,257 ****
--- 265,275 ----
          if (bufhead.b_size != cnt)
                  errexit("Panic: lost %d buffers\n", bufhead.b_size - cnt);
          if (debug)
+ #ifdef VICE
+                 vprintf("cache missed %d of %d (%d%%)\n", diskreads,
+ #else
                  printf("cache missed %d of %d (%d%%)\n", diskreads,
+ #endif
                      totalreads, diskreads * 100 / totalreads);
          (void)close(fsreadfd);
          (void)close(fswritefd);
***************
*** 275,294 ****
--- 293,328 ----
                  rwerror("SEEK", blk);
          errs = 0;
          bzero(buf, (int)size);
+ #ifdef VICE
+         vprintf("THE FOLLOWING DISK SECTORS COULD NOT BE READ:");
+ #else
          printf("THE FOLLOWING DISK SECTORS COULD NOT BE READ:");
+ #endif
          for (cp = buf, i = 0; i < size; i += secsize, cp += secsize) {
                  if (read(fd, cp, (int)secsize) < 0) {
                          lseek(fd, blk * dev_bsize + i + secsize, 0);
                          if (secsize != dev_bsize && dev_bsize != 1)
+ #ifdef VICE
+                                 vprintf(" %d (%d),",
+ #else
                                  printf(" %d (%d),",
+ #endif
                                      (blk * dev_bsize + i) / secsize,
                                      blk + i / dev_bsize);
                          else
+ #ifdef VICE
+                                 vprintf(" %d,", blk + i / dev_bsize);
+ #else
                                  printf(" %d,", blk + i / dev_bsize);
+ #endif
                          errs++;
                  }
          }
+ #ifdef VICE
+         vprintf("\n");
+ #else
          printf("\n");
+ #endif
          return (errs);
  }
  
***************
*** 312,324 ****
--- 346,370 ----
          rwerror("WRITE", blk);
          if (lseek(fd, blk * dev_bsize, 0) < 0)
                  rwerror("SEEK", blk);
+ #ifdef VICE
+         vprintf("THE FOLLOWING SECTORS COULD NOT BE WRITTEN:");
+ #else
          printf("THE FOLLOWING SECTORS COULD NOT BE WRITTEN:");
+ #endif
          for (cp = buf, i = 0; i < size; i += dev_bsize, cp += dev_bsize)
                  if (write(fd, cp, (int)dev_bsize) < 0) {
                          lseek(fd, blk * dev_bsize + i + dev_bsize, 0);
+ #ifdef VICE
+                         vprintf(" %d,", blk + i / dev_bsize);
+ #else
                          printf(" %d,", blk + i / dev_bsize);
+ #endif
                  }
+ #ifdef VICE
+         vprintf("\n");
+ #else
          printf("\n");
+ #endif
          return;
  }
  
***************
*** 435,441 ****
--- 481,491 ----
  {
          extern returntosingle;
  
+ #ifdef VICE
+         vprintf("returning to single-user after filesystem check\n");
+ #else
          printf("returning to single-user after filesystem check\n");
+ #endif
          returntosingle = 1;
          (void)signal(SIGQUIT, SIG_DFL);
  }
***************
*** 469,475 ****
--- 519,529 ----
                  else
                          pwarn(msg);
                  if (preen) {
+ #ifdef VICE
+                         vprintf(" (SALVAGED)\n");
+ #else
                          printf(" (SALVAGED)\n");
+ #endif
                          idesc->id_fix = FIX;
                          return (ALTERED);
                  }
***************
*** 496,502 ****
--- 550,560 ----
  errexit(s1, s2, s3, s4)
          char *s1;
  {
+ #ifdef VICE
+         vprintf(s1, s2, s3, s4);
+ #else
          printf(s1, s2, s3, s4);
+ #endif
          exit(8);
  }
  
***************
*** 510,523 ****
--- 568,601 ----
  {
  
          if (preen) {
+ #ifdef VICE
+                 vprintf("%s: ", devname);
+ #else
                  printf("%s: ", devname);
+ #endif
+ #ifdef VICE
+                 vprintf(s, a1, a2, a3);
+ #else
                  printf(s, a1, a2, a3);
+ #endif
+ #ifdef VICE
+                 vprintf("\n");
+ #else
                  printf("\n");
+ #endif
+ #ifdef VICE
+                 vprintf("%s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.\n",
+ #else
                  printf("%s: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.\n",
+ #endif
                          devname);
                  exit(8);
          }
+ #ifdef VICE
+         vprintf(s, a1, a2, a3);
+ #else
          printf(s, a1, a2, a3);
+ #endif
  }
  
  /*
***************
*** 530,537 ****
--- 608,623 ----
  {
  
          if (preen)
+ #ifdef VICE
+                 vprintf("%s: ", devname);
+ #else
                  printf("%s: ", devname);
+ #endif
+ #ifdef VICE
+         vprintf(s, a1, a2, a3, a4, a5, a6);
+ #else
          printf(s, a1, a2, a3, a4, a5, a6);
+ #endif
  }
  
  #ifndef lint
*** /tmp/,RCSt1ES4Wqc	Mon Jan  6 05:21:08 1992
--- src/viced/Makefile	Mon Dec 30 10:29:39 1991
***************
*** 1,5 ****
! # $Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/viced/RCS/Makefile,v 1.1 91/12/23 17:02:47 probe Exp $ 
! # $Source: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/viced/RCS/Makefile,v $ 
  
  #
  # P_R_P_Q_# (C) COPYRIGHT IBM CORPORATION 1987
--- 1,5 ----
! # $Header: /afs/athena.mit.edu/astaff/project/afsdev/src/3.1b/src/viced/RCS/Makefile,v 1.2 91/12/30 10:29:32 probe Exp $ 
! # $Source: /afs/athena.mit.edu/astaff/project/afsdev/src/3.1b/src/viced/RCS/Makefile,v $ 
  
  #
  # P_R_P_Q_# (C) COPYRIGHT IBM CORPORATION 1987
***************
*** 11,17 ****
  DESTDIR = /usr/andy/
  INSTALL = ${SRCDIR}bin/install
  
! DEBUG = -g 
  CFLAGS = -DNINTERFACE ${DEBUG} -I. -I${SRCDIR}include/afs -I${SRCDIR}include ${XCFLAGS}
  LDFLAGS = ${DEBUG}
  
--- 11,17 ----
  DESTDIR = /usr/andy/
  INSTALL = ${SRCDIR}bin/install
  
! DEBUG =  
  CFLAGS = -DNINTERFACE ${DEBUG} -I. -I${SRCDIR}include/afs -I${SRCDIR}include ${XCFLAGS}
  LDFLAGS = ${DEBUG}
  
***************
*** 55,72 ****
          callback.o      \
          profile.o
  
! all: fileserver
  
  ${objects}:${headers}
  
  fileserver: viced.o ${objects} ${headers} ${LIBS}
          ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS}
  
  lint:
          lint -uvn  -I${SRCDIR}include viced.c afsfileprocs.c host.c physio.c callback.c profile.c ${SRCDIR}lib/afs/llib-lutil.ln
  
  install: all
          ${INSTALL} -ns fileserver ${DESTDIR}root.server/usr/afs/bin/fileserver
          ${INSTALL} fs_stats.h ${DESTDIR}/include/afs
  
  system: install
--- 55,91 ----
          callback.o      \
          profile.o
  
! gobjects=viced.o                \
!         afsfileprocs.group.o    \
!         host.o                  \
!         physio.o                \
!         callback.o              \
!         profile.o
  
+ all: fileserver fileserver.group
+ 
  ${objects}:${headers}
+ ${gobjects}:${headers}
  
  fileserver: viced.o ${objects} ${headers} ${LIBS}
          ${CC} ${LDFLAGS} -o fileserver ${objects} ${LIBS}
  
+ fileserver.group: viced.o ${gobjects} ${headers} ${LIBS}
+         ${CC} ${LDFLAGS} -o fileserver.group ${gobjects} ${LIBS}
+ 
+ afsfileprocs.group.o: afsfileprocs.group.c
+         ${CC} ${CFLAGS} -DUSE_GROUP_PERMS -c afsfileprocs.group.c
+ 
+ afsfileprocs.group.c: afsfileprocs.c
+         rm -f afsfileprocs.group.c
+         ln -s afsfileprocs.c afsfileprocs.group.c
+ 
  lint:
          lint -uvn  -I${SRCDIR}include viced.c afsfileprocs.c host.c physio.c callback.c profile.c ${SRCDIR}lib/afs/llib-lutil.ln
  
  install: all
          ${INSTALL} -ns fileserver ${DESTDIR}root.server/usr/afs/bin/fileserver
+         ${INSTALL} -ns fileserver.group ${DESTDIR}root.server/usr/afs/bin/fileserver.group
          ${INSTALL} fs_stats.h ${DESTDIR}/include/afs
  
  system: install
*** /tmp/,RCSt1ES4Y85	Mon Jan  6 05:21:11 1992
--- src/viced/afsfileprocs.c	Mon Jan  6 01:00:50 1992
***************
*** 72,78 ****
  #include <sys/inode.h>
  #endif AFS_VFSINCL_ENV
  
! RCSID ("$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/viced/RCS/afsfileprocs.c,v 1.1 91/12/23 17:02:47 probe Exp $")
  
  #ifndef R_SUPPORT
  #define R_SUPPORT 0
--- 72,78 ----
  #include <sys/inode.h>
  #endif AFS_VFSINCL_ENV
  
! RCSID ("$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/viced/RCS/afsfileprocs.c,v 1.4 92/01/06 00:59:45 probe Exp $")
  
  #ifndef R_SUPPORT
  #define R_SUPPORT 0
***************
*** 2860,2865 ****
--- 2860,2870 ----
          goto Bad_SetVolumeStatus;
      }
  
+     if (!VolumeWriteable(volptr)) {
+         errorCode = EROFS;
+         goto Bad_SetVolumeStatus;
+     }
+     
      errorCode = RXUpdate_VolumeStatus(volptr, StoreVolStatus, Name, OfflineMsg, Motd);
  
   Bad_SetVolumeStatus:
***************
*** 3553,3562 ****
          if (CallingRoutine == CHK_FETCHDATA || VanillaUser(client)) {
  #endif
              if (targetptr->disk.type == vDirectory || targetptr->disk.type == vSymlink) {
!                 if (client->ViceId != targetptr->disk.owner &&
                      !acl_IsAMember(targetptr->disk.owner, &client->CPS) &&
!                     !VolumeOwner(client, targetptr) &&
!                     !(rights & PRSFS_LOOKUP))
                      return(EACCES);
              } else {    /* file */
                  /* must have read access, or be owner and have insert access */
--- 3558,3569 ----
          if (CallingRoutine == CHK_FETCHDATA || VanillaUser(client)) {
  #endif
              if (targetptr->disk.type == vDirectory || targetptr->disk.type == vSymlink) {
!                 if (!(rights & PRSFS_LOOKUP) &&
! #if 0
!                     client->ViceId != targetptr->disk.owner &&
                      !acl_IsAMember(targetptr->disk.owner, &client->CPS) &&
! #endif
!                     !VolumeOwner(client, targetptr))
                      return(EACCES);
              } else {    /* file */
                  /* must have read access, or be owner and have insert access */
***************
*** 3578,3583 ****
--- 3585,3594 ----
  #endif
          }
      } else {    /* a store operation */
+         /* Check to see if this is a readonly volume */
+         if (!VolumeWriteable(targetptr->volumePtr))
+             return(EROFS);
+             
          if ((client->ViceId == targetptr->disk.owner) && (rights & PRSFS_INSERT) && (CallingRoutine != CHK_STOREACL) && (targetptr->disk.type == vFile)) {
              /* bypass protection checks on first store after a create for the creator; also prevent chowns during this time unless you are a system administrator*/
              /******  InStatus->Owner && UnixModeBits better be SET!! */
***************
*** 3585,3596 ****
--- 3596,3611 ----
                  return(EACCES);
              if ((InStatus->Mask & AFS_SETGROUP) && InStatus->Group != targetptr->disk.group && VanillaUser (client))
                  return(EACCES);
+             if ((InStatus->Mask & AFS_SETMODE) && (InStatus->UnixModeBits & (ISUID|ISGID)) != 0 && VanillaUser(client))
+               return(EACCES);
          } else {
              if (CallingRoutine == CHK_STOREDATA || VanillaUser(client)) {
                  if (CallingRoutine == CHK_STOREACL) {
                      if (!(rights & PRSFS_ADMINISTER) &&
+ #if 0
                          (client->ViceId != targetptr->disk.owner) &&
                          !acl_IsAMember(targetptr->disk.owner, &client->CPS) &&
+ #endif
                          !VolumeOwner(client, targetptr)) return(EACCES);
                  }
                  else {  /* store data or status */
*** /tmp/,RCSt1ES4dpU	Mon Jan  6 05:21:19 1992
--- src/viced/viced.c	Sun Jan  5 22:29:45 1992
***************
*** 52,58 ****
  #include "viced.h"
  #include "host.h"
  
! RCSID ("$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/viced/RCS/viced.c,v 1.1 92/01/03 03:51:24 probe Exp $")
  
  #ifndef R_SUPPORT
  #define R_SUPPORT 0
--- 52,58 ----
  #include "viced.h"
  #include "host.h"
  
! RCSID ("$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/viced/RCS/viced.c,v 1.2 92/01/05 22:28:41 probe Exp $")
  
  #ifndef R_SUPPORT
  #define R_SUPPORT 0
***************
*** 328,342 ****
      /*
       * Figure out the FileServer's name and primary address.
       */
!     ViceLog(0, "Getting FileServer name...\n");
      code = gethostname(FS_HostName, 64);
      if (code) {
          ViceLog(0, "gethostname() failed\n");
          exit(-1);
      }
!     ViceLog(0, "FileServer host name is '%s'\n", FS_HostName);
  
!     ViceLog(0, "Getting FileServer address...\n");
      he = gethostbyname(FS_HostName);
      if (!he) {
          ViceLog(0, "Can't find address for FileServer '%s'\n",
--- 328,342 ----
      /*
       * Figure out the FileServer's name and primary address.
       */
!     ViceLog(1, "Getting FileServer name...\n");
      code = gethostname(FS_HostName, 64);
      if (code) {
          ViceLog(0, "gethostname() failed\n");
          exit(-1);
      }
!     ViceLog(1, "FileServer host name is '%s'\n", FS_HostName);
  
!     ViceLog(1, "Getting FileServer address...\n");
      he = gethostbyname(FS_HostName);
      if (!he) {
          ViceLog(0, "Can't find address for FileServer '%s'\n",
***************
*** 360,366 ****
      signal(SIGQUIT, ShutDown_Signal);
      signal(SIGTERM, CheckDescriptors_Signal);
      if (!newVLDB) {
!         assert(file = fopen("/vice/file/pid","w"));
          fprintf(file,"%d",getpid());
          fclose(file);
      }
--- 360,366 ----
      signal(SIGQUIT, ShutDown_Signal);
      signal(SIGTERM, CheckDescriptors_Signal);
      if (!newVLDB) {
!         assert(file = fopen("/usr/afs/local/pid","w"));
          fprintf(file,"%d",getpid());
          fclose(file);
      }
***************
*** 790,800 ****
  
  static CheckSignal()
  {
- #if R_SUPPORT
      static struct  stat  sbuf;
  
!     if(!(stat("/vice/file/RLOG",&sbuf))) {
!         unlink("/vice/file/RLOG");
          if(r_debug) {
              fclose(r_debug);
              rftp_debug = r_debug = 0;
--- 790,800 ----
  
  static CheckSignal()
  {
      static struct  stat  sbuf;
  
! #if R_SUPPORT
!     if(!(stat("/usr/afs/local/RLOG",&sbuf))) {
!         unlink("/usr/afs/local/RLOG");
          if(r_debug) {
              fclose(r_debug);
              rftp_debug = r_debug = 0;
***************
*** 805,830 ****
          }
      }
  
!     if(!(stat("/vice/file/LIST",&sbuf))) {
!         unlink("/vice/file/LIST");
!         h_PrintClients();
!     }
! 
!     if(!(stat("/vice/file/STATS",&sbuf))) {
!         unlink("/vice/file/STATS");
!         PrintCounters();
!     }
! 
!     if(!(stat("/vice/file/HOSTDUMP",&sbuf))) {
!         unlink("/vice/file/HOSTDUMP");
!         h_DumpHosts();
!         DumpCallBackState();
!     }
! 
!     if(!(stat("/vice/file/DATABASE",&sbuf))) {
          static unsigned long keytime = 0;
          struct stat buff;
!         unlink("/vice/file/DATABASE");
  /*
          CheckPRO();
          stat(KEY1, &buff);
--- 805,814 ----
          }
      }
  
!     if(!(stat("/usr/afs/local/DATABASE",&sbuf))) {
          static unsigned long keytime = 0;
          struct stat buff;
!         unlink("/usr/afs/local/DATABASE");
  /*
          CheckPRO();
          stat(KEY1, &buff);
***************
*** 836,852 ****
          VCheckVLDB();
          ViceLog(0,"New Data Base received\n");
      }
  
!     if(!(stat("/vice/file/SWAPLOG",&sbuf))) {
!         unlink("/vice/file/SWAPLOG");
          SwapLog();
      }
  
!     if(!(stat("/vice/file/PROFILE",&sbuf))) {
!         unlink("/vice/file/PROFILE");
          ProfileToggle();
      }
! #endif
  }
  
  static void     ShutDown()
--- 820,854 ----
          VCheckVLDB();
          ViceLog(0,"New Data Base received\n");
      }
+ #endif
  
!     if(!(stat("/usr/afs/local/LIST",&sbuf))) {
!         unlink("/usr/afs/local/LIST");
!         h_PrintClients();
!     }
! 
!     if(!(stat("/usr/afs/local/STATS",&sbuf))) {
!         unlink("/usr/afs/local/STATS");
!         PrintCounters();
!     }
! 
!     if(!(stat("/usr/afs/local/HOSTDUMP",&sbuf))) {
!         unlink("/usr/afs/local/HOSTDUMP");
!         h_DumpHosts();
!         DumpCallBackState();
!     }
! 
!     if(!(stat("/usr/afs/local/SWAPLOG",&sbuf))) {
!         unlink("/usr/afs/local/SWAPLOG");
          SwapLog();
      }
  
!     if(!(stat("/usr/afs/local/PROFILE",&sbuf))) {
!         unlink("/usr/afs/local/PROFILE");
          ProfileToggle();
      }
! 
!     return;
  }
  
  static void     ShutDown()
***************
*** 997,1003 ****
      char   * argv[MAXPARMS];
      register int      argc;
  
!     if(!(stat("/vice/file/parms",&sbuf))) {
          parms = (char *)malloc(sbuf.st_size);
          if(parms <= (char *)0) return;
          fd = open("parms", O_RDONLY, 0666);
--- 999,1005 ----
      char   * argv[MAXPARMS];
      register int      argc;
  
!     if(!(stat("/usr/afs/local/parms",&sbuf))) {
          parms = (char *)malloc(sbuf.st_size);
          if(parms <= (char *)0) return;
          fd = open("parms", O_RDONLY, 0666);
*** /tmp/,RCSt1ES4hBA	Mon Jan  6 05:21:20 1992
--- src/util/errors.h	Mon Jan  6 02:52:38 1992
***************
*** 1,8 ****
! /* $Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/util/RCS/errors.h,v 1.1 92/01/06 02:51:00 probe Exp $ */
  /* $Source: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/util/RCS/errors.h,v $ */
  
  #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
! static char *rcsiderrors = "$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/util/RCS/errors.h,v 1.1 92/01/06 02:51:00 probe Exp $";
  #endif
  
  /*
--- 1,8 ----
! /* $Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/util/RCS/errors.h,v 1.2 92/01/06 02:52:28 probe Exp $ */
  /* $Source: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/util/RCS/errors.h,v $ */
  
  #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
! static char *rcsiderrors = "$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/util/RCS/errors.h,v 1.2 92/01/06 02:52:28 probe Exp $";
  #endif
  
  /*
***************
*** 46,52 ****
  #define VONLINE         107     /* Volume is already on line */
  #define VDISKFULL       ENOSPC  /* Partition is "full", i.e. rougly within
                                     n% of full */
! #define VOVERQUOTA      EDQUOT  /* Volume max quota exceeded */
  #define VBUSY           110     /* Volume temporarily unavailable; try again.
                                     The volume should be available again shortly; if
                                     it isn't something is wrong.  Not normally to be
--- 46,52 ----
  #define VONLINE         107     /* Volume is already on line */
  #define VDISKFULL       ENOSPC  /* Partition is "full", i.e. rougly within
                                     n% of full */
! #define VOVERQUOTA      69      /* Volume max quota exceeded */
  #define VBUSY           110     /* Volume temporarily unavailable; try again.
                                     The volume should be available again shortly; if
                                     it isn't something is wrong.  Not normally to be
*** /tmp/,RCSt1ES4n0S	Mon Jan  6 05:21:22 1992
--- src/afs/afs_resource.c	Mon Jan  6 04:44:42 1992
***************
*** 11,22 ****
  #include "../afs/afsincludes.h" /* Afs-based standard headers */
  #include "../afs/afs_stats.h"   /* afs statistics */
  
  /* shouldn't do it this way, but for now will do */
  #ifndef ERROR_TABLE_BASE_u
  #define ERROR_TABLE_BASE_u      (5376L)
  #endif /* ubik error base define */
  
! RCSID ("$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/afs_resource.c,v 1.1 91/12/23 17:00:17 probe Exp $")
  
  /* This file contains routines used for dealing with users, volumes, cells
   * and connections.  They are related, unfortunately, as follows:
--- 11,27 ----
  #include "../afs/afsincludes.h" /* Afs-based standard headers */
  #include "../afs/afs_stats.h"   /* afs statistics */
  
+ #ifdef AFS_PREFER_LOCAL
+ #include "../net/if.h"
+ #include "../netinet/in_var.h"
+ #endif
+ 
  /* shouldn't do it this way, but for now will do */
  #ifndef ERROR_TABLE_BASE_u
  #define ERROR_TABLE_BASE_u      (5376L)
  #endif /* ubik error base define */
  
! RCSID ("$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/afs_resource.c,v 1.4 92/01/06 04:44:09 probe Exp $")
  
  /* This file contains routines used for dealing with users, volumes, cells
   * and connections.  They are related, unfortunately, as follows:
***************
*** 212,219 ****
                  if (tu->ct.EndTimestamp < now) {
                      /* this token has expired, warn users and reset access cache */
                      tcell = afs_GetCell(tu->cell);
!                     printf("afs: Tokens for user of AFS id %d for cell %s expired now\n",
!                            tu->vid, tcell->cellName);
                      tu->states |= (UTokensBad | UNeedsReset);
                  }
              }
--- 217,230 ----
                  if (tu->ct.EndTimestamp < now) {
                      /* this token has expired, warn users and reset access cache */
                      tcell = afs_GetCell(tu->cell);
! #ifndef AFS_ATHENA_ENV
!                     /* This shouldn't be broadcast to the console or to
!                      * other people, and it won't necessarily get to the
!                      * person for whom the tokens have expired.
!                      */
!                     printf("afs: Tokens for user %d (AFS id %d) for cell %s expired now\n",
!                            tu->uid, tu->vid, tcell->cellName);
! #endif
                      tu->states |= (UTokensBad | UNeedsReset);
                  }
              }
***************
*** 260,265 ****
--- 271,278 ----
      if (acode == 0) return 0;
      if (areq->accessError) return EACCES;
      if (areq->volumeError) return ENODEV;
+     if (acode == VOVERQUOTA) return EDQUOT;
+     if (acode == VDISKFULL) return ENOSPC;
      return acode;
  }
  
***************
*** 348,354 ****
  struct volume *afs_GetVolSlot()
    {
        extern int cacheDiskType;
!       struct volume *afs_UFSGetVolSlot(), *afs_MemGetVolSlot();
  
        AFS_STATCNT(afs_GetVolSlot);
        switch(cacheDiskType) {
--- 361,370 ----
  struct volume *afs_GetVolSlot()
    {
        extern int cacheDiskType;
!       struct volume *afs_UFSGetVolSlot();
! #ifndef AFS_NOMEMCACHE
!       struct volume *afs_MemGetVolSlot();
! #endif
  
        AFS_STATCNT(afs_GetVolSlot);
        switch(cacheDiskType) {
***************
*** 356,362 ****
--- 372,382 ----
            return afs_UFSGetVolSlot();
            break;
          case AFS_FCACHE_TYPE_MEM:
+ #ifdef AFS_NOMEMCACHE
+           panic("afs_CFileOpen: Memory cache file type not supported");
+ #else
            return afs_MemGetVolSlot();
+ #endif
            break;
          case AFS_FCACHE_TYPE_NFS:
            panic("afs_CFileOpen: NFS cache file type not supported");
***************
*** 427,432 ****
--- 447,453 ----
      return tv;
  }
  
+ #ifndef AFS_NOMEMCACHE
  struct volume *afs_MemGetVolSlot() {
      register struct volume *tv, **lv;
      register long i;
***************
*** 446,451 ****
--- 467,473 ----
      afs_freeVolList = tv->next;
      return tv;
  }
+ #endif /* !AFS_NOMEMCACHE */
  
  /* reset volume name to volume id mapping cache */
  afs_CheckVolumeNames() {
***************
*** 506,511 ****
--- 528,537 ----
      else
          print_internet_address("afs: Lost contact with file server ", aserver, "\n");
      aserver->isDown = 1;
+ 
+     /* If this was our time-server, search for another time-server */
+     if (aserver->host == afs_setTimeHost)
+         afs_setTimeHost = 0;
  }
  
  /* return true if we have any callback promises from this server */
***************
*** 587,592 ****
--- 613,634 ----
               */
              if (acellp && acellp != ts->cell) continue;
  
+ #ifdef AFS_ATHENA_ENV
+             /* If we are checking "all" servers, our remote-cell checks
+              * skip those servers which we believe are still up and from
+              * which there are no active callbacks.
+              *
+              * In afs_daemons.c, we cannot simply check the local cell
+              * every 10 minutes because of the synchronization problems
+              * that may occur with servers in a remote cell.
+              * [Synchronization and Caching Issues in the Andrew File System,
+              * Mike Kazar, Winter 1988/Dallas Usenix Proceedings, p.31-43]
+              */
+             if (!acellp &&
+                 ts->cell->cell != 1 && !ts->isDown && !HaveCallBacksFrom(ts))
+                 continue;
+ #endif
+             
              /* see if this server is the type we're checking this time */
              if (adown != ts->isDown) continue;
              /* check vlserver with special code */
***************
*** 614,622 ****
                      and the time is really different, then really set the time */
                  if (code == 0 && start == end && afs_setTime != 0 &&
                      (tc->server->host == afs_setTimeHost ||
!                      /* sync only to a server in the local cell: cell(id)==1 or CPrimary. */
!                      (afs_setTimeHost == 0 &&
!                       (ts->cell->cell == 1 || (ts->cell->states&CPrimary))))) {
                      char msgbuf[90];    /* strlen("afs: setting clock...") + slop */
                      /* set the time */
                      delta = end - tv.tv_sec;   /* how many secs fast we are */
--- 656,663 ----
                      and the time is really different, then really set the time */
                  if (code == 0 && start == end && afs_setTime != 0 &&
                      (tc->server->host == afs_setTimeHost ||
!                      /* sync only to a server in the local cell: cell(id)==1 */
!                      (afs_setTimeHost == 0 && ts->cell->cell == 1))) {
                      char msgbuf[90];    /* strlen("afs: setting clock...") + slop */
                      /* set the time */
                      delta = end - tv.tv_sec;   /* how many secs fast we are */
***************
*** 1336,1341 ****
--- 1377,1387 ----
      register long aserver; {
      register struct server *ts;
      register int i;
+ #ifdef AFS_PREFER_LOCAL
+     register u_long as = ntohl(aserver);
+     register struct ifnet *in;
+ #endif
+     
      AFS_STATCNT(afs_GetServer);
      i = SHash(aserver);
      ObtainSharedLock(&afs_xserver);
***************
*** 1355,1360 ****
--- 1401,1433 ----
      /* compute random value for funny sorting */
      afs_servers[i] = ts;
      ts->random = afs_random();
+ #ifdef AFS_PREFER_LOCAL
+     /*
+      * Bias the order so that servers on the local subnets are preferred.
+      *
+      * Written by Richard Basch/MIT
+      * Copyright (c) 1991 by the Massachusetts Institute of Technology.
+      *
+      * Permission to use, copy, modify, and distribute this software and its
+      * documentation for any purpose and without fee is hereby granted,
+      * provided that the above copyright notice appear in all copies and that
+      * both that copyright notice and this permission notice appear in
+      * supporting documentation, and that the name of M.I.T. not be used in
+      * advertising or publicity pertaining to distribution of the software
+      * without specific, written prior permission.  M.I.T. makes no
+      * representations about the suitability of this software for any
+      * purpose.  It is provided "as is" without express or implied warranty.
+      */
+     ts->random |= 0x4000;                       /* Set the high bit */
+     for (in = ifnet; in; in=in->if_next) {
+         register struct in_ifaddr *ia = (struct in_ifaddr *)in->if_addrlist;
+         if ((in->if_flags & IFF_UP) &&
+             (as & ia->ia_subnetmask) == ia->ia_subnet) {
+                 ts->random &= 0x3fff;           /* Local: clear high bits */
+                 break;                          /* No need to check more */
+         }
+     }
+ #endif
      ReleaseWriteLock(&afs_xserver);
      return ts;
  }
***************
*** 1553,1559 ****
          tu = afs_FindUser(areq->uid, tsp->cell->cell);
  #ifndef AFS_NEXT_ENV
          if (tu) {
!             uprintf("afs: Tokens for user of AFS id %d for cell %s have expired\n", tu->vid, aconn->server->cell->cellName);
          }
          else /* The else case shouldn't be possible and should probably be replaced by a panic? */
              uprintf("afs: Tokens for user %d for cell %s have expired\n", areq->uid, aconn->server->cell->cellName);
--- 1626,1633 ----
          tu = afs_FindUser(areq->uid, tsp->cell->cell);
  #ifndef AFS_NEXT_ENV
          if (tu) {
!             uprintf("afs: Tokens for user %d (AFS id %d) for cell %s have expired\n",
!                     areq->uid, tu->vid, aconn->server->cell->cellName);
          }
          else /* The else case shouldn't be possible and should probably be replaced by a panic? */
              uprintf("afs: Tokens for user %d for cell %s have expired\n", areq->uid, aconn->server->cell->cellName);
***************
*** 1635,1640 ****
--- 1709,1716 ----
      } else if (acode >= 0) {
          if (acode == VOVERQUOTA)
              acode = EDQUOT;     /* XXX Not all err #s are the same!! XXX */
+         else if (acode == VDISKFULL)
+             acode = ENOSPC;     /* XXX Not all err #s are the same!! XXX */
          returnCode = 0;         /* Other random Vice error. */
      }
      if (acode < 0) {
*** /tmp/,RCSt1ES4qnk	Mon Jan  6 05:21:24 1992
--- src/afs/volerrors.h	Mon Jan  6 02:52:23 1992
***************
*** 1,8 ****
! /* $Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/volerrors.h,v 1.1 92/01/05 22:20:54 probe Exp $ */
  /* $Source: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/volerrors.h,v $ */
  
  #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
! static char *rcsiderrors = "$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/volerrors.h,v 1.1 92/01/05 22:20:54 probe Exp $";
  #endif
  
  /*
--- 1,8 ----
! /* $Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/volerrors.h,v 1.2 92/01/05 22:26:53 probe Exp $ */
  /* $Source: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/volerrors.h,v $ */
  
  #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
! static char *rcsiderrors = "$Header: /afs/athena.mit.edu/astaff/project/afsdev/bld/src/afs/RCS/volerrors.h,v 1.2 92/01/05 22:26:53 probe Exp $";
  #endif
  
  /*
***************
*** 45,51 ****
  #define VONLINE         107     /* Volume is already on line */
  #define VDISKFULL       ENOSPC  /* Partition is "full", i.e. rougly within
                                     n% of full */
! #define VOVERQUOTA      EDQUOT  /* Volume max quota exceeded */
  #define VBUSY           110     /* Volume temporarily unavailable; try again.
                                     The volume should be available again shortly; if
                                     it isn't something is wrong.  Not normally to be
--- 45,51 ----
  #define VONLINE         107     /* Volume is already on line */
  #define VDISKFULL       ENOSPC  /* Partition is "full", i.e. rougly within
                                     n% of full */
! #define VOVERQUOTA      69      /* Volume max quota exceeded */
  #define VBUSY           110     /* Volume temporarily unavailable; try again.
                                     The volume should be available again shortly; if
                                     it isn't something is wrong.  Not normally to be

home help back first fref pref prev next nref lref last post