Arno Lehmann wrote:
> 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=29 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.
>>
>
> 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.
>
How about allowing quoting? If you really mean volume labels, type
"000029". That should be completely backwards compatible (unless the
quote characters are allowed in volume labels - I don't think they are?)
If I was to design this from scratch, I'd actually *require* quoting for
volume labels (for consistency), but that would break backwards
compatibility.
> Actually, as most volume names today are non-numeric, I don't think
> this affects enough users to make a fix an urgent thing.
>
It seems to me that somebody actually ran into that issue, so it
probably is somewhat pressing for some users.
As long as it is legal as a volume name, bacula should be able to
process it correctly.
> 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.
>
In a way, that would be nice - but actually, it's not completely
backwards compatible because for the exact same input, bacula's behavior
would be changing.
It also doesn't cover all the bases, because who says that volume labels
have to have leading zeros. What about a scenario where the volume label
has only digits but doesn't start with a leading zero? In that case, you
might well have a volume label "137" and a media id 137 and you'd still
have the same problem.
--
Kevin Keane
Owner
The NetTech
Find the Uncommon: Expert Solutions for a Network You Never Have to Think About
Office: 866-642-7116
http://www.4nettech.com
This e-mail and attachments, if any, may contain confidential and/or
proprietary information. Please be advised that the unauthorized use or
disclosure of the information is strictly prohibited. The information herein is
intended only for use by the intended recipient(s) named above. If you have
received this transmission in error, please notify the sender immediately and
permanently delete the e-mail and any copies, printouts or attachments thereof.
------------------------------------------------------------------------------
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
|