Menu

#110 CMDS: bad array subscript

duply
closed-fixed
nobody
None
5
2017-07-20
2017-07-09
No

I see the notice about v2.0 saying I should change the config lines about SOURCE but there are only parameters about specific backends.

So those are really two bugs - the second one being the hint to the the config lines.

I wrote about this on the mailing list one month ago - but looking at its archive now I guess that was a rather bad idea.

duply lokal status
Start duply v2.0.2, time is 2017-07-10 00:35:56.
Using profile '/etc/duply/lokal'.
Using installed duplicity version 0.7.13, python 2.6.8, gpg 2.0.9 (Home: ~/.gnupg), awk 'GNU Awk 3.1.8', grep 'grep (GNU grep) 2.7', bash '3.2.51(1)-release (i586-suse-linux-gnu)'.
Checking TEMP_DIR '/tmp' is a folder and writable (OK)
Test - En/Decryption skipped. (GPG disabled)
/usr/local/bin/duply: line 2231: CMDS: bad array subscript

--- Start running command STATUS at 00:35:57.118 ---
Another duplicity instance is already running with this archive directory

00:35:57.573 Task 'STATUS' failed with exit code '23'.
--- Finished state FAILED 'code 23' at 00:35:57.573 - Runtime 00:00:00.454 ---

Discussion

  • Wolfgang Rohdewald

    Actually looking at the source code

    # get prev cnd, cnd are skipped pseudocmds
    prevno=$(( $CMD_NO - 1 ))
    CMD_VALUE=${CMDS[$prevno]}
    is_condition "$CMD_VALUE" && [ "$prevno" -ge 0 ] && CND_PREV=${CMDS[$prevno]}
    

    I propose this fix:

    diff -u /tmp/duply.alt /usr/local/bin/duply
    --- /tmp/duply.alt      2017-07-10 00:47:35.000000000 +0200
    +++ /usr/local/bin/duply        2017-07-10 00:51:31.000000000 +0200
    @@ -2228,8 +2228,10 @@
    
     # get prev cnd, cnd are skipped pseudocmds
     prevno=$(( $CMD_NO - 1 ))
    -CMD_VALUE=${CMDS[$prevno]}
    -is_condition "$CMD_VALUE" && [ "$prevno" -ge 0 ] && CND_PREV=${CMDS[$prevno]}
    +if [ "$prevno" -ge 0 ]; then
    
    +  CMD_VALUE=${CMDS[$prevno]}
    +  is_condition "$CMD_VALUE" && CND_PREV=${CMDS[$prevno]}
    +fi
    
     # get prev cmd command minus skipped commands, only executed
     prevno=$(( $CMD_NO - ${CMD_SKIPPED-0} - 1 )); unset CMD_SKIPPED
    
     
    • ede

      ede - 2017-07-10

      Wolfgang,

      weird my bash '4.3.30(1)-release (i686-pc-linux-gnu)', does not complain. btw. you should really update bash because of
      https://de.wikipedia.org/wiki/Shellshock_(Sicherheitsl%C3%BCcke)

      can you check if

      get prev cnd, cnd are skipped pseudocmds

      prevno=$(( $CMD_NO - 1 ))
      [ "$prevno" -ge 0 ] && is_condition "${CMDS[$prevno]}" && CND_PREV=${CMDS[$prevno]}

      works as well for you? seems more elegant to me.. thx ede

      On 10.07.2017 00:52, Wolfgang Rohdewald wrote:

      Actually looking at the source code

      ~~~

      get prev cnd, cnd are skipped pseudocmds

      prevno=$(( $CMD_NO - 1 ))
      CMD_VALUE=${CMDS[$prevno]}
      is_condition "$CMD_VALUE" && [ "$prevno" -ge 0 ] && CND_PREV=${CMDS[$prevno]}
      ~~~

      I propose this fix:

      ~~~
      diff -u /tmp/duply.alt /usr/local/bin/duply
      --- /tmp/duply.alt 2017-07-10 00:47:35.000000000 +0200
      +++ /usr/local/bin/duply 2017-07-10 00:51:31.000000000 +0200
      @@ -2228,8 +2228,10 @@

      # get prev cnd, cnd are skipped pseudocmds
      prevno=$(( $CMD_NO - 1 ))
      -CMD_VALUE=${CMDS[$prevno]}
      -is_condition "$CMD_VALUE" && [ "$prevno" -ge 0 ] && CND_PREV=${CMDS[$prevno]}
      +if [ "$prevno" -ge 0 ]; then
      + CMD_VALUE=${CMDS[$prevno]}
      + is_condition "$CMD_VALUE" && CND_PREV=${CMDS[$prevno]}
      +fi

      # get prev cmd command minus skipped commands, only executed
      prevno=$(( $CMD_NO - ${CMD_SKIPPED-0} - 1 )); unset CMD_SKIPPED

      ~~~


      ** [bugs:#110] CMDS: bad array subscript**

      Status: open
      Group: duply
      Created: Sun Jul 09, 2017 10:43 PM UTC by Wolfgang Rohdewald
      Last Updated: Sun Jul 09, 2017 10:43 PM UTC
      Owner: nobody

      I see the notice about v2.0 saying I should change the config lines about SOURCE but there are only parameters about specific backends.

      So those are really two bugs - the second one being the hint to the the config lines.

      I wrote about this on the mailing list one month ago - but looking at its archive now I guess that was a rather bad idea.

      ~~~
      duply lokal status
      Start duply v2.0.2, time is 2017-07-10 00:35:56.
      Using profile '/etc/duply/lokal'.
      Using installed duplicity version 0.7.13, python 2.6.8, gpg 2.0.9 (Home: ~/.gnupg), awk 'GNU Awk 3.1.8', grep 'grep (GNU grep) 2.7', bash '3.2.51(1)-release (i586-suse-linux-gnu)'.
      Checking TEMP_DIR '/tmp' is a folder and writable (OK)
      Test - En/Decryption skipped. (GPG disabled)
      /usr/local/bin/duply: line 2231: CMDS: bad array subscript

      --- Start running command STATUS at 00:35:57.118 ---
      Another duplicity instance is already running with this archive directory

      00:35:57.573 Task 'STATUS' failed with exit code '23'.
      --- Finished state FAILED 'code 23' at 00:35:57.573 - Runtime 00:00:00.454 ---

      ~~~


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ftplicity/bugs/110/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • Wolfgang Rohdewald

    Your proposal does not set CMD_VALUE anymore. But it is needed further down.

     
    • ede

      ede - 2017-07-20

      did you test it? does it work? works for me ;)

      wrt. CMD_VALUE
      can you show me where it is needed further down? i am sure it is simply used as a temp var to make the code more readable.

      ..ede/duply.net

      On 20.07.2017 09:12, Wolfgang Rohdewald wrote:

      Your proposal does not set CMD_VALUE anymore. But it is needed further down.


      [bugs:#110] https://sourceforge.net/p/ftplicity/bugs/110/ CMDS: bad array subscript

      Status: open
      Group: duply
      Created: Sun Jul 09, 2017 10:43 PM UTC by Wolfgang Rohdewald
      Last Updated: Sun Jul 09, 2017 10:52 PM UTC
      Owner: nobody

      I see the notice about v2.0 saying I should change the config lines about SOURCE but there are only parameters about specific backends.

      So those are really two bugs - the second one being the hint to the the config lines.

      I wrote about this on the mailing list one month ago - but looking at its archive now I guess that was a rather bad idea.

      duply lokal status
      Start duply v2.0.2, time is 2017-07-10 00:35:56.
      Using profile '/etc/duply/lokal'.
      Using installed duplicity version 0.7.13, python 2.6.8, gpg 2.0.9 (Home: ~/.gnupg), awk 'GNU Awk 3.1.8', grep 'grep (GNU grep) 2.7', bash '3.2.51(1)-release (i586-suse-linux-gnu)'.
      Checking TEMP_DIR '/tmp' is a folder and writable (OK)
      Test - En/Decryption skipped. (GPG disabled)
      /usr/local/bin/duply: line 2231: CMDS: bad array subscript

      --- Start running command STATUS at 00:35:57.118 ---
      Another duplicity instance is already running with this archive directory

      00:35:57.573 Task 'STATUS' failed with exit code '23'.
      --- Finished state FAILED 'code 23' at 00:35:57.573 - Runtime 00:00:00.454 ---


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ftplicity/bugs/110/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • Wolfgang Rohdewald

    You are absolutely right. Your patch works.

     
    • ede

      ede - 2017-07-20

      must have been one of my good days. will be in the next release.. i'll close the ticket then.. ede

      On 20.07.2017 12:14, Wolfgang Rohdewald wrote:

      You are absolutely right. Your patch works.


      [bugs:#110] https://sourceforge.net/p/ftplicity/bugs/110/ CMDS: bad array subscript

      Status: open
      Group: duply
      Created: Sun Jul 09, 2017 10:43 PM UTC by Wolfgang Rohdewald
      Last Updated: Thu Jul 20, 2017 07:12 AM UTC
      Owner: nobody

      I see the notice about v2.0 saying I should change the config lines about SOURCE but there are only parameters about specific backends.

      So those are really two bugs - the second one being the hint to the the config lines.

      I wrote about this on the mailing list one month ago - but looking at its archive now I guess that was a rather bad idea.

      duply lokal status
      Start duply v2.0.2, time is 2017-07-10 00:35:56.
      Using profile '/etc/duply/lokal'.
      Using installed duplicity version 0.7.13, python 2.6.8, gpg 2.0.9 (Home: ~/.gnupg), awk 'GNU Awk 3.1.8', grep 'grep (GNU grep) 2.7', bash '3.2.51(1)-release (i586-suse-linux-gnu)'.
      Checking TEMP_DIR '/tmp' is a folder and writable (OK)
      Test - En/Decryption skipped. (GPG disabled)
      /usr/local/bin/duply: line 2231: CMDS: bad array subscript

      --- Start running command STATUS at 00:35:57.118 ---
      Another duplicity instance is already running with this archive directory

      00:35:57.573 Task 'STATUS' failed with exit code '23'.
      --- Finished state FAILED 'code 23' at 00:35:57.573 - Runtime 00:00:00.454 ---


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ftplicity/bugs/110/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • ede

    ede - 2017-07-20
    • status: open --> closed-fixed
     

Log in to post a comment.