Changeset 2490
- Timestamp:
- Dec 12, 2005, 5:30:33 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/baselayout/src/pwd_mkdb/pwd_mkdb.c
r2489 r2490 178 178 * This lock is necessary when someone runs pwd_mkdb manually, directly 179 179 * on master.passwd, to handle the case where a user might try to 180 * change his password while pwd_mkdb is running. 180 * change his password while pwd_mkdb is running. 181 181 */ 182 182 for (;;) { … … 225 225 226 226 /* 227 * Do some trouble to check if we should store this users 228 * uid. Don't use getpwnam/getpwuid as that interferes 227 * Do some trouble to check if we should store this users 228 * uid. Don't use getpwnam/getpwuid as that interferes 229 229 * with NIS. 230 230 */ … … 322 322 /* In order to transition this file into a machine-independent 323 323 * form, we have to change the format of entries. However, since 324 * older binaries will still expect the old MD format entries, we 324 * older binaries will still expect the old MD format entries, we 325 325 * create those as usual and use versioned tags for the new entries. 326 326 */ … … 345 345 key.data = (u_char *)tbuf; 346 346 for (cnt = 1; scan(fp, &pwd); ++cnt) { 347 if (!is_comment && 347 if (!is_comment && 348 348 (pwd.pw_name[0] == '+' || pwd.pw_name[0] == '-')) 349 349 yp_enabled = 1; … … 354 354 memmove(p, &store, sizeof(store)); \ 355 355 p += sizeof(store); 356 if (!is_comment && 356 if (!is_comment && 357 357 (!username || (strcmp(username, pwd.pw_name) == 0))) { 358 358 pw_change = pwd.pw_change; … … 613 613 */ 614 614 (void)snprintf(buf, sizeof(buf), "%s/%s", prefix, _MASTERPASSWD); 615 #ifdef __EMX__ /* unsafe, but we cannot rename open files. */ 616 if (fclose(fp) == EOF) 617 error("close fp"); 618 #endif 615 619 mv(pname, buf); 616 620 621 #ifndef __EMX__ 617 622 /* 618 623 * Close locked password file after rename() … … 620 625 if (fclose(fp) == EOF) 621 626 error("close fp"); 627 #endif 622 628 623 629 exit(0); … … 651 657 *p = '\0'; 652 658 653 /* 659 /* 654 660 * Ignore comments: ^[ \t]*# 655 661 */ … … 672 678 } 673 679 674 void 675 cp(from, to, mode) 680 void 681 cp(from, to, mode) 676 682 char *from, *to; 677 mode_t mode; 678 { 683 mode_t mode; 684 { 679 685 static char buf[MAXBSIZE]; 680 686 int from_fd, rcount, to_fd, wcount;
Note:
See TracChangeset
for help on using the changeset viewer.