[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r14482 - in trunk/subversion: mod_dav_svn

From: <kfogel_at_collab.net>
Date: 2005-05-04 23:10:11 CEST

Huh. This seems to be a followup to r14180, but while r14180 made it
into 1.2.0-rc2, this commit did not (it was merged into 1.2.x after
rc2 went out).

I'm kind of surprised we're not seeing more complaints about it,
therefore. Particularly the mod_dav_svn/lock.c:~111 fix -- why
wouldn't people be getting overflow errors without this change? We're
more than halfway across the epoch already, after all.

A puzzled,
-Karl

sussman@tigris.org writes:
> Author: sussman
> Date: Wed Apr 27 14:42:27 2005
> New Revision: 14482
>
> Modified:
> trunk/subversion/libsvn_fs/fs-loader.c
> trunk/subversion/mod_dav_svn/lock.c
>
> Log:
> mod_dav_svn bugfix: prevent lock creation/expiration dates from overflowing.
> And don't a allow negative expiration date into svn_fs_lock().
>
> * subversion/mod_dav_svn/lock.c
> (svn_lock_to_dav_lock): divide 64-bit int by 1000 before casting to 32-bit.
> (dav_lock_to_svn_lock): cast to 64-bit int before mulitplying by 1000.
>
> * subversion/libsvn_fs/fs-loader.c
> (svn_fs_lock): reject a negative expiration_date argument.
>
>
> Modified: trunk/subversion/libsvn_fs/fs-loader.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_fs/fs-loader.c?rev=14482&p1=trunk/subversion/libsvn_fs/fs-loader.c&p2=trunk/subversion/libsvn_fs/fs-loader.c&r1=14481&r2=14482
> ==============================================================================
> --- trunk/subversion/libsvn_fs/fs-loader.c (original)
> +++ trunk/subversion/libsvn_fs/fs-loader.c Wed Apr 27 14:42:27 2005
> @@ -892,6 +892,11 @@
> _("Lock comment has illegal characters"));
> }
>
> + if (expiration_date < 0)
> + return svn_error_create
> + (SVN_ERR_INCORRECT_PARAMS, NULL,
> + _("Negative expiration date passed to svn_fs_lock"));
> +
> return fs->vtable->lock (lock, fs, path, token, comment, expiration_date,
> current_rev, steal_lock, pool);
> }
>
> Modified: trunk/subversion/mod_dav_svn/lock.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/mod_dav_svn/lock.c?rev=14482&p1=trunk/subversion/mod_dav_svn/lock.c&p2=trunk/subversion/mod_dav_svn/lock.c&r1=14481&r2=14482
> ==============================================================================
> --- trunk/subversion/mod_dav_svn/lock.c (original)
> +++ trunk/subversion/mod_dav_svn/lock.c Wed Apr 27 14:42:27 2005
> @@ -109,7 +109,7 @@
> /* This is absurd. apr_time.h has an apr_time_t->time_t func,
> but not the reverse?? */
> if (slock->expiration_date)
> - lock->timeout = (time_t)slock->expiration_date / APR_USEC_PER_SEC;
> + lock->timeout = (time_t) (slock->expiration_date / APR_USEC_PER_SEC);
> else
> lock->timeout = DAV_TIMEOUT_INFINITE;
>
> @@ -212,7 +212,7 @@
> if (dlock->timeout == DAV_TIMEOUT_INFINITE)
> lock->expiration_date = 0; /* never expires */
> else
> - lock->expiration_date = (apr_time_t)dlock->timeout * APR_USEC_PER_SEC;
> + lock->expiration_date = ((apr_time_t)dlock->timeout) * APR_USEC_PER_SEC;
>
> *slock = lock;
> return 0;
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed May 4 23:43:14 2005

This is an archived mail posted to the Subversion Dev mailing list.