Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Alternative Computing > Linux Support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Linux Support Linux - Operating Systems and Applications Support

Reply
 
LinkBack Thread Tools
Old 10-13-2008, 04:11 PM   #1 (permalink)
Registered User
 
Join Date: Oct 2008
Posts: 2
OS: XP sp2


unzip and retain original ownersip/permissions

Hi all

(first time poster)

I develop on XP but host sites on a Linux VPS. To speed the upload process I zip the site on mp XP machine, ftp the zip file to the server and then SSH to the server and 'unzip' the file.

This works fine most of the time, however in one particular application there are some important permissions that I need retained. XP of course has no specific permissions and therefore unzip applies the default umask and the currently logged on users ownership and group. What I really need is the original ownership of the existing file retained.

Any ideas how this can be done?

Cheers
mc
collingwood is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 10-13-2008, 04:31 PM   #2 (permalink)
Registered User
 
Join Date: Mar 2008
Posts: 82
OS: ubuntu,fedora,opensuse,xp,vista


Re: unzip and retain original ownersip/permissions

I am unsure of what you are asking for? You want the permissions of a zipped windows xp file to go over to an Unix/GNU system to remain the same permission? Or you want a Unix/GNU zipped file permission to remain the same while transing to Windows XP? But as you stated before Window's OS and Unix/GNU's OS has two different permission tree if you will. So, that's an issue already.

As what I have seen in transfering files between the two OSs usally anything from Window's base OS will require a root access to write to the original file. And anything from an Unix/GNU's base OS will be write-able as default.

Hope that helps some,
Sugi

PS: Please reply with more details
Sugi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 10-13-2008, 04:42 PM   #3 (permalink)
Registered User
 
Join Date: Oct 2008
Posts: 2
OS: XP sp2


Re: unzip and retain original ownersip/permissions

Okay - being really specific:

XP file: index.php - no particular permissions
XP zip of index.php to site.zip

FTP site.zip to Linux machine

Linux now has two files:
index.php user7 group2 -rw-rw-r-- (this is the existing file that will be replaced)
site.zip ftpuser group1 -rw-r--r-- (this has been created via ftp)

Linux - now I unzip the site.zip file and I will be overwriting index.php, what I want is:
index.php user7 group2 -rw-rw-r-- (the new file with the same ownership etc)

Linux - but what I get is:
index.php collingwood group1 -rw-r--r-- (the ownership of me currently logged in)

Hope this is clear.

Cheers
mc
collingwood is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 10-13-2008, 07:02 PM   #4 (permalink)
Registered User
 
Join Date: Oct 2007
Location: Littleton, Colorado USA
Posts: 470
OS: xp 64 sp2 Fedora Core 8 (vmware xp core 8 x32) Minix


Re: unzip and retain original ownersip/permissions

Piece of cake!!! Sort-of.

Add group1 to the /etc/group file using /usr/sbin/groupadd.

"/usr/sbin/usermod -G group2 collinswood" (you already belong to group1 because your administrator set that up for you)

If you run the command "groups" you should see that you now belong to two groups "group1" and "group2"

You are going to have to setup "user7" the normal way of adding a new user. To become the new user just do "su - user7" from user "collingwood" and enter the password. Remember that the program "su" is for "set user" not "superuser".

If user7 does not belong to group2 then to change it to the new group enter "newgrp group2" and you are now in the proper group. Test this by using the "touch" command.

It might just be easier to add yourself "collinwood" to both groups (group1 and group2) and run "chmod 664 index.php" and then run "chown user7.group2 index.php". Unix used to allow you to set a file to a group or user to which you didn't belong. Somebody went stupid and fixed this feature! Don't forget the dot between user7 and group2.

Recall that 664 stands for rw-rw-r--. r's are 4's, w's are 2's, and x's are 1's. Just add then up. x stands for the execute bit. Values are grouped into threes.


Hope this helps.

Last edited by lensman3; 10-13-2008 at 07:06 PM. Reason: usermod instead of useradd
lensman3 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 10:08 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85