CFEngine layer
Table of ContentsClose
1 Description
This layer makes working with CFEngine policy easier:
- Syntax highlighting
- On the fly syntax checks (via
syntax-checking
layer) - Auto completion (via
auto-completion
layer)
2 Install
Add cfengine
to the dotspacemacs-configuration-layers
in your ~/.spacemacs
to use this layer.
3 Configuration
3.1 Set file permission on save
Here is a function to set permissions to 600 on save, this can help avoid errors like:
File ./example.cf (owner 1000) is writable by others (security exception)
(defun cfengine-permissions-policy-owner-only () "If file starts with a shebang, make `buffer-file-name' executable" (save-excursion (set-file-modes buffer-file-name #o600) (message (concat "Made " buffer-file-name " accessibly only by the owner (600).")))) (add-hook 'after-save-hook 'cfengine-permissions-policy-owner-only nil 'make-it-local)