#include "lisp.h"
#include <pwd.h>
+#include <grp.h>
#ifdef __GNUC__
#define _ANONYMOUS_UNION
the_passwd_shell,
};
+static struct group the_group =
+{
+ /* There are no groups on NT, so we just return "root" as the
+ group name. */
+ "root",
+};
+
int
getuid ()
{
return NULL;
}
+struct group *
+getgrgid (gid_t gid)
+{
+ return &the_group;
+}
+
struct passwd *
getpwnam (char *name)
{
if (rc == 0)
{
- flags = FILE_PIPE | FILE_READ | FILE_BINARY;
- fd_info[phandles[0]].flags = flags;
+ /* Protect against overflow, since Windows can open more handles than
+ our fd_info array has room for. */
+ if (phandles[0] >= MAXDESC || phandles[1] >= MAXDESC)
+ {
+ _close (phandles[0]);
+ _close (phandles[1]);
+ rc = -1;
+ }
+ else
+ {
+ flags = FILE_PIPE | FILE_READ | FILE_BINARY;
+ fd_info[phandles[0]].flags = flags;
- flags = FILE_PIPE | FILE_WRITE | FILE_BINARY;
- fd_info[phandles[1]].flags = flags;
+ flags = FILE_PIPE | FILE_WRITE | FILE_BINARY;
+ fd_info[phandles[1]].flags = flags;
+ }
}
return rc;
}
/* end of nt.c */
+
+/* arch-tag: 90442dd3-37be-482b-b272-ac752e3049f1
+ (do not change this comment) */