PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > File permissions not preserved with copy function?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
File permissions not preserved with copy function?

Réponse
 
LinkBack Outils de la discussion
Vieux 01/05/2008, 17h43   #1
John Murtari
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut File permissions not preserved with copy function?

Folks,

Just noticed this with PHP 5 on RHEL 4 -- started using
the copy function to move some files around and saw that
executable permissions were being lost? The documentation didn't
say anything about that? Is this a bug or a feature?

Thanks.
--
John
__________________________________________________ _________________
John Murtari Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)
http://thebook.com/
  Réponse avec citation
Vieux 02/05/2008, 11h24   #2
Álvaro G. Vicario
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: File permissions not preserved with copy function?

John Murtari escribió:
> Just noticed this with PHP 5 on RHEL 4 -- started using
> the copy function to move some files around and saw that
> executable permissions were being lost? The documentation didn't
> say anything about that? Is this a bug or a feature?


It sounds sensible. Copying means reading the original file, creating a
new file and dumping contents in the new file. Let's see an extreme example:

-rw-r--r-- root root /usr/share/foo/splash.png

Obviously, john should not be able to create a new file owned by root.
But he should be able to copy the file if he can read the source and has
permissions in the destination directory.

Check these functions:

umask()
stat()
chmod()
chown()
chgrp()


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
  Réponse avec citation
Vieux 02/05/2008, 15h37   #3
Gordon
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: File permissions not preserved with copy function?

On May 1, 5:43 pm, John Murtari <jmurt...@thebook.com> wrote:
> Folks,
>
> Just noticed this with PHP 5 on RHEL 4 -- started using
> the copy function to move some files around and saw that
> executable permissions were being lost? The documentation didn't
> say anything about that? Is this a bug or a feature?
>
> Thanks.
> --
> John
> __________________________________________________ _________________
> John Murtari Software Workshop Inc.
> jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)http://thebook.com/


I would think that it's probably a feature, a copy is basically
creating a new file using the contents of the old as contents. If
user B copied a file owned by user A but which he had permission to
read, then if permissions were copied then the result would be another
file owned by user A. User B may have made a copy of the file
belonging to user A in order to make his own modified version, so if
the permissions were identical then he wouldn't be able to edit his
copy either.
  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 07h21.


É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,09724 seconds with 11 queries