X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=etc%2Fafpd%2Fafp_dsi.c;h=8b1b1a8d7ce98624b41b0e0ae8edf22eaa195a06;hp=e282002e4a37b02dd761a82f85446543be2887c3;hb=321a0107c48da7b3fbf895a2b32244174c1ff39c;hpb=6f45d8eaada82e401ecde525c689a67148b3ba1e diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index e282002e..8b1b1a8d 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -46,7 +46,7 @@ #include "dircache.h" #ifndef SOL_TCP -#define SOL_TCP IPPROTO_TCPSOL_TCP +#define SOL_TCP IPPROTO_TCP #endif /* @@ -76,7 +76,8 @@ static sigjmp_buf recon_jmp; static void afp_dsi_close(AFPObj *obj) { DSI *dsi = obj->dsi; - + sigset_t sigs; + close(obj->ipc_fd); obj->ipc_fd = -1; @@ -92,9 +93,13 @@ static void afp_dsi_close(AFPObj *obj) } } - close_all_vol(); - if (obj->logout) + close_all_vol(obj); + if (obj->logout) { + /* Block sigs, PAM/systemd/whoever might send us a SIG??? in (*obj->logout)() -> pam_close_session() */ + sigfillset(&sigs); + pthread_sigmask(SIG_BLOCK, &sigs, NULL); (*obj->logout)(); + } LOG(log_note, logtype_afpd, "AFP statistics: %.2f KB read, %.2f KB written", dsi->read_count/1024.0, dsi->write_count/1024.0); @@ -385,7 +390,6 @@ void afp_over_dsi(AFPObj *obj) struct sigaction action; AFPobj = obj; - dsi->AFPobj = obj; obj->exit = afp_dsi_die; obj->reply = (int (*)()) dsi_cmdreply; obj->attention = (int (*)(void *, AFPUserBytes)) dsi_attention;