title: Setting file permissions on contents of tarfile
body: <p>Is there a way to <code>chmod 777</code> the contents of a tarfile upon creation (or shortly thereafter) before distributing?  The write permissions of the directory that's being tar'd is unknown at the time of tar'ing (but typically 555).  I would like the unrolled dir to be world writable without the users who are unrolling the tar to have to remember to <code>chmod -R 777 &lt;untarred dir&gt;</code> before proceeding.</p>
  
  <p>The clumsy way would be to make a copy of the directory, and then <code>chmod -R 777 &lt;copydir&gt;</code> but I was wondering if there was a better solution.</p>
  
  <p>I'm on a Solaris 10 machine.</p>
  
  <p><strong>BACKGROUND:</strong></p>
  
  <p>The root directory is in our ClearCase vob with specific file permissions, recursively. A tarfile is created and distributed to multiple "customers" within our org. Most only need the read/execute permissions (and specifically DON'T want them writable), but one group in particular needs their copy to be recursively writable since they may edit these files, or even restore back to a "fresh" copy (i.e., in their original state as I gave them).</p>
  
  <p>This group is somewhat technically challenged. Even though they have instructions on the "how-to's" of the tarfile, they always seem to forget (or get wrong) the setting of the files to be recursively writable once untarred. This leads to phone calls to me to diagnose a variety of problems where the root cause is that they forgot to do (or did incorrectly) the chmod'ing of the unrolled directory.</p>
  
  <p>And before you ask, yes, I wrote them a script to untar/chmod (specific just for them), but... oh never mind.</p>
  
  <p>So, I figured I'd create a separate, recursively-writable version of the tar to distribute just to them. As I said originally, I could always create a copy of the dir, make the copy recursively writable and then tar up the copy dir, but the dir is fairly large, and disk space is sometimes near full (it can vary greatly), so making a copy of the dir will not be feasable 100% of the time.</p>