Mac OS X 10.5+ and POSIX

I need to program an authentication module that should work with Mac OS X 10.6 Snow Leopard and at the same time must be POSIX compatible.

I read here: developer.apple.com/leopard/overview/osfoundations.html

since Mac OS X 10.5 Leopard, Mac OS X is POSIX compatible (prior to POSIX 1003.1), but running under MAC OS X 10.5 Leopard, I cannot find a single trace of my username in / etc / passwd or its successor / etc / master.passwd, which is mentioned here: developer.apple.com/mac/library/DOCUMENTATION/Darwin/Reference/ManPages/man5/passwd.5.html

Instead, he says that both files use the OpenDirectory Service, which should be an OpenLDAP according to the OpenDirectoryService man page.

Is it POSIX compliant? Probably not. I wonder how Mac OS X will handle my 100% POSIX-compatible code, which depends on / etc / passwd?

I would appreciate it if someone could explain how this works for me.

Thanks for your time and problems.

Best wishes

Phil.

+4
source share
3 answers

I don’t think that the way to store users and passwords is covered by POSIX (or at least POSIX 1003.1) - see the POSIX Wikipedia page for a brief overview of what is covered.

+2
source

You can use the getpwuid or getpwnam functions from pwd.h to find the username / identifier. It is part of the 1003.1 standard.

+1
source

POSIX doesn't seem to cover this, but most major Unices seem to be using PAM these days. You can try checking how to authenticate users with PAM ...

0
source

Source: https://habr.com/ru/post/1307327/


All Articles