Thread: Problems with permissions after CYGWIN upgrade

Problems with permissions after CYGWIN upgrade

From
David R Robison
Date:
I just upgraded to the latest version of cygwin and now I am unable to connect
to the postgres database except from the "postgres" account (I am running
Windows 2000).

When I try to connect with psql from my normal account, I get the following error:

psql: could not connect to server: Bad file descriptor
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

The file permissions in /tmp are:

total 5512
drwxrwxrwx+   2 Administ None         4096 Mar 19 08:57 .
drwxrwxrwx+   9 Administ None         4096 Dec 12 12:59 ..
-rwx------    1 ???????? None           51 Mar 19 08:57 .s.PGSQL.5432
-rw-------    1 ???????? None           31 Mar 19 08:57 .s.PGSQL.5432.lock
-rw-rw-rw-    1 SYSTEM   SYSTEM    3916520 Mar 19 08:56 MultiFileMsg
-rw-rw-rw-    1 SYSTEM   SYSTEM      22032 Mar 19 08:56 MultiFileSem
-rw-rw-rw-    1 SYSTEM   SYSTEM     202768 Mar 19 08:56 MultiFileShm
-rw-------    1 ???????? None      1499136 Mar 19 08:57 cygipc_0

Everything use to work file. Any ideas on what might have changed, what the
problem is, or how to work around it?

Thanks,

David Robison

Re: Problems with permissions after CYGWIN upgrade

From
David R Robison
Date:
I added postgres to the /etc/passwd file and it took care of the question marks
on the directory listing, however, I still cannot connect to postgres except
from the postgres account.

Thanks,
David Robison

Quoting David R Robison <drrobison@openroadsconsulting.com>:

> I just upgraded to the latest version of cygwin and now I am unable to
> connect
> to the postgres database except from the "postgres" account (I am
> running
> Windows 2000).
>
> When I try to connect with psql from my normal account, I get the
> following error:
>
> psql: could not connect to server: Bad file descriptor
>     Is the server running locally and accepting
>     connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
>
> The file permissions in /tmp are:
>
> total 5512
> drwxrwxrwx+   2 Administ None         4096 Mar 19 08:57 .
> drwxrwxrwx+   9 Administ None         4096 Dec 12 12:59 ..
> -rwx------    1 ???????? None           51 Mar 19 08:57 .s.PGSQL.5432
> -rw-------    1 ???????? None           31 Mar 19 08:57
> .s.PGSQL.5432.lock
> -rw-rw-rw-    1 SYSTEM   SYSTEM    3916520 Mar 19 08:56 MultiFileMsg
> -rw-rw-rw-    1 SYSTEM   SYSTEM      22032 Mar 19 08:56 MultiFileSem
> -rw-rw-rw-    1 SYSTEM   SYSTEM     202768 Mar 19 08:56 MultiFileShm
> -rw-------    1 ???????? None      1499136 Mar 19 08:57 cygipc_0
>
> Everything use to work file. Any ideas on what might have changed, what
> the
> problem is, or how to work around it?
>
> Thanks,
>
> David Robison
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo@postgresql.org
>

Re: Problems with permissions after CYGWIN upgrade

From
Jason Tishler
Date:
On Wed, Mar 19, 2003 at 09:29:19AM -0500, David R Robison wrote:
> The file permissions in /tmp are:
>
> total 5512
> drwxrwxrwx+   2 Administ None         4096 Mar 19 08:57 .
> drwxrwxrwx+   9 Administ None         4096 Dec 12 12:59 ..
> -rwx------    1 ???????? None           51 Mar 19 08:57 .s.PGSQL.5432
  ^
  *
> -rw-------    1 ???????? None           31 Mar 19 08:57 .s.PGSQL.5432.lock
> [snip]
>
> Everything use to work file. Any ideas on what might have changed,
> what the problem is, or how to work around it?

I get the following:

    ls -l /tmp/.s.PGSQL.5432*
    srwx------    1 postgres None            0 Mar 19 12:18 /tmp/.s.PGSQL.5432
    -rw-------    1 postgres None           32 Mar 19 12:18 /tmp/.s.PGSQL.5432.lock

It appears that your /tmp/.s.PGSQL.5432 is not considered a socket.
Sorry, but I don't know why.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Problems with permissions after CYGWIN upgrade

From
"David R Robison"
Date:
If I change the permissions on the files to 777 then it works fine. Any
ideas?

David R Robison
Open Roads Consulting, Inc.
http://www.openroadsconsulting.com


-----Original Message-----
From: Jason Tishler [mailto:jason@tishler.net]
Sent: Wednesday, March 19, 2003 12:44 PM
To: David R Robison
Cc: pgsql-cygwin@postgresql.org
Subject: Re: [CYGWIN] Problems with permissions after CYGWIN upgrade

On Wed, Mar 19, 2003 at 09:29:19AM -0500, David R Robison wrote:
> The file permissions in /tmp are:
>
> total 5512
> drwxrwxrwx+   2 Administ None         4096 Mar 19 08:57 .
> drwxrwxrwx+   9 Administ None         4096 Dec 12 12:59 ..
> -rwx------    1 ???????? None           51 Mar 19 08:57 .s.PGSQL.5432
  ^
  *
> -rw-------    1 ???????? None           31 Mar 19 08:57
.s.PGSQL.5432.lock
> [snip]
>
> Everything use to work file. Any ideas on what might have changed,
> what the problem is, or how to work around it?

I get the following:

    ls -l /tmp/.s.PGSQL.5432*
    srwx------    1 postgres None            0 Mar 19 12:18
/tmp/.s.PGSQL.5432
    -rw-------    1 postgres None           32 Mar 19 12:18
/tmp/.s.PGSQL.5432.lock

It appears that your /tmp/.s.PGSQL.5432 is not considered a socket.
Sorry, but I don't know why.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6


Re: Problems with permissions after CYGWIN upgrade

From
Jason Tishler
Date:
David,

On Wed, Mar 19, 2003 at 12:56:32PM -0500, David R Robison wrote:
> Any ideas?

Yes, recent Cygwin versions (sometime after 1.3.18) has a chmod() bug:

    http://cygwin.com/ml/cygwin/2003-03/msg01344.html

What Cygwin version are you using?

> If I change the permissions on the files to 777 then it works fine.

AFAICT, chmod() on sockets has no affect:

    $ ls -l /tmp/.afunix
    srwx------    1 jt       Domain U        0 Mar 19 15:57 /tmp/.afunix
    $ chmod 0777 .afunix
    $ ls -l /tmp/.afunix
    srwx------    1 jt       Domain U        0 Mar 19 15:57 /tmp/.afunix

How did you get chmod to work?

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Problems with permissions after CYGWIN upgrade

From
Jason Tishler
Date:
David,

On Wed, Mar 19, 2003 at 04:15:10PM -0500, Jason Tishler wrote:
> On Wed, Mar 19, 2003 at 12:56:32PM -0500, David R Robison wrote:
> > Any ideas?
>
> Yes, recent Cygwin versions (sometime after 1.3.18) has a chmod() bug:
>
>     http://cygwin.com/ml/cygwin/2003-03/msg01344.html

The above bug has been fixed in Cygwin CVS:

    http://cygwin.com/ml/cygwin-cvs/2003-q1/msg00397.html

However, a Cygwin snapshot does not exist yet that contains the above
change.  So, you will have to either build your own Cygwin DLL from CVS
or using IP sockets (i.e., postmaster -i) in the meantime.

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: Problems with permissions after CYGWIN upgrade

From
Jason Tishler
Date:
David,

On Sun, Jun 15, 2003 at 06:25:15PM +1000, David Garrett wrote:
> I refer to a recent post ...
>
> Problems with permissions after CYGWIN upgrade
> http://archives.postgresql.org/pgsql-cygwin/2003-03/msg00053.php
>
> I have the same problem even though I am using the "postmaster -i"
> workaround you proposed.
>
> [snip]
>
> The error I receive is as follows:
>
> Administrator@xxx ~
> $ psql -U postgres template1
> psql: could not connect to server: Bad file descriptor
>         Is the server running locally and accepting
>         connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Sorry, I forgot to mention that one needs to run psql as follows:

    $ psql -h localhost -U postgres template1
           ^^^^^^^^^^^^

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6