summaryrefslogtreecommitdiff
path: root/lib/psm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-24 12:03:45 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-24 12:03:45 +0300
commit39b75d24cfe50e65ca940cc5466beb03c801d033 (patch)
treef7777db67b55f5139676e4abf55e49b84ecad5af /lib/psm.c
parentae929240b7643927bc8a317e7992272f69a00fe0 (diff)
downloadrpm-39b75d24cfe50e65ca940cc5466beb03c801d033.tar.gz
rpm-39b75d24cfe50e65ca940cc5466beb03c801d033.tar.bz2
rpm-39b75d24cfe50e65ca940cc5466beb03c801d033.zip
Force preloading of name service libraries early in initialization
- this used to be done in psm chroot operation, but we can end up chrooting before that and without psm being involved - don't bother with getpwnam() etc, a single gethostbyname() loads all that we need
Diffstat (limited to 'lib/psm.c')
-rw-r--r--lib/psm.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/psm.c b/lib/psm.c
index 4ca25bd28..c600520ce 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -1680,20 +1680,6 @@ assert(psm->mi == NULL);
if (rootDir != NULL && !(rootDir[0] == '/' && rootDir[1] == '\0')
&& !rpmtsChrootDone(ts) && !psm->chrootDone)
{
- static int _pw_loaded = 0;
- static int _gr_loaded = 0;
-
- if (!_pw_loaded) {
- (void)getpwnam("root");
- endpwent();
- _pw_loaded++;
- }
- if (!_gr_loaded) {
- (void)getgrnam("root");
- endgrent();
- _gr_loaded++;
- }
-
xx = chdir("/");
if (rootDir != NULL && strcmp(rootDir, "/") && *rootDir == '/')
rc = chroot(rootDir);