Ignore:
Timestamp:
Jan 10, 2009, 5:51:37 PM (15 years ago)
Author:
Bruno Cornec
Message:
  • Do not limit the PATH variable length anymore (report of Dale Marinenko dmarinenko_at_reasonco.com)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.8/mondo/src/mondoarchive/mondoarchive.c

    r2053 r2113  
    181181{
    182182    char *tmp;
     183    char *tmp1 = NULL;
    183184    int res, retval;
    184185    char *say_at_end;
     
    219220
    220221    /* make sure PATH environmental variable allows access to mkfs, fdisk, etc. */
    221     strncpy(tmp, getenv("PATH"), MAX_STR_LEN - 1);
    222     tmp[MAX_STR_LEN - 1] = '\0';
    223     if (strlen(tmp) >= MAX_STR_LEN - 33) {
    224         fatal_error
    225             ("Your PATH environmental variable is too long. Please shorten it.");
    226     }
    227     strcat(tmp, ":/sbin:/usr/sbin:/usr/local/sbin");
    228     setenv("PATH", tmp, 1);
     222    asprintf(&tmp1,"%s:/sbin:/usr/sbin:/usr/local/sbin",getenv("PATH"));
     223    setenv("PATH", tmp1, 1);
     224    paranoid_free(tmp1);
    229225
    230226    /* Add the ARCH environment variable for ia64 purposes */
    231     strncpy(tmp, get_architecture(), MAX_STR_LEN - 1);
    232     tmp[MAX_STR_LEN - 1] = '\0';
    233     setenv("ARCH", tmp, 1);
     227    asprintf(&tmp1,"%s",get_architecture());
     228    setenv("ARCH", tmp1, 1);
     229    paranoid_free(tmp1);
    234230
    235231    /* Add MONDO_SHARE environment variable for mindi */
Note: See TracChangeset for help on using the changeset viewer.