Bug 51333 - isLibraryPasswordVerified raises IllegalArgumentException
Summary: isLibraryPasswordVerified raises IllegalArgumentException
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: Other All
: medium normal
Assignee: Noel Power
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-22 07:24 UTC by Laurent Godard
Modified: 2012-06-25 05:16 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Godard 2012-06-22 07:24:03 UTC
using this method through  BasicLibraries.isLibraryPasswordVerified always raises an illegalArgumentException

guesses
maybe related to
http://opengrok.libreoffice.org/xref/core/basic/source/uno/namecont.cxx#2664
http://opengrok.libreoffice.org/xref/core/basic/source/uno/scriptcont.cxx#426
it sounds like some problem with the definition of the   SfxScriptLibraryContainer class

anything related to nss ?

Morever creating a library dynamically, password protected, creates it but remains unprotected when reloading librO

		BasicLibraries.createLibrary(libName)
		BasicLibraries.getByName(libName).insertByName(module,"")
		BasicLibraries.changeLibraryPassword(libName,"",thePassword)
Comment 1 Noel Power 2012-06-22 10:36:06 UTC
so.. now I am confused, I somehow assumed from our conversation that the code in namecont.cxx was getting hit when attempting to access the isLibraryPasswordVerified method. That appears not to be the case and the code in scriptcont.cxx IS getting hit. So.. I don't see what is wrong here e.g.

sub passfoo
msgbox basicLibraries.isLibraryPasswordProtected( "Library1" )
if basicLibraries.isLibraryPasswordProtected( "Library1" ) then
    msgbox basiclibraries.isLibraryPasswordVerified( "Library1" )
end if
end sub

produces message box with "true" and then a message box with "false" for a password protected "Library1"


additionally if I extend that example like

basicLibraries.verifyLibraryPassword(  "Library1", "foo" )

msgbox basicLibraries.isLibraryPasswordProtected( "Library1" )
if basicLibraries.isLibraryPasswordProtected( "Library1" ) then
    msgbox basiclibraries.isLibraryPasswordVerified( "Library1" )
end if


to supply the password for "Library1" I get "true" then "false".

Sofar seems to be working as expected, maybe you can supply a snippet for the regression you were mentioning  


about the second part of the bug, I think this is a separate issue you mentioned before ( and no regression ) right? better then to file that separately.
Comment 2 Laurent Godard 2012-06-25 05:15:35 UTC
really sorry 
a stupid mistake of me, and my library was not protected at all.

(/me hides)

the basicLibraries.isLibraryPasswordProtected pointed me.

so for me it is ok, no problem

and really sorry for the waste of time

i close