Changeset 8188062


Ignore:
Timestamp:
Jan 6, 2014 12:40:15 PM (3 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1
Children:
13c57f6
Parents:
7fd139f
Message:

Fix several bugs for PBIs on 10

  • Fix an issue building from source and not copying files to /usr/pbi
  • Set and pass along the users cwd to the PBI container
  • Fix some clang warnings in pbime
Location:
src-sh/pbi-manager
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pbi-manager/install.sh

    r7ff5d68 r8188062  
    112112  chmod 644 pbiwrapper 
    113113  mv pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-i386 
     114  if [ "${LB}" = "/usr/local" ] ; then 
     115     install -o root -g wheel -m 755 ${LB}/share/pbi-manager/.pbiwrapper-i386 /usr/pbi/.pbi-wrapper-i386 
     116  fi 
    114117else 
    115118  touch ${LB}/share/pbi-manager/.pbiwrapper-amd64 
     
    127130chmod 644 pbiwrapper 
    128131mv pbiwrapper ${LB}/share/pbi-manager/.pbiwrapper-`uname -m` 
     132if [ "${LB}" = "/usr/local" ] ; then 
     133   install -o root -g wheel -m 755 ${LB}/share/pbi-manager/.pbiwrapper-`uname -m` /usr/pbi/.pbi-wrapper-`uname -m` 
     134fi 
    129135 
    130136# Install the pbime wrapper 
  • src-sh/pbi-manager/pbime/pbime.c

    r7ff5d68 r8188062  
    9090                err(1, "Could not chroot to: %s", newchroot); 
    9191 
     92        if (chdir(argv[4]) == -1 ) 
     93                err(1, "Could not chdir to: %s", argv[4]); 
     94 
    9295        /* Get the user name in the jail */ 
    9396        jusername = getpwuid(huid); 
     
    97100        //      err(1, "chdir(): /"); 
    98101        lcap = login_getpwclass(jusername); 
    99         if (lcap = NULL) 
    100                 err(1, "getpwclass: %s", jusername); 
     102        if (lcap == NULL) { 
     103          err(1, "getpwclass: %s", jusername->pw_name); 
     104        } 
    101105        ngroups = NGROUPS; 
    102106        if (getgrouplist(jusername->pw_name, jusername->pw_gid, groups, &ngroups) != 0)  
     
    110114                err(1, "setusercontext"); 
    111115        login_close(lcap); 
    112         if (execvp(argv[3], argv + 3) == -1) 
     116        if (execvp(argv[3], argv + 4) == -1) 
    113117                err(1, "execvp(): %s", argv[3]); 
    114118        exit(0); 
  • src-sh/pbi-manager/wrapper/main.c

    ra8a79f9 r8188062  
    2323    char pbimntdir[MAX_SIZE]; 
    2424    char pbime[MAX_SIZE]; 
     25    char pbicwd[MAXPATHLEN]; 
    2526 
    2627    // Setup working variables 
     
    126127 
    127128    // Build new target argv 
    128     char *targv[argc+4]; 
     129    char *targv[argc+5]; 
    129130    targv[0] = pbime; 
    130131    targv[1] = pbimntdir; 
    131132    targv[2] = progdir; 
    132133    targv[3] = newtarget; 
    133     int i=4; 
     134    targv[4] = getwd(pbicwd); 
     135    int i=5; 
    134136    int j=1; 
    135137    while(j < argc){ 
     
    144146    //printf( "Arg: %s \n", targv[2]); 
    145147    //printf( "Arg: %s \n", targv[3]); 
     148    //printf( "Arg: %s \n", targv[4]); 
    146149 
    147150    return execv(pbime, targv); 
Note: See TracChangeset for help on using the changeset viewer.