Skip to content

Conversation

@estenberg
Copy link
Contributor

Taking the last_policy_update variable from stat of cf_promises_validated instead of contents. This gives the last update (local) time at the client, and is better if the clocks of the hub and client are skewed. Update masterfiles to use the new and safer copy (on skewed clocks).

…m when local machine saw the update, while contents is (possibly skewed) timestamp of when hub saw it
…bust when clokcs of hub and client are not in sync. This is possible now that we save contents in the file, not merely touch it.
@sigurdteigen
Copy link
Contributor

where's the like button

@dottedmag
Copy link
Contributor

Hmm, isn't it yet merged?

@estenberg
Copy link
Contributor Author

No, I was waiting for someone to do it - please feel free. :)

On 06/03/12 01:32, Mikhail Gusarov wrote:

Hmm, isn't it yet merged?


Reply to this email directly or view it on GitHub:
#13 (comment)

Eystein

sigurdteigen pushed a commit that referenced this pull request Mar 6, 2012
Get last_policy_update var from stat
@sigurdteigen sigurdteigen merged commit 7fa0022 into cfengine:master Mar 6, 2012
olehermanse added a commit to olehermanse/core that referenced this pull request Nov 28, 2019
When compiling with explicit CFLAGS / LDFLAGS these are not handled in
the same way in different automake files.

The way we are mixing user-provided flags with configure generated ones
is not ideal, this change doesn't fix that, but it at least makes it
more consistent.

For example, compiling like this:

```
./autogen.sh --enable-debug && make CFLAGS="-fsanitize=address" LDFLAGS="-fsanitize=address"
```

Would cause the explicit flags to override flags from configure when
building cf-agent, but not in cf-promises. The end result is that debug
info (line numbers) is missing in some places.

**Before change:**

```
Direct leak of 9 byte(s) in 1 object(s) allocated from:
    #0 0x7fc5c3640538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7fc5c31badc0 in xstrdup /home/vagrant/cfe/core/libntech/libutils/alloc.c:58
    #2 0x559ddf51b064 in VerifyNotInFstab (/var/cfengine/bin/cf-agent+0xa0064)
    #3 0x559ddf4d6bd1 in VerifyMountPromise (/var/cfengine/bin/cf-agent+0x5bbd1)
    #4 0x559ddf4d506c in VerifyStoragePromise (/var/cfengine/bin/cf-agent+0x5a06c)
    #5 0x559ddf529cd9 in LocateFilePromiserGroup (/var/cfengine/bin/cf-agent+0xaecd9)
    #6 0x559ddf4d4a83 in FindStoragePromiserObjects (/var/cfengine/bin/cf-agent+0x59a83)
    #7 0x559ddf4d4a2d in FindAndVerifyStoragePromises (/var/cfengine/bin/cf-agent+0x59a2d)
    #8 0x559ddf4b7239 in KeepAgentPromise (/var/cfengine/bin/cf-agent+0x3c239)
    #9 0x7fc5c3138372 in ExpandPromiseAndDo /home/vagrant/cfe/core/libpromises/expand.c:215
    cfengine#10 0x7fc5c3138713 in ExpandPromise /home/vagrant/cfe/core/libpromises/expand.c:283
    cfengine#11 0x559ddf4b5e43 in ScheduleAgentOperations (/var/cfengine/bin/cf-agent+0x3ae43)
    cfengine#12 0x559ddf4b5656 in KeepPromiseBundles (/var/cfengine/bin/cf-agent+0x3a656)
    cfengine#13 0x559ddf4b2870 in KeepPromises (/var/cfengine/bin/cf-agent+0x37870)
    cfengine#14 0x559ddf4b025b in main (/var/cfengine/bin/cf-agent+0x3525b)
    cfengine#15 0x7fc5c238cb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
```

**After change:**

```
Direct leak of 9 byte(s) in 1 object(s) allocated from:
    #0 0x7fb282da4538 in strdup (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x77538)
    #1 0x7fb28291edc0 in xstrdup /home/vagrant/cfe/core/libntech/libutils/alloc.c:58
    #2 0x55d8be8f6064 in VerifyNotInFstab /home/vagrant/cfe/core/cf-agent/nfs.c:541
    #3 0x55d8be8b1bd1 in VerifyMountPromise /home/vagrant/cfe/core/cf-agent/verify_storage.c:491
    #4 0x55d8be8b006c in VerifyStoragePromise /home/vagrant/cfe/core/cf-agent/verify_storage.c:146
    #5 0x55d8be904cd9 in LocateFilePromiserGroup /home/vagrant/cfe/core/cf-agent/promiser_regex_resolver.c:62
    #6 0x55d8be8afa83 in FindStoragePromiserObjects /home/vagrant/cfe/core/cf-agent/verify_storage.c:84
    #7 0x55d8be8afa2d in FindAndVerifyStoragePromises /home/vagrant/cfe/core/cf-agent/verify_storage.c:75
    #8 0x55d8be892239 in KeepAgentPromise /home/vagrant/cfe/core/cf-agent/cf-agent.c:1697
    #9 0x7fb28289c372 in ExpandPromiseAndDo /home/vagrant/cfe/core/libpromises/expand.c:215
    cfengine#10 0x7fb28289c713 in ExpandPromise /home/vagrant/cfe/core/libpromises/expand.c:283
    cfengine#11 0x55d8be890e43 in ScheduleAgentOperations /home/vagrant/cfe/core/cf-agent/cf-agent.c:1431
    cfengine#12 0x55d8be890656 in KeepPromiseBundles /home/vagrant/cfe/core/cf-agent/cf-agent.c:1344
    cfengine#13 0x55d8be88d870 in KeepPromises /home/vagrant/cfe/core/cf-agent/cf-agent.c:831
    cfengine#14 0x55d8be88b25b in main /home/vagrant/cfe/core/cf-agent/cf-agent.c:279
    cfengine#15 0x7fb281af0b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
```

Changelog: None
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants