Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > fr.comp.lang.python > #3428

Re: sudo python PermissionError [Errno 13] Permission denied

From Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid>
Newsgroups fr.comp.lang.python
Subject Re: sudo python PermissionError [Errno 13] Permission denied
Date 2020-12-26 18:47 +0100
Organization Université de Strasbourg
Message-ID <87wnx431dj.fsf@universite-de-strasbourg.fr.invalid> (permalink)
References (3 earlier) <5fdbdbe6$0$3275$426a74cc@news.free.fr> <87a6ubi9ak.fsf@universite-de-strasbourg.fr.invalid> <16c8f5ba-5c7a-4b21-b8e6-fd0f1787449en@googlegroups.com> <875z4viqvy.fsf@universite-de-strasbourg.fr.invalid> <a9a662b3-7c6b-4a91-96d5-bf396a6bc313n@googlegroups.com>

Show all headers | View raw


"pata...@gmail.com" <patatetom@gmail.com> writes:

> seules deux actions sont avancées "rename" et "delete".
> la page de manuel n'en dit pas plus :
>
> $ man chmod
> ...
> RESTRICTED DELETION FLAG OR STICKY BIT
> The restricted deletion flag or sticky bit is a single bit, whose
> interpretation depends on the file type. For directories, it prevents
> unprivileged users from removing or renaming a file in the directory
> unless they own the file or the directory; this is called the
> restricted deletion flag for the directory, and is commonly found on
> world-writable directories like /tmp. For regular files on some older
> systems, the bit saves the program's text image on the swap device so
> it will load more quickly when run; this is called the sticky bit.
> ...
>
> il faudrait peut être y ajouter l'action "modifier" pour être plus
> précis

Ce n'est pas fait parce que rename/delete sont des opérations sur les
répertoires (et donc soumis au sticky bit sur le répertoire englobant),
alors que la modification est une opération sur les fichiers, pour
laquelle il faut disposer du bit "w" pertinent (selon qu'on est le
propriétaire, etc.) *sur le fichier*. Autrement dit :

- on peut avoir le droit de supprimer un fichier qu'on n'a pas le droit
  de modifier (avec "w" sur la dir et pas de "w" sur le fichier)

- on peut avoir le droit de modifier un fichier qu'on n'a pas le droit
  de supprimer (avec "w" sur le fichier et pas de "w" sur la dir)

Le sticky bit ajoute une restriction au premier cas, et
fs.protected_regular (et consorts) ajoute une restriction au second cas.

> et y faire apparaître cette particularité fs.protected_regular...

Effectivement, ce serait mieux que ce truc soit plus mis en avant,
surtout si c'est maintenant le comportement par défaut.

-- Alain.

P/S: comme tu le dis, c'est hors-sujet ici, j'arrête là de répondre dans
ce thread.

Back to fr.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

sudo python PermissionError [Errno 13] Permission denied "pata...@gmail.com" <patatetom@gmail.com> - 2020-12-17 01:56 -0800
  Re: sudo python PermissionError [Errno 13] Permission denied yamo' <yamo@beurdin.invalid> - 2020-12-17 12:16 +0100
    Re: sudo python PermissionError [Errno 13] Permission denied "pata...@gmail.com" <patatetom@gmail.com> - 2020-12-17 04:28 -0800
      Re: sudo python PermissionError [Errno 13] Permission denied Francois Lafont <francois.lafont@nospam.invalid> - 2020-12-17 23:29 +0100
        Re: sudo python PermissionError [Errno 13] Permission denied Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2020-12-18 13:32 +0100
          Re: sudo python PermissionError [Errno 13] Permission denied "pata...@gmail.com" <patatetom@gmail.com> - 2020-12-18 06:03 -0800
            Re: sudo python PermissionError [Errno 13] Permission denied "pata...@gmail.com" <patatetom@gmail.com> - 2020-12-18 06:20 -0800
              Re: sudo python PermissionError [Errno 13] Permission denied Benoit Izac <use.reply.to@INVALID.ADDRESS> - 2020-12-18 18:38 +0100
                Re: sudo python PermissionError [Errno 13] Permission denied Francois Lafont <francois.lafont@nospam.invalid> - 2020-12-19 02:59 +0100
                Re: sudo python PermissionError [Errno 13] Permission denied "pata...@gmail.com" <patatetom@gmail.com> - 2020-12-23 03:12 -0800
            Re: sudo python PermissionError [Errno 13] Permission denied Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2020-12-21 08:01 +0100
              Re: sudo python PermissionError [Errno 13] Permission denied "pata...@gmail.com" <patatetom@gmail.com> - 2020-12-23 03:27 -0800
                Re: sudo python PermissionError [Errno 13] Permission denied Alain Ketterlin <alain@universite-de-strasbourg.fr.invalid> - 2020-12-26 18:47 +0100
                Re: sudo python PermissionError [Errno 13] Permission denied "pata...@gmail.com" <patatetom@gmail.com> - 2021-01-07 07:49 -0800

csiph-web