delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/27/07:35:23

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <408E4596.8080306@x-ray.at>
Date: Tue, 27 Apr 2004 13:35:50 +0200
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7b) Gecko/20040316 MultiZilla/1.5.0.4h
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: restoring facls after restore from tar
References: <Pine DOT LNX DOT 4 DOT 58 DOT 0404261659170 DOT 18755 AT lack DOT ucs DOT indiana DOT edu>
In-Reply-To: <Pine.LNX.4.58.0404261659170.18755@lack.ucs.indiana.edu>
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on hornet.mur.at
X-Spam-Level:
X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.63
X-IsSubscribed: yes
Note-from-DJ: This may be spam

Dick Repasky schrieb:
> Second question: how can I backup facls as part of a tar backup and 
> restore them?

Below some results for: zip, rar, pax, tar, cpio
CYGWIN="ntsec tty server=1 ntea"

I didn't test how they store the uid/username resp. gid/groupname.
As number or as string? With rsync you can control that, but no ACL's.

* ZIP / UNZIP (yes)

cygwin zip does not offer the -! (use privileges (if granted) to obtain 
all aspects of WinNT security), the native windows versions does.
cygwin unzip does offer the -X (restore UID/GID info) command line 
option, but only native unzip offers the true
-X restore ACLs and better -XX => use privileges option.

get the zip copies from a infozip mirror instead. non-us mirrors also 
carry the encryption. such as http://www.info-zip.org/pub/infozip/

$ /cygdrive/u/ZIP/zip-crypt-2.32/zip -h
Copyright (C) 1990-1999 Info-ZIP
Type 'zip "-L"' for software license.
Zip 2.3 (November 29th 1999). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list]
     [-xi list]
The default action is to add or replace zipfile entries from list, which
can include the special name - to compress standard input.
If zipfile and list are omitted, zip compresses stdin to stdout.
-f freshen: only changed files  -u   update: only changed or new files
-d delete entries in zipfile  -m   move into zipfile (delete files)
-r recurse into directories   -j junk (don't record) directory names
-0 store only                 -l convert LF to CR LF (-ll CR LF to LF)
-1   compress faster          -9   compress better
-q   quiet operation          -v   verbose operation/print version info
-c   add one-line comments    -z   add zipfile comment
-@   read names from stdin    -o   make zipfile as old as latest entry
-x   exclude the following names  -i   include only the following names
-F   fix zipfile (-FF try harder) -D   do not add directory entries
-A   adjust self-extracting exe   -J   junk zipfile prefix (unzipsfx)
-T   test zipfile integrity       -X   eXclude eXtra file attributes
-!   use privileges (if granted) to obtain all aspects of WinNT security
-R   PKZIP recursion (see manual)
-$   include volume label         -S   include system and hidden files
-e   encrypt                      -n   don't compress these suffixes

$ /usr/bin/zip -h
Copyright (C) 1990-1999 Info-ZIP
Type 'zip "-L"' for software license.
Zip 2.3 (November 29th 1999). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list]
     [-xi list]
The default action is to add or replace zipfile entries from list, which
can include the special name - to compress standard input.
If zipfile and list are omitted, zip compresses stdin to stdout.
-f   freshen: only changed files  -u   update: only changed or new files
-d   delete entries in zipfile  -m move into zipfile (delete files)
-r   recurse into directories   -j junk (don't record) directory names
-0   store only                 -l convert LF to CR LF (-ll CR LF to LF)
-1   compress faster            -9 compress better
-q   quiet operation            -v verbose operation/print version info
-c   add one-line comments      -z   add zipfile comment
-@   read names from stdin      -o   make zipfile as old as latest entry
-x   exclude the following names  -i   include only the following names
-F   fix zipfile (-FF try harder) -D   do not add directory entries
-A   adjust self-extracting exe   -J   junk zipfile prefix (unzipsfx)
-T   test zipfile integrity       -X   eXclude eXtra file attributes
-y   store symbolic links as the link instead of the referenced file
-R   PKZIP recursion (see manual)
-e   encrypt                      -n   don't compress these suffixes

tests with native zip -! / unzip -XX optained identical facl's.
native unzip -X alone was mangled by different parent directory ACL masks.
Attention: cygwin unzip -XX was the same as native unzip -X,
so it silently dropped the XX and didn't restore the mask and gid's.


* RAR / UNRAR (no)

native rar / unrar offer the -ow switch (Save or restore file owner and 
group)
but after unrar x -ow the directory mask did override the group 
membership, and the mask was just the default one.

* PAX (yes)

I have a native pax which preserves ACL's.
I didn't see a cygwin pax yet, but didn't look for it. And I wouldn't 
trust it too much.

See also http://acl.bestbits.at/pipermail/acl-devel/2000-October/000389.html

* TAR (no)
solaris tar should do it with -p

     "Restore the named files to their  original  modes,  and
     ACLs  if  applicable,  ignoring  the  present umask(1).
     This is the default behavior if invoked  as  super-user
     with  the  x function letter specified.  If super-user,
     SETUID and sticky information are also  extracted,  and
     files  are restored with their original owners and per-
     missions, rather than owned by root.  When  this  func-
     tion  modifier  is  used  with the c function, ACLs are
     created in the tarfile along  with  other  information.
     Errors will occur when a tarfile with ACLs is extracted
     by previous versions of tar."

However cygwin tar -p preserves the mask, ignores the umask,
but does not preserve the gid and any special ACL is dropped.

* CPIO (no)

With the Solaris cpio, the corresponding option is `-P',
that has no meaning in gnu cpio:

  -P  Preserve ACLs.  If the  option  is  used  for
      output,  ACLs  if  existed  are written along
      with other attributes to the standard output.
      ACLs are created as special files with a spe-
      cial file type.  If the option  is  used  for
      input,  ACLs  if  existed are extracted along
      with other attributes  from  standard  input.
      The  option recognizes the special file type.
      Note that errors will occur if a cpio archive
      with  ACLs  is extracted by previous versions
      of cpio.  This option should not be used with
      the  -c  option,  as  ACL  support may not be
      present on all  systems,  and  hence  is  not
      portable.  Use ASCII headers for portability.

unimplemented in cygwin (gnu) cpio

-- 
Reini Urban
http://xarch.tu-graz.ac.at/home/rurban/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019