Luca,

As this is a student assignment, the proper spirit seems to require answering mostly with pointers to further relevant materials or to further considerations that appear minimally necessary to arrive at adequate answers.

For item 1, I expect the comments in /usr/include/nss_common.h should be adequate to evaluate your understanding.

For item 2, I don't see why you'd expect to modify a system header in adding a new name service to an architecture that's supposed to be extensible by third parties. The header in question is supposed to be code for nss provider implementations from Sun, so you probably don't want to give it anything other than exemplary value. A few other points:

        it's not correct to refer to getXXXbyYYY as a system call
I don't really follow your understanding of the source organisation (why separate source for each of the pw lookup functions?) you're not proposing to create multiple backends, just a single new backend for a new database to query pw data (again, reading nss_common.h indicates that the term backend is either a synonym for database or specifies the instantiation of a backend source pair) you've talked about source organisation but not specified the file object(s) or installation requirements

Cheers,
Bayard

Am 4 Feb 2010 um 15:26 schrieb Luca Tamburo:

Hi everyone,
I'm a student of Computer Science at University of Naples (Italy) - "Federico II".
For a project, I need to add a new database into nss.
I read the getpwnam() system call source code to search a way to add this new
database.

I have two questions:

1)Is correct the getpwnam() system call following sequence?
        a) getpwnam()
        b) getpwnam_r()
        c0) NSS_XbyY_INIT()
        c1) nss_search()
        c2) NSS_XbyY()
nss_search() function searches data in the backend as written in the nsswitch.conf file and it calls the function for the specific backend (e.g. if ldap is the passwd database backend, nss_search() invokes the _nss_ldap_passwd_constr function and, then, the
getbyname() function).

2)To insert a new database into nss, I think the following steps are necessary:
        a) add the database definition to the nss_dbdefs.h;
b) create a getMYDATAbynam.c file, that implements the system call getMYDATAbynam(); c) I need to create getMYDATAbynam().c, that implements backend functions, foreach backend supported by this new database.

Is it right?

Best regards,
Luca Tamburo
--
This message posted from opensolaris.org
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to