Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1583174

Summary: [RFE] engine-backup should support tilde expansion
Product: [oVirt] ovirt-engine Reporter: Jiri Belka <jbelka>
Component: Backup-Restore.EngineAssignee: Yedidyah Bar David <didi>
Status: CLOSED DEFERRED QA Contact: Pavel Stehlik <pstehlik>
Severity: low Docs Contact:
Priority: low    
Version: 4.2.3.5CC: bugs
Target Milestone: ---Keywords: FutureFeature, StudentProject
Target Release: ---Flags: rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-03 07:29:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Belka 2018-05-28 12:01:15 UTC
Description of problem:

# strace -f -o /tmp/out.strace  -e trace=file engine-backup --mode=verify --file=~/backup/brq-setup-engine-201805271705 --log=/tmp/out.log                                                                                                     
Verifying:
- Unpacking file '~/backup/brq-setup-engine-201805271705'
tar: ~/backup/brq-setup-engine-201805271705: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
FATAL: cannot open /tmp/engine-backup.8ZmkN5xKFD

# ls -l ~/backup/brq-setup-engine-201805271705
-rw-r--r--. 1 root root 172877307 May 27 17:07 /root/backup/brq-setup-engine-201805271705

* strace part

...
19976 getcwd("/root/backup", 4096)      = 13
19976 open("~/backup/brq-setup-engine-201805271705", O_RDONLY) = -1 ENOENT (No such file or directory)
19976 +++ exited with 2 +++
19916 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=19976, si_uid=0, si_status=2, si_utime=0, si_stime=0} ---
19977 stat(".", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
...

Version-Release number of selected component (if applicable):
ovirt-engine-tools-backup-4.2.3.5-0.1.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1. engine-backup ... and use tilda as part of file path for file argument
2.
3.

Actual results:
engine-backup fails

Expected results:
should work, file exists

Additional info:

Comment 2 Jiri Belka 2018-05-28 12:02:43 UTC
full path works, so something with tilda expansion

Comment 3 Yedidyah Bar David 2018-05-30 07:01:13 UTC
IMHO tilde expansion is the shell's job, not each program's.

E.g.:

This works:

tar -C ~/bin -cf - . > /dev/null

This fails:

tar --directory=~/bin -cf - . > /dev/null

So would you open a bug on 'tar' to support tilde expansion? I do not think so. It's not its job.

You might say that engine-backup should also have short options which do not require '=' but ' ', which will fix your problem, but then we'd have to start fighting how to shorten options and struggle adding new ones with short versions. So I think we'd rather not. It's not used so much that you can't always use the long versions.

That said, we did fix this in otopi (bug 1529474), so not closing...

Comment 4 Yaniv Kaul 2018-06-03 07:29:53 UTC
(In reply to Yedidyah Bar David from comment #3)
> IMHO tilde expansion is the shell's job, not each program's.
> 
> E.g.:
> 
> This works:
> 
> tar -C ~/bin -cf - . > /dev/null
> 
> This fails:
> 
> tar --directory=~/bin -cf - . > /dev/null
> 
> So would you open a bug on 'tar' to support tilde expansion? I do not think
> so. It's not its job.
> 
> You might say that engine-backup should also have short options which do not
> require '=' but ' ', which will fix your problem, but then we'd have to
> start fighting how to shorten options and struggle adding new ones with
> short versions. So I think we'd rather not. It's not used so much that you
> can't always use the long versions.
> 
> That said, we did fix this in otopi (bug 1529474), so not closing...

I'm afraid we don't have the bw to handle this right now. Close-Deferred for the time being.