This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setup/symlinks/gcc/chown question


Hi All...

I see the broken links on any machine I use. I run as a restricted user, except when I am installing or updating software. Here is the way I do the initial install (to prevent permissions leaks)...

define CYGWIN=tty for system

add C:\Cygwin\bin to PATH for system

create C:\Cygwin directory

set C:\Cygwin ownership and full access for administrators
 and disable inheriting permissions from C:\

install Cygwin with setup.exe

.
.
.

Then each time that I update using setup, I have to reset the permissions (and mount points-I use system mounts, binary for all except cygdrive, which is text). So after running setup each time, I run this script (with no services running)

#!/bin/bash

echo Setting up Cygwin mount points
cygwin-mount-points             <<----  This works fine

echo "Globally changing ownership and permissions (except /dev /home /proc)"
cd /
chown administrators.none .
chmod 0755 .
for item in /* ; do
if [ "$item" != /dev -a "$item" != /proc ]; then
if [ -d "$item" ]; then
if [ "$item" != /home ]; then
chmod -R 0755 "$item" > /dev/null 2>&1
chown -R administrators.none "$item"
chmod -R 0555 "$item" <<---- this is a workaround for the symlink problem
chmod -R 0755 "$item"
fi
else
chown administrators.none "$item"
chmod 0755 "$item"
fi
fi
done


echo Fixing up /etc
rm -f /etc/ssh_host_key
rm -f /etc/ssh_host_key.pub
rm -f /etc/ssh_host_dsa_key
rm -f /etc/ssh_host_dsa_key.pub
chmod 0600 /etc/ssh*
chown system.none /etc/ssh*

echo Fixing up /home
chown administrators.none /home
chmod 0755 /home

echo Fixing up /tmp
chmod 1777 /tmp
rm -fr /tmp/* >/dev/null 2>&1

echo Fixing up /var
chown system.none /var/empty
chmod 1777 /var/log
rm -f /var/log/agent*.log
chmod 0777 /var/log/lastlog
rm -f /var/log/OpenSSH.log
chmod 1777 /var/tmp

I am using the version of setup that is currently on the Cygwin web page. Which chmod and which chown report /usr/bin/chmod and /usr/bin/chown respectively. For the sequence I reported yesterday, I was running as administrator.

Thanks,

...Karl

From: Corinna Vinschen Subject: Re: setup/symlinks/gcc/chown question
Date: Mon, 19 Dec 2005 13:12:26 +0100

On Dec 18 15:51, Karl M wrote:
> Hi All...
>
> It appears to be file permissions related. The link being broken looks like
> it is because the read only bit on the shortcut file (the .lnk file) is
> getting turned off. Even though this first getfacl shows write access, the
> read only box in the windows properties is checked. after the chown -h the
> windows properties box says not a valid link. After the chmod -R 755, the
> windows properties shows it as a valid shortcut, but the read only box is
> unchecked. After a chmod -R 555, the read only box is checked and Cygwin
> thinks it is a symlink again.
> [...]


Still, I can't reproduce this.  I tried all variations I could think of,
but I couldn't break the symlink using Cygwin coreutils chmod and chown
tools.  The only way I was able to break the symlink was by using the
native Windows tool "attrib" to reset the readonly bit.

Are you sure you're using Cygwin's chmod/chown?  Did you try to run them
under strace and see what happens?


Corinna


--
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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/




-- 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]