Bug 1324430 - name tag in macpools does accept special characters if created using REST API
Summary: name tag in macpools does accept special characters if created using REST API
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.6.0
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-06 10:21 UTC by Martin Tessun
Modified: 2019-10-10 11:50 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-18 12:12:47 UTC
oVirt Team: Infra
Target Upstream Version:


Attachments (Terms of Use)

Description Martin Tessun 2016-04-06 10:21:37 UTC
Description of problem:
name tag accepts special characters without complaining. As this might not be a problem yet, the names should be restricted to a-zA-Z0-9 and _.

Version-Release number of selected component (if applicable):
RHEV 3.6

How reproducible:
always

Steps to Reproduce:
1. Create a new macpool with e.g. newlines and Spaces in the name, (not using curl, but e.g. RestClient for Firefox):

<mac_pool>
    <name>Testpool
with
somes
 special characters</name>
    <description>Some 
other
 special Characters</description>
    <allow_duplicates>false</allow_duplicates>
    <default_pool>false</default_pool>
    <ranges>
        <range>
            <from>00:1a:4b:01:00:00</from>
            <to>00:1a:4c:ff:ff:ff</to>
        </range>
    </ranges>
</mac_pool>

2. Check the results:
   curl -s -k -u 'admin@internal:password' https://<url>/ovirt-engine/api/macpools/<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Actual results:
The special characters are accepted and also returned after querying

Expected results:
The special characters should either get stripped, or the request for creating the macpool should fail with an appropriate error message.

Additional info:

Comment 1 Yaniv Kaul 2016-04-07 13:20:16 UTC
I wonder if we should have some kind of filter to most fields, to filter where we should not accept extended chars.

Comment 2 Michal Skrivanek 2016-04-07 21:11:18 UTC
We do have unicode support in most places. Why would we want to do that?

Comment 3 Yaniv Kaul 2016-04-07 21:28:29 UTC
(In reply to Michal Skrivanek from comment #2)
> We do have unicode support in most places. Why would we want to do that?

I see absolutely no point in supporting Unicode in the MAC pool name, that's all.

Comment 4 Pavel Stehlik 2016-04-08 07:29:28 UTC
It's working, we've it on many other places, we do support Unicode for other languages, even in ticket is no explanation why this shouldn't be allowed.
Closed as NOTABZ?
(otherwise - where else we should block it? Cluster/Quota/everywhere?)

Comment 5 Martin Tessun 2016-04-08 08:55:20 UTC
Personally I think as the name is usually also printed in a single line in the WebUI, and names currently only support the abovbe mentioned characterset (at least from WebUI), there could arise some problems in at least accepting newline.

In case we do not see any issues with UTF-8 encoding in <name> tags, I am fine with closing NOTABUG.

Cheers,
MArtin

Comment 6 Pavel Stehlik 2016-04-08 08:58:29 UTC
My worries comes from creating exceptions for specific areas as those could affect the other behaviour. Thus I'd rather see unified approaches in the system.

Comment 8 Yaniv Kaul 2016-04-08 18:13:50 UTC
(In reply to Michal Skrivanek from comment #7)
> (In reply to Yaniv Kaul from comment #3)
> > (In reply to Michal Skrivanek from comment #2)
> > > We do have unicode support in most places. Why would we want to do that?
> > 
> > I see absolutely no point in supporting Unicode in the MAC pool name, that's
> > all.
> 
> localization? We have complaints about Blank and None being non-translated
> at random places, and we have people with chinese and cyrillic VM names...so
> why not a mac pool, that's a virtual engine-only entity.

For user supplied input, I think there are two categories of fields we need to look at:
1. Those that only admins will use and see (example: the MAC pool names). I see no reason to use anything but English there. I also have always a greater suspicion those may at some point be used by other lower layers (who know, maybe some day the MAC pool will be passed to a network provider for some reason - do they support Unicode?)
2. Those that are more user facing, commonly can be in non-ASCII chars - and we have to work hard to ensure end-to-end it's OK to have them in Unicode or so - such as VM names.

Comment 9 Oved Ourfali 2016-04-11 12:19:08 UTC
Coming back to the original bug, Pavel, (In reply to Martin Tessun from comment #5)
> Personally I think as the name is usually also printed in a single line in
> the WebUI, and names currently only support the abovbe mentioned
> characterset (at least from WebUI), there could arise some problems in at
> least accepting newline.
> 
> In case we do not see any issues with UTF-8 encoding in <name> tags, I am
> fine with closing NOTABUG.
> 
> Cheers,
> MArtin

Pavel - can this be tested so that we know whether we can close that or not?

Comment 10 Pavel Novotny 2016-04-11 15:02:22 UTC
(In reply to Oved Ourfali from comment #9)
> Coming back to the original bug, Pavel, (In reply to Martin Tessun from
> comment #5)
> > Personally I think as the name is usually also printed in a single line in
> > the WebUI, and names currently only support the abovbe mentioned
> > characterset (at least from WebUI), there could arise some problems in at
> > least accepting newline.
> > 
> > In case we do not see any issues with UTF-8 encoding in <name> tags, I am
> > fine with closing NOTABUG.
> > 
> > Cheers,
> > MArtin
> 
> Pavel - can this be tested so that we know whether we can close that or not?

Regarding to new-lines and similar whitespaces, CSS in Webadmin does not override the "white-space" property, which means they are rendered according to this rule:
"Sequences of whitespace will collapse into a single whitespace. Text will wrap when necessary. This is default"

I.e., whitespaces are represented in browser as a space.

Comment 11 Oved Ourfali 2016-04-18 11:24:24 UTC
I'm trying to understand what action items are required on this bug.
Pavel S. - can you elaborate?

Comment 12 Oved Ourfali 2016-04-18 12:12:47 UTC
Based on all comments + discussion offline with Pavel, closing as NOTABUG.
If relevant, please reopen.


Note You need to log in before you can comment on or make changes to this bug.