kopia lustrzana https://gitlab.com/sane-project/backends
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 passwordDEVEL_2_0_BRANCH-1
rodzic
048276ef82
commit
c49187b579
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue