Bug 784079 - hg view is broken
Summary: hg view is broken
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mercurial
Version: 6.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Petr Stodulka
QA Contact: Leos Pol
Depends On:
TreeView+ depends on / blocked
Reported: 2012-01-23 18:40 UTC by Andy Grover
Modified: 2015-07-22 07:45 UTC (History)
6 users (show)

Fixed In Version: mercurial-1.4-4.el6
Doc Type: Bug Fix
Doc Text:
* Previously, the "hg view" command failed with the "Permission denied" error message. This update adds the required execute permission to the hgk utility. As a result, running "hg view" works as expected. (BZ#784079)
Clone Of:
Last Closed: 2015-07-22 07:45:36 UTC
Target Upstream Version:

Attachments (Terms of Use)
Fix permissions of hgk (857 bytes, patch)
2014-11-01 15:23 UTC, Dave Johansen
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1436 0 normal SHIPPED_LIVE mercurial bug fix update 2015-07-20 18:05:56 UTC

Description Andy Grover 2012-01-23 18:40:59 UTC
Description of problem:
hg view
/bin/sh: /usr/libexec/mercurial/hgk: Permission denied

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. install mercurial and mercurial-hgk
2. go to a hg repo dir
3. execute hg view

Comment 1 Andy Grover 2012-01-23 18:44:19 UTC
permissions on /usr/libexec/mercurial and /usr/libexec/mercurial/hgk need to be +x.

Comment 4 Suzanne Yeghiayan 2012-02-14 23:28:53 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support

Comment 5 Dave Johansen 2014-11-01 15:23:06 UTC
Created attachment 952773 [details]
Fix permissions of hgk

This patch fixes the issue in this bugzilla, so can it please be applied and an updated version of mercurial be released?

Comment 6 Bob Arendt 2014-11-05 18:45:09 UTC
The problem is obvious from listing the the rpm contents:

rpm -qlvp mercurial-hgk-1.4-3.el6.x86_64.rpm
-rw-r--r--    1 root    root                      118 Mar 12  2010 /etc/mercurial/hgrc.d/hgk.rc
-rw-r--r--    1 root    root                    11698 Nov 16  2009 /usr/lib64/python2.6/site-packages/hgext/hgk.py
-rw-r--r--    1 root    root                    10826 Mar 12  2010 /usr/lib64/python2.6/site-packages/hgext/hgk.pyc
-rw-r--r--    1 root    root                    10780 Mar 12  2010 /usr/lib64/python2.6/site-packages/hgext/hgk.pyo
drw-r--r--    2 root    root                        0 Mar 12  2010 /usr/libexec/mercurial
-rw-r--r--    1 root    root                   109044 Mar 12  2010 /usr/libexec/mercurial/hgk

A directory that doesn't have execute permission can't function as a directory.

I've tested Dave's patch and it works. The issue is an obvious error in the mercurial packaging, not the code itself.  Please fix and re-release the package.

Comment 7 Petr Stodulka 2014-11-07 09:41:04 UTC
I agree. It seems like candidate for fasttrack.

Comment 8 Dave Johansen 2015-04-30 21:44:23 UTC
Any update on this being applied?

Comment 9 Petr Stodulka 2015-05-03 21:19:54 UTC
Hi Dave, I hope that patch will be aplied in rhel-6.8.

Comment 10 Andrew John Hughes 2015-05-13 17:00:54 UTC
Just hit this myself today. Given this has PM+dev ACKs, it could go out for RHEL 6.7 with the requisite QA ack added.

At present, hg view is completely broken as shipped.

Comment 11 Andrew John Hughes 2015-05-13 17:11:33 UTC
The test and fix is very simple.

1. $ hg clone http://hg.openjdk.java.net/jdk8u/jdk8u
2. $ cd jdk8u
3. $ hg view

Current result:

/bin/sh: /usr/libexec/mercurial/hgk: Permission denied

Expected result:

hgk loads up, displaying a graphical view of the repository.


Making /usr/libexec/mercurial and /usr/libexec/mercurial/hgk
executable. I tested this fix manually by doing the following as

$ chmod ugo+X /usr/libexec/mercurial
$ chmod ugo+x /usr/libexec/mercurial/hgk

and hgk then loads.

Comment 12 Petr Stodulka 2015-05-13 17:13:10 UTC
Yes, it's expected solution according to proposed patch :-)

Comment 13 Andrew John Hughes 2015-05-13 17:30:32 UTC
Was the patch sufficient? I found that it only worked if hgk itself was also made executable.

Comment 14 Petr Stodulka 2015-05-13 17:49:18 UTC
Yes, it is. Because hgk inherit permissions from directory.

Comment 15 Andrew John Hughes 2015-05-13 18:02:55 UTC
Ok, so the RPM change also makes hgk executable? That's fine.

Comment 16 Bob Arendt 2015-05-13 18:03:54 UTC
The patch works - we've been rebuilding/installing a patched mercurial rpm for over 3 years now.  It would be great if Redhat would correct their packaging error and release an update.

Comment 19 Leos Pol 2015-05-19 07:45:41 UTC
# rpm -q mercurial
# hg view
/bin/sh: /usr/libexec/mercurial/hgk: Permission denied

# rpm -q mercurial
# hg view

- opens hg view gui

Comment 21 errata-xmlrpc 2015-07-22 07:45:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.