Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

How to properly change file permissions?

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> How to properly change file permissions? Page: [1]
Login
Message << Older Topic   Newer Topic >>
How to properly change file permissions? - Jul. 8, '05, 12:09:23 PM   
jerker_back

 

Posts: 68
Joined: Jul. 7, '05,
From: Sweden
Status: offline
Hello SFU users,
Thanks for a great support site.
I've been using CygWin for a while but is now trying SFU 3.5. My main objective is to get unix development support tools to work properly (ie GNU make). I'm using a standalone workstation with Windows 2003 SP1 (no Active Directory).

Run in to some problems:
How to properly change file permissions?
I think this is a common problem. I installed SFU using the admin account and then installed some of the /tools packages using your installer with my user account (also in admin group). Bad idea - the file permissions is mixed with the two accounts. Admin and SYSTEM have no access to some of the files. So I tried to fix this (in Windows Explorer) with forcing full permissions and ownership for the admin group for all files and directories in the SFU directory tree. After that, the shell stop working properly. Like this: "/bin/ksh: /etc/profile ignored: improper write permissions". How to fix this without reinstall SFU? Is it a bad idea to change permissions in the Windows Explorer?

Also, files created by interix have the following account:
Unknown account(S-1-5-21-1212173858-3838196392-1508475673-513)
Who is this?

regards Jerker
Post #: 1
RE: How to properly change file permissions? - Jul. 8, '05, 12:53:52 PM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: online
Well, gmake is already available as a package so that should be easy enough.

Being on W2K3 with SP1 you must get the hotfix (see the FAQ) for things to work well.

Don't ever use File Explorer to change permission on a Unix file.
Use chmod for permissions; use chown for ownership/groups.
File Explorer puts ACE's into the ACL that mess things up and it also rearranges
the ACE's in the ACL which is horrid as well. So yes, using File Explorer is a bad idea.

File Explorer has likely mucked up enough file permissions that a reinstall is the best bet.


> Also, files created by interix have the following account:
> Unknown account(S-1-5-21-1212173858-3838196392-1508475673-513)
> Who is this?

I don't know. This is a SID. Who's reporting this SID? (which utility).

For installed tools SYSTEM doesn't need access. The files should have read and write
for the Administrators group (directories having exec as well). Administrator is in
the Administrators group so access should not be a problem.
You need to tell me what the specific problem was you encountered.

The pkg installer is set to allow the Administrator and members of the Administrators group
to add/delete/update packages. Permissions/ownership are set in this context per Unix rules, not
to Win32 rules (which are weird). You may see different owners for some of the files depending on
who range the installer, but all accounts allowed to install can work with this because of the group
setting.

(in reply to jerker_back)
Post #: 2
RE: How to properly change file permissions? - Jul. 8, '05, 1:22:10 PM   
jerker_back

 

Posts: 68
Joined: Jul. 7, '05,
From: Sweden
Status: offline
quote:

File Explorer has likely mucked up enough file permissions that a reinstall is the best bet.

OK, I just thought you had a universal way to fix this with chmod recursivly through the directory tree. Maybe we'll need a handy Win32 utility for interix file permissions?

Hotfix - searched MS: nothing about this. How about put this for download at this site?

Unknown SID:
If you look (in Windows Explorer) at permissions for a file created by interix outside the SFU directory tree, you will see this account (at least I do).

gmake - I put a lot of time trying to compile a fully functional Win32 GNU make with the Microsoft compiler. I think that without a major design change, this is not possible. So, with some interix tweaks, maybe a interix-win32 hybrid would be the answer?

regards Jerker

(in reply to Rodney)
Post #: 3
RE: How to properly change file permissions? - Jul. 8, '05, 2:02:42 PM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: online
> OK, I just thought you had a universal way to fix this with chmod recursivly through the directory tree. Maybe we'll need a
> handy Win32 utility for interix file permissions?

I don't know exactly what you did. There are files that are (or were) marked setuid.
So, yes, you can go to "/ and do a chmod -R but you can't pick a blanket
permission mode. Directories will be executable, some files will be executable, other files
will be read/write only, a few setuid, a few are no-read for other/world. So from hosed
to less-hosed is, still, hosed.

> Hotfix - searched MS: nothing about this. How about put this for download at this site?

You have to contact PSS (MS support) for the hotfix. Tell them you have SFU 3.5 on W2K3/SP1.
PSS wants to track who has the hotfix. We have no redistribution rights.
PSS will want a credit card number, but at the end of it you won't get charged.

> gmake - I put a lot of time trying to compile a fully functional Win32 GNU make with the Microsoft compiler. I think that
> without a major design change, this is not possible. So, with some interix tweaks, maybe a interix-win32 hybrid would be
> the answer?

Why didn't you just download the Win32 version then if you want a Win32 version?
You can find it on the ftp site under "Win32/gmake".
Interix compiles and runs gmake with no/zero changes.

You can use the any of the Interix-based build tools to drive a Win32 build with MSVC.
In the build scripts switch from "cc" to "wcc" (see ftp site "pub"). The you can drive
the build using make, gmake, jam, etc.

> Unknown SID

You see this on the File Explorer's Security panel of Properties?
Usually you will see the proper name from the user database.
Being shown a raw SID implies that a user who has access to the disk
create the file, but the local system cannot access the user database that
has the information on this SID. Likely a standalone machine, not the one
you see this on. Or your machine can't access AD and the information isn't cached.
It's not Interix creating a funky SID. The SID is was came from the process token
which would have been assigned from the LSA when the user logged in.

(in reply to jerker_back)
Post #: 4
RE: How to properly change file permissions? - Jul. 8, '05, 2:52:54 PM   
jerker_back

 

Posts: 68
Joined: Jul. 7, '05,
From: Sweden
Status: offline
chmod - setuid
OK, guess I have to reinstall then. Thanks for advise. Maybe you can write a note in /tools FAQs about this: "Do NOT change file permissions with Windows Explorer unless you know exactly what you are doing!"

quote:

Why didn't you just download the Win32 version then if you want a Win32 version?
You can find it on the ftp site under "Win32/gmake".
Interix compiles and runs gmake with no/zero changes

Win32 GNU make (any versions or build) does not work properly - this is a known issue due to design.

quote:

You can use the any of the Interix-based build tools to drive a Win32 build with MSVC. In the build scripts switch from "cc" to "wcc" (see ftp site "pub"). The you can drive the build using make, gmake, jam, etc.

Thanks a lot, this was exactly my next objective. Have reinstall first though.

regards jerker

(in reply to Rodney)
Post #: 5
RE: How to properly change file permissions? - Jul. 8, '05, 3:26:07 PM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: online
> "Do NOT change file permissions with Windows Explorer unless you know exactly what you are doing!"

I'll send that over to the WebMaster.

(in reply to jerker_back)
Post #: 6
RE: How to properly change file permissions? - Jul. 8, '05, 7:19:27 PM   
mreinig

 

Posts: 1
Joined: Jul. 5, '04,
Status: offline
I too seem to have hosed my systems, I have a 2003 Server and several XP machines. If I reinstall SFU 3.5 will I get all the settings reset to the way they should be or will I need to remove SFU and reinstall it, or are the permissions and owners persistent now and I am doomed?

My biggest problem seems to be that files are created with a "none" group or with "700" permissions and nothing I have tried seems to fix it.

Thanks in advance,

Marc Reinig
Laboratory for Adaptive Optics

(in reply to Rodney)
Post #: 7
RE: How to properly change file permissions? - Jul. 9, '05, 12:23:27 AM   
Rodney

 

Posts: 3714
Joined: Jul. 9, '02,
From: /Tools lab
Status: online
> My biggest problem seems to be that files are created with a "none" group or with "700" permissions
> and nothing I have tried seems to fix it.

Files with a group of "None" are commonly created by users. These files shouldn't cause any
problems. By default, with all Unix/Posix systems, the default group for file creation is
the account's primary group. When you run the "id" command you will see in the output
"gid = ...". This gid is the account's primary group.

System files (e.g. in /bin, /etc or /usr/local/bin) shouldn't have permissions as tight as 700
(except for the /etc/sudoers which should be at 400). System files are usually 775 or 664.
However, private files for a user having mode 700 should not be a problem to the owner.
Regardless of the mode the owner always retains the right to change the permission mode.

Now you didn't say which files are causing a problem or why it is causing a problem.
So I don't know if you are "doomed" or not. If it's a "small" set of files then you
may want to just seek these ones out and deal with it directly as the "Administrator"
account. Administrator on Interix has pretty-near the same powers as root on Unix;
ownership/groups and permissions can be clobbered. Other accounts do not have this power.

Reinstalling will certainly reset things. To me reinstalling usually means remove the current
and then install again. There is the "repair" option with the SFU installer -- is that what
you are meaning to refer to?. You may want to try it. I haven't used it.

In the long term you may want to look at the mtree utility.
This is a good way to get a snapshot of the Interix filesystem hierarchy for permissions.
Mtree allows you to take a snapshot and then make a comparison later.
It also keeps track of ownership, groups and timestamps. Content changes are noticed too.
It's often used by Unix admins to detect when someone has been doing some admin work
and not put permissions back correctly, or that some nefarious sort has been poking around.
And lastly it does have its '-U' and '-u' options to restore things back to the snapshot
for permissions, owner, group, ... but it can't doing anything about content of course.
This can be installed from the /Tools warehouse and then you can read the fine details
on the manual page.

< Message edited by Rodney -- Jul. 9, '05, 12:41:58 AM >

(in reply to mreinig)
Post #: 8
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> How to properly change file permissions? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047