Apparently, nobody ever uses pam_getenv(3), because nobody has ever
complained that it didn't work. Make it return a pointer to the actual value of the requested environment variable. git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@204 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
b34ff41a8c
commit
80c9bf5c74
1 changed files with 7 additions and 2 deletions
|
@ -31,7 +31,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $P4: //depot/projects/openpam/lib/pam_getenv.c#11 $
|
* $P4: //depot/projects/openpam/lib/pam_getenv.c#12 $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -62,7 +62,12 @@ pam_getenv(pam_handle_t *pamh,
|
||||||
RETURNS(NULL);
|
RETURNS(NULL);
|
||||||
if ((i = openpam_findenv(pamh, name, strlen(name))) == -1)
|
if ((i = openpam_findenv(pamh, name, strlen(name))) == -1)
|
||||||
RETURNS(NULL);
|
RETURNS(NULL);
|
||||||
str = strdup(pamh->env[i]);
|
for (str = pamh->env[i]; *str != '\0'; ++str) {
|
||||||
|
if (*str == '=') {
|
||||||
|
++str;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
RETURNS(str);
|
RETURNS(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue