You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kannan <ka...@collab.net> on 2009/10/07 06:57:07 UTC

[PATCH] Invoke 'store password' prompt for all commands requiring authentication

Log:
 While working on a wc of a repo which needs authentication, 'store
 password unencrypted' prompt is getting invoked only for those svn
 commands that access the repo URL or that have an URL as argument
 (eg. svn ls http://localhost/repo) and not for wc oriented commands
 such as `svn ls' or `svn cat -r 5 test.c' which also require
 authentication. The prompt gets invoked for the rest of the commands
 which need repo access, with the following patch.

 * subversion/libsvn_ra_neon/session.c
  (svn_ra_neon__get_repos_root) : Call
  `svn_ra_neon__maybe_store_auth_info' to invoke 'store
   password unencrypted' prompt.

 Patch by : Kannan R <ka...@collab.net>

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2404392

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Kannan R <ka...@collab.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 06 August 2010 06:22 PM, Senthil Kumaran S wrote:
> Hi,
>
> Kannan R wrote:
>> On Wednesday 07 October 2009 04:17 PM, Kannan wrote:
>>> Stefan Sperling wrote:
>>
>>>> Does this patch fix this case, too?
>>
>>
>> [..]
>>
>> /me digs from the list of yet-to-be-committed patches.
>
> I ve attached a new patch which fixes this by calling
> svn_ra_neon__maybe_store_auth_info() once, instead of the repeated calls as
> cmpilato has pointed out. Kannan, can you confirm this solves the issue you
> see? If so I shall commit the patch.
>
>
[..]

Yes, Senthil. This fixes the issue.


- -- 
Thanks & Regards,
Kannan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMXA3EAAoJELQAaYkQr+e7glQIAK+kBECPTIAI6yo5WrKFZ9Ze
VhqW9k4yCXxEA0BPvGPFStX2sm3yCgH5llPYAxh+xQ1TAPpnWwQn1WloJDjT/nBv
tEGwWHNmtkhEjzoBc/7AgtCTLFYCMgY7BANVhFGfg2mHrb7tEAcF3lWq47o7pTpe
P8hNq/UGiosL077zVpHKeMyIaPizuwslZAYuy/CuKwfWxDIT3Umi63rXCNOm95dD
TT90Ge4NlvWe0LXZmvNWJp8GoDPuOgbr76qjdESUcken5Ipnn4rdfPEY+C94GUPP
3xwUJ/GHePalPiXOqfcNerZo+pqv8aFGhGpFoKZrhuDyddp6mdcPHGmAxNF5tso=
=rD9F
-----END PGP SIGNATURE-----

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Senthil Kumaran S <se...@collab.net>.
Hi,

Kannan R wrote:
> On Wednesday 07 October 2009 04:17 PM, Kannan wrote:
>> Stefan Sperling wrote:
> 
>>> Does this patch fix this case, too?
> 
> 
> [..]
> 
> /me digs from the list of yet-to-be-committed patches.

I ve attached a new patch which fixes this by calling
svn_ra_neon__maybe_store_auth_info() once, instead of the repeated calls as
cmpilato has pointed out. Kannan, can you confirm this solves the issue you
see? If so I shall commit the patch.

[[[
While working on a wc of a repo which needs authentication, 'store
password unencrypted' prompt is getting invoked only for those svn
commands that access the repo URL or that have an URL as argument
(eg. svn ls http://localhost/repo) and not for wc oriented commands
such as `svn ls' or `svn cat -r 5 test.c' which also require
authentication, which is solved here. This also fixes redundant
invokation of the function 'svn_ra_neon__maybe_store_auth_info' at
various places.

* subversion/libsvn_ra_neon/util.c
  (svn_ra_neon__request_create): Store auth credentials if we can.

* subversion/libsvn_ra_neon/session.c
  (svn_ra_neon__do_get_uuid): Remove redundant invocation.

* subversion/libsvn_ra_neon/commit.c
  (commit_close_edit): Remove redundant invocation.

* subversion/libsvn_ra_neon/fetch.c
  (svn_ra_neon__get_latest_revnum, reporter_finish_report): Remove
   redundant invocation.
]]]

Thank You.
-- 
Senthil Kumaran S
http://www.stylesen.org/

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Senthil Kumaran S <se...@collab.net>.
Kannan R wrote:
> On Friday 06 August 2010 06:25 PM, Senthil Kumaran S wrote:
>> Hi Kannan,
> 
>> Kannan R wrote:
>>> * props.c (svn_ra_neon__get_props) : Call
>>> `svn_ra_neon__maybe_store_auth_info' to invoke 'store password
>>> unencrypted' prompt.
>> I don't think calling the function in props.c is the right way to
>> go. I have posted an alternate patch for the same.
> 
> 
> 
> Yes, Senthil, I see your point. Though all commands would be
> redirected to props.c of neon, it's advisable to store the auth
> credentials, when the session is created.

Committed in r982952.

Thank You.
-- 
Senthil Kumaran S
http://www.stylesen.org/

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Kannan R <ka...@collab.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 06 August 2010 06:25 PM, Senthil Kumaran S wrote:
> Hi Kannan,
>
> Kannan R wrote:
>> * props.c (svn_ra_neon__get_props) : Call
>> `svn_ra_neon__maybe_store_auth_info' to invoke 'store password
>> unencrypted' prompt.
>
> I don't think calling the function in props.c is the right way to
> go. I have posted an alternate patch for the same.
>
>

Yes, Senthil, I see your point. Though all commands would be
redirected to props.c of neon, it's advisable to store the auth
credentials, when the session is created.

Thank you.

- -- 
Thanks & Regards,
Kannan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMXA7EAAoJELQAaYkQr+e7v+QH/3K1bxJb3sNIntKdFWdO7ifJ
A0C+hyJcyE/TYkDwGo7cNqBAC+y+63O7lkHJH90QA6nNxvTf6l58JwUkFBZI30yp
53WAA6bnxcimnxfCx8T+hC2MYUzhlrUH9H6s7YETU4QTbljGycyVow7kOpoaNYpM
piG+0aE+6luHvrl2WColQ4P8xhmG5xuVkC7/Dld2kIEnYT1F3NUE0GVrA0Kzhn1B
qrpbCwScKvINgiC3ILdnVmZrYH1kHZkGXI0YUXmDC/jI8/ix5uIQoiTQ7bmWe04h
Dir29mL0YFa+VqJQ3s0xWz5UTzy+AEj12lx6cL3H1teL/3OJdosxvXoPP0CLzwM=
=Lm6u
-----END PGP SIGNATURE-----

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Senthil Kumaran S <se...@collab.net>.
Hi Kannan,

Kannan R wrote:
>    * props.c
>     (svn_ra_neon__get_props) : Call
>     `svn_ra_neon__maybe_store_auth_info' to invoke 'store
>      password unencrypted' prompt.

I don't think calling the function in props.c is the right way to go. I have
posted an alternate patch for the same.

Thank You.
-- 
Senthil Kumaran S
http://www.stylesen.org/

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Senthil Kumaran S <se...@collab.net>.
Kannan R wrote:
> On Thursday 29 July 2010 01:38 AM, Hyrum K. Wright wrote:
>> Does this need to be fixed for serf too?
> 
> serf seems to hold good in this case, it was working fine even at the
> time of submission of this initial patch.

Yes I confirm this. Looks like a problem with neon alone.

Thank You.
-- 
Senthil Kumaran S
http://www.stylesen.org/

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Kannan R <ka...@collab.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 29 July 2010 01:38 AM, Hyrum K. Wright wrote:
> Does this need to be fixed for serf too?

serf seems to hold good in this case, it was working fine even at the
time of submission of this initial patch.

- -- 
Thanks & Regards,
Kannan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMVBLnAAoJELQAaYkQr+e7ROAH/AwME7utCTcVHDJVb13MSyOx
0eIf3Pdz0gW9/LVLg+aQWG3VIZD/fqeqmkhQtue3LQsi6bNsk9DpqKIPoRHTBMXB
XxzhnwfDdM/PZQdCW/GbE0YEr9QmFcoew2rH4UPaNpiO78EZpW+s3r7j+bm7LoYy
7CQyj4BjIp9E6MnS8X3w9PnV/dCFjjtKLvCMgxZFEURw4Xv5VQjF2+MsCxGPOFyj
FbjGX7MUUx4NcuekOQp2MUM7F15ZKnha1gN6q8xkhDfiF1jSUkTeo40977MtOhXv
9C4bHrKynIwg+LDOT3+d/4M3zDPSstfTrPrULA/AXApFTO6SW/AOaZZ5UJTOkFw=
=gjhR
-----END PGP SIGNATURE-----


Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Does this need to be fixed for serf too?

-Hyrum

On Wed, Jul 28, 2010 at 12:52 PM, Kannan R <ka...@collab.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wednesday 07 October 2009 04:17 PM, Kannan wrote:
>> Stefan Sperling wrote:
>>
>>> Does this patch fix this case, too?
>>
>>
> [..]
>
> /me digs from the list of yet-to-be-committed patches.
>
> [[[
>   Log:
>    While working on a wc of a repo which needs authentication, 'store
>    password unencrypted' prompt is getting invoked only for those svn
>    commands that access the repo URL or that have an URL as argument
>    (eg. svn ls http://localhost/repo) and not for wc oriented commands
>    such as `svn ls' or `svn cat -r 5 test.c' which also require
>    authentication. The prompt gets invoked for the rest of the commands
>    which need repo access, with the following patch.
>
>    [ in subversion/libsvn_ra_neon ]
>
>    * props.c
>     (svn_ra_neon__get_props) : Call
>     `svn_ra_neon__maybe_store_auth_info' to invoke 'store
>      password unencrypted' prompt.
>
>    * commit.c
>    * fetch.c
>    * session.c
>        Remove redundant invocations of the above method.
> ]]]
>
> - --
>
> Thanks & Regards,
> Kannan
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJMUG51AAoJELQAaYkQr+e7t9UIAK3/u+9DzgRifCZawitsWbRr
> yLjBWMdZM58SbNziWVRVwAIyvjd2uIT0+5hHaRe3xD9V9QR/GKe1Wss2goJXwy9I
> 1Ofer7XLTRe1f5p8BeeP2bvWiT7Mbb7IGfjo8weQP16ViF0j1O/LJCYUOjvMax9R
> xmCN8P1ZlEl+qaxOEoRyTZZQFo93iibS1GgvhBdxBoZf8qk+Hp8GF+Fpxu+P/o1x
> 6S1EAWunUQgPjz8r+XN5sy2QYOEv0iYP1yFISigIFk55B+vI4RTDNCdvwiDpRaor
> vKzJayxhDAhfvtJ45IYB1gNlrzB9znYAgecWAki9lqkv08l5D8hn2FbMBdINlSM=
> =n8SW
> -----END PGP SIGNATURE-----
>
>

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Kannan R <ka...@collab.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wednesday 07 October 2009 04:17 PM, Kannan wrote:
> Stefan Sperling wrote:
>
>> Does this patch fix this case, too?
>
>
[..]

/me digs from the list of yet-to-be-committed patches.

[[[
  Log:
   While working on a wc of a repo which needs authentication, 'store
   password unencrypted' prompt is getting invoked only for those svn
   commands that access the repo URL or that have an URL as argument
   (eg. svn ls http://localhost/repo) and not for wc oriented commands
   such as `svn ls' or `svn cat -r 5 test.c' which also require
   authentication. The prompt gets invoked for the rest of the commands
   which need repo access, with the following patch.

   [ in subversion/libsvn_ra_neon ]

   * props.c
    (svn_ra_neon__get_props) : Call
    `svn_ra_neon__maybe_store_auth_info' to invoke 'store
     password unencrypted' prompt.

   * commit.c
   * fetch.c
   * session.c
       Remove redundant invocations of the above method.
]]]

- -- 

Thanks & Regards,
Kannan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJMUG51AAoJELQAaYkQr+e7t9UIAK3/u+9DzgRifCZawitsWbRr
yLjBWMdZM58SbNziWVRVwAIyvjd2uIT0+5hHaRe3xD9V9QR/GKe1Wss2goJXwy9I
1Ofer7XLTRe1f5p8BeeP2bvWiT7Mbb7IGfjo8weQP16ViF0j1O/LJCYUOjvMax9R
xmCN8P1ZlEl+qaxOEoRyTZZQFo93iibS1GgvhBdxBoZf8qk+Hp8GF+Fpxu+P/o1x
6S1EAWunUQgPjz8r+XN5sy2QYOEv0iYP1yFISigIFk55B+vI4RTDNCdvwiDpRaor
vKzJayxhDAhfvtJ45IYB1gNlrzB9znYAgecWAki9lqkv08l5D8hn2FbMBdINlSM=
=n8SW
-----END PGP SIGNATURE-----


Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by "C. Michael Pilato" <cm...@collab.net>.
Kannan wrote:
> Stefan Sperling wrote:
> 
>> Does this patch fix this case, too?
> 
> It doesn't as of now, also for other svn prop* commands. Trying to fix
> them too.

Looking through the ra_neon code, I'm not sure I could detect either rhyme
or reason for when the maybe_store_auth_info() help was being called.  Looks
like we just scattered those calls all over the place as we detected the
need for them.

ra_serf appears to take a more sane approach, remembering in a very
low-level request handler helper function when it had to re-attempt a
request (any request!) on account of insufficient privileges, and storing
auth creds if the second attempt succeeded.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2404498

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Kannan <ka...@collab.net>.
Stefan Sperling wrote:

> Does this patch fix this case, too?

It doesn't as of now, also for other svn prop* commands. Trying to fix
them too.


-- 
Thanks & Regards,
Kannan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2404458

Re: [PATCH] Invoke 'store password' prompt for all commands requiring authentication

Posted by Stefan Sperling <st...@elego.de>.
On Wed, Oct 07, 2009 at 12:27:07PM +0530, Kannan wrote:
> Log:
>  While working on a wc of a repo which needs authentication, 'store
>  password unencrypted' prompt is getting invoked only for those svn
>  commands that access the repo URL or that have an URL as argument
>  (eg. svn ls http://localhost/repo) and not for wc oriented commands
>  such as `svn ls' or `svn cat -r 5 test.c' which also require
>  authentication. The prompt gets invoked for the rest of the commands
>  which need repo access, with the following patch.
> 
>  * subversion/libsvn_ra_neon/session.c
>   (svn_ra_neon__get_repos_root) : Call
>   `svn_ra_neon__maybe_store_auth_info' to invoke 'store
>    password unencrypted' prompt.
> 

I'm not familiar enough with ra-neon to decide whether this patch
is OK, but I have a related question:

I noticed the prompt does not show up during 'svn propedit' either.
E.g. when I do: 'svn propedit --revprop -rX svn:log
https://svn.collab.net/... ' I have to enter my password after exiting
the editor but svn never asks me whether it should store the password
in plaintext (as it does when I make a commit).

Does this patch fix this case, too?

Thanks,
Stefan


> Index: session.c
> ===================================================================
> --- session.c	(revision 39675)
> +++ session.c	(working copy)
> @@ -1099,6 +1099,7 @@
>      }
>  
>    *url = ras->repos_root;
> +  SVN_ERR(svn_ra_neon__maybe_store_auth_info(ras, pool));  
>    return SVN_NO_ERROR;
>  }
>  




-- 
printf("Eh???/n");

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2404437