Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2885 Some cron module lib fuctions don't work with foreign_call.

1.350
closed
Jamie Cameron
5
2007-08-16
2007-08-15
Radek Vykydal
No

Several functions in cron-lib.pl don't operate on structures ($job) passed as arguments (which is suggested
in their comments), but on structures that happen to be referred by global variable of the same name ($job) as
supposed local variable. It works OK when the functions
are called in cron module scripts, because the global
variable $job is accessible from within the functions,
but when calling the functions as foreign module functions, the global variable isn't visible due to wrapping the foreign library into its namespace, I think.

There is similar problem with function parse_range_input where the %in is accessed both via local reference
(passed by argument) ($in->{'foo'}) and directly via
global variable ($in{'foo'}). The latter isn't accessible
when the function is called as foreign.

Perhaps attached patch can fix it.

Discussion

  • Radek Vykydal
    Radek Vykydal
    2007-08-15

    patch of cron-lib.pl

     
    Attachments
  • Jamie Cameron
    Jamie Cameron
    2007-08-16

    • status: open --> closed
     
  • Jamie Cameron
    Jamie Cameron
    2007-08-16

    Logged In: YES
    user_id=129364
    Originator: NO

    Thanks for the patch - that is indeed a bug, which I will fix with your patch in the next Webmin release.