Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 599125 Details for
Bug 647231
RHEL7: unable to backup and restore a symlink
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed fix for issue with symlink in parent dir, including test case
rlFileBackup-symlink_in_parent_fix.patch (text/plain), 2.22 KB, created by
Karel Srot
on 2012-07-19 12:08:49 UTC
(
hide
)
Description:
proposed fix for issue with symlink in parent dir, including test case
Filename:
MIME Type:
Creator:
Karel Srot
Created:
2012-07-19 12:08:49 UTC
Size:
2.22 KB
patch
obsolete
>From 2ae8483e362d0f5187e3480de0a75af2658d45c8 Mon Sep 17 00:00:00 2001 >From: Karel Srot <ksrot@redhat.com> >Date: Thu, 19 Jul 2012 14:04:49 +0200 >Subject: [PATCH] rlFileBackup fix for symlink in parent path, test case > included > >--- > src/infrastructure.sh | 3 +++ > src/test/infrastructureTest.sh | 15 +++++++++++++++ > 2 files changed, 18 insertions(+) > >diff --git a/src/infrastructure.sh b/src/infrastructure.sh >index 8ffbbe0..aac4937 100644 >--- a/src/infrastructure.sh >+++ b/src/infrastructure.sh >@@ -302,7 +302,10 @@ rlFileBackup() { > for file in "$@"; do > # convert relative path to absolute, remove trailing slash > file=$(echo "$file" | sed "s|^\([^/]\)|$PWD/\1|" | sed "s|/$||") >+ # follow symlinks in parent dir > path=$(dirname "$file") >+ path=$(readlink -n -f $path) >+ file=$path/$(basename $file) > > # bail out if the file does not exist > if ! [ -e "$file" ]; then >diff --git a/src/test/infrastructureTest.sh b/src/test/infrastructureTest.sh >index 3d5ae41..94af445 100644 >--- a/src/test/infrastructureTest.sh >+++ b/src/test/infrastructureTest.sh >@@ -225,6 +225,21 @@ test_rlFileBackup_Symlinks() { > rm -rf $dir $BEAKERLIB_DIR/backup" > } > >+# backing up dir with symlink in the parent dir [BZ#647231#c13] >+test_rlFileBackup_SymlinkInParent() { >+ local dir >+ assertTrue "Preparing tmp directory" 'dir=$(mktemp -d) && pushd $dir' >+ assertTrue "Preparing target directory" 'mkdir target && touch target/file1 target/file2' >+ assertTrue "Preparing linked directory" 'ln -s target link' >+ assertRun "rlFileBackup link/file1" '0' "Backing up the link/file1" >+ assertTrue "Removing link/file1" 'rm link/file1' >+ assertRun "rlFileRestore" 0 "Restoring the file1" >+ assertTrue "Testing that link points to target" 'readlink link | grep target' >+ assertTrue "Testing that link/file1 was restored" 'test -f link/file1' >+ assertTrue "Testing that link/file2 is still present" 'test -f link/file2' >+ assertTrue "Clean up" "popd && rm -rf $dir && chmod -R 777 $BEAKERLIB_DIR/backup && >+ rm -rf $dir $BEAKERLIB_DIR/backup" >+} > > test_rlServiceStart() { > assertTrue "rlServiceStart should fail and return 99 when no service given" \ >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 647231
:
456421
|
599125
|
599321