On Thursday 03 June 2010 17:04, Larry Ploetz wrote:
> On 6/3/10 8:51 AM, Edmund R. MacKenty wrote:
>> ConvertDirTree()
>> {
>> find "$1" -type f | while read file; do
>> tmp="$file.ic$$"
>> if iconv -f "$2" -t "$3" $file"> "$tmp"&& \
>> chown --reference="$file" "$tmp"&& \
>> chmod --reference="$file" "$tmp; then
>
>This is purely nit-picky, but since you've gone to the trouble of ensuring
> the owner and permissions are the same, you could also throw in (directly
> from the setfacl man page):
>
>getfacl file1 | setfacl --set-file=- file2
>
>Although pax probably doesn't store/restore ACLs anyway...
Good point! Pax's own format supports ACLs, so it would be good to preserve
them too in that function. It could also attempt to replicate SELinux
security contexts:
chcon --reference="$file" "$tmp"
I tend to forget these new-fangled security things. :-)
- MacK.
-----
Edmund R. MacKenty
Software Architect
Rocket Software
275 Grove Street · Newton, MA 02466-2272 · USA
Tel: +1.617.614.4321
Email: [email protected]
Web: www.rocketsoftware.com
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390