Safety Property: NoObserveProperties

property NoObserveProperties {
  check RSystem.observeProperty (key: String) {
    // We need to check that system initialization has finished, since
    // it has to observe some properties.  (Perhaps, we should change
    // the pfi so they don't count as observeProperty operations.)
    if (key.equals ("java.compiler")
        || key.equals ("file.separator")
        || key.equals ("path.separator")) {
      ; 
      // allow a couple harmless (?) properties to be observed
      // they aren't really harmless --- they reveal information about
      // the host operating system.
    } else {   
      if (naccio.library.NCheck.isInitialized ()) {
        violation ("Attempt to observe property: " + key + " / " +
                   key.equals ("java.compiler"));
      }
    }
  }

  check RSystem.observeAllProperties () {
    violation ("Attempt to observe properties");
  }
}

About this file

Naccio Home Page
David Evans
University of Virginia, Computer Science