[10825] in Athena Bugs
config_afs
daemon@ATHENA.MIT.EDU (Mark Rosenstein)
Wed Aug 25 12:35:17 1993
Date: Wed, 25 Aug 93 12:35:12 EDT
From: Mark Rosenstein <mar@MIT.EDU>
To: bugs@Athena.MIT.EDU, bug-sparc@Athena.MIT.EDU
In investigating why this didn't work on the suns, I discovered a bug
that affects all the platforms. The problem on the suns was
generating a string that was too long for awk to handle. The bug on
all platforms was that the for loops checking each cell were skipping
the last cell. Apply the following patch, and make sure that this
gets installed on Solaris as well.
-Mark
*** /afs/athena/system/vax_bsd43/srvd.76/etc/athena/config_afs Fri Aug 14 12:56:00 1992
--- /tmp/config_afs Wed Aug 25 12:29:40 1993
***************
*** 37,52 ****
(awk '/^>/ {print $1}' ${CELLDB}; cat ${SUIDDB}) | awk '\
/^>/ {i++; cells[i]=substr($1,2,length($1)-1);suid[i]=0;next}; \
! /^-/ {for (j=1;j<i;j++) {if (substr($1,2,length($1)-1)==cells[j]) \
{suid[j]=0;next;}}}; \
! {for (j=1;j<i;j++) {if ($1==cells[j]) {suid[j]=1;next}}}; \
END { ns=0; nn=0; \
! for (j=1;j<i;j++) { \
! if (suid[j]){ns++;scmd=scmd" "cells[j];\
print "echo",cells[j];}\
! else {nn++;ncmd=ncmd" "cells[j];}; } \
! if (ns) {printf("fs setcell %s -suid\n", scmd)};\
! if (nn) {printf("fs setcell %s -nosuid\n",ncmd)};\
! }' | sh
exit 0
--- 37,50 ----
(awk '/^>/ {print $1}' ${CELLDB}; cat ${SUIDDB}) | awk '\
/^>/ {i++; cells[i]=substr($1,2,length($1)-1);suid[i]=0;next}; \
! /^-/ {for (j=1;j<=i;j++) {if (substr($1,2,length($1)-1)==cells[j]) \
{suid[j]=0;next;}}}; \
! {for (j=1;j<=i;j++) {if ($1==cells[j]) {suid[j]=1;next}}}; \
END { ns=0; nn=0; \
! for (j=1;j<=i;j++) { \
! if (suid[j]){printf("fs setcell %s -suid\n", cells[j]);\
print "echo",cells[j];}\
! else {printf("fs setcell %s -nosuid\n",cells[j]);};};\
! }' | /bin/sh
exit 0