Commit f61a4181 authored by nextime's avatar nextime

Update patches for 2.26

parent 85114263
......@@ -18,12 +18,12 @@ Conflicts:
1 file changed, 10 insertions(+)
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 474e04f..3af99ab 100644
index c9d422d..daa80f6 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1259,8 +1259,18 @@ static void determine_clock_access_method(const bool user_requests_ISA)
if (!ur)
ur = probe_for_kd_clock();
@@ -1228,8 +1228,18 @@ static void determine_clock_access_method(const bool user_requests_ISA)
{
ur = NULL;
+ /*
+ * This final clause is a really bad idea on x86/AT PCs. You run the
......@@ -34,9 +34,9 @@ index 474e04f..3af99ab 100644
+ * access like that can really hose the RTC.
+ */
+#if !defined(__i386__)
if (!ur && !user_requests_ISA)
if (user_requests_ISA)
ur = probe_for_cmos_clock();
+#endif
if (debug) {
if (ur)
#ifdef __linux__
if (!ur)
......@@ -23,10 +23,10 @@ Conflicts:
5 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 79b5aea..ff99c78 100644
index 391de3d..2ac4d5e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -116,6 +116,7 @@ edit_cmd = sed \
@@ -117,6 +117,7 @@ edit_cmd = sed \
-e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \
-e 's|@usrbin_execdir[@]|$(usrbin_execdir)|g' \
-e 's|@usrsbin_execdir[@]|$(usrsbin_execdir)|g' \
......@@ -35,10 +35,10 @@ index 79b5aea..ff99c78 100644
-e 's|@ADJTIME_PATH[@]|$(ADJTIME_PATH)|g' \
-e 's|@LIBUUID_VERSION[@]|$(LIBUUID_VERSION)|g' \
diff --git a/configure.ac b/configure.ac
index 3eca73e..5a28ff5 100644
index 6bc9efd..ff6fae5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,7 +71,6 @@ AS_CASE([$prefix:$localstatedir],
@@ -78,7 +78,6 @@ AS_CASE([$prefix:$localstatedir],
)
AC_SUBST([localstatedir])
......@@ -46,7 +46,7 @@ index 3eca73e..5a28ff5 100644
# The original default values of {bin,sbin,lib}dir
usrbin_execdir='${exec_prefix}/bin'
AC_SUBST([usrbin_execdir])
@@ -82,9 +81,10 @@ AC_SUBST([usrsbin_execdir])
@@ -89,9 +88,10 @@ AC_SUBST([usrsbin_execdir])
AS_CASE([$libdir],
['${exec_prefix}/'* | '${prefix}/'* | /usr/* | "${prefix}"/* ],
[usrlib_execdir=$libdir],
......
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Wed, 19 Nov 2014 15:07:16 -0400
Subject: Trivial unfuzzy
---
po/cs.po | 3 +--
po/nl.po | 3 +--
po/pl.po | 3 +--
po/vi.po | 3 +--
po/zh_CN.po | 3 +--
5 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/po/cs.po b/po/cs.po
index cf40871..f4c2519 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -7486,9 +7486,8 @@ msgid "cannot set signal handler"
msgstr "obsluhu signálu nelze nastavit"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (výpis paměti uložen)\n"
+msgstr " (výpis paměti uložen)"
#: login-utils/su-common.c:383
#, c-format
diff --git a/po/nl.po b/po/nl.po
index e093ce7..56adce0 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -7524,9 +7524,8 @@ msgid "cannot set signal handler"
msgstr "kan geen signaalverwerker instellen"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (geheugendump gemaakt)\n"
+msgstr " (geheugendump gemaakt)"
#: login-utils/su-common.c:383
#, c-format
diff --git a/po/pl.po b/po/pl.po
index a128bc4..375e049 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -7405,9 +7405,8 @@ msgid "cannot set signal handler"
msgstr "nie można ustawić procedury obsługi sygnału"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (zrzut pamięci)\n"
+msgstr " (zrzut pamięci)"
#: login-utils/su-common.c:383
#, c-format
diff --git a/po/vi.po b/po/vi.po
index 0df3809..82b2d59 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -7402,9 +7402,8 @@ msgid "cannot set signal handler"
msgstr "không đặt bộ tiếp hợp tín hiệu"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (lõi được đổ)\n"
+msgstr " (lõi được đổ)"
#: login-utils/su-common.c:383
#, c-format
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 9ae0415..2e5b7ab 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -7374,9 +7374,8 @@ msgid "cannot set signal handler"
msgstr "无法设置信号处理函数"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (核心已转储)\n"
+msgstr " (核心已转储)"
#: login-utils/su-common.c:383
#, c-format
From: Rafael Ferreira <rafael.f.f1@gmail.com>
Date: Mon, 24 Nov 2014 16:20:31 -0400
Subject: Update Brazilian Portuguese translation
---
po/pt_BR.po | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 729914c..ac1ea4e 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -7446,9 +7446,8 @@ msgid "cannot set signal handler"
msgstr "não foi possível definir manipulador de sinal"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (núcleo despejado)\n"
+msgstr " (núcleo despejado)"
#: login-utils/su-common.c:383
#, c-format
@@ -9801,9 +9800,9 @@ msgid "%s: BLKSSZGET ioctl failed"
msgstr "%s: ioctl de BLKSSZGET falhou"
#: sys-utils/blkdiscard.c:153
-#, fuzzy, c-format
+#, c-format
msgid "%s: offset is greater than device size"
-msgstr "não foi possível obter o tamanho do disco"
+msgstr "%s: posição é maior do que o tamanho do disco"
#: sys-utils/blkdiscard.c:160
#, c-format
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Wed, 19 Nov 2014 15:10:12 -0400
Subject: Update French translation
Forwarded: http://translationproject.org/PO-files/fr/util-linux-2.25.1-rc1.fr.po
Bug-Debian: https://bugs.debian.org/770506
---
po/fr.po | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/po/fr.po b/po/fr.po
index 659400c..939946d 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -15,7 +15,7 @@ msgstr ""
"Project-Id-Version: util-linux 2.25.1-rc1\n"
"Report-Msgid-Bugs-To: util-linux@vger.kernel.org\n"
"POT-Creation-Date: 2014-11-19 12:21-0400\n"
-"PO-Revision-Date: 2014-08-27 16:24-0400\n"
+"PO-Revision-Date: 2014-11-23 15:24-0400\n"
"Last-Translator: David Prévot <david@tilapin.org>\n"
"Language-Team: French <traduc@traduc.org>\n"
"Language: fr\n"
@@ -7431,9 +7431,8 @@ msgid "cannot set signal handler"
msgstr "impossible d'initialiser le traitement de signaux"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (core dump)\n"
+msgstr " (core dump)"
#: login-utils/su-common.c:383
#, c-format
@@ -9787,9 +9786,9 @@ msgid "%s: BLKSSZGET ioctl failed"
msgstr "%s : échec d'ioctl BLKSSZGET"
#: sys-utils/blkdiscard.c:153
-#, fuzzy, c-format
+#, c-format
msgid "%s: offset is greater than device size"
-msgstr "impossible d'obtenir la taille du périphérique"
+msgstr "%s : position au-delà de la taille du périphérique"
#: sys-utils/blkdiscard.c:160
#, c-format
@@ -16939,6 +16938,9 @@ msgstr "séquence de protection inconnue en entrée : %o, %o"
msgid "Input line too long."
msgstr "Ligne d'entrée trop longue."
+#~ msgid "%s (core dumped)\n"
+#~ msgstr "%s (core dump)\n"
+
#~ msgid "timeout cannot be zero"
#~ msgstr "le temps maximal ne peut pas être nul"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Wed, 19 Nov 2014 12:22:54 -0400
Subject: Update POT file
---
po/util-linux.pot | 82 +++++++++++++++++++++++++++++++------------------------
1 file changed, 46 insertions(+), 36 deletions(-)
diff --git a/po/util-linux.pot b/po/util-linux.pot
index 94aa838..d3aba37 100644
--- a/po/util-linux.pot
+++ b/po/util-linux.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: util-linux 2.25.2\n"
"Report-Msgid-Bugs-To: util-linux@vger.kernel.org\n"
-"POT-Creation-Date: 2014-10-24 12:30+0200\n"
+"POT-Creation-Date: 2014-11-19 12:21-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -541,7 +541,7 @@ msgstr ""
#: disk-utils/cfdisk.c:2034 include/c.h:286 schedutils/chrt.c:266
#: schedutils/taskset.c:166 sys-utils/chcpu.c:330 sys-utils/dmesg.c:1335
-#: sys-utils/hwclock.c:1550 sys-utils/lscpu.c:1727 sys-utils/renice.c:102
+#: sys-utils/hwclock.c:1560 sys-utils/lscpu.c:1727 sys-utils/renice.c:102
#: sys-utils/rtcwake.c:474 sys-utils/tunelp.c:249 term-utils/agetty.c:751
#: term-utils/script.c:221 term-utils/scriptreplay.c:177
#: term-utils/write.c:113 text-utils/col.c:208 text-utils/colcrt.c:118
@@ -2362,7 +2362,7 @@ msgstr ""
#: disk-utils/mkfs.c:42 include/c.h:280 misc-utils/getopt.c:322
#: misc-utils/look.c:370 misc-utils/namei.c:431 misc-utils/uuidd.c:75
-#: misc-utils/uuidgen.c:35 misc-utils/wipefs.c:455 sys-utils/hwclock.c:1591
+#: misc-utils/uuidgen.c:35 misc-utils/wipefs.c:455 sys-utils/hwclock.c:1601
#: sys-utils/renice.c:62 term-utils/script.c:146 term-utils/scriptreplay.c:45
#: term-utils/write.c:85
#, c-format
@@ -4220,7 +4220,7 @@ msgstr ""
#: include/c.h:279 misc-utils/getopt.c:314 misc-utils/look.c:366
#: misc-utils/namei.c:427 misc-utils/uuidd.c:71 misc-utils/uuidgen.c:31
-#: misc-utils/wipefs.c:451 sys-utils/hwclock.c:1570 sys-utils/renice.c:55
+#: misc-utils/wipefs.c:451 sys-utils/hwclock.c:1580 sys-utils/renice.c:55
#: term-utils/script.c:142 term-utils/scriptreplay.c:40 term-utils/write.c:80
msgid ""
"\n"
@@ -10705,23 +10705,23 @@ msgstr ""
msgid "Needed adjustment is less than one second, so not setting clock.\n"
msgstr ""
-#: sys-utils/hwclock.c:1270
+#: sys-utils/hwclock.c:1280
#, c-format
msgid "No usable clock interface found.\n"
msgstr ""
-#: sys-utils/hwclock.c:1399 sys-utils/hwclock.c:1405
+#: sys-utils/hwclock.c:1409 sys-utils/hwclock.c:1415
#, c-format
msgid "Unable to set system clock.\n"
msgstr ""
-#: sys-utils/hwclock.c:1418
+#: sys-utils/hwclock.c:1428
#, c-format
msgid ""
"At %ld seconds after 1969, RTC is predicted to read %ld seconds after 1969.\n"
msgstr ""
-#: sys-utils/hwclock.c:1447
+#: sys-utils/hwclock.c:1457
msgid ""
"The kernel keeps an epoch value for the Hardware Clock only on an Alpha "
"machine.\n"
@@ -10729,49 +10729,49 @@ msgid ""
"(and thus is presumably not running on an Alpha now). No action taken."
msgstr ""
-#: sys-utils/hwclock.c:1464
+#: sys-utils/hwclock.c:1474
msgid "Unable to get the epoch value from the kernel."
msgstr ""
-#: sys-utils/hwclock.c:1466
+#: sys-utils/hwclock.c:1476
#, c-format
msgid "Kernel is assuming an epoch value of %lu\n"
msgstr ""
-#: sys-utils/hwclock.c:1471
+#: sys-utils/hwclock.c:1481
msgid ""
"To set the epoch value, you must use the 'epoch' option to tell to what "
"value to set it."
msgstr ""
-#: sys-utils/hwclock.c:1475
+#: sys-utils/hwclock.c:1485
#, c-format
msgid "Not setting the epoch to %d - testing only.\n"
msgstr ""
-#: sys-utils/hwclock.c:1479
+#: sys-utils/hwclock.c:1489
#, c-format
msgid "Unable to set the epoch value in the kernel.\n"
msgstr ""
-#: sys-utils/hwclock.c:1571
+#: sys-utils/hwclock.c:1581
msgid " hwclock [function] [option...]\n"
msgstr ""
-#: sys-utils/hwclock.c:1573
+#: sys-utils/hwclock.c:1583
msgid ""
"\n"
"Functions:\n"
msgstr ""
-#: sys-utils/hwclock.c:1574
+#: sys-utils/hwclock.c:1584
msgid ""
" -h, --help show this help text and exit\n"
" -r, --show read hardware clock and print result\n"
" --set set the RTC to the time given with --date\n"
msgstr ""
-#: sys-utils/hwclock.c:1577
+#: sys-utils/hwclock.c:1587
msgid ""
" -s, --hctosys set the system time from the hardware clock\n"
" -w, --systohc set the hardware clock from the current system time\n"
@@ -10780,36 +10780,36 @@ msgid ""
" the clock was last set or adjusted\n"
msgstr ""
-#: sys-utils/hwclock.c:1582
+#: sys-utils/hwclock.c:1592
msgid ""
" -c, --compare periodically compare the system clock with the CMOS "
"clock\n"
msgstr ""
-#: sys-utils/hwclock.c:1584
+#: sys-utils/hwclock.c:1594
msgid ""
" --getepoch print out the kernel's hardware clock epoch value\n"
" --setepoch set the kernel's hardware clock epoch value to the \n"
" value given with --epoch\n"
msgstr ""
-#: sys-utils/hwclock.c:1588
+#: sys-utils/hwclock.c:1598
msgid ""
" --predict predict RTC reading at time given with --date\n"
" -V, --version display version information and exit\n"
msgstr ""
-#: sys-utils/hwclock.c:1592
+#: sys-utils/hwclock.c:1602
msgid ""
" -u, --utc the hardware clock is kept in UTC\n"
" --localtime the hardware clock is kept in local time\n"
msgstr ""
-#: sys-utils/hwclock.c:1595
+#: sys-utils/hwclock.c:1605
msgid " -f, --rtc <file> special /dev/... file to use instead of default\n"
msgstr ""
-#: sys-utils/hwclock.c:1598
+#: sys-utils/hwclock.c:1608
#, c-format
msgid ""
" --directisa access the ISA bus directly instead of %s\n"
@@ -10819,7 +10819,7 @@ msgid ""
" hardware clock's epoch value\n"
msgstr ""
-#: sys-utils/hwclock.c:1604
+#: sys-utils/hwclock.c:1614
#, c-format
msgid ""
" --noadjfile do not access %s; this requires the use of\n"
@@ -10828,59 +10828,59 @@ msgid ""
" the default is %s\n"
msgstr ""
-#: sys-utils/hwclock.c:1608
+#: sys-utils/hwclock.c:1618
msgid ""
" --test do not update anything, just show what would happen\n"
" -D, --debug debugging mode\n"
"\n"
msgstr ""
-#: sys-utils/hwclock.c:1611
+#: sys-utils/hwclock.c:1621
msgid ""
" -J|--jensen, -A|--arc, -S|--srm, -F|--funky-toy\n"
" tell hwclock the type of Alpha you have (see hwclock(8))\n"
"\n"
msgstr ""
-#: sys-utils/hwclock.c:1734
+#: sys-utils/hwclock.c:1744
msgid "Unable to connect to audit system"
msgstr ""
-#: sys-utils/hwclock.c:1832
+#: sys-utils/hwclock.c:1842
msgid "invalid epoch argument"
msgstr ""
-#: sys-utils/hwclock.c:1871
+#: sys-utils/hwclock.c:1881
#, c-format
msgid "%s takes no non-option arguments. You supplied %d.\n"
msgstr ""
-#: sys-utils/hwclock.c:1880
+#: sys-utils/hwclock.c:1890
msgid "With --noadjfile, you must specify either --utc or --localtime"
msgstr ""
-#: sys-utils/hwclock.c:1893
+#: sys-utils/hwclock.c:1903
msgid "No usable set-to time. Cannot set clock."
msgstr ""
-#: sys-utils/hwclock.c:1908
+#: sys-utils/hwclock.c:1918
msgid "Sorry, only the superuser can change the Hardware Clock."
msgstr ""
-#: sys-utils/hwclock.c:1912
+#: sys-utils/hwclock.c:1922
msgid "Sorry, only the superuser can change the System Clock."
msgstr ""
-#: sys-utils/hwclock.c:1916
+#: sys-utils/hwclock.c:1926
msgid ""
"Sorry, only the superuser can change the Hardware Clock epoch in the kernel."
msgstr ""
-#: sys-utils/hwclock.c:1939
+#: sys-utils/hwclock.c:1949
msgid "Cannot access the Hardware Clock via any known method."
msgstr ""
-#: sys-utils/hwclock.c:1942
+#: sys-utils/hwclock.c:1952
msgid ""
"Use the --debug option to see the details of our search for an access method."
msgstr ""
@@ -11332,6 +11332,16 @@ msgstr ""
msgid "------ Shared Memory Status --------\n"
msgstr ""
+#. TRANSLATORS: This output format is maintained for backward
+#. compatibility as ipcs is used in scripts. For consistency
+#. with the rest, the translated form can follow this model:
+#. *
+#. "segments allocated = %d\n"
+#. "pages allocated = %ld\n"
+#. "pages resident = %ld\n"
+#. "pages swapped = %ld\n"
+#. "swap performance = %ld attempts, %ld successes\n"
+#.
#: sys-utils/ipcs.c:232
#, c-format
msgid ""
This diff is collapsed.
This diff is collapsed.
From: Yuri Chornoivan <yurchor@ukr.net>
Date: Sun, 23 Nov 2014 16:07:19 -0400
Subject: Update Ukrainian translation
---
po/uk.po | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/po/uk.po b/po/uk.po
index fa87882..f45eb02 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: util-linux 2.25.1-rc1\n"
"Report-Msgid-Bugs-To: util-linux@vger.kernel.org\n"
"POT-Creation-Date: 2014-11-19 12:21-0400\n"
-"PO-Revision-Date: 2014-08-27 22:54+0300\n"
+"PO-Revision-Date: 2014-11-23 09:31+0200\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <translation-team-uk@lists.sourceforge.net>\n"
"Language: uk\n"
@@ -7420,9 +7420,8 @@ msgid "cannot set signal handler"
msgstr "не вдалося встановити обробник сигналу"
#: login-utils/su-common.c:367
-#, fuzzy
msgid " (core dumped)"
-msgstr "%s (створено дамп ядра)\n"
+msgstr " (створено дамп ядра)"
#: login-utils/su-common.c:383
#, c-format
@@ -9756,9 +9755,9 @@ msgid "%s: BLKSSZGET ioctl failed"
msgstr "%s: помилка ioctl BLKSSZGET"
#: sys-utils/blkdiscard.c:153
-#, fuzzy, c-format
+#, c-format
msgid "%s: offset is greater than device size"
-msgstr "не вдалося отримати розмір пристрою"
+msgstr "%s: зсув виходить за межі розміру пристрою"
#: sys-utils/blkdiscard.c:160
#, c-format
......@@ -9,7 +9,7 @@ Conflicts:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/disk-utils/cfdisk.8 b/disk-utils/cfdisk.8
index 6471de6..ea34f21 100644
index 79f85cf..1a607e9 100644
--- a/disk-utils/cfdisk.8
+++ b/disk-utils/cfdisk.8
@@ -20,7 +20,7 @@ cfdisk \- display or manipulate a disk partition table
......
From: Karel Zak <kzak@redhat.com>
Date: Thu, 27 Nov 2014 13:39:35 +0100
Subject: libblkid: care about unsafe chars in cache
The high-level libblkid API uses /run/blkid/blkid.tab cache to
store probing results. The cache format is
<device NAME="value" ...>devname</device>
and unfortunately the cache code does not escape quotation marks:
# mkfs.ext4 -L 'AAA"BBB'
# cat /run/blkid/blkid.tab
...
<device ... LABEL="AAA"BBB" ...>/dev/sdb1</device>
such string is later incorrectly parsed and blkid(8) returns
nonsenses. And for use-cases like
# eval $(blkid -o export /dev/sdb1)
it's also insecure.
Note that mount, udevd and blkid -p are based on low-level libblkid
API, it bypass the cache and directly read data from the devices.
The current udevd upstream does not depend on blkid(8) output at all,
it's directly linked with the library and all unsafe chars are encoded by
\x<hex> notation.
# mkfs.ext4 -L 'X"`/tmp/foo` "' /dev/sdb1
# udevadm info --export-db | grep LABEL
...
E: ID_FS_LABEL=X__/tmp/foo___
E: ID_FS_LABEL_ENC=X\x22\x60\x2ftmp\x2ffoo\x60\x20\x22
Signed-off-by: Karel Zak <kzak@redhat.com>
---
libblkid/src/read.c | 21 ++++++++++++++++++---
libblkid/src/save.c | 22 +++++++++++++++++++++-
misc-utils/blkid.8 | 5 ++++-
misc-utils/blkid.c | 4 ++--
4 files changed, 45 insertions(+), 7 deletions(-)
diff --git a/libblkid/src/read.c b/libblkid/src/read.c
index 0e91c9c..81ab0df 100644
--- a/libblkid/src/read.c
+++ b/libblkid/src/read.c
@@ -252,15 +252,30 @@ static int parse_token(char **name, char **value, char **cp)
*value = skip_over_blank(*value + 1);
if (**value == '"') {
- end = strchr(*value + 1, '"');
- if (!end) {
+ char *p = end = *value + 1;
+
+ /* convert 'foo\"bar' to 'foo"bar' */
+ while (*p) {
+ if (*p == '\\') {
+ p++;
+ *end = *p;
+ } else {
+ *end = *p;
+ if (*p == '"')
+ break;
+ }
+ p++;
+ end++;
+ }
+
+ if (*end != '"') {
DBG(READ, ul_debug("unbalanced quotes at: %s", *value));
*cp = *value;
return -BLKID_ERR_CACHE;
}
(*value)++;
*end = '\0';
- end++;
+ end = ++p;
} else {
end = skip_over_word(*value);
if (*end) {
diff --git a/libblkid/src/save.c b/libblkid/src/save.c
index 8216f09..5e8bbee 100644
--- a/libblkid/src/save.c
+++ b/libblkid/src/save.c
@@ -26,6 +26,21 @@
#include "blkidP.h"
+
+static void save_quoted(const char *data, FILE *file)
+{
+ const char *p;
+
+ fputc('"', file);
+ for (p = data; p && *p; p++) {
+ if ((unsigned char) *p == 0x22 || /* " */
+ (unsigned char) *p == 0x5c) /* \ */
+ fputc('\\', file);
+
+ fputc(*p, file);
+ }
+ fputc('"', file);
+}
static int save_dev(blkid_dev dev, FILE *file)
{
struct list_head *p;
@@ -43,9 +58,14 @@ static int save_dev(blkid_dev dev, FILE *file)
if (dev->bid_pri)
fprintf(file, " PRI=\"%d\"", dev->bid_pri);
+
list_for_each(p, &dev->bid_tags) {
blkid_tag tag = list_entry(p, struct blkid_struct_tag, bit_tags);
- fprintf(file, " %s=\"%s\"", tag->bit_name,tag->bit_val);
+
+ fputc(' ', file); /* space between tags */
+ fputs(tag->bit_name, file); /* tag NAME */
+ fputc('=', file); /* separator between NAME and VALUE */
+ save_quoted(tag->bit_val, file); /* tag "VALUE" */
}
fprintf(file, ">%s</device>\n", dev->bid_name);
diff --git a/misc-utils/blkid.8 b/misc-utils/blkid.8
index a974b8e..7c0e176 100644
--- a/misc-utils/blkid.8
+++ b/misc-utils/blkid.8
@@ -193,7 +193,10 @@ partitions. This output format is \fBDEPRECATED\fR.
.TP
.B export
print key=value pairs for easy import into the environment; this output format
-is automatically enabled when I/O Limits (\fB-i\fR option) are requested
+is automatically enabled when I/O Limits (\fB-i\fR option) are requested.
+
+The non-printing characters are encoded by ^ and M- notation and all
+potentially unsafe characters are escaped.
.RE
.TP
.BI \-O " offset"
diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c
index a6ca660..1bd8646 100644
--- a/misc-utils/blkid.c
+++ b/misc-utils/blkid.c
@@ -306,7 +306,7 @@ static void print_value(int output, int num, const char *devname,
printf("DEVNAME=%s\n", devname);
fputs(name, stdout);
fputs("=", stdout);
- safe_print(value, valsz, NULL);
+ safe_print(value, valsz, " \\\"'$`<>");
fputs("\n", stdout);