diff options
| author | phaniram rampura krishnamurthy - Sun Microsystems - Bangalore India <Phaniram.Krishnamurthy@Sun.COM> | 2009-07-03 13:30:39 +0530 |
|---|---|---|
| committer | phaniram rampura krishnamurthy - Sun Microsystems - Bangalore India <Phaniram.Krishnamurthy@Sun.COM> | 2009-07-03 13:30:39 +0530 |
| commit | 9b2055ccc67e94a8568754108452d32facb6c23e (patch) | |
| tree | 617ce2115fcc3f664c8984fc59f665eef2f71c3f /usr/src/cmd/svr4pkg/installf | |
| parent | f0376ac130b3a35ce06cfe09350a4fb5db24f9da (diff) | |
| download | illumos-joyent-9b2055ccc67e94a8568754108452d32facb6c23e.tar.gz | |
6767793 removef returns $BASEDIR if the $BASEDIR is not "/"
Diffstat (limited to 'usr/src/cmd/svr4pkg/installf')
| -rw-r--r-- | usr/src/cmd/svr4pkg/installf/main.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/usr/src/cmd/svr4pkg/installf/main.c b/usr/src/cmd/svr4pkg/installf/main.c index 2e1bfed717..2d3b889c15 100644 --- a/usr/src/cmd/svr4pkg/installf/main.c +++ b/usr/src/cmd/svr4pkg/installf/main.c @@ -135,6 +135,7 @@ main(int argc, char **argv) char *prog; char *pt; char *vfstab_file = NULL; + char *temp_cl_basedir; char outbuf[PATH_MAX]; int c; int dbchg; @@ -434,10 +435,24 @@ main(int argc, char **argv) c = 0; if (is_a_cl_basedir() && !is_an_inst_root()) { - c = strlen(get_client_basedir()); - (void) snprintf(outbuf, sizeof (outbuf), - "%s/%s\n", get_basedir(), - &(ept->path[c])); + /* + * A path in contents db might have + * other prefix than BASEDIR of the + * package + */ + temp_cl_basedir = get_client_basedir(); + if (strncmp(ept->path, temp_cl_basedir, + strlen(temp_cl_basedir)) == 0) { + c = strlen(temp_cl_basedir); + (void) snprintf(outbuf, + sizeof (outbuf), "%s/%s\n", + get_basedir(), + &(ept->path[c])); + } else { + (void) snprintf(outbuf, + sizeof (outbuf), + "%s\n", &(ept->path[c])); + } } else if (is_an_inst_root()) { (void) snprintf(outbuf, sizeof (outbuf), "%s/%s\n", get_inst_root(), |
