atom feed3 messages in net.sourceforge.lists.courier-users[courier-users] Re: Setting permissio...
FromSent OnAttachments
mailingMar 26, 2002 12:51 pm 
KennethMar 26, 2002 2:55 pm 
KennethMar 26, 2002 4:27 pm 
Subject:[courier-users] Re: Setting permissions from permissions.dat
From:Kenneth (kr@aikido.com)
Date:Mar 26, 2002 4:27:41 pm
List:net.sourceforge.lists.courier-users

Well it's not really that easy...

Here's a more thoroughly tested version... perl -anF -e '@CF= (undef, oct($F[1]), scalar getpwnam($F[2]), scalar getgrnam($F[3])); chmod ($CF[1], $F[0]); chown ($CF[2], $CF[3], $F[0]) ;' permissions.dat

The undef is so that CF & F have the same values in the same location.

Here's a perl one liner to process permissions.dat. perl -anF -e 'chown ($F[2], $F[3], $F[0]); chmod (oct($F[1]), $F[0]);'

If you're in to more error checking setperms.sh is more elaborate but I didn't see that until after writing this. setperms.sh ignores field 5 which is called special (reserved for future use or something...)

Comments are welcome.