git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3] credential: new attribute password_expiry_utc

From
Lessley Dennington <lessleydennington@gmail.com>
Date
Feb 17, 2023, 21:44 UTC
Message-ID
<85ab572a-cd00-f62a-97ab-f344e2b6f68e@gmail.com>
In-Reply-To
<CAGJzqs=t7k2zRKKq9xN-Avbo2uXgqsg7i0Utfv-ee6yZ2CWNDA@mail.gmail.com>
On 2/14/23 3:36 PM, M Hickford wrote:
> Curious, let me take a look. I see that the tests failed on freebsd too.
> 

I was curious about this as well and took a look on my Windows machine. It appears that errno will be set to 'No such file or directory' unless you explicitly set it before checking it. This is odd, given that the helper script I wrote worked just fine without this requirement. However, I took a look through the rest of the codebase and noticed that `errno = 0` seems to always be declared before this type of conditional check. That did indeed fix the issue - tests all pass on Windows with this patch. I have not confirmed on freebsd, though, as a heads up.

Thanks, Lessley

---
diff --git a/credential.c b/credential.c
index d3e1bf7a67..b9a9a1d7b1 100644
--- a/credential.c
+++ b/credential.c
@@ -236,6 +236,7 @@ int credential_read(struct credential *c, FILE *fp)
                         free(c->path);
                         c->path = xstrdup(value);
                 } else if (!strcmp(key, "password_expiry_utc")) {
+                       errno = 0;
                         c->password_expiry_utc = parse_timestamp(value, NULL, 10);
                         if (c->password_expiry_utc == 0 || errno)
                                 c->password_expiry_utc = TIME_MAX;
Previous: M HickfordNext: Junio C Hamano
Message 19 of 26 in “credential: new attribute password_expiry_utc”
  1. credential: new attribute password_expiry_utcM Hickford via GitGitGadget, Jan 28, 2023
  2. Junio C HamanoJan 29, 2023
  3. M HickfordFeb 1, 2023
  4. Junio C HamanoFeb 1, 2023
  5. Eric SunshineJan 30, 2023
  6. M HickfordFeb 5, 2023
  7. credential: new attribute password_expiry_utcM Hickford via GitGitGadget, Feb 1, 2023
  8. Jeff KingFeb 1, 2023
  9. Junio C HamanoFeb 1, 2023
  10. Jeff KingFeb 2, 2023
  11. Matthew John CheethamFeb 1, 2023
  12. Jeff KingFeb 2, 2023
  13. M HickfordFeb 5, 2023
  14. Matthew John CheethamFeb 6, 2023
  15. M HickfordFeb 5, 2023
  16. credential: new attribute password_expiry_utcM Hickford via GitGitGadget, Feb 4, 2023
  17. Junio C HamanoFeb 14, 2023
  18. M HickfordFeb 14, 2023
  19. Lessley DenningtonFeb 17, 2023
  20. Junio C HamanoFeb 17, 2023
  21. M HickfordFeb 18, 2023
  22. Martin ÅgrenFeb 14, 2023
  23. Calvin WanFeb 16, 2023
  24. M HickfordFeb 18, 2023
  25. credential: new attribute password_expiry_utcM Hickford via GitGitGadget, Feb 18, 2023
  26. Calvin WanFeb 22, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.