Re: what do I hash to get .subversion/auth/svn.simple file name?

2014-01-06 Thread Ben Reser
On 1/6/14, 11:40 AM, Tristan Slominski wrote:
> Given ~/.subversion/auth/svn.simple/5671adf2865e267db74f09ba6f872c28 with the
> contents of:
> 
> K 8
> username
> V 3
> joe
> K 8
> password
> V 4
> blah
> K 15
> svn:realmstring
> V 45
>  Joe's repository
> END
> 
> What string to I hash to get 5671adf2865e267db74f09ba6f872c28?
> 
> I tried md5 hashing a lot of strings (first one being
> " Joe's repository"), and I can't find one that
> generates the correct hash.

It's the value in svn:realmstring which is apparently the one you tried first
but must have made some mistake (I'd guess a trailing character if you're using
the md5sum command).

I see on StackOverflow that you figured it out.  For reference the code
responsible for this is in svn_auth__file_path() which lives in
subversion/libsvn_subr/config_auth.c

Link to the code in trunk:
https://svn.apache.org/repos/asf/subversion/trunk/subversion/libsvn_subr/config_auth.c


Re: what do I hash to get .subversion/auth/svn.simple file name?

2014-01-06 Thread Tristan Slominski
Thank you Bert for the explanation and the cautions. I will definitely heed
them and after spending hours on this I'll probably remember the context
for this decision for quite a while :)


On Mon, Jan 6, 2014 at 2:06 PM, Bert Huijben  wrote:

> First: Note this is an implementation detail. We don’t promise that this
> format stays compatible over versions, and with a default client you would
> see that the password on Windows is crypted in this file.
>
>
>
> In the current implementation the hash string is constructed in
> subversion/libsvn_subr/config_auth.c’s function svn_auth__file_path()
>
>
>
> [[
>
> svn_error_t *
>
> svn_auth__file_path(const char **path,
>
> const char *cred_kind,
>
> const char *realmstring,
>
> const char *config_dir,
>
> apr_pool_t *pool)
>
> {
>
>   const char *authdir_path, *hexname;
>
>   svn_checksum_t *checksum;
>
>
>
>   /* Construct the path to the directory containing the creds files,
>
>  e.g. "~/.subversion/auth/svn.simple".  The last component is
>
>  simply the cred_kind.  */
>
>   SVN_ERR(svn_config_get_user_config_path(&authdir_path, config_dir,
>
>   SVN_CONFIG__AUTH_SUBDIR, pool));
>
>   if (authdir_path)
>
> {
>
>   authdir_path = svn_dirent_join(authdir_path, cred_kind, pool);
>
>
>
>   /* Construct the basename of the creds file.  It's just the
>
>  realmstring converted into an md5 hex string.  */
>
>   SVN_ERR(svn_checksum(&checksum, svn_checksum_md5, realmstring,
>
>strlen(realmstring), pool));
>
>   hexname = svn_checksum_to_cstring(checksum, pool);
>
>
>
>   *path = svn_dirent_join(authdir_path, hexname, pool);
>
> }
>
>   else
>
> *path = NULL;
>
>
>
>   return SVN_NO_ERROR;
>
> }
>
> ]]
>
>
>
> So we calculate the md5 hash over the realm string in UTF-8 form (your
> first guess)
>
>
>
> But as noted: you should not rely on this. This format may change at any
> time.
>
> Functions like svn_config_walk_auth_data() provide a stable api against
> future versions, while this storage will probably change at some point, and
> is certainly incompatible with other backends like keychains, etc.
>
>
>
> Bert
>
>
>
>
>
> *From:* Tristan Slominski [mailto:tristan.slomin...@gmail.com]
> *Sent:* maandag 6 januari 2014 20:41
> *To:* users@subversion.apache.org
> *Subject:* what do I hash to get .subversion/auth/svn.simple file name?
>
>
>
> Hi,
>
>
>
> I thought this was going to be easy to find out, but after hours
> researching this and trying different things, I still don't know how to
> answer the question.
>
>
>
> I posted it on stack overflow here:
> http://stackoverflow.com/questions/20952004/subversion-auth-svn-simple-hash-algorithm
>
>
>
> It boils down to this:
>
>
> Given ~/.subversion/auth/svn.simple/5671adf2865e267db74f09ba6f872c28 with
> the contents of:
>
> K 8
> username
> V 3
> joe
> K 8
> password
> V 4
> blah
> K 15
> svn:realmstring
> V 45
>  Joe's repository
> END
>
> What string to I hash to get 5671adf2865e267db74f09ba6f872c28?
>
> I tried md5 hashing a lot of strings (first one being "<
> https://svn.domain.com:443> Joe's repository"), and I can't find one that
> generates the correct hash.
>
>
>
> Cheers,
>
>
>
> Tristan
>


Re: what do I hash to get .subversion/auth/svn.simple file name?

2014-01-06 Thread Tristan Slominski
My poor use of command line was at fault when diagnosing this issue. I did
not use -n option when invoking echo.

Thank you very much!


On Mon, Jan 6, 2014 at 2:03 PM, Stefan Sperling  wrote:

> On Mon, Jan 06, 2014 at 01:40:58PM -0600, Tristan Slominski wrote:
> > Hi,
> >
> > I thought this was going to be easy to find out, but after hours
> > researching this and trying different things, I still don't know how to
> > answer the question.
> >
> > I posted it on stack overflow here:
> >
> http://stackoverflow.com/questions/20952004/subversion-auth-svn-simple-hash-algorithm
> >
> > It boils down to this:
> >
> > Given ~/.subversion/auth/svn.simple/5671adf2865e267db74f09ba6f872c28 with
> > the contents of:
> >
> > K 8
> > username
> > V 3
> > joe
> > K 8
> > password
> > V 4
> > blah
> > K 15
> > svn:realmstring
> > V 45
> >  Joe's repository
> > END
> >
> > What string to I hash to get 5671adf2865e267db74f09ba6f872c28?
>
> The creds file's name is indeed the MD5 checksum of the realmstring.
> This code generates the name (in subversion/libsvn_subr/config_auth.c):
>
>   /* Construct the basename of the creds file.  It's just the
>  realmstring converted into an md5 hex string.  */
>   SVN_ERR(svn_checksum(&checksum, svn_checksum_md5, realmstring,
>strlen(realmstring), pool));
>   hexname = svn_checksum_to_cstring(checksum, pool);
>
>   *path = svn_dirent_join(authdir_path, hexname, pool);
>
> > https://svn.domain.com:443> Joe's repository"), and I can't find one
> that
> > generates the correct hash.
>
> I'm not sure why your example doesn't work, but with a data set
> of mine I get the right hash:
>
> $ cd ~/.subversion/auth/svn.simple
> $ echo -n " ASF Committers:443> ASF
> Committers" | md5
> d3c8a345b14f6a1b42251aef8027ab57
> $ grep ASF ./d3c8a345b14f6a1b42251aef8027ab57
>  ASF Committers
> $
>


RE: what do I hash to get .subversion/auth/svn.simple file name?

2014-01-06 Thread Bert Huijben
First: Note this is an implementation detail. We don't promise that this
format stays compatible over versions, and with a default client you would
see that the password on Windows is crypted in this file.

 

In the current implementation the hash string is constructed in
subversion/libsvn_subr/config_auth.c's function svn_auth__file_path()

 

[[

svn_error_t *

svn_auth__file_path(const char **path,

const char *cred_kind,

const char *realmstring,

const char *config_dir,

apr_pool_t *pool)

{

  const char *authdir_path, *hexname;

  svn_checksum_t *checksum;

 

  /* Construct the path to the directory containing the creds files,

 e.g. "~/.subversion/auth/svn.simple".  The last component is

 simply the cred_kind.  */

  SVN_ERR(svn_config_get_user_config_path(&authdir_path, config_dir,

  SVN_CONFIG__AUTH_SUBDIR, pool));

  if (authdir_path)

{

  authdir_path = svn_dirent_join(authdir_path, cred_kind, pool);

 

  /* Construct the basename of the creds file.  It's just the

 realmstring converted into an md5 hex string.  */

  SVN_ERR(svn_checksum(&checksum, svn_checksum_md5, realmstring,

   strlen(realmstring), pool));

  hexname = svn_checksum_to_cstring(checksum, pool);

 

  *path = svn_dirent_join(authdir_path, hexname, pool);

}

  else

*path = NULL;

 

  return SVN_NO_ERROR;

}

]]

 

So we calculate the md5 hash over the realm string in UTF-8 form (your first
guess)

 

But as noted: you should not rely on this. This format may change at any
time. 

Functions like svn_config_walk_auth_data() provide a stable api against
future versions, while this storage will probably change at some point, and
is certainly incompatible with other backends like keychains, etc.

 

Bert

 

 

From: Tristan Slominski [mailto:tristan.slomin...@gmail.com] 
Sent: maandag 6 januari 2014 20:41
To: users@subversion.apache.org
Subject: what do I hash to get .subversion/auth/svn.simple file name?

 

Hi,

 

I thought this was going to be easy to find out, but after hours researching
this and trying different things, I still don't know how to answer the
question.

 

I posted it on stack overflow here:
http://stackoverflow.com/questions/20952004/subversion-auth-svn-simple-hash-
algorithm

 

It boils down to this:


Given ~/.subversion/auth/svn.simple/5671adf2865e267db74f09ba6f872c28 with
the contents of:

K 8
username
V 3
joe
K 8
password
V 4
blah
K 15
svn:realmstring
V 45
 Joe's repository
END

What string to I hash to get 5671adf2865e267db74f09ba6f872c28?

I tried md5 hashing a lot of strings (first one being
" Joe's repository"), and I can't find one that
generates the correct hash.

 

Cheers,

 

Tristan



Re: what do I hash to get .subversion/auth/svn.simple file name?

2014-01-06 Thread Stefan Sperling
On Mon, Jan 06, 2014 at 01:40:58PM -0600, Tristan Slominski wrote:
> Hi,
> 
> I thought this was going to be easy to find out, but after hours
> researching this and trying different things, I still don't know how to
> answer the question.
> 
> I posted it on stack overflow here:
> http://stackoverflow.com/questions/20952004/subversion-auth-svn-simple-hash-algorithm
> 
> It boils down to this:
> 
> Given ~/.subversion/auth/svn.simple/5671adf2865e267db74f09ba6f872c28 with
> the contents of:
> 
> K 8
> username
> V 3
> joe
> K 8
> password
> V 4
> blah
> K 15
> svn:realmstring
> V 45
>  Joe's repository
> END
> 
> What string to I hash to get 5671adf2865e267db74f09ba6f872c28?

The creds file's name is indeed the MD5 checksum of the realmstring.
This code generates the name (in subversion/libsvn_subr/config_auth.c):

  /* Construct the basename of the creds file.  It's just the
 realmstring converted into an md5 hex string.  */
  SVN_ERR(svn_checksum(&checksum, svn_checksum_md5, realmstring,
   strlen(realmstring), pool));
  hexname = svn_checksum_to_cstring(checksum, pool);

  *path = svn_dirent_join(authdir_path, hexname, pool);

> https://svn.domain.com:443> Joe's repository"), and I can't find one that
> generates the correct hash.

I'm not sure why your example doesn't work, but with a data set
of mine I get the right hash:

$ cd ~/.subversion/auth/svn.simple
$ echo -n " ASF Committers:443> ASF Committers" | 
md5
d3c8a345b14f6a1b42251aef8027ab57
$ grep ASF ./d3c8a345b14f6a1b42251aef8027ab57
 ASF Committers
$ 


what do I hash to get .subversion/auth/svn.simple file name?

2014-01-06 Thread Tristan Slominski
Hi,

I thought this was going to be easy to find out, but after hours
researching this and trying different things, I still don't know how to
answer the question.

I posted it on stack overflow here:
http://stackoverflow.com/questions/20952004/subversion-auth-svn-simple-hash-algorithm

It boils down to this:

Given ~/.subversion/auth/svn.simple/5671adf2865e267db74f09ba6f872c28 with
the contents of:

K 8
username
V 3
joe
K 8
password
V 4
blah
K 15
svn:realmstring
V 45
 Joe's repository
END

What string to I hash to get 5671adf2865e267db74f09ba6f872c28?

I tried md5 hashing a lot of strings (first one being "<
https://svn.domain.com:443> Joe's repository"), and I can't find one that
generates the correct hash.

Cheers,

Tristan


RE: Keyword expansion from merged changes

2014-01-06 Thread Andrew Reedick


> -Original Message-
> From: James Hanley [mailto:jhan...@dgtlrift.com]
> Sent: Saturday, January 04, 2014 2:47 AM
> To: Ben Reser
> Cc: users@subversion.apache.org
> Subject: Re: Keyword expansion from merged changes
> 
> 
> > So in my opinion I don't think this is a good suggested feature.
> 
> Fair enough, and one of the workarounds you previously mentioned may be
> useful, but in my opinion there is still gap between keywords and merge
> history even if this specific feature proposal is not a desired
> solution to close that gap.
> 
> Where do we go from here?

Nowhere.



IMHO, you should change your process to not rely on keywords, for the simple 
reason that merge edge-cases require human intervention and/or interpretation 
(e.g. extra changes made in the merge revision, non-trivial conflict 
resolution, partial merges, reverse merges, cherry picked merges, record only 
merges, etc.)  The svn tools (e.g. 'svn diff' or 'svn mergeinfo --show-revs 
eligible') simply help to notify you that there may be a problem that needs to 
be investigated.  A difference between exported code bases could be acceptable, 
but only a human can make that determination.  "Missing" merges may be okay if 
the skipped revisions represent an unwanted or incomplete feature, (i.e. you 
don't want to merge incomplete work to trunk.)  

>From a previous post:
"our need would be for during the release process for validating all changes 
are completely synchronized and that there are no missing changes between 
branches, but aside from our need, it just doesn't seem right that there would 
show differences between the exported branches"

There are two types of bicycle riders:  those who have fallen and those who 
have yet to fall.  Right now you have a very easy to merge code base since you 
can "safely" make the assumption that exported merges should be identical.  But 
trust me, you will eventually hit a merge edge case which completely negate 
your ability to maintain that assumption.

Your process, workflow, and issue/defect/bug/ticket tracking system should be 
instrumental in ensuring that work is being tracked (in addition to 'svn 
mergeinfo' and 'svn diff'.)  A "merge aware" keyword just isn't enough, because 
even if a "merge aware" keyword were implemented, it would become useless once 
you hit a merge edge case.





Regarding Tracker Issue 4215

2014-01-06 Thread Anne Christensen
Hi Developers,

We have run into the same issue as is reported in tracker issue 4215.

We are using svn:externals with sub-projects in same repository and are using 
same branch names for each sub-project.
We would like to be able to merge all the external projects when merging the 
main project from trunk to branch or vice versa.

What is the status of tracker issue 4215?
Do you plan to do any fixes for this issue?

Best Regards
Anne Christensen

---
Anne Christensen
Senior Principal Engineer

Radiocomp ApS
An MTI Company

Krakasvej 17, 3400 Hilleroed, Denmark

M: +45 29268065
T: +45 70231024
F: +45 70231022
E: anne.christen...@mtigroup.com
W: www.mti-mobile.com / 
www.mtigroup.com

This message is confidential and intended only for the addressees named 
therein. The message may contain legally privileged information or be otherwise 
protected by law. If you are not the intended recipient, please let the sender 
know by return email and immediately delete this message and its attachments 
without reading, copying or printing it or disclosing its contents to anyone.


=== MICROELECTRONICS TECHNOLOGY INC. ===
This message (and any attachments) may contain information that is 
confidential, proprietary, privileged or otherwise protected by law. The 
message is intended solely for the named addressee (or a person responsible for 
delivering it to the addressee). If you are not the intended recipient of this 
message, you are not authorized to read, print, retain, copy or disseminate 
this message or any part of it. If you have received this message in error, 
please destroy the message or delete it from your system immediately and notify 
the sender.