[Eisfair_dev] eisfair-64 Mini-http --> htpasswd Segmentation fault

Peter Bäumer peter at baeumer.dd-dns.de
Sa Okt 6 11:30:56 CEST 2018


Glück Auf! Newsgroup,

Wenn man nur den mini_httpd installiert fehlt openssl als abhänigkeit.

Downloading required packages ...
=> [####################] mini_httpd (2.3.0)... 
 
       [  OK  ]
Done!
Installation of: mini_httpd (2.3.0) ...
updating shared library file (19284->48916) ...
'/var/install/include/jedlib.mini_httpd' -> '/var/install/include/jedlib'
cat: /usr/local/ssl/private/mini_httpd.key: No such file or directory
sed: can't read /usr/local/ssl/newcerts/mini_httpd.crt: No such file or 
directory
/tmp/install.sh: line 279: /usr/bin/openssl: No such file or directory
Edit mini_httpd services configuration

Nach der Installation von openssl

Downloading required packages ...
=> [####################] mini_httpd (2.3.0)... 
 
       [  OK  ]
Done!
Installation of: mini_httpd (2.3.0) ...
unable to load certificate
140179007325952:error:0906D06C:PEM routines:PEM_read_bio:no start 
line:crypto/pem/pem_lib.c:686:Expecting: TRUSTED CERTIFICATE
Successfully installed: mini_httpd (2.3.0)!

---

Mini_HTTPD hat Probleme beim anlegen von User Passwörtern.

Der Aufruf von
     /usr/sbin/htpasswd /etc/httpd/htpasswd admin
endet nach der Passworteingabe mit einem Segmentation fault

Bei einem strace wird eine fehlende Datei/Ordner angezeigt:
   open("/proc/sys/crypto/fips_enabled", O_RDONLY) = -1 ENOENT (No such 
file or directory)

Das kommt aber bei eisfair-1 auch, aber da wird das PW wird angelegt.

Was unterschiedlich ist das der Aufruf fstat64 bei E1 und fstat bei E64

eisfair-1:
fstat64(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 
0) = 0xb77bc000
write(3, "admin:YBlLDvDxj18GA\n", 20)   = 20
close(3)                                = 0
munmap(0xb77bc000, 4096)                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

eisfair-64:
fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee9000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x62cca1c0} ---
+++ killed by SIGSEGV +++

Das kopieren von der Datei /etc/httpd/htpasswd aus einem E1 brachte auch 
keine Hilfe. Es wird zwar User und Password im Browser angefragt, aber 
man bekommt eine fehlermeldung :(
z.B.:
Opera:
   Diese Seite funktioniert nicht
   172.31.0.227 hat keine Daten gesendet.

Firefox:
   Fehler: Verbindung unterbrochen

   Die Verbindung zum Server wurde zurückgesetzt, während die Seite 
geladen wurde.

--

Der Hilfetext bei MINI_HTTPD_USER_1_RIGHTS ist etwas verwirrend.
Da scheid etas vom Logging reigerutscht zusein:
Wurde der Parameter MINI_HTTPD_LOGFILE ungleich `none' gesetzt, so kann 
ueber die folgenden Parameter eingestellt werden, wie das System mit den 
erzeugten Logdateien umgehen soll.

--

Der zugriff ohne Useranledung funzt,
das Aufwecken von PC mit mini_httpd_wolsol funtzt auch :)

PS.: Eisfair-64 ist eine XEN domU


MfG
   Peter B.

---------------------------------------------------------------------------
eisfair-64 Ausgabe strace:
nx-03-07 # strace /usr/sbin/htpasswd /etc/httpd/htpasswd admin
execve("/usr/sbin/htpasswd", ["/usr/sbin/htpasswd", 
"/etc/httpd/htpasswd", "admin"], 0x7ffff63d5050 /* 23 vars */) = 0
brk(NULL)                               = 0x603000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or 
directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=18397, ...}) = 0
mmap(NULL, 18397, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f4462ee7000
close(3)                                = 0
open("/lib64/libcrypt.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\320\v\0\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=51632, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee6000
mmap(NULL, 2335200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0x7f4462a90000
mprotect(0x7f4462a9c000, 2093056, PROT_NONE) = 0
mmap(0x7f4462c9b000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xb000) = 0x7f4462c9b000
mmap(0x7f4462c9d000, 184800, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4462c9d000
close(3)                                = 0
open("/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\360\6\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1722048, ...}) = 0
mmap(NULL, 3828160, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0x7f44626e9000
mprotect(0x7f4462886000, 2097152, PROT_NONE) = 0
mmap(0x7f4462a86000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7f4462a86000
mmap(0x7f4462a8c000, 14784, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f4462a8c000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee5000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee4000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee3000
arch_prctl(ARCH_SET_FS, 0x7f4462ee4700) = 0
mprotect(0x7f4462a86000, 16384, PROT_READ) = 0
mprotect(0x7f4462c9b000, 4096, PROT_READ) = 0
mprotect(0x601000, 4096, PROT_READ)     = 0
mprotect(0x7f4462eec000, 4096, PROT_READ) = 0
munmap(0x7f4462ee7000, 18397)           = 0
rt_sigaction(SIGINT, {sa_handler=0x401366, sa_mask=[INT], 
sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f446271dc90}, 
{sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
gettimeofday({tv_sec=1538810556, tv_usec=180252}, NULL) = 0
getpid()                                = 14537
open("/tmp/htp.BfxSPf", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
fcntl(3, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
brk(NULL)                               = 0x603000
brk(0x624000)                           = 0x624000
open("/etc/httpd/htpasswd", O_RDONLY)   = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462eeb000
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
read(4, "", 4096)                       = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462eea000
write(1, "Adding user admin\n", 18Adding user admin
)     = 18
ioctl(0, TCGETS, {B38400 opost isig icanon echo ...}) = 0
open("/dev/tty", O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 5
ioctl(5, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost -isig icanon 
-echo ...}) = 0
fstat(5, {st_mode=S_IFCHR|0666, st_rdev=makedev(5, 0), ...}) = 0
ioctl(5, TCGETS, {B38400 opost -isig icanon -echo ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee9000
write(5, "New password:", 13New password:)           = 13
read(5, "1234567890\n", 4096)           = 11
write(5, "\n", 1
)                       = 1
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo 
...}) = 0
close(5)                                = 0
munmap(0x7f4462ee9000, 4096)            = 0
open("/dev/tty", O_RDWR|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 5
ioctl(5, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost -isig icanon 
-echo ...}) = 0
fstat(5, {st_mode=S_IFCHR|0666, st_rdev=makedev(5, 0), ...}) = 0
ioctl(5, TCGETS, {B38400 opost -isig icanon -echo ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee9000
write(5, "Re-type new password:", 21Re-type new password:)   = 21
read(5, "1234567890\n", 4096)           = 11
write(5, "\n", 1
)                       = 1
ioctl(5, SNDCTL_TMR_CONTINUE or TCSETSF, {B38400 opost isig icanon echo 
...}) = 0
close(5)                                = 0
munmap(0x7f4462ee9000, 4096)            = 0
open("/proc/sys/crypto/fips_enabled", O_RDONLY) = -1 ENOENT (No such 
file or directory)
fstat(3, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f4462ee9000
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x62cca1c0} ---
+++ killed by SIGSEGV +++
Segmentation fault


Mehr Informationen über die Mailingliste Eisfair_dev