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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29980
@ -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 New Issue
Block a user