-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make sure mtime is always an int #28066
Conversation
9717f7a
to
c8267a2
Compare
the tests all fail with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. The only problem is what happened to the tests with the weird mail error thing.
So approving here, with the proviso that of course the tests have to be made to pass somehow.
6ed251d
to
bcef283
Compare
added changes as requested |
some tests on |
I wonder what the requirement is to be able to store files from before 1970? |
I think Swift does not accept any timestamps < 0 |
all test passing now. |
Note: Travis litmus-v1 job fails because of: anything that triggers real work in that job is failing. I guess other PRs that have changes that trigger the litmus-v1 job will also have this problem. |
Apologies to @individual-it - I was thinking about how the negative mtime support checks could be refactor a bit and to make it easy in future to add any other conditionals for when negative mtime [is|is not] supported. I accidentally pushed straight to this branch, when I intended to check/test the changes myself. Anyway, the tests have run here and hopefully somebody will think my edits are reasonable. |
@phil-davis I like your changes 👍 |
fix tests
fix type error delete unused mocks
Signed-off-by: Phil Davis <[email protected]>
Signed-off-by: Phil Davis <[email protected]>
ae89c0d
to
bfc2cf7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I'd like to use the OCP api for getting file information, but since the DAV app still isn't using it I guess we can omit it for now...
Looking at the console output of Jenkins the integration tests seem to pass, but why doeas the overview at https://jenkins.owncloud.org/job/owncloud-core/job/core/job/PR-28066/ say it was "paused for 0ms"? |
Maybe a UI glitch? https://jenkins.owncloud.org/job/owncloud-core/job/core/job/PR-28066/18/flowGraphTable/ looks fine |
I did try to stop the job for "Refactor negative mtime support checking" commit yesterday when I realized that I had pushed to @individual-it 's branch, and that I still had a syntax error. I never worked out how I could stop the job, but I had clicked the pause button. I didn't touch anything in Jenkins for that last run where @individual-it had rebased and trigger the build/tests again. Hmmm... |
it had a strange error after rebase https://jenkins.owncloud.org/job/owncloud-core/job/core/job/PR-28066/17/ and I could not work out why that was happening that's why I tried to restart it. And now it came up green. If you look at the detailed log it did run the integration tests https://jenkins.owncloud.org/job/owncloud-core/job/core/job/PR-28066/18/consoleText |
please backport to stable10 where the bug first appeared |
Backport to stable10 #28186 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
HTTP_X_OC_MTIME
is cast to float, then checked if its outside theint
range if yes it set to the max values and if not the original value is cast toint
That should make sure afterwards we have an
int
value that is in PHP range, in any PHP versionThis is an alternative approach to #27615 , don't throw any errors but simply make sure the value is legal.
This fix partly fixes #23228. On a system that uses 32bit integer it would protect the database to receive a value that is too big, but on a 64bit system the value would still be given to the database.
Related Issue
#27960
#23228
Motivation and Context
currently mtime can only be stored as
int
, but the server accepts also other types.How Has This Been Tested?
run new tests against pgsql, mysql & sqlite on PHP 7.1
Types of changes
Checklist: