Skip to content

Implemented posix_getspnam() function - #72

Closed
igmar wants to merge 2 commits into
php:masterfrom
igmar:add-getspnam
Closed

igmar wants to merge 2 commits into
php:masterfrom
igmar:add-getspnam

Conversation

@igmar

@igmar igmar commented May 1, 2012

Copy link
Copy Markdown

Added posix_getspnam() function to the posix extension.

Comment thread ext/posix/posix.c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be a test for HAVE_SHADOW_H here instead? (or as well?)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AC_CHECK_FUNCS() should take care of that. You either have it and it's in shadow.h, or you don't. I haven't seen it done in a different way. It's not POSIX, so we might run into other implementations.

@dsp

dsp commented May 2, 2012

Copy link
Copy Markdown
Member

getspwnam is not part of the POSIX.1, POSIX.1b or POSIX.1c standard.

From the Linux Manpages:

CONFORMING TO
The shadow password database and its associated API are not specified in POSIX.1-2001. However, many other systems provide a similar API.

I'm not sure if this should belong to ext/posix, but then on the other hand there is no suitable other extension to add this function too.

@igmar

igmar commented May 7, 2012

Copy link
Copy Markdown
Author

The reason I've put it in ext/posix because similar functions are also in that extension. It's not POSIX, I agree, but it also serves special use cases. It's harmless in all other cases.

@ghost ghost assigned dsp May 25, 2012
Comment thread ext/posix/posix.c

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case you have ZTS and GETSPANAM_R so

#if defined(ZTS) && defined(HAVE_GETSPNAM_R)

get's execute you have buf allocated. In case php_posix_spwd_to_array fails you are not
freeing buf anymore.

@lstrojny

lstrojny commented Jan 6, 2013

Copy link
Copy Markdown
Contributor

@igmar ping

@lstrojny

Copy link
Copy Markdown
Contributor

@igmar ping again

@php-pulls

Copy link
Copy Markdown

Comment on behalf of stas at php.net:

No response for a year. If this patch is still relevant please update it according to comments and reopen the pull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants