int
gr_init(const char *dir, const char *group)
{
- struct stat st;
if (dir == NULL) {
strcpy(group_dir, _PATH_ETC);
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);
}
int
gr_mkdb(void)
{
+ if (chmod(tempname, 0644) != 0)
+ return (-1);
+
return (rename(tempname, group_file));
}