Bug 12131 - about-mageia looks for non-existent directory and thus cripple.
Summary: about-mageia looks for non-existent directory and thus cripple.
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 4
Hardware: All Linux
Priority: Normal minor
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA3TOO has_procedure advisory MGA4-6...
Keywords: Junior_job, PATCH, validated_update
Depends on:
Blocks:
 
Reported: 2013-12-28 02:51 CET by Atilla ÖNTAŞ
Modified: 2017-03-13 19:23 CET (History)
8 users (show)

See Also:
Source RPM: indexhtml-1-9.mga3.src.rpm, indexhtml-1-10.mga4.src.rpm
CVE:
Status comment:


Attachments
Modified about-mageia script to open mageia.org/about (429 bytes, text/plain)
2013-12-28 02:57 CET, Atilla ÖNTAŞ
Details

Description Atilla ÖNTAŞ 2013-12-28 02:51:13 CET
Description of problem:
Indexhtml package supposed to be display useful information about Mageia. But it simply doesn't work. There are critical problems for this package:

1. /usr/bin/about-mageia script looks for non-existent /usr/share/mdv directory. It should be /usr/share/mga directory.

2. If i supply correct path for about-mageia script; i get only "Coming soon" written web page on my default web browser; which seems to me nonsense.


So, i recommend (if otherwise not planned) about-mageia script should open Mageia web site's about page. I have re-written the script to satisfy this. Will attach soon.

Reproducible: 

Steps to Reproduce:
Comment 1 Atilla ÖNTAŞ 2013-12-28 02:57:46 CET
Created attachment 4670 [details]
Modified about-mageia script to open mageia.org/about

This script first tests internet connectivity; if a working internet connection detected then calculates installed system's locale and opens localized mageia.org/about page via xdg-open command.

Assignee: bugsquad => tarakbumba

Atilla ÖNTAŞ 2013-12-28 02:58:07 CET

Keywords: (none) => Junior_job
Whiteboard: (none) => MGA3TOO

Jani Välimaa 2013-12-28 09:37:34 CET

Attachment 4670 mime type: application/octet-stream => text/plain

Thierry Vignaud 2013-12-29 11:54:21 CET

Keywords: (none) => PATCH
CC: (none) => ennael1, thierry.vignaud

Thierry Vignaud 2013-12-29 11:54:58 CET

CC: (none) => tmb

Comment 2 Manuel Hiebel 2013-12-29 14:51:35 CET
http://www.mageia.org/$lang/community is maybe better
Comment 3 Atilla ÖNTAŞ 2013-12-29 19:26:22 CET
(In reply to Manuel Hiebel from comment #2)
Well, name suggests us to use about page. May be community page provides more; about page provides berief information about Mageia. So, i' ve used about page.

Also i improved the script a bit to check if localized page is available, if not it defaults to english page.

I committed changes to package, waiting for freeze push.
Comment 4 Atilla ÖNTAŞ 2013-12-29 19:56:13 CET
I have uploaded a patched/updated package for Mageia 3.

Suggested advisory:
========================

Updated indexhtml package to fix :

Indexhtml package supposed to be display useful information about Mageia.But it did not working. about-mageia script supplied with package was looking for non-existent directory and if correct path supplied displayed almost empty web page. Updated package fixes this issue and new about-mageia script opens mageia.org/about page for user in a web browser.

References:
https://bugs.mageia.org/show_bug.cgi?id=12131
========================

Updated packages in core/updates_testing:
========================
indexhtml-1-9.mga3.noarch.rpm

Source RPMs: 
indexhtml-1-9.mga3.noarch.rpm.src.rpm
xmoto-1.2.2-3.1.mga2.tainted.src.rpm
Comment 5 Atilla ÖNTAŞ 2013-12-29 19:57:01 CET
Sorry, there is no xmoto-1.2.2-3.1.mga2.tainted.src.rpm in advisory.
Atilla ÖNTAŞ 2013-12-29 19:58:28 CET

Assignee: tarakbumba => qa-bugs

Comment 6 Manuel Hiebel 2013-12-29 20:15:47 CET
just checked more and there is more easier to do: 

http://gitweb.mageia.org/software/indexhtml/tree/about/about-mageia

change mdk to mga in:
http://gitweb.mageia.org/software/indexhtml/tree/about/index.html.in

before </head> add:
<script language=javascript>
function redirect(){
  window.location = "http://mageia.org/about";
}
</script>

and change <body> to <body onload="redirect()">

all the two in http://gitweb.mageia.org/software/indexhtml/tree/about/index.html.in

I just modified mageia.org/about, it should now redirect automatically to the correct lang

(there useless stuff but well)

Assignee: qa-bugs => bugsquad

Comment 7 Atilla ÖNTAŞ 2014-01-17 22:42:25 CET
(In reply to Manuel Hiebel from comment #6)
Your suggestion seems cause errors:

./create_html.sh 
Merging translations into index.html.

not well-formed (invalid token) at line 5, column 33, byte 269 at /usr/lib/perl5/vendor_perl/5.18.1/x86_64-linux-thread-multi/XML/Parser.pm line 187.
Comment 8 Manuel Hiebel 2014-01-17 23:48:26 CET
Nop, as it said "Merging translations into index.html." So no issue I made.

And I didn't make any change for about-mageia.desktop, which is the second intltool-merge. It looks more warning.
Comment 9 Atilla ÖNTAŞ 2014-01-18 00:22:37 CET
(In reply to Manuel Hiebel from comment #8)
But i get an empty index.html file...
Comment 10 Manuel Hiebel 2014-01-18 00:35:02 CET
indeed sorry, it looks like <script language=javascript> was not valid in xml

using <script language="javascript"> instead made it working.
Comment 11 Atilla ÖNTAŞ 2014-01-18 01:10:15 CET
(In reply to Manuel Hiebel from comment #10)
Thanks. This time it worked. But i still in doubt to use your suggestion. Because, as i see, browser first opens index.html but it is impossible to read what is written and quickly redirected to mageia.org/about. 

It somewhat seems not pretty for me. Sorry.

Also, i don' t understand why we even need an index.html. Index.html is untouched almost 2 years now and what will "Coming soon..." ?
Comment 12 Manuel Hiebel 2014-01-18 03:02:24 CET
Well it's a quick fix, I'm not the author of this. 
You can remove generation of localised html + content too if you want.

But adding a shell script to redirect something already present is not better ihmo.
Comment 13 Manuel Hiebel 2014-01-18 03:06:08 CET
ah didn't see you don't provide the code anymore, but it this case: 
 cd about
./create_html.sh

is useless too
Comment 14 Atilla ÖNTAŞ 2014-01-18 15:29:45 CET
(In reply to Manuel Hiebel from comment #13)
I did not provide a code to source from the beginning. I only replace about-mageia.sh script with a new one in package not source. 

Thanks for the hint, i remove build create_html.sh stuff from specfile. Now waiting for the freeze push...
Comment 15 Atilla ÖNTAŞ 2014-01-18 15:39:32 CET
(In reply to Atilla ÃNTAÅ from comment #14)
Naah... create_html.sh is needed to create desktop file. I reverted my previous commit.
Comment 16 Atilla ÖNTAŞ 2014-01-18 15:42:52 CET
I' m assigning bug report to qa-bugs@ml.mageia.org because there is an Mageia 3 update proposed and updates policy requires this.

Assignee: bugsquad => qa-bugs

Comment 17 David Walser 2014-01-18 18:24:28 CET
Since objections have been raised to the implementation of these changes on the dev list, let's wait until that's settled and this is pushed in Cauldron before pushing the Mageia 3 update to QA.

CC: (none) => qa-bugs
Assignee: qa-bugs => tarakbumba

Comment 18 Atilla ÖNTAŞ 2014-01-18 23:25:50 CET
Manuel and David; we have to decide which fix should be used:

2014/1/19 Thomas Backlund <tmb@mageia.org>:
> Since there is still disagreement of what the fix should be, it wont get
> pushed to cauldron or mga3

I prefer using about-mageia script included as source; which doesn' t interfere with the source code and do not cause to display  "Coming soon" page.
Comment 19 Alex Loginov 2014-01-19 13:25:11 CET
Package indexhtml in Mageia 4 RC is very old. No new translations. There is problem with mdk->mga. There is problem with pot file. There are no strings
About Mageia
More about Mageia
in pot file from about-mageia.desktop.in for translations.
desktop file is without translations.

Atilla, in MATE you can see untranslated Menu and unworked about-mageia.
As Mageia 4 will be soon, then please hide about-mageia from Menu in MATE.

CC: (none) => loginov_alex

Comment 20 Atilla ÖNTAŞ 2014-01-19 15:26:36 CET
(In reply to Alex Loginov from comment #19)
Alex, if we decide which fix will be used then indexhtml will work as intended.

For the transalitons for about-mageia.desktop; there are no translations at all in source...

To hide about-magia from menu, about-mageia.desktop should be patched...
Comment 21 Alex Loginov 2014-01-19 18:11:08 CET
Please add strings for translation in POT file and realy use them in spec for about-mageia.desktop localization.
Comment 22 Atilla ÖNTAŞ 2014-01-19 19:42:31 CET
(In reply to Alex Loginov from comment #21)
Alex, current source does not contain translations but git has. I' m not the developer of the source code but merely trying to fix an important issue.

Anyway, i pulled translations from git and added them into package. Now, available translations included.
Comment 23 Atilla ÖNTAŞ 2014-01-31 13:20:28 CET
Now, we are in Final Release eve, then the chance to fix this issue for ISOs is missed. We can always provide updates though. But we still need to decide which woraround should be used. More opinions?
Comment 24 Alex Loginov 2014-02-19 17:37:44 CET
If nobody can decide, but Atilla has workaround and want to fix, then better to use anything instead nothing. It's "nobody" package. Any maintainer can take it.
Atilla, will you take and support?
Comment 25 Philippe Makowski 2014-04-01 22:57:27 CEST
Please push Atilla's solution(In reply to Alex Loginov from comment #24)
> If nobody can decide, but Atilla has workaround and want to fix, then better
> to use anything instead nothing. 
yes please go

CC: (none) => makowski.mageia

Comment 26 Atilla ÖNTAŞ 2014-04-01 23:33:32 CEST
I have submitted indexhtml-1-12.mga5 to Cauldron.
Comment 27 Atilla ÖNTAŞ 2014-04-01 23:35:43 CEST
I have uploaded a patched/updated package to core/updates_testing for Mageia 3.

Suggested advisory:
========================

Updated indexhtml package to fix :

Indexhtml package supposed to be display useful information about Mageia. But it did not working. about-mageia script supplied with package itself was looking for non-existent /usr/share/mdv directory and if correct path (/usr/share/mga) supplied displayed almost empty web page.

Another problem was it was not including updated translations. Updated translations added from our git.mageia.org

Updated package fixes this issue and new about-mageia script opens mageia.org/about page for user in a web browser.

References:
https://bugs.mageia.org/show_bug.cgi?id=12131
========================

Updated packages in core/updates_testing:
========================
indexhtml-1-9.2.mga3.noarch.rpm


-----------------------------------------------------------------------------
-----------------------------------------------------------------------------


I have uploaded a patched/updated package to core/updates_testing for Mageia 4.

Suggested advisory:
========================

Updated indexhtml package to fix :

Indexhtml package supposed to be display useful information about Mageia. But it did not working. about-mageia script supplied with package itself was looking for non-existent /usr/share/mdv directory and if correct path (/usr/share/mga) supplied displayed almost empty web page.

Another problem was it was not including updated translations. Updated translations added from our git.mageia.org

Updated package fixes this issue and new about-mageia script opens mageia.org/about page for user in a web browser.

References:
https://bugs.mageia.org/show_bug.cgi?id=12131
========================

Updated packages in core/updates_testing:
========================
indexhtml-1-10.1.mga4.noarch.rpm

Source RPMs: 
indexhtml-1-10.1.mga4.src.rpm

Version: Cauldron => 4
Assignee: tarakbumba => qa-bugs
Source RPM: indexhtml-1-10.mga4.src.rpm => indexhtml-1-9.mga3.src.rpm, indexhtml-1-10.mga4.src.rpm

Philippe Makowski 2014-04-04 19:04:12 CEST

CC: makowski.mageia => (none)

Comment 28 David GEIGER 2014-04-04 20:14:14 CEST
Tested mga4_64,

Testing complete for indexhtml-1.10.1.mga4, Ok for me I confirm that bug is fixed here.

Before :
$ about-mageia
file not found for about Mageia

$ cat /usr/bin/about-mageia
#!/bin/sh
if [ "x$GNOME_DESKTOP_SESSION_ID" != "x" -a -x /usr/bin/yelp ]; then
        www_browser="/usr/bin/yelp"
else
        www_browser="xdg-open"
fi

for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
 file="/usr/share/mdk/about/index-$lang.html"
 if [ -f "$file" ]; then
   $www_browser $file   
   exit 0
 fi
done

if [ -f /usr/share/mdk/about/index.html ]; then
 $www_browser /usr/share/mdk/about/index.html
 exit 0
fi

echo "file not found for about Mageia"
exit 1

--------------------------------------------------------------------------------
After :
$ about-mageia
 " Open http://www.mageia.org/fr/about/ "

$ cat /usr/bin/about-mageia
#!/bin/sh
WGET="$(which wget)"

$WGET -q --tries=20 --timeout=10 http://www.google.com -O /tmp/google.idx &> /dev/null
if [ ! -s /tmp/google.idx ]; then
    echo "ERROR: No internet connection detected.
In order to display About Mageia page you should have an working connection."
        exit 1
else
        for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
            $WGET -q --tries=20 --timeout=10 http://www.mageia.org/$lang/about -O /tmp/mageiaorg.idx &> /dev/null
            if [ ! -s /tmp/mageiaorg.idx ]; then
                echo "WARNING: There is no localized Mageia About web page; 
displaying English web page"
            xdg-open "http://www.mageia.org/en/about"
        else
            xdg-open "http://www.mageia.org/$lang/about"
            exit 0
        fi
        done   
fi

CC: (none) => geiger.david68210

Comment 29 David GEIGER 2014-04-04 20:20:15 CEST
Tested mga4_32,

Testing complete for indexhtml-1.10.1.mga4, Ok for me I confirm that bug is fixed here too.

Before :
$ about-mageia
file not found for about Mageia

$ cat /usr/bin/about-mageia
#!/bin/sh
if [ "x$GNOME_DESKTOP_SESSION_ID" != "x" -a -x /usr/bin/yelp ]; then
        www_browser="/usr/bin/yelp"
else
        www_browser="xdg-open"
fi

for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
 file="/usr/share/mdk/about/index-$lang.html"
 if [ -f "$file" ]; then
   $www_browser $file   
   exit 0
 fi
done

if [ -f /usr/share/mdk/about/index.html ]; then
 $www_browser /usr/share/mdk/about/index.html
 exit 0
fi

echo "file not found for about Mageia"
exit 1

--------------------------------------------------------------------------------
After :
$ about-mageia
 " Open http://www.mageia.org/fr/about/ "

$ cat /usr/bin/about-mageia
#!/bin/sh
WGET="$(which wget)"

$WGET -q --tries=20 --timeout=10 http://www.google.com -O /tmp/google.idx &> /dev/null
if [ ! -s /tmp/google.idx ]; then
    echo "ERROR: No internet connection detected.
In order to display About Mageia page you should have an working connection."
        exit 1
else
        for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
            $WGET -q --tries=20 --timeout=10 http://www.mageia.org/$lang/about -O /tmp/mageiaorg.idx &> /dev/null
            if [ ! -s /tmp/mageiaorg.idx ]; then
                echo "WARNING: There is no localized Mageia About web page; 
displaying English web page"
            xdg-open "http://www.mageia.org/en/about"
        else
            xdg-open "http://www.mageia.org/$lang/about"
            exit 0
        fi
        done   
fi

Whiteboard: MGA3TOO => MGA3TOO MGA4-64-OK MGA4-32-OK

Comment 30 David GEIGER 2014-04-04 20:34:10 CEST
Tested mga3_64,

Testing complete for indexhtml-1.9.2.mga3, Ok for me I confirm that bug is fixed here.

Before :
$ about-mageia
file not found for about Mageia

$ cat /usr/bin/about-mageia
#!/bin/sh
if [ "x$GNOME_DESKTOP_SESSION_ID" != "x" -a -x /usr/bin/yelp ]; then
        www_browser="/usr/bin/yelp"
else
        www_browser="xdg-open"
fi

for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
 file="/usr/share/mdk/about/index-$lang.html"
 if [ -f "$file" ]; then
   $www_browser $file   
   exit 0
 fi
done

if [ -f /usr/share/mdk/about/index.html ]; then
 $www_browser /usr/share/mdk/about/index.html
 exit 0
fi

echo "file not found for about Mageia"
exit 1

--------------------------------------------------------------------------------
After :
$ about-mageia
 " Open http://www.mageia.org/fr/about/ "

$ cat /usr/bin/about-mageia
#!/bin/sh
WGET="$(which wget)"

$WGET -q --tries=20 --timeout=10 http://www.google.com -O /tmp/google.idx &> /dev/null
if [ ! -s /tmp/google.idx ]; then
    echo "ERROR: No internet connection detected.
In order to display About Mageia page you should have an working connection."
        exit 1
else
        for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
            $WGET -q --tries=20 --timeout=10 http://www.mageia.org/$lang/about -O /tmp/mageiaorg.idx &> /dev/null
            if [ ! -s /tmp/mageiaorg.idx ]; then
                echo "WARNING: There is no localized Mageia About web page; 
displaying English web page"
            xdg-open "http://www.mageia.org/en/about"
        else
            xdg-open "http://www.mageia.org/$lang/about"
            exit 0
        fi
        done   
fi
Comment 31 David GEIGER 2014-04-04 20:37:08 CEST
Tested mga3_32,

Testing complete for indexhtml-1.9.2.mga3, Ok for me I confirm that bug is fixed here too.

Before :
$ about-mageia
file not found for about Mageia

$ cat /usr/bin/about-mageia
#!/bin/sh
if [ "x$GNOME_DESKTOP_SESSION_ID" != "x" -a -x /usr/bin/yelp ]; then
        www_browser="/usr/bin/yelp"
else
        www_browser="xdg-open"
fi

for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
 file="/usr/share/mdk/about/index-$lang.html"
 if [ -f "$file" ]; then
   $www_browser $file   
   exit 0
 fi
done

if [ -f /usr/share/mdk/about/index.html ]; then
 $www_browser /usr/share/mdk/about/index.html
 exit 0
fi

echo "file not found for about Mageia"
exit 1

--------------------------------------------------------------------------------
After :
$ about-mageia
 " Open http://www.mageia.org/fr/about/ "

$ cat /usr/bin/about-mageia
#!/bin/sh
WGET="$(which wget)"

$WGET -q --tries=20 --timeout=10 http://www.google.com -O /tmp/google.idx &> /dev/null
if [ ! -s /tmp/google.idx ]; then
    echo "ERROR: No internet connection detected.
In order to display About Mageia page you should have an working connection."
        exit 1
else
        for lang in `echo $LANG:$LANGUAGE | tr ':' ' ' | cut -d'_' -f1` ; do
            $WGET -q --tries=20 --timeout=10 http://www.mageia.org/$lang/about -O /tmp/mageiaorg.idx &> /dev/null
            if [ ! -s /tmp/mageiaorg.idx ]; then
                echo "WARNING: There is no localized Mageia About web page; 
displaying English web page"
            xdg-open "http://www.mageia.org/en/about"
        else
            xdg-open "http://www.mageia.org/$lang/about"
            exit 0
        fi
        done   
fi

Whiteboard: MGA3TOO MGA4-64-OK MGA4-32-OK => MGA3TOO MGA4-64-OK MGA4-32-OK MGA3-64-OK MGA3-32-OK

Comment 32 claire robinson 2014-04-04 21:08:00 CEST
Advisory uploaded. Validating.

Could sysadmin please push to 3 & 4 updates

Thanks!

Keywords: (none) => validated_update
Whiteboard: MGA3TOO MGA4-64-OK MGA4-32-OK MGA3-64-OK MGA3-32-OK => MGA3TOO has_procedure advisory MGA4-64-OK MGA4-32-OK MGA3-64-OK MGA3-32-OK
CC: (none) => sysadmin-bugs

Comment 33 Damien Lallement 2014-04-04 23:00:31 CEST
http://advisories.mageia.org/MGAA-2014-0095.html

Status: NEW => RESOLVED
CC: (none) => mageia
Resolution: (none) => FIXED

Comment 34 Mageia Robot 2017-03-13 19:23:01 CET
commit e63429937b6cfa71709e3c39e0a340e448a0b583
Author: Rémi Verschelde <rverschelde@...>
Date:   Mon Mar 13 19:19:36 2017 +0100

    Fix about-mageia looking for non-existing directory (mga#12131)
    
    This fix had been provided as an alternative source in the SRPM and never
    committed to git. (That's bad!)
---
 Commit Link:
   http://gitweb.mageia.org/software/indexhtml/commit/?id=e63429937b6cfa71709e3c39e0a340e448a0b583

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