Project

General

Profile

Feature #3240

Move some functions from libproject into libc

Added by Igor Pashev over 7 years ago. Updated over 7 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2012-09-29
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

libproject provides some functions which in nature are used to be a part of libc like getpwent(), setpwent() or getspent().

These functions in libproject are: setprojent(), endprojent(), getprojent(), getprojbyname(), getprojbyid(). Maybe others.

Such functions are implemented through NSS and do not require anything outside of libc (+libsocket and libnsl). But libproject depends on may other libraries, thus even getent(1) depends on libxml2 or libsmbios:

ldd /usr/bin/getent 
        libsocket.so.1 =>        /lib/libsocket.so.1
        libnsl.so.1 =>   /lib/libnsl.so.1
        libproject.so.1 =>       /usr/lib/libproject.so.1
        libc.so.1 =>     /lib/libc.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libsecdb.so.1 =>         /lib/libsecdb.so.1
        libproc.so.1 =>  /lib/libproc.so.1
        libpool.so.1 =>  /usr/lib/libpool.so.1
        librtld_db.so.1 =>       /lib/librtld_db.so.1
        libelf.so.1 =>   /lib/libelf.so.1
        libctf.so.1 =>   /lib/libctf.so.1
        libxml2.so.2 =>  /lib/libxml2.so.2
        libscf.so.1 =>   /lib/libscf.so.1
        libnvpair.so.1 =>        /lib/libnvpair.so.1
        libexacct.so.1 =>        /usr/lib/libexacct.so.1
        libpthread.so.1 =>       /lib/libpthread.so.1
        libz.so.1 =>     /lib/libz.so.1
        libm.so.2 =>     /lib/libm.so.2
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1
        libsmbios.so.1 =>        /usr/lib/libsmbios.so.1

I attached a patch for getent(1) showing what should go to libc and stay in project.h


Files

getent-avoid-libproject.patch (6.68 KB) getent-avoid-libproject.patch Patched getent Igor Pashev, 2012-09-29 10:29 PM

History

#1

Updated by Igor Pashev over 7 years ago

SETPROJ_ERR_* unneeded.

#2

Updated by Milan Jurik over 7 years ago

Using nss internal functions to shrink getent dependencies is not the best way. libproject itself does not depend on xml2 but on libpool.

Do not forget it is using lazyload so impact of such set of libs is minimal. Code duplication is much bigger disaster.

Moving not frequently used functions to libc means every app will have them in their memspace, it is much worse then impact on getent I believe.

#3

Updated by Igor Pashev over 7 years ago

Milan Jurik wrote:

Moving not frequently used functions to libc means every app will have them in their memspace, it is much worse then impact on getent I believe.

come on, let make libxpg7.so
XPG7 functions are not used at all :-)

#4

Updated by Milan Jurik over 7 years ago

  • Status changed from New to Feedback

But xpg7 functions are expected to be in libc.

On the other hand, project functions are not in libc usually and you want to split project functions between 2 libs just because getent. What's the benefit?

#5

Updated by Igor Pashev over 7 years ago

http://docs.oracle.com/cd/E23824_01/html/821-1464/libsecdb-3lib.html

Historically, functions in libsecdb provided support for the security attributes database. This functionality now resides in libc(3LIB).

// WBR

Also available in: Atom PDF