[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-devel] [PATCH] vscsi and symlinks



On Mon, 2011-02-07 at 11:28 +0000, James Harper wrote:
> > 
> > On Mon, 2011-02-07 at 09:43 +0000, James Harper wrote:
> > > I think target isn't always a file. It can be a scsi ID like 0:1:2:3.
> > > I think it can be other types of specifier too.
> > 
> > OK. So perhaps:
> > 
> > if os.path.islink(target):
> >     target = os.path.realpath(target)
> > 
> 
> I guess. I know it's a long shot but what if there was a symlink
> called 0:1:2:3? While that is unlikely, there might be other
> incantations used by vscsi that could ambiguously be the filename of a
> symlink or not. I'd be happier if realpath was only used if an
> absolute path was specified. Who's going to want to specify a relative
> path anyway... what would it be relative to?

Yes, good points. I guess we could go with target[0] == '/' but I think
you are right to go with the conservative approach of checking for /dev/
unless/until someone shows up with a bug suggesting we do otherwise.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.