Hi folks!

Yesterday, we got a bug report about a crash at the moment to save the
yast2-ftp-server configuration when "Allowing for anonymous upload"

  ...
  Caller: /usr/share/YaST2/modules/FtpServer.rb:522:in 'WriteUpload'
  Details: undefined method 'mkdir' for
#<Yast::FileUtilsClass:0x00001002ce2a2c0>
  ...

After realizing that, probably, the code was written with the FileUtils
Ruby module[1] in mind but the Yast::FileUtils module[2] is being called
instead, two questions came two my mind

- How much time has been this broken without nobody noticing/reporting it?

  The change was introduced exactly a year ago[3], do it means that the
yast2-ftp-server is no longer relevant?

- Do we have this problem in more places? I.e. Yast::FileUtils taking
the place of Object::FileUtils.


I don't have the answer for any of them ;) but I have a proposal[4] for
the last one: to implement the `method_missing` in the Yast::FileUtils
and fallback to Object::FileUtils. That way, we could avoid similar crashes.

What do you think?

[1] https://ruby-doc.org/stdlib-2.6.5/libdoc/fileutils/rdoc/FileUtils.html
[2]
https://github.com/yast/yast-yast2/blob/master/library/general/src/modules/FileUtils.rb
[3] https://github.com/yast/yast-ftp-server/pull/54
[4] https://github.com/yast/yast-yast2/pull/997

-- 
David Díaz González
YaST Team at SUSE Linux GmbH


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to