Re: [Haserl-users] haserl fails with sigpipe on content upload
Brought to you by:
nangel
From: Nathan A. <na...@us...> - 2011-04-13 17:57:17
|
Hi Olivier, > Hi, > > we are using haserl to upload a tar file on an embedded system (router) which contains a firmware image. > > The shebang of the cgi looks like this: > #!/usr/bin/haserl -u 20000 -U /var/tmp -H /usr/lib/mww/do_update_handler.sh > > The update handler processes the input and unpacks the tar file: > ... > tar -f "$1" -C / -xv 2>&1 > ... > > It's working until the user tries to upload a non-tar file. Tar fails with "tar: invalid magic" and haserl gets SIGPIPE on next write. As a workaround we are doing this now: > ( > tar -C / -xv 2>&1 > cat> /dev/null > )< "$1" > > Is it possible to let haserl handle the case that the upload is not fully processed by the handler? Or are there other suggestions? > What would you like haserl to do in this case? |