dimanche 4 janvier 2015

Quick copy (instead of move) for permissions


I am:



  • user: userA

  • groups: ... users ...


I see:



.
└── [drwxrwsr-x userB users ] testdir
├── [-rw-rw-r-- userB users ] testfile1


I can run cp testfile1 testfile2; rm testfile1 to get:



.
└── [drwxrwsr-x userB users ] testdir
└── [-rw-r--r-- userA users ] testfile2


So if I have the following abilities



  • read testfile1

  • delete testfile1

  • create testfile2 with different permissions


and because cp must read & recreate the file (I/O intensive), why can't I just mv testfile1 testfile2 without preserving permissions? Or is it possible that I don't know how?


For backstory read Can I allow users to chmod a file not owned by them?



Aucun commentaire:

Enregistrer un commentaire