#include <wintirpc.h>
#include <sys/param.h>
#include <rpc/rpc.h>
#include "rpc_com.h"
#include <ctype.h>
#include <stdio.h>
#include <grp.h>
#include <pwd.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
Go to the source code of this file.
◆ NGROUPS
◆ _getgroups() [1/2]
◆ _getgroups() [2/2]
Definition at line 149 of file netnamer.c.
152{
158
159 setgrent();
160 while ((grp = getgrent())) {
161 for (
i = 0; grp->gr_mem[
i];
i++)
162 if (!
strcmp(grp->gr_mem[
i], uname)) {
164#ifdef DEBUG
166 "initgroups: %s is in too many groups\n", uname);
167#endif
168 goto toomany;
169 }
170
172 for (
j = 0;
j < ngroups;
j++)
173 if (
groups[
j] == grp->gr_gid) {
175 break;
176 }
178 groups[ngroups++] = grp->gr_gid;
179 }
180 }
181toomany:
182 endgrent();
183 return (ngroups);
184}
int strcmp(const char *String1, const char *String2)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
◆ getnetid()
Definition at line 239 of file netnamer.c.
241{
244 char *mkey;
245 char *mval;
247#ifdef YP
252#endif
253
256#ifdef YP
258 goto getnetidyp;
259#else
260 return (0);
261#endif
262 }
263 for (;;) {
265 return (0);
269 return (0);
270 }
272 continue;
273 else if (
res[0] ==
'+') {
274#ifdef YP
275 getnetidyp:
278 continue;
279 }
284#ifdef DEBUG
286#endif
287 continue;
288 }
294 return (2);
295#else
296#ifdef DEBUG
298"Bad record in %s '+' -- NIS not supported in this library copy\n",
300#endif
301 continue;
302#endif
303 } else {
304 mkey = strsep(&
res,
"\t ");
308 continue;
309 }
310 do {
311 mval = strsep(&
res,
" \t#\n");
312 }
while (mval !=
NULL && !*mval);
316 continue;
317 }
321 return (1);
322
323 }
324 }
325 }
326}
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
GLenum GLuint GLenum GLsizei const GLchar * buf
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
Referenced by netname2host(), and netname2user().
◆ netname2host()
int netname2host |
( |
netname |
, |
|
|
char * |
hostname, |
|
|
int |
hostlen |
|
) |
| |
Definition at line 190 of file netnamer.c.
194{
196 char valbuf[1024];
198 char *val2;
199 int vallen;
201
204 if ((*
val ==
'0') && (
val[1] ==
':')) {
206 return (1);
207 }
208 }
211 return (0);
213 return (0);
217 return (0);
219 if (vallen > (hostlen - 1))
220 vallen = hostlen - 1;
223
226 return (0);
227
229 return (0);
230 else
231 return (1);
232}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
static int getnetid(char *, char *)
int __rpc_get_default_domain(char **)
◆ netname2user()
Definition at line 67 of file netnamer.c.
73{
75 int gidlen;
77 long luid;
80 char *val1, *val2;
82 int vallen;
84
87
88 p = strsep(&
res,
":");
90 return (0);
92 p = strsep(&
res,
"\n,");
94 return (0);
95 }
97 gidlen = 0;
98 for (gidlen = 0; gidlen <
NGROUPS; gidlen++) {
99 p = strsep(&
res,
"\n,");
101 break;
103 }
104 *gidlenp = gidlen;
105
106 return (1);
107 }
108 val1 =
strchr(netname,
'.');
110 return (0);
112 return (0);
113 val1++;
116 return (0);
117 vallen = val2 - val1;
118 if (vallen > (1024 - 1))
119 vallen = 1024 - 1;
122
125 return (0);
126
128 return (0);
129
131 return (0);
132 uid = luid;
133
134
137 return (0);
141 return (1);
142}
void pwd(int argc, const char *argv[])
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ long __cdecl atol(_In_z_ const char *_Str)
static int _getgroups(char *, gid_t *)
◆ NETID
char* NETID = "netid.byname" |
|
static |
◆ NETIDFILE
char* NETIDFILE = "/etc/netid" |
|
static |
◆ OPSYS