summaryrefslogtreecommitdiff
path: root/lib/mangle.c
AgeCommit message (Collapse)AuthorFilesLines
2012-08-13lib/mangle: remove unused variableKarel Zak1-1/+0
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-13libmount: fix unmangle codeKarel Zak1-2/+3
old version: /mnt/ugly/te\134st\134 -> /mnt/ugly/te\st\134 fixed version: /mnt/ugly/te\134st\134 -> /mnt/ugly/te\st\ Reported-by: Naja Melan <najamelan@autistici.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2012-06-21lib/mangle: fix a memory leak in the test caseCong Wang1-2/+6
Marek reported there is a memory leak in lib/mangle.c CC mangle.o mangle.c:160:9: warning: Memory is never released; potential leak of memory pointed to by 'ss' This patch fixes it. Reported-by: Marek Otahal <markotahal@gmail.com> Cc: Karel Zak <kzak@redhat.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-15lib/mangle: check for end of string on every iterationDave Reisner1-4/+5
Checking for the null byte at the end of the string only conditionally leads to segfaults, evidenced by mount helpers crashing on writes to /run/mount/utab. Simply check for the null on each iteration, and append a null byte to the mangled string before breaking. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-26lib/mangle: cleanup, add unhexmangleKarel Zak1-18/+39
* use strchr() rather than for() * small refactoring in mangle code * add un-hex-mangle Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01lib: [mangle.c] fix compiler warnings [-Wsign-compare]Karel Zak1-1/+1
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-04umount: segfaults with inconsistent entry in /etc/fstabKarel Zak1-0/+2
Addresses: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/726283 Reported-by: Greg Brockman <gdb@gregbrockman.com> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-14build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen1-1/+1
Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-01-03libmount: cleanup mangle() usageKarel Zak1-4/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03libmount: use better format for utab, improve bind mountsKarel Zak1-5/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03libmount: rewrite mountinfo/fstab parsers to use sscanf()Karel Zak1-3/+12
The old solution (without scanf()) was based on old code from mount(8). It seems that the modern libc is able to provide all necessary functionality by sscanf() and %ms directive. Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03lib: fix mange() and unmangle() to handle NULLKarel Zak1-0/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-03libmount: add unmangle/mangle() functions to APIKarel Zak1-4/+5
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-03-10lib: add mangle.c for mtab (fstab or swaps) encodingKarel Zak1-0/+116
Signed-off-by: Karel Zak <kzak@redhat.com>