[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] SELinux support

From: Karel Klic
Subject: [PATCH] SELinux support
Date: Tue, 02 Mar 2010 20:36:07 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100225 Fedora/3.0.2-1.fc12 Thunderbird/3.0.2


I have created patches that add basic SELinux support into Emacs.

Currently, if you have SELinux enabled, and you edit a file and then store it, the backup file (with the tilde) gets the proper SELinux context but the real file loses it. That is caused by "backup by renaming". If you set "backup-by-copying" variable to non-nil, the file you edited preserves the correct context after saving, but the backup file gets the default context (it should get the context of the original file).

This causes a lot of problems when editing config files on machines with SELinux enabled.

The attached patches modify Emacs so that it preserves SELinux context of edited files.
- emacs-1-selinux-config changes the build system to support libselinux
- emacs-2-selinux-get-set-context-fun adds two new functions
  file-selinux-context and set-file-selinux-context
- emacs-3-selinux-backups-on-save modifies the buffer saving functions
  to handle SELinux context

The patch can be applied against a recent version of the repository.

Best regards,
Karel Klic

Attachment: emacs-1-selinux-config.patch
Description: Text Data

Attachment: emacs-2-selinux-get-set-context-fun.patch
Description: Text Data

Attachment: emacs-3-selinux-backups-on-save.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]