Bacula-users

Re: [Bacula-users] Bug / RFE

2009-02-05 03:28:19
Subject: Re: [Bacula-users] Bug / RFE
From: Arno Lehmann <al AT its-lehmann DOT de>
To: "bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Thu, 05 Feb 2009 09:22:15 +0100
Hi,

04.02.2009 23:29, Kevin Keane wrote:
> 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?)

No, quotes are not allowed in volume labels as far as I know.

Unfortunately, requiring quotes makes the user interface incompatible 
to how it works today.

> If I was to design this from scratch, I'd actually *require* quoting for 
> volume labels (for consistency), but that would break backwards 
> compatibility.

Just the point... optional quotes would be ok, I guess...

>> 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.

Well, for at least one user, true. But is that enough pressure to get 
one of the core developers to working on it? I doubt that.

> 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.

Yes, but, in my opinion, in a less disruptive way.

> It also doesn't cover all the bases, because who says that volume labels 
> have to have leading zeros.

Another border case :-)

> 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.

Quite true, though I suspect that would affect even less users. Or 
rather, I hope so ;-)

Patches, anyone?

I looked up the relevant source, and it shouldn't be too hard to, at 
least, interpret optional quotes... and a feature request with an 
added patch is much more likely to get accepted :-)

Arno


-- 
Arno Lehmann
IT-Service Lehmann
Sandstr. 6, 49080 Osnabrück
www.its-lehmann.de

------------------------------------------------------------------------------
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