//
// Safety Properties for Tar
//
property TarNoOverWrite { // no existing files may be overwritten
requires RecordArgs, FileNames;
check RFileSystem.openOverwrite (file: RFile) {
String fname;
fname = file.getName ();
if (RSystem.commandArgsContains ("-c")) {
if (fname.endsWith (".tar")) {
; // okay to overwrite .tar files
} else {
violation ("Attempt to write over existing file: " + fname);
}
} else {
violation ("Attempt to write over existing file: " + fname);
}
}
}
Naccio Home Page
University of Virginia, Computer Science