PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > chmod 670
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

chmod 670

Réponse
 
LinkBack Outils de la discussion
Vieux 13/11/2007, 16h50   #1
Patricio Rojo
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut chmod 670

Hi,

I don't know whether this is a bug or it is expected behavior. If
this is a bug I would appreciate someone telling me who to report it
to...


I recently noticed that strange things happen if you do 'chmod 670' on
a directory that you own, and whose group is set to one you belong.

- If you try 'ls', then its contents are shown
- If you try 'cd' to it, you get permission denied.
- If you try 'ls -l', you get many interrogation signs (?????) instead
of the properties of the file.
- If the user is changed to someone other than you, but the group
remains the same, then you get full access.

Since the permissions are set to full access to the group, and I'm
part of that group, shouldn't I get full access to the directory?
Anyways, getting many '????' is very awkward.

Thank you very much!

Patricio


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 13/11/2007, 20h30   #2
Owen Townend
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670


On Tue, 2007-11-13 at 13:25 -0300, Patricio Rojo wrote:
> Hi,
>
> I don't know whether this is a bug or it is expected behavior. If
> this is a bug I would appreciate someone telling me who to report it
> to...
>
>
> I recently noticed that strange things happen if you do 'chmod 670' on
> a directory that you own, and whose group is set to one you belong.
>
> - If you try 'ls', then its contents are shown
> - If you try 'cd' to it, you get permission denied.
> - If you try 'ls -l', you get many interrogation signs (?????) instead
> of the properties of the file.
> - If the user is changed to someone other than you, but the group
> remains the same, then you get full access.
>
> Since the permissions are set to full access to the group, and I'm
> part of that group, shouldn't I get full access to the directory?
> Anyways, getting many '????' is very awkward.
>
> Thank you very much!
>
> Patricio
>
>


Hey,
It's my understanding that it is a linear check for permission. UID,
then GID, then world permissions stopping at a match rather than
aggregating the three. This would explain the behaviour.

cheers,
Owen.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 13/11/2007, 20h50   #3
Andrew Sackville-West
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670

On Wed, Nov 14, 2007 at 07:22:45AM +1100, Owen Townend wrote:
>
> On Tue, 2007-11-13 at 13:25 -0300, Patricio Rojo wrote:
> > Hi,
> >
> > I don't know whether this is a bug or it is expected behavior. If
> > this is a bug I would appreciate someone telling me who to report it
> > to...
> >
> >
> > I recently noticed that strange things happen if you do 'chmod 670' on
> > a directory that you own, and whose group is set to one you belong.
> >
> > - If you try 'ls', then its contents are shown
> > - If you try 'cd' to it, you get permission denied.
> > - If you try 'ls -l', you get many interrogation signs (?????) instead
> > of the properties of the file.



can you provide the exact output from ls -l? Usually, ???????
indicates some kind of filesystem damage.

A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHOg3NaIeIEqwil4YRAtfMAJ9jrPvBdV5OG0jXbAUgwF OMyQcyIgCeLlS9
XyFHs+dm6IdVAoki3nQa5QY=
=STRT
-----END PGP SIGNATURE-----

  Réponse avec citation
Vieux 14/11/2007, 01h30   #4
Raj Kiran Grandhi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670

Patricio Rojo wrote:
> Hi,
>
> I don't know whether this is a bug or it is expected behavior. If
> this is a bug I would appreciate someone telling me who to report it
> to...
>
>
> I recently noticed that strange things happen if you do 'chmod 670' on
> a directory that you own, and whose group is set to one you belong.
>
> - If you try 'ls', then its contents are shown
> - If you try 'cd' to it, you get permission denied.
> - If you try 'ls -l', you get many interrogation signs (?????) instead
> of the properties of the file.
> - If the user is changed to someone other than you, but the group
> remains the same, then you get full access.
>
> Since the permissions are set to full access to the group, and I'm
> part of that group, shouldn't I get full access to the directory?
> Anyways, getting many '????' is very awkward.
>


Is there some reason why you would "chmod 670" and not "chmod 770"?


--
Raj Kiran Grandhi


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 14/11/2007, 03h10   #5
Owen Townend
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670


On Tue, 2007-11-13 at 12:49 -0800, Andrew Sackville-West wrote:
> On Wed, Nov 14, 2007 at 07:22:45AM +1100, Owen Townend wrote:
> >
> > On Tue, 2007-11-13 at 13:25 -0300, Patricio Rojo wrote:
> > > Hi,
> > >
> > > I don't know whether this is a bug or it is expected behavior. If
> > > this is a bug I would appreciate someone telling me who to report it
> > > to...
> > >
> > >
> > > I recently noticed that strange things happen if you do 'chmod 670' on
> > > a directory that you own, and whose group is set to one you belong.
> > >
> > > - If you try 'ls', then its contents are shown
> > > - If you try 'cd' to it, you get permission denied.
> > > - If you try 'ls -l', you get many interrogation signs (?????) instead
> > > of the properties of the file.

>
>
> can you provide the exact output from ls -l? Usually, ???????
> indicates some kind of filesystem damage.
>
> A


Hey,
I'm running Ubuntu 7.10 and was able to reproduce the behaviour.
Also got the same result on my Etch box.

owen@mattimeo:~/TMP$ mkdir one; touch one/a one/b one/c;

owen@mattimeo:~/TMP$ ls -l
total 8
drwxr-xr-x 3 owen owen 4096 2007-09-02 00:29 one

owen@mattimeo:~/TMP$ ls -l one
total 4
-rw-r--r-- 1 owen owen 0 2007-09-02 00:29 a
-rw-r--r-- 1 owen owen 0 2007-09-02 00:29 b
-rw-r--r-- 1 owen owen 0 2007-09-02 00:29 c

owen@mattimeo:~/TMP$ chmod 670 one

owen@mattimeo:~/TMP$ ls -l one
total 0
?--------- ? ? ? ? ? one/a
?--------- ? ? ? ? ? one/b
?--------- ? ? ? ? ? one/c

owen@mattimeo:~/TMP$ ls -l
total 8
drw-rwx--- 3 owen owen 4096 2007-09-02 00:29 one

owen@mattimeo:~/TMP$ uname -a
Linux mattimeo 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007
i686 GNU/Linux

For kicks I booted a FreeBSD 6.2 VM and the behaviour was similar:

$ ls -l one
ls: a: Permission denied
ls: b: Permission denied
ls: c: Permission denied
total 0

cheers,
Owen.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 14/11/2007, 05h20   #6
s. keeling
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670

Raj Kiran Grandhi <grajkiran@gmail.com>:
>
> Is there some reason why you would "chmod 670" and not "chmod 770"?


To cause filesystem breakage? :-) It's not a bright thing to do.
Users do a lot of not bright things. We should know what's going to
happen when they do this.

It's interesting phenomena, so far, apparently repeatable by others.
I await further reports.


--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://blinkynet.net/comp/uip5.html Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 14/11/2007, 05h20   #7
s. keeling
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670

Owen Townend <bowbowbow@optushome.com.au>:
>
> On Tue, 2007-11-13 at 13:25 -0300, Patricio Rojo wrote:
> >
> > I recently noticed that strange things happen if you do 'chmod 670' on
> > a directory that you own, and whose group is set to one you belong.
> >
> > - If you try 'ls', then its contents are shown
> > - If you try 'cd' to it, you get permission denied.


You need execute permission on a dir to do anything to it. Without
it, you can still access files in it if you know the files' names.

> > - If you try 'ls -l', you get many interrogation signs (?????) instead
> > of the properties of the file.
> > - If the user is changed to someone other than you, but the group
> > remains the same, then you get full access.
> >
> > Since the permissions are set to full access to the group, and I'm
> > part of that group, shouldn't I get full access to the directory?
> > Anyways, getting many '????' is very awkward.

>
> It's my understanding that it is a linear check for permission. UID,


Agreed. User (ugo) doesn't have x, fail.

> then GID, then world permissions stopping at a match rather than
> aggregating the three. This would explain the behaviour.



--
Any technology distinguishable from magic is insufficiently advanced.
(*) http://blinkynet.net/comp/uip5.html Linux Counter #80292
- - http://www.faqs.org/rfcs/rfc1855.html Please, don't Cc: me.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 14/11/2007, 12h40   #8
Gabor Gombas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670

On Tue, Nov 13, 2007 at 01:25:35PM -0300, Patricio Rojo wrote:

> - If you try 'ls', then its contents are shown


Yes, because you have read permission.

> - If you try 'cd' to it, you get permission denied.


Yes, because you do not have search ("x") permission.

> - If you try 'ls -l', you get many interrogation signs (?????) instead
> of the properties of the file.


Yes, because you do not have search ("x") permission, so "ls" can not
get the requested information, but it still has to display _something_.

> - If the user is changed to someone other than you, but the group
> remains the same, then you get full access.


Yes, because group permission bits are used only if you are _not_ the
owner of the file.

> Anyways, getting many '????' is very awkward.


No, specifying "rw-" rights for a directory what is awkward. You get
what you've asked for.

Gabor

--
---------------------------------------------------------
MTA SZTAKI Computer and Automation Research Institute
Hungarian Academy of Sciences
---------------------------------------------------------


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 14/11/2007, 18h20   #9
Andrew Sackville-West
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: chmod 670

On Wed, Nov 14, 2007 at 02:08:12PM +1100, Owen Townend wrote:
>
> On Tue, 2007-11-13 at 12:49 -0800, Andrew Sackville-West wrote:


.....
> >
> > can you provide the exact output from ls -l? Usually, ???????
> > indicates some kind of filesystem damage.
> >

.....
> I'm running Ubuntu 7.10 and was able to reproduce the behaviour.
> Also got the same result on my Etch box.
>


yeah, I was wrong. Others have provided good explanations in this
thread.
A

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHOzu7aIeIEqwil4YRAsaIAJ0dnZlYTkQ+iZta4e2b07 aIhDeDCgCfZTvS
89s1vwAOk0+No/TH0RVpS74=
=1i+6
-----END PGP SIGNATURE-----

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h21.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,23688 seconds with 17 queries