a directory.
MFC after: 1 month
int
gr_init(const char *dir, const char *group)
{
+ struct stat st;
+
if (dir == NULL) {
strcpy(group_dir, _PATH_ETC);
} else {
}
strcpy(group_file, group);
}
+
+ if (stat(group_file, &st) == -1)
+ return (-1);
+
+ if (S_ISDIR(st.st_mode)) {
+ errno = EISDIR;
+ return (-1);
+ }
+
initialized = 1;
return (0);
}
#if 0
struct rlimit rlim;
#endif
+ struct stat st;
if (dir == NULL) {
strcpy(passwd_dir, _PATH_ETC);
strcpy(masterpasswd, master);
}
+ if (stat(masterpasswd, &st) == -1)
+ return (-1);
+
+ if (S_ISDIR(st.st_mode)) {
+ errno = EISDIR;
+ return (-1);
+ }
+
/*
* The code that follows is extremely disruptive to the calling
* process, and is therefore disabled until someone can conceive