Ignore:
Timestamp:
Jun 24, 2013, 10:20:16 AM (11 years ago)
Author:
Bruno Cornec
Message:
  • First attempt at fixing #628 by avoiding to erase choices done for varible bkpinfo->isodir and g_isodir_device in iso_fiddly_bits later in the code. Needs testing by people using external disks containing ISO.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mondo/src/mondorestore/mondo-rstr-newt.c

    r3069 r3158  
    22662266
    22672267/**
    2268  * Get information about the location of ISO images from the user.
    2269  * @param isodir_device Where to put the device (e.g. /dev/hda4) the user enters.
    2270  * @param isodir_format Where to put the format (e.g. ext2) the user enters.
    2271  * @param isodir_path Where to put the path (e.g. /var/cache/mondo) the user enters.
    2272  * @param nuke_me_please Whether we're planning on nuking or not.
    2273  * @return TRUE if OK was pressed, FALSE otherwise.
    2274  */
    2275 bool
    2276 get_isodir_info(char *isodir_device, char *isodir_format,
    2277                 char *isodir_path, char *subdir_path, bool nuke_me_please)
    2278 {
    2279 
    2280     bool HDD = FALSE;
    2281     /** initialize ********************************************************/
    2282 
    2283     assert(isodir_device != NULL);
    2284     assert(isodir_format != NULL);
    2285     assert(isodir_path != NULL);
    2286 
    2287     log_it("isodir_path = %s", isodir_path);
    2288     isodir_format[0] = '\0';
    2289     if (isodir_device[0] == '\0') {
    2290         strcpy(isodir_device, "/dev/");
    2291     }
    2292     if (isodir_path[0] == '\0') {
    2293         strcpy(isodir_path, "/");
    2294     }
    2295     if (does_file_exist("/tmp/NETFS-SERVER-PATH")) {
    2296         strcpy(isodir_device, last_line_of_file("/tmp/NETFS-SERVER-MOUNT"));
    2297         strcpy(isodir_format, "netfs");
    2298         strcpy(isodir_path, last_line_of_file("/tmp/NETFS-SERVER-PATH"));
    2299     }
    2300     if (nuke_me_please) {
    2301         return (TRUE);
    2302     }
    2303 
    2304     if (popup_and_get_string
    2305         ("ISO Mode - device", "On what device do the ISO files live?",
    2306          isodir_device, MAX_STR_LEN / 4)) {
    2307         if (popup_and_get_string
    2308             ("ISO Mode - format",
    2309              "What is the disk format of the device? (Hit ENTER if you don't know.)",
    2310              isodir_format, 16)) {
    2311             if (popup_with_buttons("Are you restoring from an external hard drive ?", "Yes", "No")) {
    2312                 HDD = TRUE;
    2313             }
    2314             if (popup_and_get_string
    2315                 ("ISO Mode - path",
    2316                 "At what path on this device can the ISO files be found ?",
    2317                 isodir_path, MAX_STR_LEN / 4)) {
    2318                 strip_spaces(isodir_device);
    2319                 strip_spaces(isodir_format);
    2320                 strip_spaces(isodir_path);
    2321                 log_it("isodir_device = %s - isodir_format = %s - isodir_path = %s", isodir_device, isodir_format, isodir_path);
    2322                 if (HDD) {
    2323                     /*  We need an additional param */
    2324                     mr_asprintf(&subdir_path, "%s", isodir_path);
    2325                     strcpy(isodir_path, "/tmp/isodir");
    2326                 }
    2327                 return (TRUE);
    2328             }
    2329         }
    2330     }
    2331     return (FALSE);
    2332 }
    2333 
    2334 
    2335 /**
    23362268 * Create a new raidtab entry for @p device in @p raidlist.
    23372269 * @param raidlist The raidlist to add the device to.
Note: See TracChangeset for help on using the changeset viewer.