e ckpasswd - handle read errors on stdin

error path - not going to be a problem but in theory... it's there.

fix CID 1425211
enlightenment-0.24
Carsten Haitzler 3 years ago
parent 23493550b2
commit 2ccfec3dad
  1. 10
      src/bin/e_ckpasswd_main.c

@ -296,6 +296,11 @@ main(int argc, char **argv)
for (;;) // cookie
{
rd = read(0, pw + pos, 1);
if (rd < 0)
{
fprintf(stderr, "Error. Can't read polkit cookie on stdin\n");
goto err;
}
if (pw[pos] == ' ')
{
memcpy(polkit_cookie, pw, pos);
@ -317,6 +322,11 @@ main(int argc, char **argv)
for (;;) // uid
{
rd = read(0, pw + pos, 1);
if (rd < 0)
{
fprintf(stderr, "Error. Can't read polkit uid on stdin\n");
goto err;
}
if (pw[pos] == ' ')
{
pw[pos] = 0;

Loading…
Cancel
Save