[Muscle] [PATCH] Check return value of libusb_init

2011-07-07 Thread Dwi Sasongko Supriyadi
Hello,

libusb_init() could return non zero value/negative when it failed to
initialize. I feel that it could be good to have early notification
when there is something wrong with libusb.

Best regards,
DWI
From 3154a2053af99ce6931583f703f4ee585a10e257 Mon Sep 17 00:00:00 2001
From: Dwi Sasongko S 
Date: Fri, 8 Jul 2011 13:12:04 +0700
Subject: [PATCH] Check return value of libusb_init()

Signed-off-by: Dwi Sasongko S 
---
 src/hotplug_libusb.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/hotplug_libusb.c b/src/hotplug_libusb.c
index ddd5391..6d0ff6e 100644
--- a/src/hotplug_libusb.c
+++ b/src/hotplug_libusb.c
@@ -388,10 +388,14 @@ static void HPRescanUsbBus(void)
 
 static void HPEstablishUSBNotifications(int pipefd[2])
 {
-	int i, do_polling;
+	int i, do_polling, rv;
 	char c = 42;	/* magic value */
 
-	libusb_init(ctx);
+	rv = libusb_init(ctx);
+	if (rv < 0) {
+		Log1(PCSC_LOG_ERROR, "Failed to initialise libusb");
+		exit(1);
+	}
 
 	/* scan the USB bus for devices at startup */
 	HPRescanUsbBus();
-- 
1.7.0.4

___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re: [Muscle] PCSCD got segmentation fault on ARM v5 with uClibc

2011-07-07 Thread Dwi Sasongko Supriyadi
On Thu, Jul 7, 2011 at 10:07 PM, Dwi Sasongko Supriyadi
 wrote:
> On Tue, Jul 5, 2011 at 4:29 PM, Dwi Sasongko Supriyadi
>  wrote:
>> On Tue, Jul 5, 2011 at 4:18 PM, Ludovic Rousseau
>>  wrote:
>>> 2011/7/5 Dwi Sasongko Supriyadi :
 I confirmed that the url for the pcsc-lite download is not correct.
>>>
>>> Can you give me this page URL with a wrong link so I can fix it?
>>>
>>
>> I mean, it is not correct on *my side*. It should be:
>>
>> PCSC_LITE_SITE =
>> https://alioth.debian.org/frs/download.php/3598/pcsc-lite-1.7.4.tar.bz2
>>
>> instead of
>>
>> PCSC_LITE_SITE =
>> https://alioth.debian.org/frs/download.php/3533/pcsc-lite-1.7.4.tar.bz2
>>
>> Best regards,
>> DWI
>>
>
> Hello again,
>
> I found that the root cause of my problem seems to be libusb
> initialization failed. Please correct me if I am wrong, I tried to add
> a return value check in src/libusb_hotplug.c
>
>  rv = libusb_init(ctx);
>        if (rv < 0) {
>                fprintf(stderr, "failed to initialise libusb\n");
>                exit(1);
>        }
>
> and there is, it failed to initialise libusb on the system.
>
> Thanks for forthcoming response and advise.
>

I want to say sorry for wasting your time in this issue, but then I
found out the root cause is that the usbfs is not mounted. Too bad,
this information is not available when executing pcscd. The issue is
solved by simply:

mount -t usbfs usbfs /proc/bus/usb

I would to propose a patch to check the return value of libusb_init()
call inside src/libusb/hotplug_libusb.c so the user will be notified
early if there is something wrong with libusb.

Thanks for your time and response. Keep the good work!

Best regards,
DWI

___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re: [Muscle] Some remarks

2011-07-07 Thread Karsten Ohme
Hi Norbert,

if you need these information I can send it to you.

Karsten

Am 02.05.2011 13:56, schrieb Ludovic Rousseau:
> 2011/5/2 NorbertSchmitz :
>> Hi,
> Hello,
>
>> I am new to the smartcard/musclecard world. While looking for
>> information I found that the links
>> Software->Musclecard->Latest MuscleCard Developer Builds
>> and
>> [Click here to learn about MuscleCard]
>> is not valid.
>> Is there a special point of contact for these link issues?
> The link "[Click here to learn about MuscleCard]" [1] from the page
> "MuscleCard.com - MUSCLE Smart Card Development" [2] is dead.
> I do not have (write) access to the http://musclecard.com/ web site.
> This web site has not been updated since a long time.
>
> David, any project for the web site?
>
> I think the pages you are looking for were written by Karsten Ohme
> [3]. You can try to contact him directly.
>
> Bye
>
> [1] http://www.inf.tu-dresden.de/~ko189283/MuscleCard/MuscleCardArticle.html
> [2] http://musclecard.com/musclecard/index.html
> [3] http://sourceforge.net/users/k_o_
>

___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re: [Muscle] GPShell missing a library?

2011-07-07 Thread Karsten Ohme
Am 07.07.2011 17:44, schrieb Ryan W:
> Forgive me if you are not the people I should ask this to, but please
> direct me to whom I should contact if this is the case.

Hi,

GPShell is a SourceForge project, so you can use the mailing list or the
project page to get into contact.

In your case you also have to install the PC/SC Connection Plugin.
Plugins are an abstraction to support different transport mechanisms.

I have just copied some images to Natty:

https://launchpad.net/~k-o-/+archive/globalplatform


Should be there in 2 hours. Let's see if it works. So, just add this
repo and it should work.

BR,
Karsten
> I tried installing gpshell-1.4.4 on my Ubuntu 11.04 system,
> installing the necessary prerequisites globalplatform 6.0.0, zlib
> 1.2.5, pcsc-lite 1.7.3, and openssl-1.0.0d.
> GPshell will run from the terminal, now; however, it crashes on
> establish_context, saying:
> establish_context failed with error 0x
> (libgppcscconnectionplugin.so.1.0.1: cannot open shared object file:
> No such file or directory)
> I couldn't find anything about libgppcscconnectionplugin.so.1.0.1 and
> it's not on my computer, so my question is: which prerequisite should
> have given me it, and what could I have done wrong with installing it?
>
> Thank you for at least taking note of my problem, and for any help you
> might offer.
> ___
> Muscle mailing list
> Muscle@lists.musclecard.com
> http://lists.drizzle.com/mailman/listinfo/muscle
>

___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


[Muscle] GPShell missing a library?

2011-07-07 Thread Ryan W
Forgive me if you are not the people I should ask this to, but please
direct me to whom I should contact if this is the case.
I tried installing gpshell-1.4.4 on my Ubuntu 11.04 system,
installing the necessary prerequisites globalplatform 6.0.0, zlib
1.2.5, pcsc-lite 1.7.3, and openssl-1.0.0d.
GPshell will run from the terminal, now; however, it crashes on
establish_context, saying:
establish_context failed with error 0x
(libgppcscconnectionplugin.so.1.0.1: cannot open shared object file:
No such file or directory)
I couldn't find anything about libgppcscconnectionplugin.so.1.0.1 and
it's not on my computer, so my question is: which prerequisite should
have given me it, and what could I have done wrong with installing it?

Thank you for at least taking note of my problem, and for any help you
might offer.
___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle


Re: [Muscle] PCSCD got segmentation fault on ARM v5 with uClibc

2011-07-07 Thread Dwi Sasongko Supriyadi
On Tue, Jul 5, 2011 at 4:29 PM, Dwi Sasongko Supriyadi
 wrote:
> On Tue, Jul 5, 2011 at 4:18 PM, Ludovic Rousseau
>  wrote:
>> 2011/7/5 Dwi Sasongko Supriyadi :
>>> I confirmed that the url for the pcsc-lite download is not correct.
>>
>> Can you give me this page URL with a wrong link so I can fix it?
>>
>
> I mean, it is not correct on *my side*. It should be:
>
> PCSC_LITE_SITE =
> https://alioth.debian.org/frs/download.php/3598/pcsc-lite-1.7.4.tar.bz2
>
> instead of
>
> PCSC_LITE_SITE =
> https://alioth.debian.org/frs/download.php/3533/pcsc-lite-1.7.4.tar.bz2
>
> Best regards,
> DWI
>

Hello again,

I found that the root cause of my problem seems to be libusb
initialization failed. Please correct me if I am wrong, I tried to add
a return value check in src/libusb_hotplug.c

 rv = libusb_init(ctx);
if (rv < 0) {
fprintf(stderr, "failed to initialise libusb\n");
exit(1);
}

and there is, it failed to initialise libusb on the system.

Thanks for forthcoming response and advise.
___
Muscle mailing list
Muscle@lists.musclecard.com
http://lists.drizzle.com/mailman/listinfo/muscle