Re: [PATCHv2 4/5] Ignore storage volumes with control codes in their names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 14, 2015 at 13:28:49 +0200, Ján Tomko wrote:
> To prevent generating invalid XML.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1066564
> ---
>  src/storage/storage_backend_fs.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
> index d4d65bc..fb33f08 100644
> --- a/src/storage/storage_backend_fs.c
> +++ b/src/storage/storage_backend_fs.c
> @@ -860,6 +860,12 @@ virStorageBackendFileSystemRefresh(virConnectPtr conn ATTRIBUTE_UNUSED,
>      while ((direrr = virDirRead(dir, &ent, pool->def->target.path)) > 0) {
>          int ret;
>  
> +        if (virStringHasControlChars(ent->d_name)) {
> +            VIR_WARN("Ignoring file with control characters in its name: '%s'",
> +                     ent->d_name);

I'm not quite sure that printing the string containing control
characters to the log file is a good idea. While journalctl probably
will handle the string properly, classic text logs may cause problems
then.

I'd rather log the pool name or directory path or something else than
the offending name itself.

> +            continue;
> +        }
> +
>          if (VIR_ALLOC(vol) < 0)
>              goto error;

Peter

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]