On 30.09.2014 12:51, stef...@apache.org wrote:
> Author: stefan2
> Date: Tue Sep 30 10:51:51 2014
> New Revision: 1628392
>
> URL: http://svn.apache.org/r1628392
> Log:
> Some of our FSFS config settings will cause malfunction if invalid
> values were given.  Thus, sanitize them before using them.
>
> * subversion/libsvn_fs_fs/fs_fs.c
>   (sanitize_block_size): New function to verify config data.
>   (read_config): Use the new function to guarantee valid settings
>                  in our FS struct.
>
> Modified:
>     subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
>
> Modified: subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c
> URL: 
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c?rev=1628392&r1=1628391&r2=1628392&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c (original)
> +++ subversion/trunk/subversion/libsvn_fs_fs/fs_fs.c Tue Sep 30 10:51:51 2014
> @@ -644,6 +644,41 @@ svn_fs_fs__fs_supports_mergeinfo(svn_fs_
>    return ffd->format >= SVN_FS_FS__MIN_MERGEINFO_FORMAT;
>  }
>  
> +/* Check that BLOCK_SIZE is a valid block / page size, i.e. it is within
> + * the range of what the current system may address in RAM and it is a
> + * power of 2.  Assume that the element size within the block is ITEM_SIZE.
> + */
> +static svn_error_t *
> +verify_block_size(apr_int64_t block_size,
> +                  apr_size_t item_size,
> +                  const char *name)
> +{
> +  /* Limit range. */
> +  if (block_size <= 0)
> +    return svn_error_createf(SVN_ERR_BAD_CONFIG_VALUE, NULL,
> +                             _("%" APR_INT64_T_FMT " is too small for "
> +                               "fsfs.conf setting '%s'."),
> +                             block_size, name);


We determined a while ago that this kind of format pattern causes
headaches for translators, because APR_INT64_T_FMT et al. are
platform-specific.

I forget what we decided to do instead ... search the archives, there's
a solution in them somewhere.

-- Brane

Reply via email to