]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - login-utils/islocal.c
2 islocal.c - returns true if user is registered in the local
3 /etc/passwd file. Written by Alvaro Martinez Echevarria,
4 alvaro@enano.etsit.upm.es, to allow peaceful coexistence with yp. Nov 94.
6 Hacked a bit by poe@daimi.aau.dk
7 See also ftp://ftp.daimi.aau.dk/pub/linux/poe/admutil*
9 Hacked by Peter Breitenlohner, peb@mppmu.mpg.de,
10 to distinguish user names where one is a prefix of the other,
11 and to use "pathnames.h". Oct 5, 96.
13 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
14 - added Native Language Support
24 #include "pathnames.h"
27 #define MAX_LENGTH 1024
33 char line
[MAX_LENGTH
];
37 if(!(fd
= fopen(_PATH_PASSWD
, "r"))) {
38 fprintf(stderr
,_("Can't read %s, exiting."),_PATH_PASSWD
);
43 while(fgets(line
, MAX_LENGTH
, fd
) > 0) {
44 if(!strncmp(line
, user
, len
) && line
[len
] == ':') {