[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[Subclipse-users] svnClientAdapter reads cached passwords from wrong folder

From: Staffan Olsson <solsson_at_gmail.com>
Date: 2006-11-23 19:56:55 CET

Hello,

With setConfigDirectory in svnClientAdapter, it seems that cached
credentials are still read from the default runtime configuration area.

My application creates a new ISVNClientAdapter, runs setConfigDirctory with
a new folder, but still gets the cached credentials from other svn clients.
The setConfigDirectory call seems to work, because it creates the default
config structure. If I delete the default config folder (in user profile)
login fails, as it should.

-----
        File configFolder = new File("configarea");
        File wc = new File("wc");

        JhlClientAdapterFactory.setup();
        ISVNClientAdapter client = SVNClientAdapterFactory.createSVNClient(
                JhlClientAdapterFactory.JAVAHL_CLIENT);

        client.setConfigDirectory(configFolder);
        assertTrue("Should have created default config", configFolder.exists
());

        try {
            client.setUsername("test");
            client.checkout(
                    new SVNUrl("http://localhost/testrepo/test/trunk/"),
                    wc, SVNRevision.HEAD, true);
        } catch (SVNClientException e) {
            // expected, no password set
        }
        assertFalse("invalid login -> no checkout", new File(wc,
".svn").exists());
 -----

The test fails on the last assert, but passes if I delete the Subversion
folder from Application Data. Did I misunderstand setConfigDirectory? The
'svn' client in command prompt with --config-dir works as expected (fails to
login).

Can this be related to the caching issues discussed in
http://svn.haxx.se/dev/archive-2006-11/0100.shtml? A mysterious 'auth'
folder shows up every time the javahl client is created.

thanks
/Staffan
Received on Thu Nov 23 20:21:37 2006

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.