Changeset 913


Ignore:
Timestamp:
Nov 2, 2006, 1:45:12 AM (12 years ago)
Author:
bruno
Message:

Fix bug #89 (env var were queried too early, and not ncessarily in PXE mode)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/mondorestore/mondo-rstr-tools.c

    r910 r913  
    10461046                    strcpy(bkpinfo->prefix,STD_PREFIX);
    10471047            }
    1048             /* We need to override prefix value in PXE mode as it's
    1049              * already done in start-nfs */
    1050             envtmp1 = getenv("imgname");
    1051             if (envtmp1 == NULL) {
    1052                 fatal_error("no imgname variable in environment");
    1053             }
    10541048            if (strstr(call_program_and_get_last_line_of_output
    10551049               ("cat /proc/cmdline"), "pxe")) {
    1056                     strcpy(bkpinfo->prefix,envtmp1);
     1050                /* We need to override prefix value in PXE mode as it's
     1051                * already done in start-nfs */
     1052                envtmp1 = getenv("imgname");
     1053                if (envtmp1 == NULL) {
     1054                    fatal_error("no imgname variable in environment");
     1055                }
     1056                strcpy(bkpinfo->prefix,envtmp1);
    10571057            }
    10581058
     
    11641164            log_msg(2, "nfs_remote_dir is %s", bkpinfo->nfs_remote_dir);
    11651165        }
    1166         /* We need to override values in PXE mode as it's
    1167          * already done in start-nfs */
    1168         envtmp1 = getenv("nfsmount");
    1169         if (envtmp1 == NULL) {
    1170             fatal_error("no nfsmount variable in environment");
    1171         }
    1172         envtmp2 = getenv("dirimg");
    1173         if (envtmp2 == NULL) {
    1174             fatal_error("no dirimg variable in environment");
    1175         }
    11761166        if (strstr(call_program_and_get_last_line_of_output
    11771167           ("cat /proc/cmdline"), "pxe")) {
    1178                 strcpy(bkpinfo->nfs_mount,envtmp1);
    1179                 strcpy(bkpinfo->nfs_remote_dir,envtmp2);
    1180             }
     1168            /* We need to override values in PXE mode as it's
     1169            * already done in start-nfs */
     1170            envtmp1 = getenv("nfsmount");
     1171            if (envtmp1 == NULL) {
     1172                fatal_error("no nfsmount variable in environment");
     1173            }
     1174            envtmp2 = getenv("dirimg");
     1175            if (envtmp2 == NULL) {
     1176                fatal_error("no dirimg variable in environment");
     1177            }
     1178            strcpy(bkpinfo->nfs_mount,envtmp1);
     1179            strcpy(bkpinfo->nfs_remote_dir,envtmp2);
     1180        }
    11811181    } else if (bkpinfo->backup_media_type == iso) {
    11821182        /* Patch by Conor Daly 23-june-2004
Note: See TracChangeset for help on using the changeset viewer.