...
 
Commits (1)
  • Rob Swindell's avatar
    Fix up the unzip command-line introduced in mlong's enhancements · c73f9bdb
    Rob Swindell authored
    1. You can't include % specifiers in the string passed to system.exec()
       - this is just a wrapper for system(), it doesn't recongize Synchronet
         command-line specifiers.
       - so I just prepend the exec_dir for Win32, leave off for *nix.
       - it appears this wasn't tested since that command-line would not work.
    
    2. Added 'j' option to unzip. We don't want the extraction of infopacks with
       sub-directories to be creating sub-directories under our ctrl dir.
       We should consider extracting to a temp dir instead of the ctrl dir if
       we don't have absolute control over what's being extracted from downloaded
       zip files. This could be dangerous if we're not extremely careful.
    c73f9bdb
......@@ -700,8 +700,11 @@ if(network.echolist
file.write(contents);
file.close();
// try to extract on linux,
if (system.exec("%@unzip -CLo " + file_getname(network.pack) + " " + echolist_fname) !== 0) {
// try to extract
var prefix = "";
if(system.platform == "Win32")
prefix = system.exec_dir;
if (system.exec(prefix + "unzip -CLjo " + file_getname(network.pack) + " " + echolist_fname) !== 0) {
print("Please extract " + network.echolist + " from " + file.name + " into " + system.ctrl_dir);
}
......