mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
Endless loop.
$ vipw [corrupt a line in editor, exit editor] pwd_mkdb: corrupted entry pwd_mkdb: at line #2 pwd_mkdb: /etc/pw.012585: Inappropriate file type or format re-edit the password file? [y]: n^D^D [hang]
This commit is contained in:
parent
a203eb6ef6
commit
2af22b06a4
2 changed files with 10 additions and 10 deletions
|
|
@ -202,14 +202,14 @@ pw_edit(notsetuid)
|
|||
void
|
||||
pw_prompt()
|
||||
{
|
||||
int c;
|
||||
int c, first;
|
||||
|
||||
(void)printf("re-edit the password file? [y]: ");
|
||||
(void)fflush(stdout);
|
||||
c = getchar();
|
||||
if (c != EOF && c != '\n')
|
||||
while (getchar() != '\n');
|
||||
if (c == 'n')
|
||||
first = c = getchar();
|
||||
while (c != '\n' && c != EOF)
|
||||
c = getchar();
|
||||
if (first == 'n')
|
||||
pw_error(NULL, 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -202,14 +202,14 @@ pw_edit(notsetuid)
|
|||
void
|
||||
pw_prompt()
|
||||
{
|
||||
int c;
|
||||
int c, first;
|
||||
|
||||
(void)printf("re-edit the password file? [y]: ");
|
||||
(void)fflush(stdout);
|
||||
c = getchar();
|
||||
if (c != EOF && c != '\n')
|
||||
while (getchar() != '\n');
|
||||
if (c == 'n')
|
||||
first = c = getchar();
|
||||
while (c != '\n' && c != EOF)
|
||||
c = getchar();
|
||||
if (first == 'n')
|
||||
pw_error(NULL, 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue