*** newgroup.pgp Fri Mar 21 20:08:32 1997 --- ctl/newgroup Wed Jun 18 09:50:32 1997 *************** *** 79,89 **** ;; esac case "$old-$new" in ! m-m|y-y) exit ;; # no-op ! x-*) exit ;; # disregard, group nulled out locally esac case "$oldstatus" in ! ''|m|y) ;; *) reject=${reject-'moderation status is not m or y, cannot change it'} ;; esac newstatus="$new" --- 79,89 ---- ;; esac case "$old-$new" in ! m-m|y-y) oldstatus=n ;; # possible Newsgroups line change ! x-*) exit ;; # disregard, group nulled out locally esac case "$oldstatus" in ! ''|m|y|n) ;; *) reject=${reject-'moderation status is not m or y, cannot change it'} ;; esac newstatus="$new" *************** *** 152,157 **** --- 152,158 ---- echo "newgroup: \`$author' tried" case "$oldstatus" in '') echo "to create newsgroup \`$g'." ;; + n) echo "to re-create newsgroup \`$g'." ;; *) echo "to set newsgroup \`$g' to \`$f'." ;; esac echo "Request was refused:" *************** *** 196,202 **** then fail='unable to append new entry to active file' fi ! # and a newsgroups entry, if any... awk ' BEGIN { printit = 0 } $0 == "For your newsgroups file:" { printit = NR+1 } NR == printit { print }' $posting | tail -1 >$tmp --- 197,203 ---- then fail='unable to append new entry to active file' fi ! # add a newsgroups entry, if any... awk ' BEGIN { printit = 0 } $0 == "For your newsgroups file:" { printit = NR+1 } NR == printit { print }' $posting | tail -1 >$tmp *************** *** 206,211 **** --- 207,235 ---- fi cat $tmp >>$NEWSCTL/newsgroups ;; + n) # possible newsgroups file change + awk ' BEGIN { printit = 0 } + $0 == "For your newsgroups file:" { printit = NR+1 } + NR == printit { print }' $posting | tail -1 >$tmp + if test -s $tmp + then + if test -r $NEWSCTL/newsgroups \ + && fgrep -x "`cat $tmp`" $NEWSCTL/newsgroups >/dev/null + then + exit + else + if test -r $NEWSCTL/newsgroups + then + cp $NEWSCTL/newsgroups $NEWSCTL/newsgroups.bac || exit 1 + else + >$NEWSCTL/newsgroups.bac + fi + awk '$1 != ng { print }' ng=$g $NEWSCTL/newsgroups.bac | cat - $tmp >$NEWSCTL/newsgroups + fi + else + exit + fi + ;; *) # status change awk '$1 == "'"$g"'" { print $1, $2, $3, "'"$newstatus"'" ; next } { print }' $NEWSCTL/active >$NEWSCTL/active.tmp *************** *** 218,223 **** --- 242,267 ---- else fail='cannot rename active.tmp to active' fi + # now do newsgroup file change + awk ' BEGIN { printit = 0 } + $0 == "For your newsgroups file:" { printit = NR+1 } + NR == printit { print }' $posting | tail -1 >$tmp + if test -s $tmp + then + if test -r $NEWSCTL/newsgroups \ + && fgrep -x "`cat $tmp`" $NEWSCTL/newsgroups >/dev/null + then + : okay + else + if test -r $NEWSCTL/newsgroups + then + cp $NEWSCTL/newsgroups $NEWSCTL/newsgroups.bac || exit 1 + else + >$NEWSCTL/newsgroups.bac + fi + awk '$1 != ng { print }' ng=$g $NEWSCTL/newsgroups.bac | cat - $tmp >$NEWSCTL/newsgroups + fi + fi ;; esac *************** *** 225,231 **** case "$action" in *q*) ;; *) case "$oldstatus" in ! '') title="newgroup $g" ;; *) title="status change for $g" ;; esac ( --- 269,276 ---- case "$action" in *q*) ;; *) case "$oldstatus" in ! '') title="new newsgroup $g" ;; ! n) title="updated newsgroups line for $g" ;; *) title="status change for $g" ;; esac ( *************** *** 232,237 **** --- 277,283 ---- echo "$author said to" case "$oldstatus" in '') echo "create \`$g'." ;; + n) echo "update newsgroups line for $g" ;; *) case "$newstatus" in m) p=moderated ;; *) p=unmoderated ;; *** checkgroups.pgp Fri Mar 21 21:21:51 1997 --- ctl/checkgroups Fri Mar 21 21:27:51 1997 *************** *** 67,80 **** *) pgpresult=1 ;; esac ! # behead checkgroups article & ignore lines that don't fit the syntax ! # (should just be able to reject tabless lines, but Bitnet buggers that). ! # ignore signatures and initial !mod lines. ! ngalpha='-_+a-zA-Z0-9' ! sed -n -e '1,/^$/d' -e '1{/^!mod$/d;}' -e '/^-- $/,$d' \ ! -e "/^[$ngalpha][ ][ ]*/p" \ ! -e "/^[$ngalpha][$ngalpha.]*[$ngalpha][ ][ ]*/p" \ ! $posting >$desc # generate list of hierarchies affected sed 's/\..*//' $desc | sort -u >$hiers --- 67,100 ---- *) pgpresult=1 ;; esac ! # Behead checkgroups article & ignore headers and initial lines that don't ! # fit the syntax (see son-of-1036). This is permissive insofar as introductory ! # text and signatures should not really occur in a checkgroups message. But ! # if they did and were allowed through severe corruption of the newsgroups ! # file could ensue. As a byproduct, tale's periodic "Checkgroups message ! # (with/without INET groups)" may be piped directly into this script. ! # Also, spaces rather than tabs after the newsgroup name are permitted, but ! # some white space is required. ! # ??? does this raise a problem with Bitnet ??? ! # "Invalidations" (e.g. !mod) are recognised but not acted upon. ! # There is no provision for "encoded words" (see son-of-1036). ! ! ngletgit='a-z0-9' ! ngalpha='-_+a-z0-9' ! if test `awk " ! BEGIN {state = 1} ! /^![$ngletgit][$ngalpha]*(,[$ngletgit][$ngalpha]*)*$/ \ ! {if (state == 1) {state = 2; next} else {state = 3; exit} } ! /^[$ngletgit][$ngalpha]*(\.[$ngletgit][$ngalpha]*)+[ ]+[ -_a-~]*$/ \ ! {state = 2; print > \"$desc\"; next} ! /^$/ {next} ! /^-- $/ {exit} ! {if (state == 2) {state = 3; exit} } ! END {print state}" $posting ` \ ! -ne 2 ! then ! reject=${reject-'ill-formed checkgroups message - edit before resubmitting'} ! fi # generate list of hierarchies affected sed 's/\..*//' $desc | sort -u >$hiers