Changeset 2774

Show
Ignore:
Timestamp:
08/25/08 23:57:57 (3 months ago)
Author:
dhozac
Message:

Handle read-only bind-mounts the new way.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/secure-mount.c

    r2678 r2774  
    437437      return false; 
    438438    } 
     439    if ((mnt->flag & MS_BIND) && 
     440        (mnt->flag & ~(MS_BIND|MS_REC))) { 
     441      /* This is needed to put us in the new mountpoint */ 
     442      if (!secureChdir(mnt->dst, opt)) 
     443        return false; 
     444      if (mount(mnt->src, ".", 
     445                mnt->type ? mnt->type : "", 
     446                ((mnt->flag & ~(MS_BIND|MS_REC)) | 
     447                MS_REMOUNT), NULL) == -1 && 
     448          errno != EBUSY) { /* Returned on older kernels */ 
     449        perror("secure-mount: mount()"); 
     450        return false; 
     451      } 
     452    } 
    439453  } 
    440454  else if (!callExternalMount(mnt))