I should not reference LV in fstab by UUID, because if i have snapshot of this LV, it is unknown which one (origin or snapshot) will be mounted.
DISCLAIMER. English language used here only for compatibility (ASCII only), so any suggestions about my bad grammar (and not only it) will be greatly appreciated.
среда, 30 ноября 2011 г.
Do not mount LV by UUID from fstab.
вторник, 22 ноября 2011 г.
xargs, arguments separator and escapes.
xargs uses blanks (not only newlines!) to split input line into arguments.
Though, there is some options, which turns this defailt off implicitly or
explicitly.
Here is summary:
+--------+--------------------+---------------------+
| Option | Argument separator | Escapes |
+--------+--------------------+---------------------+
| -L | blank | Interpreted (work) |
+--------+--------------------+---------------------+
| -d | user defined | Literal (not work) |
+--------+--------------------+---------------------+
| -I | newline | Interpreted (work) |
+--------+--------------------+---------------------+
четверг, 4 августа 2011 г.
LVM snapshots and corresponding DM tables
Here is just a few illustrations (with some text) for chapter about snapshot and snapshot-origin device mapper's targets from RedHat's Logical Volume Manager Administration Guide. Also, here i make some assumptions about how this works, which seems logical, but unproved since i don't check LVM's sources.
понедельник, 11 июля 2011 г.
This icq..
Upd5. 2012-11-16. Suggested here stunnel config is insecure. See icq through stunnel: enable certificate verification for improvement.
This icq, this damned icq.. doesn't log in! As i expected, though.
воскресенье, 8 мая 2011 г.
Variable assignment in bash `eval`
Here is example of variable assignment in eval:
(
v="a\" b";
eval "r=\"$v\"";
declare -p r
)
Such assignment lead to error due to unmatched double quote. Here is corrected
version of above example
(
v="a\" b";
eval "r=\"\$v\"";
declare -p r
)
And here is example of executing arbitrary command through such incorrect eval
construction:
(
v="a\"; ls; \":";
eval "r=\"$v\"";
declare -p r
)
Note a colon (':') in 'v' value: bash does not even complain about incorrect
syntax - all is correct and all will work fine!
So, it's safe (perhaps) to use parameter expansion to form variable's name for
assign to, like
(
v="arr";
eval "${v}[1]=123";
declare -p arr;
eval "r=\${${v}[1]}";
declare -p r
)
because here bash's own constrains on characters in variable name applied, and
bash checks this. But it's _not_ safe to expand variable up to value in the
main script - do it in eval script instead.
Note, the same also applies to indirect reference: do not use it to expand up
to value in main script in eval constructions. Here is flawed example:
(
j=var;
var="a\"; ls; \":";
i=r;
eval "$i=\"${!j}\"";
declare -p r;
)
and now corrected version
(
j=var;
var="a\"; ls; \":";
i=r;
eval "$i=\"\${$j}\"";
declare -p r;
)
or with indirect reference
(
j=var;
var="a\"; ls; \":";
i=r;
eval "$i=\"\${!j}\"";
declare -p r;
)
Подписаться на:
Сообщения (Atom)
