ALT Linux Bugzilla
– Attachment 1954 Details for
Bug 11090
Непонятное описание в помощи к passkey-agent, есть ошибка в патче.
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Откорректирорванный патч из bluez-utils-3.9-alt2
bluez-utils-3.9-alt-pin-exec.patch (text/plain), 2.49 KB, created by
serpiph
on 2007-05-11 11:24:57 MSD
(
hide
)
Description:
Откорректирорванный патч из bluez-utils-3.9-alt2
Filename:
MIME Type:
Creator:
serpiph
Created:
2007-05-11 11:24:57 MSD
Size:
2.49 KB
patch
obsolete
>diff -Naurp bluez-utils-3.9.orig/daemon/passkey-agent.c bluez-utils-3.9/daemon/passkey-agent.c >--- bluez-utils-3.9.orig/daemon/passkey-agent.c 2007-02-14 09:32:44 +0300 >+++ bluez-utils-3.9/daemon/passkey-agent.c 2007-04-26 22:15:31 +0400 >@@ -77,6 +77,11 @@ static DBusHandlerResult request_message > DBusMessage *reply; > const char *path, *address; > dbus_bool_t numeric; >+ char *buffer; >+ FILE *pin; >+ unsigned int buflen; >+ int status; >+ char *s_passkey; > > if (!passkey) > return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; >@@ -95,8 +100,34 @@ static DBusHandlerResult request_message > } > > printf("Passkey request for device %s\n", address); >+ buflen=strlen(passkey)+256; >+ if(buflen<=256) >+ { >+ fprintf(stderr, "Invalid pin-helper argument, aborting."); >+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; >+ } >+ buffer=malloc(buflen); >+ if(buffer==NULL) >+ { >+ fprintf(stderr, "Error allocating memory (malloc), aborting."); >+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; >+ } >+ sprintf(buffer, "%s %s %s", passkey, "in", address); >+ pin=popen(buffer, "r"); >+ wait(&status); >+ fgets(buffer, 256, pin); >+ pclose(pin); >+ if(buffer[0]!='P' || buffer[1]!='I' || buffer[2]!='N' || buffer[3]!=':') >+ { >+ free(buffer); >+ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; >+ } >+ s_passkey=&buffer[4]; >+ if(s_passkey[strlen(s_passkey)-1]=='\n') s_passkey[strlen(s_passkey)-1]='\0'; >+ fprintf(stderr, "Found passkey: \"%s\"\n", s_passkey); > >- dbus_message_append_args(reply, DBUS_TYPE_STRING, &passkey, >+ >+ dbus_message_append_args(reply, DBUS_TYPE_STRING, &s_passkey , > DBUS_TYPE_INVALID); > > dbus_connection_send(conn, reply, NULL); >@@ -104,7 +135,7 @@ static DBusHandlerResult request_message > dbus_connection_flush(conn); > > dbus_message_unref(reply); >- >+ free(buffer); > return DBUS_HANDLER_RESULT_HANDLED; > } > >@@ -334,10 +365,13 @@ static int unregister_agent(DBusConnecti > > static void usage(void) > { >- printf("Bluetooth passkey agent ver %s\n\n", VERSION); >+ printf("Bluetooth passkey agent ver %s with \"exec\" patch from Marco Gulino (http://www.kmobiletools.org/node/228)\n\n", VERSION); > > printf("Usage:\n" >- "\tpasskey-agent [--default] [--path agent-path] <passkey> [address]\n" >+ "\tpasskey-agent {-d|--default} [{-p|--path} agent-path] <path-to-pin-helper>\n" >+ "\tpasskey-agent [{-p|--path} agent-path] <path-to-pin-helper> address\n" >+ "\n" >+ "\tDefault for agent-path: /org/bluez/passkey_agent_<program pid>\n" > "\n"); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 11090
: 1954