|
@@ -404,7 +404,8 @@ int tarobject(struct TarInfo *ti) {
|
|
|
|
|
|
|
|
struct conffile *conff;
|
|
struct conffile *conff;
|
|
|
struct tarcontext *tc= (struct tarcontext*)ti->UserData;
|
|
struct tarcontext *tc= (struct tarcontext*)ti->UserData;
|
|
|
- int statr, i, existingdirectory, keepexisting;
|
|
|
|
|
|
|
+ bool existingdirectory, keepexisting;
|
|
|
|
|
+ int statr, i;
|
|
|
ssize_t r;
|
|
ssize_t r;
|
|
|
struct stat stab, stabtmp;
|
|
struct stat stab, stabtmp;
|
|
|
char databuf[TARBLKSZ];
|
|
char databuf[TARBLKSZ];
|
|
@@ -496,23 +497,23 @@ int tarobject(struct TarInfo *ti) {
|
|
|
* do anything. This has to be done now so that we don't die due to
|
|
* do anything. This has to be done now so that we don't die due to
|
|
|
* a file overwriting conflict.
|
|
* a file overwriting conflict.
|
|
|
*/
|
|
*/
|
|
|
- existingdirectory= 0;
|
|
|
|
|
|
|
+ existingdirectory = false;
|
|
|
switch (ti->Type) {
|
|
switch (ti->Type) {
|
|
|
case SymbolicLink:
|
|
case SymbolicLink:
|
|
|
/* If it's already an existing directory, do nothing. */
|
|
/* If it's already an existing directory, do nothing. */
|
|
|
if (!statr && S_ISDIR(stab.st_mode)) {
|
|
if (!statr && S_ISDIR(stab.st_mode)) {
|
|
|
debug(dbg_eachfiledetail,"tarobject SymbolicLink exists as directory");
|
|
debug(dbg_eachfiledetail,"tarobject SymbolicLink exists as directory");
|
|
|
- existingdirectory= 1;
|
|
|
|
|
|
|
+ existingdirectory = true;
|
|
|
} else if (!statr && S_ISLNK(stab.st_mode)) {
|
|
} else if (!statr && S_ISLNK(stab.st_mode)) {
|
|
|
if (linktosameexistingdir(ti, fnamevb.buf, &symlinkfn))
|
|
if (linktosameexistingdir(ti, fnamevb.buf, &symlinkfn))
|
|
|
- existingdirectory= 1;
|
|
|
|
|
|
|
+ existingdirectory = true;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case Directory:
|
|
case Directory:
|
|
|
/* If it's already an existing directory, do nothing. */
|
|
/* If it's already an existing directory, do nothing. */
|
|
|
if (!stat(fnamevb.buf,&stabtmp) && S_ISDIR(stabtmp.st_mode)) {
|
|
if (!stat(fnamevb.buf,&stabtmp) && S_ISDIR(stabtmp.st_mode)) {
|
|
|
debug(dbg_eachfiledetail,"tarobject Directory exists");
|
|
debug(dbg_eachfiledetail,"tarobject Directory exists");
|
|
|
- existingdirectory= 1;
|
|
|
|
|
|
|
+ existingdirectory = true;
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
case NormalFile0: case NormalFile1:
|
|
case NormalFile0: case NormalFile1:
|
|
@@ -523,7 +524,7 @@ int tarobject(struct TarInfo *ti) {
|
|
|
ohshit(_("archive contained object `%.255s' of unknown type 0x%x"),ti->Name,ti->Type);
|
|
ohshit(_("archive contained object `%.255s' of unknown type 0x%x"),ti->Name,ti->Type);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- keepexisting= 0;
|
|
|
|
|
|
|
+ keepexisting = false;
|
|
|
if (!existingdirectory) {
|
|
if (!existingdirectory) {
|
|
|
for (packageslump= nifd->namenode->packages;
|
|
for (packageslump= nifd->namenode->packages;
|
|
|
packageslump;
|
|
packageslump;
|
|
@@ -545,7 +546,7 @@ int tarobject(struct TarInfo *ti) {
|
|
|
/* Nope ? Hmm, file conflict, perhaps. Check Replaces. */
|
|
/* Nope ? Hmm, file conflict, perhaps. Check Replaces. */
|
|
|
switch (otherpkg->clientdata->replacingfilesandsaid) {
|
|
switch (otherpkg->clientdata->replacingfilesandsaid) {
|
|
|
case 2:
|
|
case 2:
|
|
|
- keepexisting= 1;
|
|
|
|
|
|
|
+ keepexisting = true;
|
|
|
case 1:
|
|
case 1:
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
@@ -590,7 +591,7 @@ int tarobject(struct TarInfo *ti) {
|
|
|
otherpkg->name);
|
|
otherpkg->name);
|
|
|
otherpkg->clientdata->replacingfilesandsaid= 2;
|
|
otherpkg->clientdata->replacingfilesandsaid= 2;
|
|
|
nifd->namenode->flags &= ~fnnf_new_inarchive;
|
|
nifd->namenode->flags &= ~fnnf_new_inarchive;
|
|
|
- keepexisting = 1;
|
|
|
|
|
|
|
+ keepexisting = true;
|
|
|
} else {
|
|
} else {
|
|
|
if (!statr && S_ISDIR(stab.st_mode)) {
|
|
if (!statr && S_ISDIR(stab.st_mode)) {
|
|
|
forcibleerr(fc_overwritedir,
|
|
forcibleerr(fc_overwritedir,
|