about summary refs log tree commit diff
path: root/src/compat/pam_misc_drop_env.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-02-17 06:27:07 +0000
committerLaurent Bercot <ska@appnovation.com>2023-02-17 06:27:07 +0000
commit89da9d1a44aea4e12bcd9ee227bfa3580262243f (patch)
tree500e63599aa3c431e26fe299a2f5a8c247fe2998 /src/compat/pam_misc_drop_env.c
parenta3a43adb2111d9a15c8782fccfd7b80d014d2269 (diff)
downloadpamela-89da9d1a44aea4e12bcd9ee227bfa3580262243f.tar.gz
pamela-89da9d1a44aea4e12bcd9ee227bfa3580262243f.tar.xz
pamela-89da9d1a44aea4e12bcd9ee227bfa3580262243f.zip
Add compat boilerplate
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/compat/pam_misc_drop_env.c')
-rw-r--r--src/compat/pam_misc_drop_env.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/compat/pam_misc_drop_env.c b/src/compat/pam_misc_drop_env.c
new file mode 100644
index 0000000..a8a7564
--- /dev/null
+++ b/src/compat/pam_misc_drop_env.c
@@ -0,0 +1,17 @@
+/* ISC license. */
+
+#include <stdlib.h>
+#include <pamela/compat.h>
+
+static inline void env_free (char **envp)
+{
+  char **p = envp ;
+  while (*p) free(*p++) ;
+  free(envp) ;
+}
+
+char **pam_misc_drop_env (char **envp)
+{
+  env_free(envp) ;
+  return 0 ;
+}