Skip to content

Domain discovery fails due to incorrectly generated output archive filename #276

@surskitt

Description

@surskitt

When running the discover domain util, I have noticed the output archive filename has been generated incorrectly. When the tool creates a temporary zip filename, the generated filename incorrectly includes the parent directories twice.

23790/2:        open("/home/shane/mydomain_archive.zip", O_RDONLY) = 460
23790/2:        open("/home/shane/home/shane/mydomain_archive3568716833221357580.zip", O_RDWR|O_CREAT|O_EXCL, 0666) Err#2 ENOENT

The above truss output was produced with the archive file argument as -archive_file /home/shane/mydomain_archive.zip.

It looks like nameComponents[0] contains the full path (minus file extension), but should only contain the filename. createTempFile takes the directory as a separate argument, so it is being prepended to the already full path.

newOutputFile = File.createTempFile(nameComponents[0], DOT + nameComponents[1], directory);

The problem may be below with getFileName returning the full path.

String[] nameComponents = FileUtils.parseFileName(getFileName());

public String getFileName() {
return getFile().getAbsolutePath();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions