This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch] Document __secure_getenv
On Thu, 12 Jul 2012 15:42:01 +0200, Florian wrote:
> I'm trying to do this, but I can't get __secure_getenv exported, and
> the internal references do not use a GLIBC_PRIVATE symbol either.
>
> I've attached my current attempt. (I know that I'll eventually have
> to update the abilist files.)
>
> Is there a symbol which shared a similar fate? Then I could
> duplicate what was done back then.
__secure_getenv is already exported, so I assume you mean
secure_getenv? I assume you've already done this to strong_alias
secure_getenv to __secure_getenv:
diff --git a/include/stdlib.h b/include/stdlib.h
index de0b414..31a0e6b 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -38,6 +38,8 @@ libc_hidden_proto (qsort)
libc_hidden_proto (qsort_r)
libc_hidden_proto (lrand48_r)
libc_hidden_proto (wctomb)
+
+extern __typeof (__secure_getenv) secure_getenv;
libc_hidden_proto (__secure_getenv)
extern long int __random (void);
diff --git a/stdlib/secure-getenv.c b/stdlib/secure-getenv.c
index f64759f..a58b02b 100644
--- a/stdlib/secure-getenv.c
+++ b/stdlib/secure-getenv.c
@@ -27,4 +27,5 @@ __secure_getenv (name)
{
return __libc_enable_secure ? NULL : getenv (name);
}
+strong_alias (__secure_getenv, secure_getenv)
libc_hidden_def (__secure_getenv)
So what you additionally need is this to export secure_getenv and then
you document secure_getenv:
diff --git a/stdlib/Versions b/stdlib/Versions
index 2aa396e..e7d4267 100644
--- a/stdlib/Versions
+++ b/stdlib/Versions
@@ -110,4 +110,7 @@ libc {
# Variable which needs a dynamic symbol table entry.
__abort_msg;
}
+ GLIBC_2.17 {
+ secure_getenv;
+ }
}
Regards,
Siddhesh