Bug 117634

Summary: time_zoneproposal.ycp does not check the /bin/date return code
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Olaf Hering <ohering>
Component: InstallationAssignee: Jiří Suchomel <jsuchome>
Status: RESOLVED INVALID QA Contact: Klaus Kämpf <kkaempf>
Severity: Normal    
Priority: P5 - None    
Version: RC 4   
Target Milestone: ---   
Hardware: PowerPC   
OS: Linux   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Olaf Hering 2005-09-17 16:25:14 UTC
SCR::Execute in clients/timezone_proposal.ycp::"MakeProposal" returned -1
because fork of /bin/date +%Y failed.
As a result, the date was always < 2004 and installation could not start.

it should probably be

if (tointeger(m["exit"]:"1") == 0 && tointeger (m["stdout"]:"0") < 2004)
Comment 1 Jiří Suchomel 2005-09-19 07:33:52 UTC
Could you attach whole log file?

I'm not sure if it could be better - what do you think MakeProposal should
return if date call fails?
Comment 2 Olaf Hering 2005-09-19 07:59:26 UTC
it should just accept the current time. inst_setup does set it to a sensible
date since 10.0.
Comment 3 Jiří Suchomel 2005-09-19 12:20:24 UTC
please attach the whole log file
Comment 4 Olaf Hering 2005-09-21 12:56:50 UTC
I dont have them anymore.

can you briefly describe the error handling here?

normal case:

/var/log/YaST2/y2log-2:2005-09-14 12:44:38 <1> linux(2854) [YCP]
clients/timezone_proposal.ycp:28 date call: $["exit":0, "stderr":"",
"stdout":"2005\n"]

error case:
/var/log/YaST2/y2log-2:2005-09-14 12:44:38 <1> linux(2854) [YCP]
clients/timezone_proposal.ycp:28 date call: $["exit":-1, "stderr":"", "stdout":""]

will the "0" be used as date value? If so, why is it 0 and not 2004?
Comment 5 Jiří Suchomel 2005-09-21 13:04:22 UTC
No, why should it? It uses stdout value. Why should it be 2004?
Comment 6 Olaf Hering 2005-09-21 13:05:41 UTC
what if stdout is empty because /bin/date did not run?
Comment 7 Jiří Suchomel 2005-09-21 13:17:58 UTC
Than there is "0" as default value
Comment 8 Olaf Hering 2005-09-21 13:20:59 UTC
and does "0" make sense in this context, because it prevents installation?
Comment 9 Jiří Suchomel 2005-09-21 13:27:07 UTC
Yes, because something goes wrong when the date doesn't run.
Comment 10 Jiří Suchomel 2005-09-21 13:32:43 UTC
More info: the check for "date in the past" was done because of bug #57458.
Comment 11 Jiří Suchomel 2005-09-22 14:54:50 UTC
Olaf, I really think this is invalid. I don't see any better solution when date
doesn't return reasonable result and thus part of the system is in some unknown
state.

(Sorry if my previous comments were too strict.)