You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mark Phippard <Ma...@softlanding.com> on 2005/05/02 18:21:55 UTC

svn lock returns null for username

sussman asked me on IRC to post this over here.

I did a custom build of the 1.2.x branch today from r14551 which was HEAD 
at the time.  I did the build on Win32 and there were a few custom bits, 
although I do not think they are relevant here.

VS .NET 2003
No BDB
OpenSSL is linked static

With that out of the way ... I ran into an odd problem when running svn 
lock via http:// to a Win32 server using brane's RC2 binaries  (only the 
client is custom). 

Basically, svn lock foo returns the message

'foo' locked by user 'null'.

The server does challenge me for a username and password and that username 
shows up on the server log.  svn info WC and svn info URL both do not show 
the lock owner field but do show the lock token and date.

svn:// works fine.

I think the problem might be in r14543 on the 1.2.x branch.  It looks like 
there was code added to libsvn_ra_dav/session.c to implement svn info 
URL://  I think this problem might be a side effect of that change.  Only 
because the diff of that revision seems to have a fair amount of code 
related to the lock owner.

Thanks

Mark



_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs. 
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn lock returns null for username

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Mon, 2 May 2005, Mark Phippard wrote:

> Mark Phippard <Ma...@softlanding.com> wrote on 05/02/2005 02:21:55 PM:
>
> OK, I can see what this "problem" is.  I will let you decide if you should
> fix it or not.  r14543 now gets the lock owner out of a custom header.
> However, this header was not sent by the server prior to this fix.  So my
> problem would occur when using an RC2+ client with an RC2 or earlier
> server.  Once the server is on RC2+ it will be sending the header that the
> client is looking for.
>
How silly a bug:-)

> Perhaps the client could fallback to ras->auth_username if it does not get
> the header?
>
I think it is better to just throw an error, since it is a server bug and
the server was never released.

Regards,
//Peter
> Thanks
>
> Mark
>
>
>
>
> _____________________________________________________________________________
> Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs.
> _____________________________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Re: svn lock returns null for username

Posted by Ben Collins-Sussman <su...@collab.net>.
On May 2, 2005, at 3:36 PM, Peter N. Lundblad wrote:

> On Mon, 2 May 2005, Ben Collins-Sussman wrote:
>
>>
>> Lundblad, are you fixing the validation issue?
>>
> What about the attached patch? Running tests right now.<d.patch>

Looks fine.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

[PATCH] Re: svn lock returns null for username

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Mon, 2 May 2005, Ben Collins-Sussman wrote:

>
> Lundblad, are you fixing the validation issue?
>
What about the attached patch? Running tests right now.

Re: svn lock returns null for username

Posted by Ben Collins-Sussman <su...@collab.net>.
On May 2, 2005, at 2:33 PM, Mark Phippard wrote:
>>
>> OK, I grant you that.  But if the client had been checking for NULL
>> lock->owner, it would be throwing an error message to Mark, instead of
>> showing a NULL value, right?  Mark still would have complained, right?
>
> Complained is probably not the right word.

Sorry, I don't mean to imply that you're a "complainer".  I appreciate 
your excellent bug reports... it's great that you find these things!


> If the error was expressed
> correctly, it could potentially have answered everything right then and
> there.

Agreed.  It would have been easier to diagnose the symptom.  But the 
underlying cause isn't fixable, nor does it need to be.

Lundblad, are you fixing the validation issue?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn lock returns null for username

Posted by Mark Phippard <Ma...@softlanding.com>.
Ben Collins-Sussman <su...@collab.net> wrote on 05/02/2005 03:26:38 PM:

> 
> On May 2, 2005, at 2:32 PM, Peter N. Lundblad wrote:
> 
> >
> > It's a bug, because the client doesn't do proper input validation and
> > thereby violates its API by returning a NULL lock->owner.
> >
> 
> OK, I grant you that.  But if the client had been checking for NULL 
> lock->owner, it would be throwing an error message to Mark, instead of 
> showing a NULL value, right?  Mark still would have complained, right?

Complained is probably not the right word.  If the error was expressed 
correctly, it could potentially have answered everything right then and 
there.

See this TortoiseSVN thread for an example of the sort of side effect 
problems this can cause, and why you might want to throw an error.  TSVN 
would have handled this much better if there had been an error.

http://svn.haxx.se/tsvn/archive-2005-05/0023.shtml

Mark


_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs. 
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn lock returns null for username

Posted by Ben Collins-Sussman <su...@collab.net>.
On May 2, 2005, at 2:32 PM, Peter N. Lundblad wrote:

>
> It's a bug, because the client doesn't do proper input validation and
> thereby violates its API by returning a NULL lock->owner.
>

OK, I grant you that.  But if the client had been checking for NULL 
lock->owner, it would be throwing an error message to Mark, instead of 
showing a NULL value, right?  Mark still would have complained, right?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn lock returns null for username

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Mon, 2 May 2005, Ben Collins-Sussman wrote:

>
> On May 2, 2005, at 2:06 PM, Mark Phippard wrote:
> > OK, I can see what this "problem" is.  I will let you decide if you
> > should
> > fix it or not.  r14543 now gets the lock owner out of a custom header.
> > However, this header was not sent by the server prior to this fix.  So
> > my
> > problem would occur when using an RC2+ client with an RC2 or earlier
> > server.  Once the server is on RC2+ it will be sending the header that
> > the
> > client is looking for.
> >
> > Perhaps the client could fallback to ras->auth_username if it does not
> > get
> > the header?
> >
>
> Nope, this is definitely not a bug.  rc2 is not an official release...

It's a bug, because the client doesn't do proper input validation and
thereby violates its API by returning a NULL lock->owner.

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn lock returns null for username

Posted by Mark Phippard <Ma...@softlanding.com>.
Ben Collins-Sussman <su...@collab.net> wrote on 05/02/2005 03:14:48 PM:

> 
> Nope, this is definitely not a bug.  rc2 is not an official release... 
> and deliberately so, so we can *exactly* make these sorts of 
> incompatible locking protocol changes.  If you're going to use rc's in 
> production, be sure that clients and servers match.
> 

I am fine with that.  I will just build the DAV modules so I can continue 
my testing.  It was dumb luck that I happened to do a build today AND test 
locking.

As an fyi... The TSVN nightly builds appear to be from the latest 1.2.x 
branch so you might see an increase in reports of this problem until RC3 
or GA is released.

Thanks

Mark



_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs. 
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn lock returns null for username

Posted by Ben Collins-Sussman <su...@collab.net>.
On May 2, 2005, at 2:06 PM, Mark Phippard wrote:
> OK, I can see what this "problem" is.  I will let you decide if you 
> should
> fix it or not.  r14543 now gets the lock owner out of a custom header.
> However, this header was not sent by the server prior to this fix.  So 
> my
> problem would occur when using an RC2+ client with an RC2 or earlier
> server.  Once the server is on RC2+ it will be sending the header that 
> the
> client is looking for.
>
> Perhaps the client could fallback to ras->auth_username if it does not 
> get
> the header?
>

Nope, this is definitely not a bug.  rc2 is not an official release... 
and deliberately so, so we can *exactly* make these sorts of 
incompatible locking protocol changes.  If you're going to use rc's in 
production, be sure that clients and servers match.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn lock returns null for username

Posted by Mark Phippard <Ma...@softlanding.com>.
Mark Phippard <Ma...@softlanding.com> wrote on 05/02/2005 02:21:55 PM:

> sussman asked me on IRC to post this over here.
> 
> I did a custom build of the 1.2.x branch today from r14551 which was 
HEAD 
> at the time.  I did the build on Win32 and there were a few custom bits, 

> although I do not think they are relevant here.
> 
> VS .NET 2003
> No BDB
> OpenSSL is linked static
> 
> With that out of the way ... I ran into an odd problem when running svn 
> lock via http:// to a Win32 server using brane's RC2 binaries  (only the 

> client is custom). 
> 
> Basically, svn lock foo returns the message
> 
> 'foo' locked by user 'null'.
> 
> The server does challenge me for a username and password and that 
username 
> shows up on the server log.  svn info WC and svn info URL both do not 
show 
> the lock owner field but do show the lock token and date.
> 
> svn:// works fine.
> 
> I think the problem might be in r14543 on the 1.2.x branch.  It looks 
like 
> there was code added to libsvn_ra_dav/session.c to implement svn info 
> URL://  I think this problem might be a side effect of that change. Only 

> because the diff of that revision seems to have a fair amount of code 
> related to the lock owner.

OK, I can see what this "problem" is.  I will let you decide if you should 
fix it or not.  r14543 now gets the lock owner out of a custom header. 
However, this header was not sent by the server prior to this fix.  So my 
problem would occur when using an RC2+ client with an RC2 or earlier 
server.  Once the server is on RC2+ it will be sending the header that the 
client is looking for.

Perhaps the client could fallback to ras->auth_username if it does not get 
the header?

Thanks

Mark




_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services powered by MessageLabs. 
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org