Discussion:
Lynx Version 2.8.8pre.5 should copy files in share/lynx_doc/ with correct owners/permissions
Rajeev V. Pillai
2014-02-22 23:58:47 UTC
Permalink
Files and dirs. in share/lynx_doc/ are not installed with the correct
owners/permissions. On a newly installed lynx directory
(user's default umask is 0077):

$ ls -l /opt/lynx/share/lynx_doc/
total 620
-rw------- 1 root rvp 564675 Feb 14 18:30 CHANGES
-rw------- 1 root rvp   3381 Jan 12 00:36 COPYHEADER
-rw------- 1 root rvp    267 Jan 12 00:36 COPYHEADER.asc
-rw------- 1 root rvp  18156 Oct 11  2006 COPYING
-rw------- 1 root rvp    258 Oct 11  2006 COPYING.asc
drwx------ 2 root rvp   4096 Feb 23 04:59 docs
-rw------- 1 root rvp  11922 May 24  2004 PROBLEMS
-rw------- 1 root rvp   6829 Feb 14 18:30 README
drwx------ 2 root rvp   4096 Feb 23 04:59 samples
drwx------ 2 root rvp   4096 Feb 23 04:59 test


Files and dirs. in share/lynx_help/ are given the correct permissions:

$ ls -l /opt/lynx/share/lynx_help/
total 244
-rw-r--r-- 1 root root   5431 Feb 23 05:11 about_lynx.html
lrwxrwxrwx 1 root root     35 Feb 23 05:11 COPYHEADER -> /opt/lynx/share/lynx_doc/COPYHEADER
lrwxrwxrwx 1 root root     32 Feb 23 05:11 COPYING -> /opt/lynx/share/lynx_doc/COPYING
drwxr-xr-x 2 root root   4096 Feb 23 05:11 keystrokes
-rw-r--r-- 1 root root   4169 Feb 23 05:11 lynx-dev.html
-rw-r--r-- 1 root root   5701 Feb 23 05:11 lynx_help_main.html
-rw-r--r-- 1 root root  32538 Feb 23 05:11 lynx_url_support.html
-rw-r--r-- 1 root root 183061 Feb 23 05:11 Lynx_users_guide.html
Thomas Dickey
2014-02-23 11:37:18 UTC
Permalink
Post by Rajeev V. Pillai
Files and dirs. in share/lynx_doc/ are not installed with the correct
owners/permissions. On a newly installed lynx directory
hmm - the reason for this is the (very old) use of tar for copying that
directory. I vaguely recall it being mentioned several years ago.
Most people rely upon packages (which generally are build using umask 027),
--
Thomas E. Dickey <***@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
Rajeev V. Pillai
2014-03-15 03:27:54 UTC
Permalink
Post by Thomas Dickey
Post by Rajeev V. Pillai
Files and dirs. in share/lynx_doc/ are not installed with the correct
owners/permissions. On a newly installed lynx directory
(user's default umask is 0077):>
hmm - the reason for this is the (very old) use of tar for copying that
directory.  I vaguely recall it being mentioned several years ago.
Most people rely upon packages (which generally are build using umask 027),
The addition of `umask 022' to the tar commands in `2.8.8rel.2.patch' still
doesn't set the correct owners+permissions for the files in share/lynx_doc/.
because the 1st tar cmd. picks up the owners/permissions for those files
from when the source tarball was extracted--ie. when the umask and user/grp
could have been anything:

$ ls -l /opt/lynx/share/lynx_doc
total 624
-rw------- 1 root rvp 565304 Mar 10 03:13 CHANGES
-rw------- 1 root rvp   3381 Jan 12 00:36 COPYHEADER
-rw------- 1 root rvp    267 Jan 12 00:36 COPYHEADER.asc
-rw------- 1 root rvp  18156 Oct 11  2006 COPYING
-rw------- 1 root rvp    258 Oct 11  2006 COPYING.asc
drwx------ 2 root rvp   4096 Mar 15 08:19 docs
-rw------- 1 root rvp  11922 May 24  2004 PROBLEMS
-rw------- 1 root rvp   6829 Feb 14 18:30 README
drwx------ 2 root rvp   4096 Mar 15 08:19 samples
drwx------ 2 root rvp   4096 Mar 15 08:19 test

What's needed, is to change this line in the install-doc rule in `makefile.in':

-$(SHELL) -c 'case `id|sed -e "s/(.*//"` in uid=0) chown -R root $(DOCDIR);; esac'

to this:

-$(SHELL) -c 'case `id|sed -e "s/(.*//"` in uid=0) chown -R root.root $(DOCDIR);; esac'

and add a couple of additional commands in there--something along the lines of:

find $(DOCDIR) -type d -print0 | xargs -0 chmod 755
find $(DOCDIR) -type f -print0 | xargs -0 chmod 644

Thanks,
Rajeev
Thomas Dickey
2014-03-15 17:18:35 UTC
Permalink
Post by Rajeev V. Pillai
Post by Thomas Dickey
Post by Rajeev V. Pillai
Files and dirs. in share/lynx_doc/ are not installed with the correct
owners/permissions. On a newly installed lynx directory
(user's default umask is 0077):>
hmm - the reason for this is the (very old) use of tar for copying that
directory.  I vaguely recall it being mentioned several years ago.
Most people rely upon packages (which generally are build using umask 027),
The addition of `umask 022' to the tar commands in `2.8.8rel.2.patch' still
doesn't set the correct owners+permissions for the files in share/lynx_doc/.
because the 1st tar cmd. picks up the owners/permissions for those files
from when the source tarball was extracted--ie. when the umask and user/grp
I see. I had tested this by setting umask in the build process,
but using a pristine tarball (which would have correct permissions).
I did that for both dpkg and rpm...
Post by Rajeev V. Pillai
$ ls -l /opt/lynx/share/lynx_doc
total 624
-rw------- 1 root rvp 565304 Mar 10 03:13 CHANGES
-rw------- 1 root rvp   3381 Jan 12 00:36 COPYHEADER
-rw------- 1 root rvp    267 Jan 12 00:36 COPYHEADER.asc
-rw------- 1 root rvp  18156 Oct 11  2006 COPYING
-rw------- 1 root rvp    258 Oct 11  2006 COPYING.asc
drwx------ 2 root rvp   4096 Mar 15 08:19 docs
-rw------- 1 root rvp  11922 May 24  2004 PROBLEMS
-rw------- 1 root rvp   6829 Feb 14 18:30 README
drwx------ 2 root rvp   4096 Mar 15 08:19 samples
drwx------ 2 root rvp   4096 Mar 15 08:19 test
-$(SHELL) -c 'case `id|sed -e "s/(.*//"` in uid=0) chown -R root $(DOCDIR);; esac'
-$(SHELL) -c 'case `id|sed -e "s/(.*//"` in uid=0) chown -R root.root $(DOCDIR);; esac'
find $(DOCDIR) -type d -print0 | xargs -0 chmod 755
find $(DOCDIR) -type f -print0 | xargs -0 chmod 644
something like (but not exactly: the example given isn't portable)

thanks
--
Thomas E. Dickey <***@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
Rajeev V. Pillai
2014-03-16 00:11:31 UTC
Permalink
I see.  I had tested this by setting umask in the build process,
but using a pristine tarball (which would have correct permissions).
I did that for both dpkg and rpm...
The source tarball does have the correct file permissions, but, when
extracting files, GNU tar will consider the user's current umask value
when setting a file's permissions instead of using only the mode-bits
in the tarball.

Speaking of tarballs, lynx2.8.8rel.2.tar has a couple of extraneous
files:
-rw-r--r-- dickey/lynx       0 2014-03-10 03:13 lynx2-8-8/test/nobody
-rw-r--r-- dickey/lynx       0 2014-03-10 03:13 lynx2-8-8/test/X
Post by Rajeev V. Pillai
find $(DOCDIR) -type d -print0 | xargs -0 chmod 755
find $(DOCDIR) -type f -print0 | xargs -0 chmod 644>
something like (but not exactly: the example given isn't portable)
I presume `find $(DOCDIR) -type d -exec chmod 755 {} \;' is more
POSIX compliant?

Thanks,
Rajeev
Thomas Dickey
2014-03-16 15:19:36 UTC
Permalink
Post by Rajeev V. Pillai
I see.? I had tested this by setting umask in the build process,
but using a pristine tarball (which would have correct permissions).
I did that for both dpkg and rpm...
The source tarball does have the correct file permissions, but, when
extracting files, GNU tar will consider the user's current umask value
when setting a file's permissions instead of using only the mode-bits
in the tarball.
I did say "pristine": packagers as a rule work directly from the tarball,
and the packaging systems generally (I don't know of exceptions) don't
alter the permissions.

(by the way, lynx's use of tar in this way for installing documentation
dates back to

1998-09-12 (2.8.1dev.26)
* split out install-doc rule in top-level makefile to install extra
documentation files in $(libdir)/lynx_doc (request by HN) - TD
Post by Rajeev V. Pillai
Speaking of tarballs, lynx2.8.8rel.2.tar has a couple of extraneous
-rw-r--r-- dickey/lynx?????? 0 2014-03-10 03:13 lynx2-8-8/test/nobody
-rw-r--r-- dickey/lynx?????? 0 2014-03-10 03:13 lynx2-8-8/test/X
those are intentional:

2014-03-09 (2.8.8rel.2)
* correct errata in test-files which cause broken links in break-out directory
in lynx.isc.org server -TD
Post by Rajeev V. Pillai
Post by Rajeev V. Pillai
find $(DOCDIR) -type d -print0 | xargs -0 chmod 755
find $(DOCDIR) -type f -print0 | xargs -0 chmod 644>
something like (but not exactly: the example given isn't portable)
I presume `find $(DOCDIR) -type d -exec chmod 755 {} \;' is more
POSIX compliant?
yes
--
Thomas E. Dickey <***@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
Rajeev V. Pillai
2014-03-17 01:12:46 UTC
Permalink
Post by Thomas Dickey
Post by Rajeev V. Pillai
The source tarball does have the correct file permissions, but, when
extracting files, GNU tar will consider the user's current umask value
when setting a file's permissions instead of using only the mode-bits
in the tarball.
I did say "pristine": packagers as a rule work directly from the tarball,
and the packaging systems generally (I don't know of exceptions) don't
alter the permissions.
I'm not clear about what you mean by pristine in this context--I build
most of my binaries directly from the tarballs (in the usual manner):

1. Download source tarball.
2. Extract tarball.
3. ./configure ...
4. make
5. make install (as root)

My understanding is that unless steps 2-5 are executed as root (ie. not
only step 5.), the owner & permissions for share/lynx_doc/* will not be
set correctly. Are packaging systems run under a specific umask (0022, say)
and with a specific user like root?
Post by Thomas Dickey
Post by Rajeev V. Pillai
Speaking of tarballs, lynx2.8.8rel.2.tar has a couple of extraneous
-rw-r--r-- dickey/lynx?????? 0 2014-03-10 03:13 lynx2-8-8/test/nobody
-rw-r--r-- dickey/lynx?????? 0 2014-03-10 03:13 lynx2-8-8/test/X
2014-03-09 (2.8.8rel.2)
* correct errata in test-files which cause broken links in break-out directory
  in lynx.isc.org server -TD
Ah, I see! I was confused by the addition of 2 oddly named zero-length files
in lynx_doc/test/.


Thanks,
Rajeev
Thomas Dickey
2014-03-18 00:02:43 UTC
Permalink
Post by Rajeev V. Pillai
Post by Thomas Dickey
Post by Rajeev V. Pillai
The source tarball does have the correct file permissions, but, when
extracting files, GNU tar will consider the user's current umask value
when setting a file's permissions instead of using only the mode-bits
in the tarball.
I did say "pristine": packagers as a rule work directly from the tarball,
and the packaging systems generally (I don't know of exceptions) don't
alter the permissions.
I'm not clear about what you mean by pristine in this context--I build
1. Download source tarball.
2. Extract tarball.
3. ./configure ...
4. make
5. make install (as root)
My understanding is that unless steps 2-5 are executed as root (ie. not
only step 5.), the owner & permissions for share/lynx_doc/* will not be
set correctly. Are packaging systems run under a specific umask (0022, say)
and with a specific user like root?
I run dpkg (Debian) and rpm as my non-root user. Those systems are
overriding my umask, as I commented before. There are other systems,
but those account for a large fraction of what's in use.

I build some packages in my FreeBSD and NetBSD machines as root, but
those are occasional, to verify that I could plug my files into /usr/ports
and make them work in an end-system. On those, I suppose umask is 022
because I've had no surprises.
Post by Rajeev V. Pillai
Post by Thomas Dickey
Post by Rajeev V. Pillai
Speaking of tarballs, lynx2.8.8rel.2.tar has a couple of extraneous
-rw-r--r-- dickey/lynx?????? 0 2014-03-10 03:13 lynx2-8-8/test/nobody
-rw-r--r-- dickey/lynx?????? 0 2014-03-10 03:13 lynx2-8-8/test/X
2014-03-09 (2.8.8rel.2)
* correct errata in test-files which cause broken links in break-out directory
? in lynx.isc.org server -TD
Ah, I see! I was confused by the addition of 2 oddly named zero-length files
in lynx_doc/test/.
no problem
--
Thomas E. Dickey <***@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
Loading...