another fcopy feature request -k --keep-modes

Michael Tautschnig tautschn at model.in.tum.de
Thu Dec 7 11:05:35 CET 2006


> 
> sometimes i don't care about the owner:group:modes:timestamp
> example /etc/ssh/sshd_config. I just want to copy my content 
> to /etc/ssh/sshd_config, but owner, group and modes should be kept.
> 
> Of course i can add -m but then i need to know the correct permissions and 
> ownership of each file i want to change.
> 
> I just want to copy a new file and KEEP the original file modes and 
> ownerships. with fcopy you have -m -M or modes from source file. 
> 
> but It would be nice to have 
> 
>   -k  --keep-modes[=owner,group,modes,time]
>   to keep all or named file stats from the original file  
> 
> i can write a patch if it sounds reasonable.
>

Sorry for leaving this one open for so long, but I'd like to add a few comments
here:

- Of course, this is indeed something useful and a fully acknowledge your
  reasoning.
- BUT: I'm fearing a real overload of fcopy with more and more options for each
  and every need. This will likely irritate users.
- Adding more and more code to fcopy makes it prone to even more bugs and harder
  to fix any of them.
- I guess one can implement your idea in a simple preinst script, which will
  work as soon as your permission-patch gets included:

preinst:
-------------------------------------------------------------------------------
#!/bin/sh

chmod --reference=$FAI_ROOT/etc/ssh/sshd_config $2
-------------------------------------------------------------------------------

Surely, this is a bit clumsy and not as flexible as =owner,group.modes,time, but
- it is simple
- won't confuse anybody

HTH,
Michael


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20061207/a9127699/attachment.bin 


More information about the linux-fai mailing list