Created
November 20, 2015 21:00
-
-
Save soumyadipdm/1ea5cbc02e973aef4d17 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/libpromises/verify_classes.c b/libpromises/verify_classes.c | |
index cef489e..0cb79e6 100644 | |
--- a/libpromises/verify_classes.c | |
+++ b/libpromises/verify_classes.c | |
@@ -161,8 +161,10 @@ static bool SelectClass(EvalContext *ctx, const Rlist *list, const Promise *pp) | |
assert(list); | |
char splay[CF_MAXVARSIZE]; | |
+ uintmax_t now = (uintmax_t)time(NULL); | |
+ now -= now % CF_HASHTABLESIZE; | |
snprintf(splay, CF_MAXVARSIZE, "%s+%s+%ju", | |
- VFQNAME, VIPADDRESS, (uintmax_t)getuid()); | |
+ VFQNAME, VIPADDRESS, now); | |
double hash = (double) StringHash(splay, 0, CF_HASHTABLESIZE); | |
assert(hash < CF_HASHTABLESIZE); | |
int n = (int) (count * hash / (double) CF_HASHTABLESIZE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment