[master/rhel7] Fix crashes in the LayoutIndicator dispose function.
by David Shea
dispose can be called multiple times, so we need to indicate that the
signal handlers on the XklEngine are unset, lest a second call to
dispose cause a segfault. Also, dispose always needs to call the parent
class's dispose.
Resolves: rhbz#1061206
---
widgets/src/LayoutIndicator.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/widgets/src/LayoutIndicator.c b/widgets/src/LayoutIndicator.c
index e1797f7..e3d4039 100644
--- a/widgets/src/LayoutIndicator.c
+++ b/widgets/src/LayoutIndicator.c
@@ -59,7 +59,9 @@ struct _AnacondaLayoutIndicatorPrivate {
GdkCursor *cursor;
XklConfigRec *config_rec;
gulong state_changed_handler_id;
+ gboolean state_changed_handler_id_set;
gulong config_changed_handler_id;
+ gboolean config_changed_handler_id_set;
};
G_DEFINE_TYPE(AnacondaLayoutIndicator, anaconda_layout_indicator, GTK_TYPE_EVENT_BOX)
@@ -198,9 +200,11 @@ static void anaconda_layout_indicator_init(AnacondaLayoutIndicator *self) {
self->priv->state_changed_handler_id = g_signal_connect(klass->engine, "X-state-changed",
G_CALLBACK(x_state_changed),
g_object_ref(self));
+ self->priv->state_changed_handler_id_set = TRUE;
self->priv->config_changed_handler_id = g_signal_connect(klass->engine, "X-config-changed",
G_CALLBACK(x_config_changed),
g_object_ref(self));
+ self->priv->config_changed_handler_id_set = TRUE;
/* init layout attribute with the current layout */
self->priv->layout = get_current_layout(klass->engine, self->priv->config_rec);
@@ -238,8 +242,17 @@ static void anaconda_layout_indicator_dispose(GObject *object) {
AnacondaLayoutIndicatorClass *klass = ANACONDA_LAYOUT_INDICATOR_GET_CLASS(self);
/* disconnect signals (XklEngine will outlive us) */
- g_signal_handler_disconnect(klass->engine, self->priv->state_changed_handler_id);
- g_signal_handler_disconnect(klass->engine, self->priv->config_changed_handler_id);
+ if (self->priv->state_changed_handler_id_set)
+ {
+ g_signal_handler_disconnect(klass->engine, self->priv->state_changed_handler_id);
+ self->priv->state_changed_handler_id_set = FALSE;
+ }
+
+ if (self->priv->config_changed_handler_id_set)
+ {
+ g_signal_handler_disconnect(klass->engine, self->priv->config_changed_handler_id);
+ self->priv->config_changed_handler_id_set = FALSE;
+ }
/* unref all objects we reference (may be called multiple times) */
if (self->priv->layout_label) {
@@ -258,6 +271,8 @@ static void anaconda_layout_indicator_dispose(GObject *object) {
g_free(self->priv->layout);
self->priv->layout = NULL;
}
+
+ G_OBJECT_CLASS(anaconda_layout_indicator_parent_class)->dispose(object);
}
static void anaconda_layout_indicator_realize(GtkWidget *widget, gpointer data) {
--
1.8.5.3
10 years, 3 months
[rhel7-branch][PATCH] Tell libreport if it is a final release or not (#1063690)
by Vratislav Podzimek
Reporting to bugzilla should be enabled/disabled on pre-release/final composes
respecively.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/exception.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pyanaconda/exception.py b/pyanaconda/exception.py
index 13f5ba9..9767c00 100644
--- a/pyanaconda/exception.py
+++ b/pyanaconda/exception.py
@@ -38,6 +38,7 @@ from pyanaconda.constants import ROOT_PATH, THREAD_EXCEPTION_HANDLING_TEST
from pyanaconda.threads import threadMgr
from pyanaconda.i18n import _
from pyanaconda import flags
+from pyanaconda import product
# pylint: disable-msg=E0611
from gi.repository import GLib
@@ -246,7 +247,11 @@ def initExceptionHandling(anaconda):
conf.register_callback("lsblk_output", lsblk_callback, attchmnt_only=True)
conf.register_callback("nmcli_dev_list", nmcli_dev_list_callback,
attchmnt_only=True)
+
+ # provide extra information for libreport
conf.register_callback("type", lambda: "anaconda", attchmnt_only=True)
+ if not product.isFinal:
+ conf.register_callback("release_type", lambda: "pre-release", attchmnt_only=True)
handler = AnacondaExceptionHandler(conf, anaconda.intf.meh_interface,
ReverseExceptionDump, anaconda.intf.tty_num)
--
1.8.5.3
10 years, 3 months
[rhel7-branch] Another round of driver disk fixes
by Vratislav Podzimek
These two patches should fix the issues of both interactive and non-interactive
driver disk specification.
Vratislav Podzimek (2):
Do not try to umount None
Fix blkid output parsing and our output
dracut/driver-updates | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
--
1.8.5.3
10 years, 3 months
[v2][rhel7-branch/master][PATCH] Proper retry handling
by Martin Kolman
Based on feedback from Chris and Brian, I have reworked how
package download retrying works:
- we no do 10 retries (+ the initial attempt)
- we wait between attempt and the wait gets progressively longer
(from 0.5 to 256 seconds for the final attempt)
- the while loops have been replaced by for loops and as a result
should be both always bounded & more readable
All in all with this patch it should now be possible to install
Fedora or RHEL over a pretty shaky connection. :)
Martin Kolman (1):
Properly retry package downloads (#924860)
scripts/anaconda-yum | 105 +++++++++++++++++++++++++++++++++++++++++----------
1 file changed, 86 insertions(+), 19 deletions(-)
--
1.8.5.3
10 years, 3 months
[rhel7-branch][PATCH] Allow catching exceptions from threads (#1063705)
by Vratislav Podzimek
By running exception handler every time an exception appears in a thread we
block us from using our features provided by the wait method. Some exceptions
may be non-critical and the waiting thread may recover from the erroneous state.
However, we need to give it a chance to do so.
The wait_all method called before we start the actual installation should make
sure there are no abandoned problematic threads that raised exception nobody
cared about.
(ported and squashed
07b7034ce91a0ac41f08c9c38b26a5c6179571a0
edc5255f3c5fa0d66f56c175b46e47415a2dda16 and
955a61aeb934e2d4196876bc0570e2139feb48b6 from master)
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/threads.py | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/threads.py b/pyanaconda/threads.py
index 854ed56..aebd7f8 100644
--- a/pyanaconda/threads.py
+++ b/pyanaconda/threads.py
@@ -57,9 +57,10 @@ class ThreadManager(object):
raise KeyError("Cannot add thread '%s', a thread with the same name already running" % obj.name)
self._objs[obj.name] = obj
- self._errors[obj.name] = None
obj.start()
+ return obj.name
+
def remove(self, name):
"""Removes a thread from the list of known objects. This should only
be called when a thread exits, or there will be no way to get a
@@ -117,6 +118,12 @@ class ThreadManager(object):
log.debug("Waiting for thread %s to exit" % name)
self.wait(name)
+ if self.any_errors:
+ thread_names = ", ".join(thread_name for thread_name in self._errors.iterkeys()
+ if self._errors[thread_name])
+ msg = "Unhandled errors from the following threads detected: %s" % thread_names
+ raise RuntimeError(msg)
+
def set_error(self, name, *exc_info):
"""Set the error data for a thread
@@ -136,10 +143,15 @@ class ThreadManager(object):
def raise_if_error(self, name):
"""If a thread has failed due to an exception, raise it into the main
- thread.
+ thread and remove it from errors.
"""
- if self._errors.get(name):
- raise self._errors[name][0], self._errors[name][1], self._errors[name][2]
+ if name not in self._errors:
+ # no errors found for the thread
+ return
+
+ exc_info = self._errors.pop(name)
+ if exc_info:
+ raise exc_info
def in_main_thread(self):
"""Return True if it is run in the main thread."""
@@ -180,7 +192,13 @@ class AnacondaThread(threading.Thread):
when the main process is killed.
"""
def __init__(self, *args, **kwargs):
+ if "fatal" in kwargs:
+ self._fatal = kwargs.pop("fatal")
+ else:
+ self._fatal = True
+
threading.Thread.__init__(self, *args, **kwargs)
+
self.daemon = True
def run(self, *args, **kwargs):
@@ -192,7 +210,8 @@ class AnacondaThread(threading.Thread):
threading.Thread.run(self, *args, **kwargs)
except:
threadMgr.set_error(self.name, *sys.exc_info())
- sys.excepthook(*sys.exc_info())
+ if self._fatal:
+ sys.excepthook(*sys.exc_info())
finally:
threadMgr.remove(self.name)
log.info("Thread Done: %s (%s)" % (self.name, self.ident))
--
1.8.5.3
10 years, 3 months
[PATCH] ListStore.remove expects an iter, not an int (#1062752).
by Chris Lumens
---
pyanaconda/ui/gui/spokes/custom.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index c040730..2f2422a 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2486,19 +2486,24 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
container.format.label = self._device_container_name
container_exists = getattr(container, "exists", False)
+ found = None
+
for idx, data in enumerate(self._containerStore):
# we're looking for the original vg name
if data[0] == container_name:
- self._containerStore.remove(idx)
-
c = self.__storage.devicetree.getDeviceByName(self._device_container_name)
freeSpace = self._device_container_name.getattr(c, "freeSpace", None)
self._containerStore.insert(idx, self._container_store_row(freeSpace))
self._containerCombo.set_active(idx)
self._modifyContainerButton.set_sensitive(not container_exists)
+
+ found = idx
break
+ if found:
+ self._containerStore.remove(self._containerStore.get_iter_from_string("%s" % found))
+
self._update_selectors()
def on_container_changed(self, combo):
--
1.8.3.1
10 years, 3 months
[PATCH anaconda:rhel7/master] Update the Aarch64 packages to include efibootmgr.
by d.marlin
From: "d.marlin" <dmarlin(a)redhat.com>
efibootmgr now builds for 64-bit ARM (aarch64), so add it back to the list
of packages.
Signed-off-by: David A. Marlin <dmarlin(a)redhat.com>
---
pyanaconda/bootloader.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index eea75ab..add40ad 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1733,10 +1733,10 @@ class EFIGRUB(GRUB2):
def check(self):
return True
-# FIXME: We need to include grubby, and omit efibootmgr and shim packages
+# FIXME: We need to include grubby, and omit the shim package
# on aarch64 until we get all the EFI bits in place.
class Aarch64EFIGRUB(EFIGRUB):
- packages = ["grub2-efi", "grubby"]
+ packages = ["grub2-efi", "efibootmgr", "grubby"]
_serial_consoles = ["ttyAMA", "ttyS"]
--
1.8.3.1
10 years, 3 months
[master/rhel7] kickstart user accounts should be locked by default (#1063554)
by Brian C. Lane
Commit 18a8f661635884e7861bc14f200455e470bebb0b changed createUser so
that an account could be created with an empty password (see bug
--password or --lock argument being created with no password, which is
not what was intended.
The impact was limited to local accounts, ssh blocks access to accounts
with empty passwords by default. But another local user could access one
of these accounts by using su.
This patch fixes user creation so that when accounts are created from a
kickstart and their password argument is blank (the default from
pykickstart is "") it will switch it to None so that createUser will
lock the passwordless account.
Resolves: rhbz#1063554
---
pyanaconda/kickstart.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 2251b2a..43a8d61 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -1400,6 +1400,12 @@ class User(commands.user.F12_User):
for usr in self.userList:
kwargs = usr.__dict__
kwargs.update({"algo": algo, "root": ROOT_PATH})
+
+ # If the user password came from a kickstart and it is blank we
+ # need to make sure the account is locked, not created with an
+ # empty password.
+ if ksdata.user.seen and kwargs.get("password", "") == "":
+ kwargs["password"] = None
if not users.createUser(usr.name, **kwargs):
log.error("User %s already exists, not creating." % usr.name)
--
1.8.5.3
10 years, 3 months
[master][PATCH] Return the returned value in the fire_gtk_action
by Vratislav Podzimek
There's no reason for discarding the value. If caller is not interested in it,
they can always not assign it anywhere.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py
index 4feb5bb..d8d8bb2 100644
--- a/pyanaconda/ui/gui/utils.py
+++ b/pyanaconda/ui/gui/utils.py
@@ -83,7 +83,7 @@ def fire_gtk_action(func, *args):
def gtk_action():
func(*args)
- gtk_action()
+ return gtk_action()
def gtk_action_nowait(func):
"""Decorator method which ensures every call of the decorated function to be
--
1.8.5.3
10 years, 3 months