bugSystem V style init programs - Bugs: bug #57887, time parsing regression in shutdown

 
 

bug #57887: time parsing regression in shutdown

Submitter:  Arkadiusz Miskiewicz <arekm>
Submitted:  Mon 24 Feb 2020 01:30:21 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 15 Aug 2020 09:54:50 PM UTC, comment #2: 

Thank you for the patch and sorry I did not see this before. I have applied the patch upstream and will include this fix in the next version, 2.98.

It looks like the parsing issue only affects a time offset of "+0", the parsing error doesn't seem to affect shutdown when "+1" or "+2" is used.

Jesse <newguy>
Group administrator
Mon 24 Feb 2020 01:31:46 PM UTC, comment #1: 

(it breaks qemu-ga (guest agent) that runs shutdown command that way and (unfortunately) silently fails)

Arkadiusz Miskiewicz <arekm>
Mon 24 Feb 2020 01:30:21 PM UTC, original submission:  

author Jesse Smith <jsmith@resonatingmedia.com> 2019-01-
commit 483dc777d2c80552cff5a0368c05355bd7c13f95 (patch)

Changed the way the "when" variable is used internally in shutdown.c.


this change broke time parsing. This command worked before and shut down the system. Now it doesn't because it skips "+" in "sp" while later looks at "when" variable and considers it invalid.

$ sudo ./src/shutdown -k -h +0 "test"
Usage:    shutdown [-akrhPHfFnc] [-t sec] time [warning message]
                  -a:      use /etc/shutdown.allow
                  -k:      don't really shutdown, only warn.
                  -r:      reboot after shutdown.
                  -h:      halt after shutdown.
                  -P:      halt action is to turn off power.
                           can only be used along with -h flag.
                  -H:      halt action is to just halt.
                           can only be used along with -h flag.
                  -f:      do a 'fast' reboot (skip fsck).
                  -F:      Force fsck on reboot.
                  -n:      do not go through "init" but go down real fast.
                  -c:      cancel a running shutdown.
                  -q:      quiet mode - display fewer shutdown warnings.
                  -Q:      full quiet mode - display only final shutdown warning.
                  -t secs: delay between warning and kill signal.
                  * the "time" argument is mandatory! (try "now") *

Arkadiusz Miskiewicz <arekm>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #48507:  x.patch added by arekm (859B - application/octet-stream - Fix)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by newguy (Posted a comment)
  • -email is unavailable- added by arekm (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-15 newguy StatusNone Fixed
        Open/ClosedOpen Closed
    2020-02-27 arekm Attached File- Added x.patch, #48507

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code