Bug#228926: /var/lib/dpkg/info/tetex-bin.postinst: line 209: 5576: Permission denied
On Thu, Jan 22, 2004 at 09:27:16PM +0100, Frank K?ster wrote:
> Matt Zimmerman <mdz@debian.org> schrieb:
>
> > Note that the line above must be inside the for loop, not ahead of
> > it.
>
> Why can't I use the same tempfile for all replacements? This was what I
> intended by putting it outside the for loop.
Because you're deleting (renaming) the temporary file each time, and then
recreating it insecurely.
> > This whole thing could probably be simplified a great deal, though, by
> > generalizing that case statement so that it doesn't need to explicitly
> > handle every possible $lang value. For example:
> >
> > langpat=$(echo "$RET" | sed -e 's/, */\|/g')
> > sed -e "s/^%! \($langpat\)/\1/" < $LDAT > $TMP_LDAT
> > chown --reference=$LDAT $TMP_LDAT
> > chmod --reference=$LDAT $TMP_LDAT
> > mv $TMP_LDAT $LDAT
>
> It's not so easy as that. Notice that the text in debconf's return
> value, i.e. what is now in the cases statements, is not the same as what
> we want to replace.
I guess I would map the debconf values to the corresponding values in the
file, and then use a procedure like the above. It's still much simpler.
--
- mdz
Reply to: