Semantics-Aware Understanding and Handling of Security and Privacy Problems in Smart Environments