- FILE *f;
- char buf[1024];
- f = fopen (fname, "r");
- if (!f)
- return -1;
- while (fgets (buf, sizeof(buf)-1, f))
- {
- struct passwd_entry *pe;
- char name[128];
- char des[128];
- char *p;
- const char *cp = buf;
- if ((p = strchr (buf, '\n')))
- *p = '\0';
- get_entry (&cp, name, 128);
- get_entry (&cp, des, 128);
-
- pe = (struct passwd_entry *) xmalloc (sizeof(*pe));
- pe->name = xstrdup (name);
- pe->des = xstrdup (des);
- pe->next = db->entries;
- db->entries = pe;
- }
- fclose (f);
- return 0;
+ FILE *f;
+ char buf[1024];
+ f = fopen (fname, "r");
+ if (!f)
+ return -1;
+ while (fgets (buf, sizeof(buf)-1, f))
+ {
+ struct passwd_entry *pe;
+ char name[128];
+ char des[128];
+ char *p;
+ const char *cp = buf;
+ if ((p = strchr (buf, '\n')))
+ *p = '\0';
+ get_entry (&cp, name, 128);
+ get_entry (&cp, des, 128);
+
+ pe = (struct passwd_entry *) xmalloc (sizeof(*pe));
+ pe->name = xstrdup (name);
+ pe->des = xstrdup (des);
+ pe->encrypt_flag = encrypt_flag;
+ pe->next = db->entries;
+ db->entries = pe;
+ }
+ fclose (f);
+ return 0;