Hello community, here is the log from the commit of package linuxrc for openSUSE:Factory checked in at 2015-06-30 10:14:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/linuxrc (Old) and /work/SRC/openSUSE:Factory/.linuxrc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "linuxrc" Changes: -------- --- /work/SRC/openSUSE:Factory/linuxrc/linuxrc.changes 2015-06-04 08:51:16.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes 2015-06-30 10:14:34.000000000 +0200 @@ -1,0 +2,15 @@ +Thu Jun 25 15:41:03 CEST 2015 - snw...@suse.com + +- avoid any interactive dialogs when checking the digest of files during + an 'extend' command (bsc#936068) +- 5.0.46 + +------------------------------------------------------------------- +Wed Jun 24 10:11:04 CEST 2015 - snw...@suse.com + +- re-arrange code a bit and fix typo +- changed 'media not found' message into a dialog letting the user select + the URL to retry (bsc#923918) +- 5.0.45 + +------------------------------------------------------------------- Old: ---- linuxrc-5.0.44.tar.xz New: ---- linuxrc-5.0.46.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.OkO5f7/_old 2015-06-30 10:14:35.000000000 +0200 +++ /var/tmp/diff_new_pack.OkO5f7/_new 2015-06-30 10:14:35.000000000 +0200 @@ -25,7 +25,7 @@ Summary: SUSE Installation Program License: GPL-3.0+ Group: System/Boot -Version: 5.0.44 +Version: 5.0.46 Release: 0 Source: %{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ linuxrc-5.0.44.tar.xz -> linuxrc-5.0.46.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.44/VERSION new/linuxrc-5.0.46/VERSION --- old/linuxrc-5.0.44/VERSION 2015-06-03 11:01:55.000000000 +0200 +++ new/linuxrc-5.0.46/VERSION 2015-06-25 15:40:33.000000000 +0200 @@ -1 +1 @@ -5.0.44 +5.0.46 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.44/changelog new/linuxrc-5.0.46/changelog --- old/linuxrc-5.0.44/changelog 2015-06-03 11:01:55.000000000 +0200 +++ new/linuxrc-5.0.46/changelog 2015-06-25 15:40:33.000000000 +0200 @@ -1,3 +1,12 @@ +2015-06-25: 5.0.46 + - avoid any interactive dialogs when checking the digest of files during + an 'extend' command (bsc #936068) + +2015-06-24: 5.0.45 + - re-arrange code a bit and fix typo + - changed 'media not found' message into a dialog letting the user select + the URL to retry (bsc #923918) + 2015-06-03: 5.0.44 - some minor corrections - added comments & prototypes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.44/global.h new/linuxrc-5.0.46/global.h --- old/linuxrc-5.0.44/global.h 2015-06-03 11:01:55.000000000 +0200 +++ new/linuxrc-5.0.46/global.h 2015-06-25 15:40:33.000000000 +0200 @@ -374,6 +374,7 @@ char *zenconfig; /* zenworks config file */ unsigned ntfs_3g:1; /* use ntfs-3g */ unsigned secure:1; /* secure mode (check digest of all downloaded files) */ + unsigned secure_always_fail:1; /* in secure mode: never ask the user but always fail directly */ unsigned sslcerts:1; /* whether to check ssl certificates */ unsigned sig_failed:2; /* signature check failed (1: not signed, 2: wrong signature) */ unsigned kexec:1; /* kexec to kernel & initrd from repo */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.44/linuxrc.c new/linuxrc-5.0.46/linuxrc.c --- old/linuxrc-5.0.44/linuxrc.c 2015-06-03 11:01:55.000000000 +0200 +++ new/linuxrc-5.0.46/linuxrc.c 2015-06-25 15:40:33.000000000 +0200 @@ -84,7 +84,7 @@ #if SWISS_ARMY_KNIFE static void lxrc_makelinks(char *name); #endif -// static void config_rescue(char *mp); +static void select_repo_url(char *msg, char **repo); #if SWISS_ARMY_KNIFE int probe_main(int argc, char **argv); @@ -668,8 +668,7 @@ void lxrc_init() { - int i, j; - char buf[256]; + int i; siginterrupt(SIGALRM, 1); signal(SIGHUP, SIG_IGN); @@ -1148,53 +1147,72 @@ if(config.braille.check) run_braille(); if(!config.manual && !auto2_init()) { + char *buf = NULL, *repo = NULL; + fprintf(stderr, "Automatic setup not possible.\n"); - util_disp_init(); + // ok, we failed to find a suitable repo + // do something about it - i = 0; - j = 1; + // If the file '/nextmedia' exists, get the message to show from there + // and retry the default repo settings if the user is ready. + // Otherwise, present the user the list of repos we have tried so far and + // let her choose / edit one and try again. + + util_disp_init(); if(util_check_exist("/nextmedia") == 'r') { config.cd1texts = file_parse_xmllike("/nextmedia", "text"); } - if(config.url.install) { - char *s = get_translation(config.cd1texts, current_language()->locale); - char *buf = NULL; + char *next_msg = get_translation(config.cd1texts, current_language()->locale); - strprintf(&buf, "%s\n\nRetry?", s ?: "Please make sure your installation medium is available."); - do { - j = dia_yesno(buf, YES) == YES ? 1 : 0; - if(j) { - slist_t *sl; + strprintf(&buf, + "%s\n\n%s", + next_msg ?: "Please make sure your installation medium is available.", + config.cd1texts ? "Continue?" : "Choose the URL to retry." + ); + + if(config.cd1texts) { + slist_t *sl; + + if(dia_okcancel(buf, YES) != YES) { + config.rescue = 0; + config.manual |= 1; + } + else { + for(sl = config.defaultrepo; sl; sl = sl->next) { config.manual = 0; - for(sl = config.defaultrepo, i = 0; sl && !i; sl = sl->next) { - url_free(config.url.install); - config.url.install = url_set(sl->key); - i = auto2_find_repo(); - } - } - } while(!i && j); - str_copy(&buf, NULL); - } + url_free(config.url.install); + config.url.install = url_set(sl->key); - if(!i) { - config.rescue = 0; - config.manual |= 1; - // this message is shown only if the above message was not - // FIXME: this is currently impossible, remove the code later - if(j) { - sprintf(buf, "Could not find the %s ", config.product); - strcat(buf, "Repository."); - strcat(buf, "\n\nActivating manual setup program.\n"); - dia_message(buf, MSGTYPE_ERROR); + if(auto2_find_repo()) break; + } } } else { - util_disp_done(); + do { + config.manual = 0; + + select_repo_url(buf, &repo); + + if(!repo || !*repo) { + config.rescue = 0; + config.manual |= 1; + + break; + } + + url_free(config.url.install); + config.url.install = url_set(repo); + } while(!auto2_find_repo()); } + + str_copy(&buf, NULL); + str_copy(&repo, NULL); + + if(!config.manual) util_disp_done(); } set_activate_language(config.language); @@ -1458,6 +1476,8 @@ if(!config.debug) config.debug = 1; config.keepinstsysconfig = 1; + config.linemode = 1; + config.secure_always_fail = 1; if(task == 'a' && sl) { fprintf(stderr, "instsys extend: add %s\n%s: already added\n", ext, ext); @@ -1567,3 +1587,71 @@ } +/* + * Offer the user a list of URLs to choose from based in the current install + * URL and the default repo setting. + * + * In addition she can also edit the URL. + * + * Return NULL in repo if the user cancelled the dialogs, else repo contains + * the chosen repo URL. + */ +void select_repo_url(char *msg, char **repo) +{ + slist_t *sl; + char **item_list; + int i, with_install_url, items, default_item; + + // if config.url.install is a duplicate of some default repo entry, skip it + with_install_url = config.url.install && !slist_getentry(config.defaultrepo, config.url.install->str); + + for(items = 1, sl = config.defaultrepo; sl; sl = sl->next) items++; + + if(with_install_url) items++; + + item_list = calloc(items + 1, sizeof *item_list); + + i = 0; + + if(with_install_url) { + item_list[i++] = config.url.install->str; + } + + for(sl = config.defaultrepo; sl; sl = sl->next, i++) { + item_list[i] = sl->key; + } + + item_list[i] = "Enter another URL"; + + default_item = 1; + + // if we skipped config.url.install because it's a duplicate of some + // defaultrepo entry, make it the default entry + if(config.url.install && !with_install_url) { + for(i = 1, sl = config.defaultrepo; sl && strcmp(sl->key, config.url.install->str); sl = sl->next) i++; + if(sl) default_item = i; + } + + i = dia_list(msg, 64, NULL, item_list, default_item, align_left); + + if(i > 0) { + if(i == items) { + if(!*repo) str_copy(repo, item_list[default_item - 1]); + if(dia_input2("Enter the repository URL.", repo, 64, 0)) { + str_copy(repo, NULL); + } + } + else { + str_copy(repo, item_list[i - 1]); + } + } + else { + str_copy(repo, NULL); + } + + free(item_list); + item_list = NULL; + + if(config.debug) fprintf(stderr, "repo: %s\n", *repo ?: ""); +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.44/url.c new/linuxrc-5.0.46/url.c --- old/linuxrc-5.0.44/url.c 2015-06-03 11:01:55.000000000 +0200 +++ new/linuxrc-5.0.46/url.c 2015-06-25 15:40:33.000000000 +0200 @@ -1476,6 +1476,11 @@ int i, win, err = 0; char *buf = NULL; + if(config.sig_failed && config.secure_always_fail) { + fprintf(stderr, "%s: file not signed or invalid signature\n", file_name); + return 1; + } + if(config.sig_failed) { strprintf(&buf, "%s: %s\n\n%s", @@ -1859,21 +1864,26 @@ else { fprintf(stderr, "digest check failed\n"); config.digests.failed = 1; - strprintf(&buf, - "%s: %s\n\n%s", - url_print2(url_data->url, NULL), - "SHA1 sum wrong.", - "If you really trust your repository, you may continue in an insecure mode." - ); - if(!(win = config.win)) util_disp_init(); - i = dia_okcancel(buf, NO); - if(!win) util_disp_done(); - if(i == YES) { - config.secure = 0; - config.digests.failed = 0; + if(config.secure_always_fail) { + ok = 0; } else { - ok = 0; + strprintf(&buf, + "%s: %s\n\n%s", + url_print2(url_data->url, NULL), + "SHA1 sum wrong.", + "If you really trust your repository, you may continue in an insecure mode." + ); + if(!(win = config.win)) util_disp_init(); + i = dia_okcancel(buf, NO); + if(!win) util_disp_done(); + if(i == YES) { + config.secure = 0; + config.digests.failed = 0; + } + else { + ok = 0; + } } } }