X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fauth.c;h=fa60b192796739d2f3ab1fd50cf0d136928d2cd6;hb=22ad101eb72bf10fe5144526209798c677b2d1d8;hp=6c81b5e482301c9e4197642e6aec179bbde3e443;hpb=aa105c51d67fe1ab7cfde61d6cd27ceeed3284db;p=netatalk.git diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index 6c81b5e4..fa60b192 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -343,6 +343,9 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi /* pam_umask or similar might have changed our umask */ (void)umask(obj->options.umask); + /* Some PAM module might have reset our signal handlers and timer, so we need to reestablish them */ + afp_over_dsi_sighandlers(obj); + return( AFP_OK ); } @@ -372,6 +375,7 @@ int afp_zzz(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen if (dsi->flags & DSI_EXTSLEEP) { LOG(log_note, logtype_afpd, "afp_zzz: waking up from extended sleep"); dsi->flags &= ~(DSI_SLEEPING | DSI_EXTSLEEP); + ipc_child_state(obj, DSI_RUNNING); } } else { /* sleep request */ @@ -379,8 +383,10 @@ int afp_zzz(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen if (data & AFPZZZ_EXT_SLEEP) { LOG(log_note, logtype_afpd, "afp_zzz: entering extended sleep"); dsi->flags |= DSI_EXTSLEEP; + ipc_child_state(obj, DSI_EXTSLEEP); } else { LOG(log_note, logtype_afpd, "afp_zzz: entering normal sleep"); + ipc_child_state(obj, DSI_SLEEPING); } } @@ -909,7 +915,7 @@ int afp_changepw(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rb if ( ibuf[0] != '\0' || ibuf[1] != '\0') return AFPERR_PARAM; ibuf += 2; - len = MIN(sizeof(username), strlen(obj->username)); + len = MIN(sizeof(username) - 1, strlen(obj->username)); memcpy(username, obj->username, len); username[ len ] = '\0'; }