Fix issues with server.allow_access_expired#14262
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
|
New Issues (5)Checkmarx found the following issues in this Pull Request
Fixed Issues (5)Great job! The following issues were fixed in this Pull Request
|
8d57e8d to
b94faef
Compare
src/db.c
Outdated
| @@ -1275,7 +1275,7 @@ void keysCommand(client *c) { | |||
| sds key = kvobjGetKey(kv); | |||
|
|
|||
| if (allkeys || stringmatchlen(pattern,plen,key,sdslen(key),0)) { | |||
| if (!keyIsExpired(c->db, NULL, kv)) { | |||
| if (server.allow_access_expired || !keyIsExpired(c->db, NULL, kv)) { | |||
There was a problem hiding this comment.
why not add server.allow_access_expired to keyIsExpired?
There was a problem hiding this comment.
That's a good idea, but since keyIsExpired is used in many places, I need to test whether this change will cause any bugs.
|
@sundb Would you mind taking a look at this? Thank you so much! |
sundb
left a comment
There was a problem hiding this comment.
please also add a module test to cover it, thx.
9c9e9d5 to
23ae347
Compare
|
@sundb Thank you very much for your corrections. This is my first time contributing code to Redis, please be lenient with me. I will continue to study Redis in depth and pay more attention in future PRs. |
|
@Jam804 please don't use force push |
but i don't see any change you made for this fix. |
6ebc948 to
af7c952
Compare
|
@Jam804, thanks for the updates 🙏. Please avoid |
|
@moticless Could you please advise if any other modifications are needed in this Pull Request? I'll diligently work on resolving all identified issues. |
src/t_hash.c
Outdated
| /* Move to the next entry in the hash. Return C_OK when the next entry | ||
| * could be found and C_ERR when the iterator reaches the end. */ | ||
| int hashTypeNext(hashTypeIterator *hi, int skipExpiredFields) { | ||
| skipExpiredFields &= !server.allow_access_expired; |
There was a problem hiding this comment.
i don't like this &=, it should be just =
(same above)
There was a problem hiding this comment.
it's not logically wrong, just looks weird
|
@Jam804 please merge the latest unstable and let's try again. thx. |
done |
|
@Jam804 please update the top comment, maybe list all the modifications that need to be noticed. |
done |
|
@Jam804 merged, thx. |
|
Thank you for your patient review and assistance. |





Close #14214