Bacula-users

[Bacula-users] atoi and volume name/media name ambiguity (Was: Re: Bug / RFE)

2009-02-04 15:46:12
Subject: [Bacula-users] atoi and volume name/media name ambiguity (Was: Re: Bug / RFE)
From: mark.bergman AT uphs.upenn DOT edu
To: <bacula-users AT lists.sourceforge DOT net>
Date: Wed, 04 Feb 2009 15:43:52 -0500

In the message dated: Wed, 04 Feb 2009 21:24:41 +0100,
The pithy ruminations from Arno Lehmann on 
<Re: [Bacula-users] Bug / RFE> were:
=> Hi,
=> 
=> 04.02.2009 19:13, Dupree, Craig wrote:
=> > This is starting to get annoying....
=> > =
=> 
=> > Can the parts of bacula that ask for volume names not arbitrarily
=> > use atoi on them?
=> 
=> Not easily, no...
=> 
=> > Here is a good example where I want to purge a volume name, since I
=> > know now the list of volumes that I want to purge and reuse for
=> > this month's backup set:
=> > =
=> 
=> > Enter MediaId or Volume name: 000029 sql_get.c:1002 Media record
=> > MediaId=3D29 not found.
=> > =
=> 
=> > In this case, it's only a hassle because MediaId 29 doesn't exist.
=> > A worse problem occurs when the leading zeros are stripped off of a
=> > volume name, and the resulting number is a valid MediaId.


Yes, I've been bitten by this several times....annoying and a bit confusing.

=> 
=> The problem is that the requests accepts both MediaId or a Volume =
=> 
=> name. MediaId is always numeric, a volume name is not.
=> 
=> As long as volume names can be numeric, and there is no way to =
=> 
=> distinguish if a MediaId or a volume name is entered, I see no simle =
=> 
=> solution to the problem.
=> 
=> Actually, as most volume names today are non-numeric, I don't think =
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

What's the data behind that statement? By "most" do you mean "most customer 
sites use non-numeric volume names" or "most pieces of media have volume names 
that are non-numeric". Though there's no data, I might agree with the first
case. However, when I look at the ~200 bar-coded tapes on the shelf behind me, 
that's a lot of data that supports the idea that most volume names are actually 
numeric.

Here's another way of looking at it...

        The distinction between 000029 and 29 is highly relevent for
        computers, and much less obvious or understood for the human
        beings who use computers.

I see it is a very bad design principle to make human beings think like 
computers, forcing people to accomodate their work processes to satisfy a
piece of software, rather than the other way around.

=> 
=> this affects enough users to make a fix an urgent thing.
=> 
=> You can, of course, post a proper feature request - preferrably along =
=> 
=> with a potential solution. A solution would have to be compatible to =
=> 
=> todays behaviour, though, as that interface is probably used by =
=> 
=> scripts; thus, requiring qoutes or any other special way to =
=> 
=> distinguish between media id and volume name when entered is probably =
=> 
=> not the best way.


Yes, backward compatibilty is important, and every bug report or RFE would 
ideally come with a proposed solution, a working patch, etc., etc.. However,
users often identify bugs (or, in this case, a dubious design choice that works 
correctly, but should be enhanced) but cannot provide a solution.


=> 
=> I could imagine some post-input checks, i.e., after the value is =
=> 
=> entered, and it's numerical only, and has leading zeros, see if a =
=> 
=> volume with that MediaId exists. If there isn't one, use the input as =
=> 
=> a volume name.


That sounds like a good first description for a way to fix this.

Mark

=> 
=> I'm sure other solutions could be found...
=> 
=> Arno
=> 
=> > Craig
=> > =



The information contained in this e-mail message is intended only for the 
personal and confidential use of the recipient(s) named above. If the reader of 
this message is not the intended recipient or an agent responsible for 
delivering it to the intended recipient, you are hereby notified that you have 
received this document in error and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you have 
received this communication in error, please notify us immediately by e-mail, 
and delete the original message.

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users