Executable files in CVS

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Executable files in CVS
Date: 2003-11-23 21:26:10
Message-ID: Pine.LNX.4.44.0311232225310.4773-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

While people add more executable files to CVS (cf. initdb.c), can we do
something about it?

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-23 23:06:58
Message-ID: 200311232306.hANN6w025754@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> While people add more executable files to CVS (cf. initdb.c), can we do
> something about it?

Sure. I logged into the main server machine and cd'ed to CVSROOT. I
then when to the src/bin/initdb directory, and because I didn't have
permisssions, I moved initdb.c,v to another file name then copied it to
the original name so I owned the file. I then removed the execute bits
from the file. I did that for initdb.c and dirmod.c. I then removed
files from my local CVS and did a CVS update and the files no longer
have execute bits.

I looked at my CVS and didn't see any more problem files. Do you see
any others?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-23 23:59:45
Message-ID: 383.1069631985@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Sure. I logged into the main server machine and cd'ed to CVSROOT. I
> then when to the src/bin/initdb directory, and because I didn't have
> permisssions, I moved initdb.c,v to another file name then copied it to
> the original name so I owned the file. I then removed the execute bits
> from the file. I did that for initdb.c and dirmod.c. I then removed
> files from my local CVS and did a CVS update and the files no longer
> have execute bits.

Um. Can anyone else check into those files now?

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 00:22:19
Message-ID: 200311240022.hAO0MJg05015@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Sure. I logged into the main server machine and cd'ed to CVSROOT. I
> > then when to the src/bin/initdb directory, and because I didn't have
> > permisssions, I moved initdb.c,v to another file name then copied it to
> > the original name so I owned the file. I then removed the execute bits
> > from the file. I did that for initdb.c and dirmod.c. I then removed
> > files from my local CVS and did a CVS update and the files no longer
> > have execute bits.
>
> Um. Can anyone else check into those files now?

Yes, I think so. The file used to be owned by Peter, but now by me:

-r--rw-r-- 1 petere pgsql 19139 Nov 23 17:42 Makefile,v
-r--r--r-- 1 momjian pgsql 86195 Nov 23 19:00 initdb.c,v
-r--r--r-- 1 petere pgsql 299 Nov 23 17:41 nls.mk,v

initdb.c looks pretty much the same as the other files in the directory.
They look pretty much the directory. Are you seeing a problem?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 00:32:34
Message-ID: 20031124003233.GE2849@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Nov 23, 2003 at 06:59:45PM -0500, Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Sure. I logged into the main server machine and cd'ed to CVSROOT. I
> > then when to the src/bin/initdb directory, and because I didn't have
> > permisssions, I moved initdb.c,v to another file name then copied it to
> > the original name so I owned the file. I then removed the execute bits
> > from the file. I did that for initdb.c and dirmod.c. I then removed
> > files from my local CVS and did a CVS update and the files no longer
> > have execute bits.
>
> Um. Can anyone else check into those files now?

Looks fine in CVSup. But in src/port I now see a file named "x" that
appears to be the old dirmod.c,v ...

BTW, I can see a whole lot of files with the executable bit:

find pgsql-server/ -type f -perm +0333 -ls

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Those who use electric razors are infidels destined to burn in hell while
we drink from rivers of beer, download free vids and mingle with naked
well shaved babes." (http://slashdot.org/comments.pl?sid=44793&cid=4647152)


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 00:41:09
Message-ID: 200311240041.hAO0f9823077@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera wrote:
> On Sun, Nov 23, 2003 at 06:59:45PM -0500, Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > Sure. I logged into the main server machine and cd'ed to CVSROOT. I
> > > then when to the src/bin/initdb directory, and because I didn't have
> > > permisssions, I moved initdb.c,v to another file name then copied it to
> > > the original name so I owned the file. I then removed the execute bits
> > > from the file. I did that for initdb.c and dirmod.c. I then removed
> > > files from my local CVS and did a CVS update and the files no longer
> > > have execute bits.
> >
> > Um. Can anyone else check into those files now?
>
> Looks fine in CVSup. But in src/port I now see a file named "x" that
> appears to be the old dirmod.c,v ...

Thanks, removed.

> BTW, I can see a whole lot of files with the executable bit:
>
> find pgsql-server/ -type f -perm +0333 -ls

That command doesn't seem to work for me. I see:

8 -r--rw-r-- 1 pgsql pgsql 2405 Nov 16 17:34 ./contrib/btree_gist/btree_common.c,v

which doesn't have execute permission.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 00:46:21
Message-ID: 1348.1069634781@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Tom Lane wrote:
>> Um. Can anyone else check into those files now?

> Yes, I think so. The file used to be owned by Peter, but now by me:

Oh, okay. I had the idea they should all be owned by the cvs daemon,
but I guess that's not required.

> -r--rw-r-- 1 petere pgsql 19139 Nov 23 17:42 Makefile,v
> -r--r--r-- 1 momjian pgsql 86195 Nov 23 19:00 initdb.c,v
> -r--r--r-- 1 petere pgsql 299 Nov 23 17:41 nls.mk,v

Hmmm ... why is the Makefile group-writable?

I did this to look for other permissions issues:

find . -type f -a -perm +313 | grep -v /Attic/ | xargs ls -l

The following files look dubious to me:

contrib/README
contrib/lo/Makefile
doc/FAQ_hungarian
src/backend/catalog/system_views.sql
src/backend/port/tas/solaris_i386.s
src/backend/port/tas/solaris_sparc.s
src/interfaces/jdbc/example/corba/stock.idl
src/pl/tcl/modules/pltcl_delmod.in
src/pl/tcl/modules/pltcl_listmod.in
src/pl/tcl/modules/pltcl_loadmod.in
src/test/locale/koi8-r/test-koi8.sql.in

The other things that are executable look like they legitimately are
scripts.

If we consider that group-writability is bad (which ISTM we ought to)
then there are a *ton* of files with the wrong permissions. I'd
recommend getting Marc to fix it instead of hacking about with a
one-file-at-a-time method.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 00:50:21
Message-ID: 1406.1069635021@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Alvaro Herrera wrote:
>> BTW, I can see a whole lot of files with the executable bit:
>>
>> find pgsql-server/ -type f -perm +0333 -ls

> That command doesn't seem to work for me.

He's looking for *either* write or execute permissions. AFAIK there is
no reason for any ordinary file in a CVS repository to have write
permissions.

regards, tom lane


From: Philip Yarra <philip(at)utiba(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 00:50:55
Message-ID: 200311241150.55249.philip@utiba.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 24 Nov 2003 11:41 am, Bruce Momjian wrote:
> > find pgsql-server/ -type f -perm +0333 -ls
>
> That command doesn't seem to work for me. I see:

I think that should be -perm +0111:

from man find:
-perm +mode
Any of the permission bits mode are set for the file.

This would find all executable files (by u,g,o). +0333 would also find
writable files (as in your example)

Regards, Philip.


From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 01:32:09
Message-ID: 3FC15F99.3060308@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> The other things that are executable look like they legitimately are
> scripts.
>
> If we consider that group-writability is bad (which ISTM we ought to)
> then there are a *ton* of files with the wrong permissions. I'd
> recommend getting Marc to fix it instead of hacking about with a
> one-file-at-a-time method.

You could consider adding a script to CVSROOT module to fix permissions
upon commit?

Chris


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 01:33:27
Message-ID: 200311240133.hAO1XR929464@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Christopher Kings-Lynne wrote:
> > The other things that are executable look like they legitimately are
> > scripts.
> >
> > If we consider that group-writability is bad (which ISTM we ought to)
> > then there are a *ton* of files with the wrong permissions. I'd
> > recommend getting Marc to fix it instead of hacking about with a
> > one-file-at-a-time method.
>
> You could consider adding a script to CVSROOT module to fix permissions
> upon commit?

Some files need execute bits, like perl scripts.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 01:37:04
Message-ID: 1736.1069637824@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Christopher Kings-Lynne wrote:
>> You could consider adding a script to CVSROOT module to fix permissions
>> upon commit?

> Some files need execute bits, like perl scripts.

Sure, but couldn't we automatically turn off the write bits?

regards, tom lane


From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 02:10:12
Message-ID: 20031123220940.A771@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, 23 Nov 2003, Tom Lane wrote:

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Christopher Kings-Lynne wrote:
> >> You could consider adding a script to CVSROOT module to fix permissions
> >> upon commit?
>
> > Some files need execute bits, like perl scripts.
>
> Sure, but couldn't we automatically turn off the write bits?

Just curious, but what do the write bits harm? Everyone that has access
to that VM has acccess to CVSROOT, either through CVS or directly ...

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 04:06:59
Message-ID: 2339.1069646819@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Marc G. Fournier" <scrappy(at)postgresql(dot)org> writes:
> On Sun, 23 Nov 2003, Tom Lane wrote:
>> Sure, but couldn't we automatically turn off the write bits?

> Just curious, but what do the write bits harm?

They're just extra protection against making a dumb mistake; the old
belt-AND-suspenders theory.

If we were to turn off group write permission on the CVS directories,
then the protection would be a lot stronger, but it would also prevent
manual fixes of the sort Bruce just made (or manual removal of stale
CVS lock files, as I can recall having to do several times). So I'm not
in favor of that. But "no write on the CVS data files" seems like a
good compromise policy.

Besides, it's a tad odd to see files that are marked group writable but
not owner writable. You've got to agree there's not much sense in that.

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 06:36:57
Message-ID: Pine.LNX.4.44.0311240735450.4773-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane writes:

> Besides, it's a tad odd to see files that are marked group writable but
> not owner writable. You've got to agree there's not much sense in that.

How else are you going to commit files? /usr/bin/cvs is not setuid, so
the only way you can write to these files is being in the group pgsql and
that group having write permission.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Executable files in CVS
Date: 2003-11-24 13:23:05
Message-ID: 8859.1069680185@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane writes:
>> Besides, it's a tad odd to see files that are marked group writable but
>> not owner writable. You've got to agree there's not much sense in that.

> How else are you going to commit files? /usr/bin/cvs is not setuid,

Sure, but as long as the directories are group-writable it can rename
the old version out of the way. Which is what I think it's actually
doing, because there are some files in the tree that are not group
writable --- src/backend/commands/alter.c,v is an example.

regards, tom lane