2001-03-10 Jochen Eisinger <jochen.eisinger@gmx.net>

* frontend/saned.c: fixed bug that allowed access to a scanner
	  without being prompted for a password
DEVEL_2_0_BRANCH-1
Jochen Eisinger 2001-03-10 15:31:46 +00:00
rodzic 048276ef82
commit c49187b579
1 zmienionych plików z 26 dodań i 0 usunięć

Wyświetl plik

@ -740,6 +740,32 @@ process_request (Wire * w)
can_authorize = 1;
resource = strdup (name);
if (strlen(resource) == 0) {
SANE_Device **device_list;
free (resource);
if ((i = sane_get_devices (&device_list, SANE_TRUE)) != SANE_STATUS_GOOD) {
memset (&reply, 0, sizeof (reply));
reply.status = i;
sanei_w_reply (w, (WireCodecFunc) sanei_w_open_reply, &reply);
}
if ((device_list == NULL) || (device_list[0] == NULL)) {
memset (&reply, 0, sizeof (reply));
reply.status = SANE_STATUS_INVAL;
sanei_w_reply (w, (WireCodecFunc) sanei_w_open_reply, &reply);
}
resource = strdup (device_list[0]->name);
}
if (strchr (resource, ':'))
*(strchr (resource, ':')) = 0;