mescc: Mes C Library: Support GNU Tar: Fix getpwnam, getpwuid stubs.
* lib/stub/getpwnam.c (getpwnam): Return pointer to static struct passwd. * lib/stub/getpwuid.c (getpwuid): Likewise.
This commit is contained in:
parent
5c979a8ce1
commit
de197a48f5
|
@ -1,6 +1,6 @@
|
||||||
/* -*-comment-start: "//";comment-end:""-*-
|
/* -*-comment-start: "//";comment-end:""-*-
|
||||||
* GNU Mes --- Maxwell Equations of Software
|
* GNU Mes --- Maxwell Equations of Software
|
||||||
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||||
*
|
*
|
||||||
* This file is part of GNU Mes.
|
* This file is part of GNU Mes.
|
||||||
*
|
*
|
||||||
|
@ -23,12 +23,13 @@
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
|
|
||||||
struct passwd *
|
struct passwd *
|
||||||
getpwnam (const char *NAME)
|
getpwnam (const char *name)
|
||||||
{
|
{
|
||||||
static int stub = 0;
|
static int stub = 0;
|
||||||
if (__mes_debug () && !stub)
|
if (__mes_debug () && !stub)
|
||||||
eputs ("getpwnam stub\n");
|
eputs ("getpwnam stub\n");
|
||||||
stub = 1;
|
stub = 1;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
return 0;
|
static struct passwd root = { "root", "*", 0, 0, "", "/root", "/bin/sh" };
|
||||||
|
return &root;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* -*-comment-start: "//";comment-end:""-*-
|
/* -*-comment-start: "//";comment-end:""-*-
|
||||||
* GNU Mes --- Maxwell Equations of Software
|
* GNU Mes --- Maxwell Equations of Software
|
||||||
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
* Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||||
*
|
*
|
||||||
* This file is part of GNU Mes.
|
* This file is part of GNU Mes.
|
||||||
*
|
*
|
||||||
|
@ -30,5 +30,6 @@ getpwuid (uid_t uid)
|
||||||
eputs ("getpwuid stub\n");
|
eputs ("getpwuid stub\n");
|
||||||
stub = 1;
|
stub = 1;
|
||||||
errno = 0;
|
errno = 0;
|
||||||
return 0;
|
static struct passwd root = { "root", "*", 0, 0, "", "/root", "/bin/sh" };
|
||||||
|
return &root;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue