Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/pam-u2f/dist - fix order initialization: debug_...



details:   https://anonhg.NetBSD.org/src/rev/fb26a40ff4d1
branches:  trunk
changeset: 1007869:fb26a40ff4d1
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 03 00:22:29 2020 +0000

description:
- fix order initialization: debug_file was not getting properly initialized
- fix free casts
- add pam module entry for OpenPAM

diffstat:

 external/bsd/pam-u2f/dist/pam-u2f.c |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r 5f47a98653e7 -r fb26a40ff4d1 external/bsd/pam-u2f/dist/pam-u2f.c
--- a/external/bsd/pam-u2f/dist/pam-u2f.c       Tue Mar 03 00:21:20 2020 +0000
+++ b/external/bsd/pam-u2f/dist/pam-u2f.c       Tue Mar 03 00:22:29 2020 +0000
@@ -168,10 +168,11 @@
   int should_free_appid = 0;
   int should_free_auth_file = 0;
   int should_free_authpending_file = 0;
-  PAM_MODUTIL_DEF_PRIVS(privs);
 
   parse_cfg(flags, argc, argv, cfg);
 
+  PAM_MODUTIL_DEF_PRIVS(privs);
+
   if (!cfg->origin) {
     strcpy(buffer, DEFAULT_ORIGIN_PREFIX);
 
@@ -427,24 +428,24 @@
     free(buf);
     buf = NULL;
   }
-
+#define free_const(a)  free((void *)(uintptr_t)(a))
   if (should_free_origin) {
-    free((char *) cfg->origin);
+    free_const(cfg->origin);
     cfg->origin = NULL;
   }
 
   if (should_free_appid) {
-    free((char *) cfg->appid);
+    free_const(cfg->appid);
     cfg->appid = NULL;
   }
 
   if (should_free_auth_file) {
-    free((char *) cfg->auth_file);
+    free_const(cfg->auth_file);
     cfg->auth_file = NULL;
   }
 
   if (should_free_authpending_file) {
-    free((char *) cfg->authpending_file);
+    free_const(cfg->authpending_file);
     cfg->authpending_file = NULL;
   }
 
@@ -470,3 +471,7 @@
 
   return PAM_SUCCESS;
 }
+
+#ifdef PAM_MODULE_ENTRY
+PAM_MODULE_ENTRY("pam_u2f"); 
+#endif



Home | Main Index | Thread Index | Old Index