FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Studio User

 
 
LinkBack Thread Tools
 
Old 03-01-2010, 03:34 PM
Radek Vykydal
 
Default Derive stage2= from repo=nfsiso: correctly (#565885)

Prevents sigsegv on x86_64.
---
loader/method.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/loader/method.c b/loader/method.c
index 5f3a7ce..219fd06 100644
--- a/loader/method.c
+++ b/loader/method.c
@@ -516,6 +516,14 @@ void setStage2LocFromCmdline(char * arg, struct loaderData_s * ld) {
&(((struct nfsInstallData *)ld->stage2Data)->host),
&(((struct nfsInstallData *)ld->stage2Data)->directory),
&(((struct nfsInstallData *)ld->stage2Data)->mountOpts));
+ } else if (!strncmp(arg, "nfsiso:", 7)) {
+ ld->method = METHOD_NFS;
+ ld->stage2Data = calloc(sizeof(struct nfsInstallData *), 1);
+
+ parseNfsHostPathOpts(arg + 7,
+ &(((struct nfsInstallData *)ld->stage2Data)->host),
+ &(((struct nfsInstallData *)ld->stage2Data)->directory),
+ &(((struct nfsInstallData *)ld->stage2Data)->mountOpts));
} else if (!strncmp(arg, "ftp:", 4) ||
!strncmp(arg, "http", 4)) {
ld->method = METHOD_URL;
--
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-02-2010, 11:03 AM
Steffen Maier
 
Default Derive stage2= from repo=nfsiso: correctly (#565885)

On 03/01/2010 05:34 PM, Radek Vykydal wrote:
> Prevents sigsegv on x86_64.

I would think this bug exists cross-platform, i.e. not just x86_64.
After all it was originally reported for s390x.

> ---
> loader/method.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
>
> diff --git a/loader/method.c b/loader/method.c
> index 5f3a7ce..219fd06 100644
> --- a/loader/method.c
> +++ b/loader/method.c
> @@ -516,6 +516,14 @@ void setStage2LocFromCmdline(char * arg, struct loaderData_s * ld) {
> &(((struct nfsInstallData *)ld->stage2Data)->host),
> &(((struct nfsInstallData *)ld->stage2Data)->directory),
> &(((struct nfsInstallData *)ld->stage2Data)->mountOpts));
> + } else if (!strncmp(arg, "nfsiso:", 7)) {
> + ld->method = METHOD_NFS;
> + ld->stage2Data = calloc(sizeof(struct nfsInstallData *), 1);
> +
> + parseNfsHostPathOpts(arg + 7,
> + &(((struct nfsInstallData *)ld->stage2Data)->host),
> + &(((struct nfsInstallData *)ld->stage2Data)->directory),
> + &(((struct nfsInstallData *)ld->stage2Data)->mountOpts));
> } else if (!strncmp(arg, "ftp:", 4) ||
> !strncmp(arg, "http", 4)) {
> ld->method = METHOD_URL;

This looks good for fixing the specific use case of specifying
repo=nfsiso:... without stage2=...

However, I fear ld->method will remain -1 or the like and ld->stage2Data
will remain without allocated memory whenever the user has a typo in his
repo method. Will loader still segfault when the user accidently
specified repo=vtp://... ? IMHO, anaconda should not break down on
invalid user input.

So
class = installMethods[validMethods[loaderData->method]].type;
in STEP_METHOD might access validMethods with an invalid index?

} else if (!loaderData->stage2Data && loaderData->instRepo) {
/* If no CD/DVD with a stage2 image was found and we were
given a
* repo=/method= parameter, try to piece together a valid
setting
* for the stage2= parameter based on that.

*/
char *tmp;

checked_asprintf(&tmp, "%s/images/install.img",
loaderData->instRepo);

logMessage(INFO, "no stage2= given, assuming %s", tmp);
setStage2LocFromCmdline(tmp, loaderData);
free(tmp);

/* If we had to infer a stage2= location, but the repo=
parameter
* we based this guess on was wrong, we need to correct the
typo
* in both places. Unfortunately we can't really know what
the
* user meant, so the best we can do is take the results of

* running stage2= through the UI and chop off any
/images/whatever
* path that's at the end of it.

*/

To me this sounds as if this should handle my above case but apparently
didn't which in turn led to the segfault?

loaderData->inferredStage2 = 1;
skipMethodDialog = 1;
}

Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-03-2010, 02:43 PM
Radek Vykydal
 
Default Derive stage2= from repo=nfsiso: correctly (#565885)

Thanks for review,

Steffen Maier wrote:

On 03/01/2010 05:34 PM, Radek Vykydal wrote:


Prevents sigsegv on x86_64.



I would think this bug exists cross-platform, i.e. not just x86_64.
After all it was originally reported for s390x.




You are right.



This looks good for fixing the specific use case of specifying
repo=nfsiso:... without stage2=...

However, I fear ld->method will remain -1 or the like and ld->stage2Data
will remain without allocated memory whenever the user has a typo in his
repo method. Will loader still segfault when the user accidently
specified repo=vtp://... ? IMHO, anaconda should not break down on
invalid user input.




True, I'd rather handle it in another patch (probably better
with appropriate new bug open?) that I am going to send to
devel list.

Radek

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org