DU4.0 / setpwfile() problem

From: Markus Schaub <giamsh_at_gia.m-m.ch>
Date: Mon, 17 Feb 1997 18:49:32 +0100

Hello alpha-osf-managers

I just tried to port a piece of software from
Digital Unix 3.2c (uname -a: OSF1 micky V3.2 214 alpha) to
Digital Unix 4.0 (uname -a: OSF1 giau001 V4.0 564 alpha)

The code (see below) is calling the function setpwfile()
to direct all /etc/passwd reads to a separate password file.

The program worked fine under 3.2c but does not work under
4.0. Under 4.0 I always get a copy of the /etc/passwd file
printed.

Did anyone encounter the same problem?
Did I overlook something in the configuration of DU4.0?
Did I miss something from the release notes?
Could this be a problem with DU4.0?


Any hints are appreciated.

Thank you


The program source:

#include <stdio.h>
#include <pwd.h>

main(int argc, char *argv[])
{
  struct passwd *pw;

  setpwfile(argv[1]);

  while (pw = getpwent()) {
    printf("login [%s] uid/gid (%d/%d) gecos [%s]\n",
          pw->pw_name,
          pw->pw_uid,
          pw->pw_gid,
          pw->pw_gecos);
  }
}


-- 
Markus Schaub                           mailto:giamsh_at_gia.m-m.ch
GIA GRAPHA-Informatik AG                http://www.gia.ch/
Peyermattstr.3, 4665 Oftringen, Switzerland
Tel: +41-62-789 7251  Fax: +41-62-789 7199
Received on Mon Feb 17 1997 - 19:23:00 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:47 NZDT