Numbers Ownership after tarring

Mark Sargent powderkeg at snow.email.ne.jp
Fri Apr 15 03:20:18 UTC 2005


Matthew Miller wrote:

>On Fri, Apr 15, 2005 at 11:35:56AM +0900, Mark Sargent wrote:
>  
>
>>>GNUtar has an --owner=USER option if you want to set the ownership as
>>>the archive is created, and when files are extracted by root it should
>>>default to setting the file ownership to match the user named in the
>>>source if a matching user name exists on the destination system. Perhaps
>>>the users didn't exist at the time of extraction so the numeric uids
>>>were used instead.
>>>      
>>>
>>yes, yes, that's what I thought it should do. Funny, when extracting as 
>>root, it gave those weird numbers as ownership. Where as, I was sure it 
>>should give the ownership as root, as I was extracting as root. Am I 
>>correct in my understanding of how it should work.? Cheers.
>>    
>>
>
>The message you replied to explains exactly how it works. If you're not
>root, it can't make files belonging to someone else (that would be a
>security breach). But if you *are* root, it does.
>
>  
>
Hi All,

ok, as a test.

[root at localhost snort]# tar --directory=/ --owner=root -xzvf 
snort-2.3.2.tar.gz

and the result of ls -alh for the created dir

[root at localhost snort]# ls -alh /snort-2.3.2
total 728K
drwxrwxrwx  10 1212 1212 4.0K Mar 11 07:04 .
drwxr-xr-x  25 root root 4.0K Apr 15 12:15 ..
-rw-r--r--   1 1212 1212  34K Mar 11 07:02 aclocal.m4
-rw-r--r--   1 1212 1212 151K Mar 11 07:00 ChangeLog
-rwxr-xr-x   1 1212 1212  38K Mar 15  2002 config.guess
-rw-r--r--   1 1212 1212 4.0K Mar 11 07:04 config.h.in
-rwxr-xr-x   1 1212 1212  29K Mar 15  2002 config.sub
-rwxr-xr-x   1 1212 1212 260K Mar 11 07:02 configure
-rw-r--r--   1 1212 1212  24K Mar 11 06:35 configure.in
drwxrwxrwx   2 1212 1212 4.0K Mar 11 07:04 contrib
-rw-r--r--   1 1212 1212  18K Aug  7  2000 COPYING
-rwxr-xr-x   1 1212 1212  12K Jul 29  2002 depcomp
drwxrwxrwx   3 1212 1212 4.0K Mar 11 07:04 doc
drwxrwxrwx   2 1212 1212 4.0K Mar 11 07:04 etc
-rwxr-xr-x   1 1212 1212 5.5K Aug  7  2000 install-sh
-rw-r--r--   1 1212 1212  18K Dec 15  2001 LICENSE
-rw-r--r--   1 1212 1212  481 Nov 11 08:20 Makefile.am
-rw-r--r--   1 1212 1212  15K Mar 11 07:02 Makefile.in
-rwxr-xr-x   1 1212 1212 8.7K Mar 15  2002 missing
-rwxr-xr-x   1 1212 1212  733 Oct 21  2003 mkinstalldirs
-rw-r--r--   1 1212 1212 5.3K Mar 11 07:02 RELEASE.NOTES
drwxrwxrwx   2 1212 1212 4.0K Mar 11 07:04 rpm
drwxrwxrwx   2 1212 1212 4.0K Mar 11 07:04 rules
drwxrwxrwx   2 1212 1212 4.0K Mar 11 07:04 schemas
-rw-r--r--   1 1212 1212  22K Feb 24  2004 snort.8
drwxrwxrwx   8 1212 1212 4.0K Mar 11 07:04 src
drwxrwxrwx   2 1212 1212 4.0K Mar 11 07:04 templates
-rwxr-xr-x   1 1212 1212 1.8K Nov 11 09:18 verstuff.pl
 
Shouldn't it being showing root as the owner..? Cheers.

Mark Sargent.




More information about the users mailing list