Debian FTP Masters dixit:

>   * Add upstream proposed patch to close Debian bug 956245. (Closes: #956245)

Thanks (but please remember to also address this in stable).

The patch itself is a bit inconsistent:

-    if ((UID != 0)); then
+    if (($(id -u) != 0)); then

is used sometimes, which is an integer comparison,
compared with the string comparison I suggested:

-    ((UID == 0)) && return
+    [[ $(id -u) = 0 ]] && return

Note that the integer comparison can fail if id
is not present or reports an error:

$ bash -c '(( $(true) == 0 ))'
bash: ((: == 0 : syntax error: operand expected (error token is "== 0 ")

This is unlikely to happen, of course, so not a big issue,
I just tend to write more reliable shell scripts.

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh

Reply via email to