You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> on 2008/04/25 23:51:19 UTC

Re: svn commit: r30782 - in branches/kwallet/subversion: include libsvn_subr

2008-04-25 23:03:17 Stefan Sperling napisał(a):
> On Fri, Apr 25, 2008 at 06:18:24AM -0700, arfrever@tigris.org wrote:
> > Author: arfrever
> > Date: Fri Apr 25 06:18:24 2008
> > New Revision: 30782
> > 
> > Log:
> > On the 'kwallet' branch:
> 
> Hey Arfrever,
> 
> > + * This is like svn_client_get_simple_provider(), except that the
> > + * password is stored in the KWallet.
> 
> Shouldn't this be "stored in Kwallet." ?
> 
> > @@ -113,7 +89,7 @@ simple_password_set(apr_hash_t *creds,
> >     CREDENTIALS. PASSWORD_GET is used to obtain the password value.
> >     PASSTYPE identifies the type of the cached password. CREDENTIALS are
> >     allocated from POOL. */
> > -static svn_error_t *
> > +svn_error_t *
> >  simple_first_creds_helper(void **credentials,
> 
> This function needs some sort of prefix since it's not static
> anymore, doesn't it? Or are the rules for libsvn_subr different?

I'm getting compilation failure when these functions are declared as static:

/bin/sh ${working_copy}/libtool --tag=CXX --silent --mode=compile g++ ${some_options} -o subversion/libsvn_subr/simple_providers_cpp.lo -c subversion/libsvn_subr/simple_providers_cpp.cpp
subversion/libsvn_subr/simple_providers.h:64: error: ‘svn_error_t* simple_first_creds_helper(void**, void**, void*, apr_hash_t*, const char*, svn_boolean_t (*)(const char**, apr_hash_t*, const char*, const char*, svn_boolean_t, apr_pool_t*), const char*, apr_pool_t*)’ used but never defined
subversion/libsvn_subr/simple_providers.h:82: error: ‘svn_error_t* simple_save_creds_helper(svn_boolean_t*, void*, void*, apr_hash_t*, const char*, svn_boolean_t (*)(apr_hash_t*, const char*, const char*, const char*, svn_boolean_t, apr_pool_t*), const char*, apr_pool_t*)’ used but never defined

http://en.wikibooks.org/wiki/C_Programming/Procedures_and_functions#Static_Functions
These functions need to be called from another file so they shouldn't be static.

> > @@ -220,7 +196,7 @@ simple_first_creds_helper(void **credent
> >     a set of CREDENTIALS to the simple auth provider's username and
> >     password cache. PASSWORD_SET is used to store the password.
> >     PASSTYPE identifies the type of the cached password. Allocates from POOL. */
> > -static svn_error_t *
> > +svn_error_t *
> >  simple_save_creds_helper(svn_boolean_t *saved,
> 
> Same here.

-- 
Arfrever Frehtes Taifersar Arahesis

Re: svn commit: r30782 - in branches/kwallet/subversion: include libsvn_subr

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Stefan Sperling wrote on Sat, 26 Apr 2008 at 13:03 +0200:
> On Sat, Apr 26, 2008 at 01:37:49PM +0300, Daniel Shahaf wrote:
> > > I'd suggest:
> > > 
> > >   svn_error_t *
> > >   svn_simple_providers_first_creds_helper(void **credentials,
> > >  
> > 
> > Do we want to make this function public?
> 
> Dunno. Guess not.
> 

Agreed.

> svn_simple_providers__first_creds_helper is probably better then?
> 
> :)
> 
> 

Okay.

Daniel

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

Re: svn commit: r30782 - in branches/kwallet/subversion: include libsvn_subr

Posted by Stefan Sperling <st...@elego.de>.
On Sat, Apr 26, 2008 at 01:37:49PM +0300, Daniel Shahaf wrote:
> > I'd suggest:
> > 
> >   svn_error_t *
> >   svn_simple_providers_first_creds_helper(void **credentials,
> >  
> 
> Do we want to make this function public?

Dunno. Guess not.

svn_simple_providers__first_creds_helper is probably better then?

:)

-- 
Stefan Sperling <st...@elego.de>                    Software Monkey
 
German law requires the following banner :(
elego Software Solutions GmbH                            HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12        Tel:  +49 30 23 45 86 96 
13355 Berlin                              Fax:  +49 30 23 45 86 95
http://www.elego.de                               CEO: Olaf Wagner
 
Store password unencrypted (yes/no)? No

Re: svn commit: r30782 - in branches/kwallet/subversion: include libsvn_subr

Posted by Daniel Shahaf <d....@daniel.shahaf.co.il>.
Stefan Sperling wrote on Sat, 26 Apr 2008 at 12:25 +0200:
> On Sat, Apr 26, 2008 at 01:51:19AM +0200, Arfrever Frehtes Taifersar Arahesis wrote:
> > 2008-04-25 23:03:17 Stefan Sperling napisał(a):
> > > Shouldn't this be "stored in Kwallet." ?
> > > 
> > > > @@ -113,7 +89,7 @@ simple_password_set(apr_hash_t *creds,
> > > >     CREDENTIALS. PASSWORD_GET is used to obtain the password value.
> > > >     PASSTYPE identifies the type of the cached password. CREDENTIALS are
> > > >     allocated from POOL. */
> > > > -static svn_error_t *
> > > > +svn_error_t *
> > > >  simple_first_creds_helper(void **credentials,
> > > 
> > > This function needs some sort of prefix since it's not static
> > > anymore, doesn't it? Or are the rules for libsvn_subr different?
> > 
> > I'm getting compilation failure when these functions are declared as static:
> 
> Sure, taking the 'static' away is not a problem. If a function is
> needed in more than one file, it cannot be static.
> 
> But functions that aren't static should be called svn_.... something,
> isn't it? So I think you need to rename them.
> 
> I'd suggest:
> 
>   svn_error_t *
>   svn_simple_providers_first_creds_helper(void **credentials,
>  

Do we want to make this function public?

Re: svn commit: r30782 - in branches/kwallet/subversion: include libsvn_subr

Posted by Stefan Sperling <st...@elego.de>.
On Sat, Apr 26, 2008 at 01:51:19AM +0200, Arfrever Frehtes Taifersar Arahesis wrote:
> 2008-04-25 23:03:17 Stefan Sperling napisał(a):
> > Shouldn't this be "stored in Kwallet." ?
> > 
> > > @@ -113,7 +89,7 @@ simple_password_set(apr_hash_t *creds,
> > >     CREDENTIALS. PASSWORD_GET is used to obtain the password value.
> > >     PASSTYPE identifies the type of the cached password. CREDENTIALS are
> > >     allocated from POOL. */
> > > -static svn_error_t *
> > > +svn_error_t *
> > >  simple_first_creds_helper(void **credentials,
> > 
> > This function needs some sort of prefix since it's not static
> > anymore, doesn't it? Or are the rules for libsvn_subr different?
> 
> I'm getting compilation failure when these functions are declared as static:

Sure, taking the 'static' away is not a problem. If a function is
needed in more than one file, it cannot be static.

But functions that aren't static should be called svn_.... something,
isn't it? So I think you need to rename them.

I'd suggest:

  svn_error_t *
  svn_simple_providers_first_creds_helper(void **credentials,
 
This matches what other files in libsvn_subr do for non-static
functions. Compare io.c, for example, all non-static functions
there start with "svn_io_".

> > > @@ -220,7 +196,7 @@ simple_first_creds_helper(void **credent
> > >     a set of CREDENTIALS to the simple auth provider's username and
> > >     password cache. PASSWORD_SET is used to store the password.
> > >     PASSTYPE identifies the type of the cached password. Allocates from POOL. */
> > > -static svn_error_t *
> > > +svn_error_t *
> > >  simple_save_creds_helper(svn_boolean_t *saved,
> > 
> > Same here.

svn_simple_providers_save_creds_helper?

-- 
Stefan Sperling <st...@elego.de>                    Software Monkey
 
German law requires the following banner :(
elego Software Solutions GmbH                            HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12        Tel:  +49 30 23 45 86 96 
13355 Berlin                              Fax:  +49 30 23 45 86 95
http://www.elego.de                               CEO: Olaf Wagner
 
Store password unencrypted (yes/no)? No

Re: svn commit: r30782 - in branches/kwallet/subversion: include libsvn_subr

Posted by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>.
2008-04-26 22:01:00 Branko Čibej napisał(a):
> Arfrever Frehtes Taifersar Arahesis wrote:
> > 2008-04-25 23:03:17 Stefan Sperling napisał(a):
> >   
> >> This function needs some sort of prefix since it's not static
> >> anymore, doesn't it? Or are the rules for libsvn_subr different?
> >>     
> >
> > I'm getting compilation failure when these functions are declared as static:
> >   
> 
> I'd like to point out that we've managed to do the Windows- and 
> Mac-specific crypto providers without exposing internal helper functions 
> to the wide world. Please do the same for Kwallet.

simple_providers_cpp.cpp contains these functions:
  static kwallet_password_get() (must be defined in C++)
  static kwallet_password_set() (must be defined in C++)
  static kwallet_simple_first_creds()
  static kwallet_simple_save_creds()
  svn_auth_get_kwallet_simple_provider()

simple_first_creds_helper() and simple_save_creds_helper() are defined in
simple_providers.c and are used by some functions in this file. If they need
to be static then the only solution is probably to rename simple_providers.c
to simple_providers.cpp, fix some casts to avoid compilation errors [1] and
merge simple_providers_cpp.cpp to simple_providers.c.

[1]:
/bin/sh ${working_copy}/libtool --tag=CXX --silent --mode=compile g++ ${some_options} -o subversion/libsvn_subr/simple_providers.lo -c subversion/libsvn_subr/simple_providers.cpp
subversion/libsvn_subr/simple_providers.cpp: In function ‘svn_boolean_t simple_password_get(const char**, apr_hash_t*, const char*, const char*, svn_boolean_t, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:62: error: invalid conversion from ‘void*’ to ‘svn_string_t*’
subversion/libsvn_subr/simple_providers.cpp: In function ‘svn_error_t* svn_simple_providers__simple_first_creds_helper(void**, void**, void*, apr_hash_t*, const char*, svn_boolean_t (*)(const char**, apr_hash_t*, const char*, const char*, svn_boolean_t, apr_pool_t*), const char*, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:104: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp:107: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp:110: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp:138: error: invalid conversion from ‘void*’ to ‘svn_string_t*’
subversion/libsvn_subr/simple_providers.cpp:151: error: invalid conversion from ‘void*’ to ‘svn_string_t*’
subversion/libsvn_subr/simple_providers.cpp:179: error: invalid conversion from ‘void*’ to ‘svn_auth_cred_simple_t*’
subversion/libsvn_subr/simple_providers.cpp: In function ‘svn_error_t* svn_simple_providers__simple_save_creds_helper(svn_boolean_t*, void*, void*, apr_hash_t*, const char*, svn_boolean_t (*)(apr_hash_t*, const char*, const char*, const char*, svn_boolean_t, apr_pool_t*), const char*, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:209: error: invalid conversion from ‘void*’ to ‘svn_auth_cred_simple_t*’
subversion/libsvn_subr/simple_providers.cpp:235: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp: In function ‘void svn_auth_get_simple_provider(svn_auth_provider_object_t**, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:331: error: invalid conversion from ‘void*’ to ‘svn_auth_provider_object_t*’
subversion/libsvn_subr/simple_providers.cpp: In function ‘svn_error_t* prompt_for_simple_creds(svn_auth_cred_simple_t**, simple_prompt_provider_baton_t*, apr_hash_t*, const char*, svn_boolean_t, svn_boolean_t, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:382: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp:389: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp:401: error: invalid conversion from ‘void*’ to ‘svn_string_t*’
subversion/libsvn_subr/simple_providers.cpp:413: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp:424: error: invalid conversion from ‘void*’ to ‘svn_auth_cred_simple_t*’
subversion/libsvn_subr/simple_providers.cpp: In function ‘svn_error_t* simple_prompt_first_creds(void**, void**, void*, apr_hash_t*, const char*, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:449: error: invalid conversion from ‘void*’ to ‘simple_prompt_provider_baton_t*’
subversion/libsvn_subr/simple_providers.cpp:450: error: invalid conversion from ‘void*’ to ‘simple_prompt_iter_baton_t*’
subversion/libsvn_subr/simple_providers.cpp:453: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp: In function ‘svn_error_t* simple_prompt_next_creds(void**, void*, void*, apr_hash_t*, const char*, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:476: error: invalid conversion from ‘void*’ to ‘simple_prompt_iter_baton_t*’
subversion/libsvn_subr/simple_providers.cpp:477: error: invalid conversion from ‘void*’ to ‘simple_prompt_provider_baton_t*’
subversion/libsvn_subr/simple_providers.cpp:480: error: invalid conversion from ‘void*’ to ‘const char*’
subversion/libsvn_subr/simple_providers.cpp: In function ‘void svn_auth_get_simple_prompt_provider(svn_auth_provider_object_t**, svn_error_t* (*)(svn_auth_cred_simple_t**, void*, const char*, const char*, svn_boolean_t, apr_pool_t*), void*, int, apr_pool_t*)’:
subversion/libsvn_subr/simple_providers.cpp:515: error: invalid conversion from ‘void*’ to ‘svn_auth_provider_object_t*’
subversion/libsvn_subr/simple_providers.cpp:516: error: invalid conversion from ‘void*’ to ‘simple_prompt_provider_baton_t*’
make: *** [subversion/libsvn_subr/simple_providers.lo] Error 1

-- 
Arfrever Frehtes Taifersar Arahesis

Re: svn commit: r30782 - in branches/kwallet/subversion: include libsvn_subr

Posted by Branko Čibej <br...@xbc.nu>.
Arfrever Frehtes Taifersar Arahesis wrote:
> 2008-04-25 23:03:17 Stefan Sperling napisał(a):
>   
>> This function needs some sort of prefix since it's not static
>> anymore, doesn't it? Or are the rules for libsvn_subr different?
>>     
>
> I'm getting compilation failure when these functions are declared as static:
>   

I'd like to point out that we've managed to do the Windows- and 
Mac-specific crypto providers without exposing internal helper functions 
to the wide world. Please do the same for Kwallet.

-- Brane


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