Prevent invalid files from being used

See https://bugzilla.redhat.com/show_bug.cgi?id=882094

Signed-off-by: Andy Grover <agrover@redhat.com>