Cwd::abs_path returns undef for non-existent packages

Bug #6945 reported by Debian Bug Importer
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
perl (Debian)
Confirmed
Unknown
perl (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Automatically imported from Debian bug report #257568 http://bugs.debian.org/257568

Revision history for this message
In , David Kimdon (david-kimdon) wrote :

severity 257568 wishlist
quit

Hi,

It looks to me like the function is behaving as documented (see
Cwd(3perl)). If the path does not exist there is no way for the
function to succeed since the function is defined to resolve symbolic
links. For example:

$ pwd
/tmp
$ mkdir -p dir
$ ln -s dir link
$ perl -e 'use Cwd; print Cwd::abs_path("link")
/tmp/dir

If link did not exist the function could not know to return '/tmp/dir'

What behavior are you looking for? I don't see a bug here. I dropped
the severity to wishlist since it looks to me like you would like a
function that does something for you, but I am not sure what. Are you
looking for something to concatenate Cwd::abs_path(".") with a
relative path?

-David

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Automatically imported from Debian bug report #257568 http://bugs.debian.org/257568

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-Id: <email address hidden>
Date: Sun, 04 Jul 2004 13:05:53 +0200
From: Eduard Bloch <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: Cwd::abs_path returns undef for non-existent packages

Package: perl-base
Version: 5.8.4-2
Severity: grave
Tags: upstream

Hello,

the Cwd::abs_path method in the current Perl package is broken again
(read: it seems to introduce the old bugs of perl 5.6). The problem:

if the directory in the argument does not exist, it returns undef. Which
is pretty stupid since it should return a valid path, even if the
file/directory does not exist. This was fixed in one of the previous
versions (some months ago) and seems to be broken again:

perl -e 'use Cwd; print Cwd::abs_path("foo/bar/baz")'
perl -e 'use Cwd; print defined(Cwd::abs_path("foo/bar/baz"))'

Regards,
Eduard.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.7
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8

Versions of packages perl-base depends on:
ii libc6 2.3.2.ds1-13 GNU C Library: Shared libraries an

-- no debconf information

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Mon, 5 Jul 2004 20:10:22 +0200
From: David Kimdon <email address hidden>
To: <email address hidden>
Cc: <email address hidden>
Subject: Cwd::abs_path returns undef for non-existent packages

severity 257568 wishlist
quit

Hi,

It looks to me like the function is behaving as documented (see
Cwd(3perl)). If the path does not exist there is no way for the
function to succeed since the function is defined to resolve symbolic
links. For example:

$ pwd
/tmp
$ mkdir -p dir
$ ln -s dir link
$ perl -e 'use Cwd; print Cwd::abs_path("link")
/tmp/dir

If link did not exist the function could not know to return '/tmp/dir'

What behavior are you looking for? I don't see a bug here. I dropped
the severity to wishlist since it looks to me like you would like a
function that does something for you, but I am not sure what. Are you
looking for something to concatenate Cwd::abs_path(".") with a
relative path?

-David

Revision history for this message
Matt Zimmerman (mdz) wrote :

Remove myself from all these CCs now that we have the warty-bugs mailing list

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

Agreed with Thom that this is not a RC bug and it doesn't affect warty

Revision history for this message
In , Brendan O'Dea (bod) wrote : bug twiddling

# reassign to canonical package
reassign 255093 perl
reassign 255919 perl
reassign 257568 perl
reassign 262957 perl
reassign 263279 perl
reassign 263325 perl
reassign 264629 perl
reassign 266194 perl
reassign 266669 perl
reassign 268810 perl
reassign 269879 perl
reassign 269919 perl
reassign 273379 perl
reassign 275142 perl
reassign 278322 perl
reassign 280220 perl
reassign 282110 perl
reassign 283802 perl
reassign 284489 perl
reassign 286905 perl
reassign 286907 perl
reassign 286922 perl

# related security issues with File::Path::rmtree
merge 286905 286922

thanks

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Fri, 24 Dec 2004 10:30:44 +1100
From: Brendan O'Dea <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: bug twiddling

# reassign to canonical package
reassign 255093 perl
reassign 255919 perl
reassign 257568 perl
reassign 262957 perl
reassign 263279 perl
reassign 263325 perl
reassign 264629 perl
reassign 266194 perl
reassign 266669 perl
reassign 268810 perl
reassign 269879 perl
reassign 269919 perl
reassign 273379 perl
reassign 275142 perl
reassign 278322 perl
reassign 280220 perl
reassign 282110 perl
reassign 283802 perl
reassign 284489 perl
reassign 286905 perl
reassign 286907 perl
reassign 286922 perl

# related security issues with File::Path::rmtree
merge 286905 286922

thanks

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.