unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs and SELinux contexts
@ 2010-06-07  6:39 Suvayu Ali
  2010-06-07  9:58 ` Juanma Barranquero
  0 siblings, 1 reply; 5+ messages in thread
From: Suvayu Ali @ 2010-06-07  6:39 UTC (permalink / raw)
  To: Emacs mailing list

Hi everyone,

I have noticed something with emacs on GNU/Linux systems. When you edit 
something with Emacs, the SELinux  context of the file doesn't stay 
preserved. This could be an issue when you edit configuration or policy 
files as root. A system setting file usually has a context like this,

system_u:object_r:usr_t:s0

but upon editing with Emacs it changes to

unconfined_u:object_r:usr_t:s0

I don't know how severe this is but maybe its worth looking at? 
Specially when this problem is absent for other editors. I tried this 
with nano, vim and  mousepad. None of them had this issue. Can this be 
filed as a bug? Where would be the appropriate place to file this? The 
Emacs bugzilla or the bugzilla for my distribution?

Thanks for any suggestions.

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Emacs and SELinux contexts
       [not found] <mailman.22.1275892792.30245.help-gnu-emacs@gnu.org>
@ 2010-06-07  7:10 ` Glenn Morris
  2010-06-07 16:27 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2010-06-07  7:10 UTC (permalink / raw)
  To: help-gnu-emacs

Suvayu Ali wrote:

> I have noticed something with emacs on GNU/Linux systems. When you
> edit something with Emacs, the SELinux  context of the file doesn't
> stay preserved.

This feature is present in the Emacs Bzr trunk, ie will be in Emacs 24.1.
See etc/NEWS for more details.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Emacs and SELinux contexts
  2010-06-07  6:39 Suvayu Ali
@ 2010-06-07  9:58 ` Juanma Barranquero
  2010-06-07 14:48   ` Suvayu Ali
  0 siblings, 1 reply; 5+ messages in thread
From: Juanma Barranquero @ 2010-06-07  9:58 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: Emacs mailing list

On Mon, Jun 7, 2010 at 08:39, Suvayu Ali <fatkasuvayu+linux@gmail.com> wrote:

> I have noticed something with emacs on GNU/Linux systems. When you edit
> something with Emacs, the SELinux  context of the file doesn't stay
> preserved. This could be an issue when you edit configuration or policy
> files as root. A system setting file usually has a context like this,

The etc/NEWS currently on the Emacs repository has this:

  ** Basic SELinux support has been added.
  This requires Emacs to be linked with libselinux at build time.

  *** Emacs preserves the SELinux file context when backing up, and
  optionally when copying files. To this end, copy-file has an extra
  optional argument, and backup-buffer and friends include the SELinux
  context in their return values.

  *** The new functions file-selinux-context and set-file-selinux-context
  get and set the SELinux context of a file.

  *** Tramp offers handlers for file-selinux-context and
set-file-selinux-context
  for remote machines which support SELinux.

so (some) SELinux support will be included on 24.1. Unfortunately,
that will likely be many months from now.

If you need that support now you can try building Emacs directly from
the current development sources.

    Juanma



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Emacs and SELinux contexts
  2010-06-07  9:58 ` Juanma Barranquero
@ 2010-06-07 14:48   ` Suvayu Ali
  0 siblings, 0 replies; 5+ messages in thread
From: Suvayu Ali @ 2010-06-07 14:48 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Emacs mailing list

On Monday 07 June 2010 02:58 AM, Juanma Barranquero wrote:
> On Mon, Jun 7, 2010 at 08:39, Suvayu Ali<fatkasuvayu+linux@gmail.com>  wrote:
>
>> I have noticed something with emacs on GNU/Linux systems. When you edit
>> something with Emacs, the SELinux  context of the file doesn't stay
>> preserved. This could be an issue when you edit configuration or policy
>> files as root. A system setting file usually has a context like this,
>
> The etc/NEWS currently on the Emacs repository has this:
>
>    ** Basic SELinux support has been added.
>    This requires Emacs to be linked with libselinux at build time.
>
>    *** Emacs preserves the SELinux file context when backing up, and
>    optionally when copying files. To this end, copy-file has an extra
>    optional argument, and backup-buffer and friends include the SELinux
>    context in their return values.
>
>    *** The new functions file-selinux-context and set-file-selinux-context
>    get and set the SELinux context of a file.
>
>    *** Tramp offers handlers for file-selinux-context and
> set-file-selinux-context
>    for remote machines which support SELinux.
>
> so (some) SELinux support will be included on 24.1. Unfortunately,
> that will likely be many months from now.
>
> If you need that support now you can try building Emacs directly from
> the current development sources.
>

Thank you very much, Juanma. :)

>      Juanma


-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Emacs and SELinux contexts
       [not found] <mailman.22.1275892792.30245.help-gnu-emacs@gnu.org>
  2010-06-07  7:10 ` Emacs and SELinux contexts Glenn Morris
@ 2010-06-07 16:27 ` Stefan Monnier
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2010-06-07 16:27 UTC (permalink / raw)
  To: help-gnu-emacs

> I have noticed something with emacs on GNU/Linux systems. When you edit
> something with Emacs, the SELinux  context of the file doesn't stay
> preserved. This could be an issue when you edit configuration or policy

As mentioned, there is improved support in the trunk (i.e. for
Emacs-24), but since this won't be released in the near future, maybe
playing around with backup-by-copying and some of its friends will let
you work around the problem in the mean time.


        Stefan


PS: I say "maybe" because I know nothing about SELinux.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-07 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.22.1275892792.30245.help-gnu-emacs@gnu.org>
2010-06-07  7:10 ` Emacs and SELinux contexts Glenn Morris
2010-06-07 16:27 ` Stefan Monnier
2010-06-07  6:39 Suvayu Ali
2010-06-07  9:58 ` Juanma Barranquero
2010-06-07 14:48   ` Suvayu Ali

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).