(argh!) Better Trojan horse fix for Rnmail & Pnews

News administrator news at rosevax.Rosemount.COM
Wed Dec 7 01:33:17 AEST 1988


My earlier 'fix' for Rnmail & Pnews failed to check if
the editor being used was vi or ex (you can also add edit if needed).
Here are more forgiving patches...


Rnmail:

*** Rnmail.old	Tue Dec  6 09:29:23 1988
--- Rnmail	Tue Dec  6 09:21:25 1988
***************
*** 200,206 ****
  		;;
  	    esac
  	done
! 	${VISUAL-${EDITOR-$defeditor}} '+set nomodeline' $tmpart $oldart
  	trap "$rescue" 2
  	state=ask
  	;;
--- 200,211 ----
  		;;
  	    esac
  	done
! 	myeditor="`basename ${VISUAL-${EDITOR-$defeditor}}`"
! 	if $test "vi" = "$myeditor" -o "ex" = "$myeditor"; then
! 		${VISUAL-${EDITOR-$defeditor}} '+set nomodeline' $tmpart $oldart
! 	else
! 		${VISUAL-${EDITOR-$defeditor}} $tmpart $oldart
! 	fi
  	trap "$rescue" 2
  	state=ask
  	;;


Pnews:

*** Pnews.old	Tue Dec  6 09:29:15 1988
--- Pnews	Tue Dec  6 09:21:09 1988
***************
*** 317,323 ****
  	    esac
  	done
  	trap : 2
! 	${VISUAL-${EDITOR-$defeditor}} '+set nomodeline' $tmpart $oldart
  	trap "$rescue" 2
  	state=ask
  	;;
--- 317,328 ----
  	    esac
  	done
  	trap : 2
! 	myeditor="`basename ${VISUAL-${EDITOR-$defeditor}}`"
! 	if $test "vi" = "$myeditor" -o "ex" = "$myeditor"; then
! 		${VISUAL-${EDITOR-$defeditor}} '+set nomodeline' $tmpart $oldart
! 	else
! 		${VISUAL-${EDITOR-$defeditor}} $tmpart $oldart
! 	fi
  	trap "$rescue" 2
  	state=ask
  	;;


-----
Merlyn LeRoy
<bong> "start again"



More information about the Comp.unix.wizards mailing list