Giter VIP home page Giter VIP logo

Comments (8)

LudovicRousseau avatar LudovicRousseau commented on June 4, 2024

What is the output of:

strace pcsc_scan

from pcsc-tools.

emasean avatar emasean commented on June 4, 2024
strace pcsc_scan
execve("/usr/bin/pcsc_scan", ["pcsc_scan"], 0x7ffc66e6abf0 /* 8 vars */) = 0
brk(NULL)                               = 0x55f39b4bc000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=14611, ...}) = 0
mmap(NULL, 14611, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fe0b4f14000
close(3)                                = 0
openat(AT_FDCWD, "/usr/lib64/libpcsclite.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\33\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=43456, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe0b4f12000
mmap(NULL, 2141808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fe0b4ae8000
mprotect(0x7fe0b4af2000, 2093056, PROT_NONE) = 0
mmap(0x7fe0b4cf1000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x7fe0b4cf1000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360a\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=140688, ...}) = 0
mmap(NULL, 2217064, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fe0b48ca000
mprotect(0x7fe0b48e3000, 2093056, PROT_NONE) = 0
mmap(0x7fe0b4ae2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7fe0b4ae2000
mmap(0x7fe0b4ae4000, 13416, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fe0b4ae4000
close(3)                                = 0
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\20\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2034840, ...}) = 0
mmap(NULL, 3906144, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fe0b4510000
mprotect(0x7fe0b46c1000, 2093056, PROT_NONE) = 0
mmap(0x7fe0b48c0000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b0000) = 0x7fe0b48c0000
mmap(0x7fe0b48c6000, 14944, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fe0b48c6000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe0b4f0f000
arch_prctl(ARCH_SET_FS, 0x7fe0b4f0f780) = 0
mprotect(0x7fe0b48c0000, 16384, PROT_READ) = 0
mprotect(0x7fe0b4ae2000, 4096, PROT_READ) = 0
mprotect(0x7fe0b4cf1000, 4096, PROT_READ) = 0
mprotect(0x55f39afd0000, 4096, PROT_READ) = 0
mprotect(0x7fe0b4f18000, 4096, PROT_READ) = 0
munmap(0x7fe0b4f14000, 14611)           = 0
set_tid_address(0x7fe0b4f0fa50)         = 40
set_robust_list(0x7fe0b4f0fa60, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7fe0b48cfc60, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7fe0b48dc300}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7fe0b48cfd00, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7fe0b48dc300}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
brk(NULL)                               = 0x55f39b4bc000
brk(0x55f39b4dd000)                     = 0x55f39b4dd000
write(1, "PC/SC device scanner\n", 21PC/SC device scanner
)  = 21
write(1, "V 1.5.2 (c) 2001-2017, Ludovic R"..., 67V 1.5.2 (c) 2001-2017, Ludovic Rousseau <[email protected]>
) = 67
stat("/var/run/pcscd/pcscd.comm", {st_mode=S_IFSOCK|0666, st_size=0, ...}) = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/pcscd/pcscd.comm"}, 28) = 0
fcntl(3, F_GETFL)                       = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)    = 0
select(4, NULL, [3], NULL, NULL)        = 1 (out [3])
sendto(3, "\f\0\0\0\21\0\0\0", 8, MSG_NOSIGNAL, NULL, 0) = 8
select(4, NULL, [3], NULL, NULL)        = 1 (out [3])
sendto(3, "\4\0\0\0\3\0\0\0\0\0\0\0", 12, MSG_NOSIGNAL, NULL, 0) = 12
select(4, [3], NULL, NULL, NULL)        = 1 (in [3])
read(3, 0x7ffd0c68a16c, 12)             = -1 ECONNRESET (Connection reset by peer)
ioctl(2, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "\33[31mSCardEstablishContext: RPC "..., 53SCardEstablishContext: RPC transport error.
) = 53
exit_group(-1)                          = ?
+++ exited with 255 +++

from pcsc-tools.

LudovicRousseau avatar LudovicRousseau commented on June 4, 2024

Now please provide a pcscd log as described at https://pcsclite.apdu.fr/#support

from pcsc-tools.

emasean avatar emasean commented on June 4, 2024
24080463 winscard_msg_srv.c:255:ProcessEventsServer() Common channel packet arrival
00000028 winscard_msg_srv.c:267:ProcessEventsServer() ProcessCommonChannelRequest detects: 7
00000004 pcscdaemon.c:133:SVCServiceRunLoop() A new context thread creation is requested: 7
00000251 auth.c:86:IsClientAuthorized() polkit_authority_get_sync failed
00000008 winscard_svc.c:335:ContextThread() Rejected unauthorized PC/SC client
00000015 winscard_svc.c:1029:MSGCleanupClient() Thread is stopping: dwClientID=7, threadContext @0x556cb9519ac0
00000003 winscard_svc.c:1035:MSGCleanupClient() Freeing SCONTEXT @0x556cb9519ac0

from pcsc-tools.

LudovicRousseau avatar LudovicRousseau commented on June 4, 2024

It is a PolicyKit issue.
Have a look at https://github.com/LudovicRousseau/PCSC/blob/master/doc/README.polkit

I don't know why the function failed.
Try to rebuild pcsc-lite with this patch to get more information.

diff --git a/src/auth.c b/src/auth.c
index 1d06b3f..f8ea2dc 100644
--- a/src/auth.c
+++ b/src/auth.c
@@ -80,10 +80,11 @@ unsigned IsClientAuthorized(int socket, const char* action, const char* reader)
        return 0;
    }
 
-   authority = polkit_authority_get_sync(NULL, NULL);
+   authority = polkit_authority_get_sync(NULL, &error);
    if (authority == NULL)
    {
-       Log1(PCSC_LOG_CRITICAL, "polkit_authority_get_sync failed");
+       Log2(PCSC_LOG_CRITICAL, "polkit_authority_get_sync failed: %s",
+           error->message);
        return 0;
    }
 

from pcsc-tools.

emasean avatar emasean commented on June 4, 2024
00000036 [140396675705024] winscard_msg_srv.c:267:ProcessEventsServer() ProcessCommonChannelRequest detects: 6
00000004 [140396675705024] pcscdaemon.c:133:SVCServiceRunLoop() A new context thread creation is requested: 6
00000076 [140396632725248] winscard_svc.c:340:ContextThread() Authorized PC/SC client
00000010 [140396632725248] winscard_svc.c:344:ContextThread() Thread is started: dwClientID=6, threadContext @0xfe5940
00000056 [140396632725248] winscard_svc.c:362:ContextThread() Received command: CMD_VERSION from client 6
00000086 [140396632725248] winscard_svc.c:374:ContextThread() Client is protocol version 4:3
00000007 [140396632725248] winscard_svc.c:383:ContextThread() Client protocol is 4:3
00000003 [140396632725248] winscard_svc.c:385:ContextThread() Server protocol is 4:4
00000003 [140396632725248] winscard_svc.c:394:ContextThread() CMD_VERSION rv=0x8010001D for client 6
00000300 [140396632725248] winscard_svc.c:354:ContextThread() Client die: 6
00000041 [140396632725248] winscard_svc.c:1055:MSGCleanupClient() Thread is stopping: dwClientID=6, threadContext @0xfe5940
00000007 [140396632725248] winscard_svc.c:1061:MSGCleanupClient() Freeing SCONTEXT @0xfe5940```

from pcsc-tools.

LudovicRousseau avatar LudovicRousseau commented on June 4, 2024
Client protocol is 4:3
Server protocol is 4:4

You are using a pcscd with a libpcsclite.so.1 from 2 different versions of pcsc-lite. This can't work.
I guess you have installed pcsc-lite manually from a different version than the one from pcsc-lite SUSE package.

from pcsc-tools.

emasean avatar emasean commented on June 4, 2024

When we build ourselves the libpcsclite from the source it worked fine, but when we take the binary from the SUSE repo (same version) it fails, we will check with SUSE.

from pcsc-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.