Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'root': 0.04; 'method.': 0.05; 'retrieved': 0.05; '*not*': 0.07; 'assign': 0.07; 'extracted': 0.07; 'command.': 0.09; 'preserve': 0.09; 'received:internal': 0.09; 'library': 0.15; 'dec': 0.15; '"member"': 0.16; 'archives.': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'overriding': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:mail.srv.osa': 0.16; 'received:messagingengine.com': 0.16; 'received:nyi.mail.srv.osa': 0.16; 'received:osa': 0.16; 'received:srv.osa': 0.16; 'tarfile': 0.16; 'wrote:': 0.17; 'documented': 0.17; 'module': 0.19; '(on': 0.22; 'specified': 0.23; 'user.': 0.23; 'header:In-Reply-To:1': 0.25; 'creating': 0.26; 'archives': 0.29; 'tar': 0.29; 'class': 0.29; "i'm": 0.29; 'expect': 0.31; 'file': 0.32; 'anywhere': 0.33; 'extract': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'pm,': 0.35; 'skip:u 20': 0.36; 'but': 0.36; 'should': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'some': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'list,': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'header:Message-Id:1': 0.62; '30,': 0.62; 'between': 0.63; 'behavior': 0.64; 'dear': 0.66; 'computers': 0.69; 'stated': 0.69; 'user,': 0.69; 'hoping': 0.72; '01:57': 0.84; 'cole': 0.84; 'computers.': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=letterboxes.org; h=message-id:from:to:mime-version:content-transfer-encoding :content-type:in-reply-to:references:subject:date; s=mesmtp; bh= 5THyzQK+bngVnAPDWYw6418nsTM=; b=wWPQ2bVU67Op03AXraJLR4pzS9NWzRSt ZJUST0pqqODHrHRxQXXY+ZwOSBgVrd/WeIau6I6IA7CC0kaRbzmXdQiJZPfXCRbt AHjnCMbcVvol0bucAkyXMoJxS35YigUE//RcwwA2cRel0/7BuIREimanjZPToBCB kHCSXwTxyI8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=5THyzQK+bngVnAPDWYw6418nsTM=; b=s33 1moyf2NMl6XGnEy1IQNr18nRVY64TqRXhy5aKRmxn8dzY/sCligc+lUUXkn4bQY0 RE7d06O6fd526gwAGs+j6pv1DLkOUdpXih/qxb3Nqg2G3lIxDYImBeR9Q1fLP1xU razZe2dAfNv/NISwfFpDHnPZWL+OmTeLlmsG9PSo= X-Sasl-Enc: M/+Q81nvPdhQcsdAssNry9SRZL2y6KLxLXUySwFzN22O 1356898025 From: Albert Hopkins To: python-list@python.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: multipart/alternative; boundary="_----------=_1356898025243066"; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-33d24f93 In-Reply-To: References: Subject: Re: Tarfile and usernames Date: Sun, 30 Dec 2012 15:07:05 -0500 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 76 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356898033 news.xs4all.nl 6881 [2001:888:2000:d::a6]:55445 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35810 This is a multi-part message in MIME format. --_----------=_1356898025243066 Content-Transfer-Encoding: 7bit Content-Type: text/plain On Sun, Dec 30, 2012, at 01:57 PM, Nicholas Cole wrote: Dear List, I'm hoping to use the tarfile module in the standard library to move some files between computers. I can't see documented anywhere what this library does with userids and groupids. I can't guarantee that the computers involved will have the same users and groups, and would like the archives to be extracted so that the files are all owned by the extracting user. Essentially, I do *not* with to preserve the owner and groups specified in the archives. Each "member" in the tar file has misc. metadata associated with it, which can be retrieved with the get_info() method. You can add/modify this metadata if creating a TarFile. However, it should be stated that by default (on *nix anyway) if the user is not root then user/groups are assigned to the user exctracting the file (because only root can assign userids/non-member-groups). The TarFile extract*() methods pretty much inherit the same behavior as the *nix tar command. So if you are extracting as a non-root user, you should expect the same behavoir. If you are extracting as root but don't want to change user/groups may have to extract it manually or create your own class by inheriting TarFile and overriding the .chown() method. -a --_----------=_1356898025243066 Content-Transfer-Encoding: 7bit Content-Type: text/html
 
 
 
On Sun, Dec 30, 2012, at 01:57 PM, Nicholas Cole wrote:
Dear List,
 
I'm hoping to use the tarfile module in the standard library to move some files between computers. 
 
I can't see documented anywhere what this library does with userids and groupids.  I can't guarantee that the computers involved will have the same users and groups, and would like the archives to be extracted so that the files are all owned by the extracting user. 
 
Essentially, I do *not* with to preserve the owner and groups specified in the archives.
 
Each "member" in the tar file has misc. metadata associated with it, which can be retrieved with the get_info() method.  You can add/modify this metadata if creating a TarFile.
 
However, it should be stated that by default (on *nix anyway) if the user is not root then user/groups are assigned to the user exctracting the file (because only root can assign userids/non-member-groups).   The TarFile extract*() methods pretty much inherit the same behavior as the *nix tar command.  So if you are extracting as a non-root user, you should expect the same behavoir.  If you are extracting as root but don't want to change user/groups may have to extract it manually or create your own class by inheriting TarFile and overriding the .chown() method.
 
-a
--_----------=_1356898025243066--