Der Beendigungsstatus des Befehls ist anders, wenn er über strace ausgeführt wird

Der Beendigungsstatus des Befehls ist anders, wenn er über strace ausgeführt wird

Normalerweise kann ich FTP mit den folgenden Befehlen als Dateisystem mounten/umounten:

└──> curlftpfs -o codepage=windows-1250 anonymous:[email protected] /home/marek/ftpfs
└──> ls /home/marek/ftpfs/
1 2 3
└──> fusermount -u /home/marek/ftpfs
└──> ls /home/marek/ftpfs/
└──>

Wenn ich jedoch das Problem habe, curlftpfswird stracenichts gemountet und der Prozess wird mit dem Status 1 beendet:

└──> strace -f curlftpfs -o codepage=windows-1250 anonymous:[email protected] /home/marek/ftpfs
└──> echo $0
1
└──> ls /home/marek/ftpfs/
└──>

Letzte Zeilen von strace(die vollständige Ausgabe istHier):

[pid  9619] mprotect(0x7f08780b2000, 4096, PROT_READ) = 0
[pid  9619] mprotect(0x7f08782bd000, 4096, PROT_READ) = 0
[pid  9619] munmap(0x7f0878e8d000, 135950) = 0
[pid  9619] open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 6
[pid  9619] lseek(6, 0, SEEK_CUR)       = 0
[pid  9619] fstat(6, {st_mode=S_IFREG|0644, st_size=2290, ...}) = 0
[pid  9619] mmap(NULL, 2290, PROT_READ, MAP_SHARED, 6, 0) = 0x7f0878eae000
[pid  9619] lseek(6, 2290, SEEK_SET)    = 2290
[pid  9619] munmap(0x7f0878eae000, 2290) = 0
[pid  9619] close(6)                    = 0
[pid  9619] getgid()                    = 1000
[pid  9619] getuid()                    = 1000
[pid  9619] openat(AT_FDCWD, ".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 6
[pid  9619] getdents(6, /* 2 entries */, 32768) = 48
[pid  9619] getdents(6, /* 0 entries */, 32768) = 0
[pid  9619] close(6)                    = 0
[pid  9619] mount("curlftpfs#ftp://anonymous:[email protected]/", ".", "fuse", MS_NOSUID|MS_NODEV, "fd=3,rootmode=40000,user_id=1000"...) = -1 EPERM (Operation not permitted)
[pid  9619] write(2, "fusermount: mount failed: Operat"..., 50fusermount: mount failed: Operation not permitted
) = 50
[pid  9619] close(3)                    = 0
[pid  9619] exit_group(1)               = ?
[pid  9618] <... recvmsg resumed> {msg_name(0)=NULL, msg_iov(1)=[{"", 1}], msg_controllen=0, msg_flags=0}, 0) = 0
[pid  9618] close(6)                    = 0
[pid  9618] wait4(9619,  <unfinished ...>
[pid  9619] +++ exited with 1 +++
<... wait4 resumed> NULL, 0, NULL)      = 9619
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=9619, si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
sendto(4, "QUIT\r\n", 6, MSG_NOSIGNAL, NULL, 0) = 6
poll([{fd=4, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}], 1, 1000) = 1 ([{fd=4, revents=POLLIN|POLLRDNORM}])
recvfrom(4, "221 Bye\r\n", 16384, 0, NULL, NULL) = 9
close(4)                                = 0
close(3)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++

Antwort1

Ich bin mit dieser ausführbaren Datei nicht vertraut, vermute aber, dass sie mit Privilegien ausgeführt werden muss (wahrscheinlich als SUID-Root oder ähnlich). strace -f kann einen solchen Prozess nicht mit Privilegien ausführen, es sei denn, strace selbst wird als Root ausgeführt und Sie benötigen möglicherweise die Option -u.

verwandte Informationen