[prev in list] [next in list] [prev in thread] [next in thread]
List: bacula-bugs
Subject: [Bacula-bugs] [bacula 0001049]: strippath fails on relative links
From: bacula-bugs () lists ! sourceforge ! net
Date: 2008-01-30 12:52:47
Message-ID: 49d64cc88da9a5ad3129ac0f2eacd486 () bugs ! bacula ! org
[Download RAW message or body]
The following issue has been CLOSED
======================================================================
http://bugs.bacula.org/view.php?id=1049
======================================================================
Reported By: jgoerzen
Assigned To:
======================================================================
Project: bacula
Issue ID: 1049
Category: File Daemon
Reproducibility: always
Severity: minor
Priority: normal
Status: closed
Resolution: fixed
Fixed in Version: 2.2.9
======================================================================
Date Submitted: 01-29-2008 16:46 UTC
Last Modified: 01-30-2008 12:52 UTC
======================================================================
Summary: strippath fails on relative links
Description:
Received from Bastian Blank <waldi@debian.org> at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452200:
do_strip is used on the filename and the target of a symlink. The link
target is either a relative or absolute path, the later not prefixed
with the to be stripped path. I think it is wrong to call the strip
function on the link target if the file type is a symlink. The following
patch fixes this.
--- src/filed/backup.c 2007-06-24 17:27:12.000000000 +0000
+++ src/filed/backup.c 2007-11-20 22:31:43.000000000 +0000
@@ -1151,7 +1151,7 @@
* I.e. if either stripping fails don't strip anything.
*/
if (do_strip(ff_pkt->strip_path, ff_pkt->fname)) {
- if (ff_pkt->fname != ff_pkt->link) {
+ if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) {
pm_strcpy(ff_pkt->link_save, ff_pkt->link);
if (!do_strip(ff_pkt->strip_path, ff_pkt->link)) {
strcpy(ff_pkt->link, ff_pkt->link_save);
@@ -1170,7 +1170,7 @@
return;
}
strcpy(ff_pkt->fname, ff_pkt->fname_save);
- if (ff_pkt->fname != ff_pkt->link) {
+ if (ff_pkt->type != FT_LNK && ff_pkt->fname != ff_pkt->link) {
strcpy(ff_pkt->link, ff_pkt->link_save);
}
}
======================================================================
----------------------------------------------------------------------
kern - 01-29-08 18:12
----------------------------------------------------------------------
I never thought about encountering relative links. Clearly this is a bug
and Bacula should not strip them or try to strip them.
It seems to me that Bacula should strip absolute links, though this is
probably a gray area. Could you explain your reasoning for wanting to not
to strip absolute links?
----------------------------------------------------------------------
jgoerzen - 01-29-08 20:02
----------------------------------------------------------------------
From:
Bastian Blank <waldi@debian.org>
On Tue, Jan 29, 2008 at 12:32:10PM -0600, John Goerzen wrote:
> It seems to me that Bacula should strip absolute links, though this is
> probably a gray area. Could you explain your reasoning for wanting to
not
> to strip absolute links?
Because the links are relative to the real root and the prefix will
never match the strip prefix.
Bastian
--
You're dead, Jim.
-- McCoy, "Amok Time", stardate 3372.7
----------------------------------------------------------------------
kern - 01-30-08 12:52
----------------------------------------------------------------------
Thanks. I have applied the patch and it will be in version 2.2.9 and in a
patch when bug http://bugs.bacula.org/view.php?id=1047 is fixed.
Issue History
Date Modified Username Field Change
======================================================================
01-29-08 16:46 jgoerzen New Issue
01-29-08 18:12 kern Note Added: 0003111
01-29-08 18:12 kern Status new => feedback
01-29-08 20:02 jgoerzen Note Added: 0003117
01-30-08 12:52 kern Note Added: 0003122
01-30-08 12:52 kern Status feedback => closed
01-30-08 12:52 kern Resolution open => fixed
01-30-08 12:52 kern Fixed in Version => 2.2.9
======================================================================
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bacula-bugs mailing list
Bacula-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic