Skip to content

Services cannot work with user names containing space #8859

@pavel-zotov

Description

@pavel-zotov

If a database:

  • was created as self-security,
  • and its owner has:
    • either name that does not look like SQL-identifier (spaces, punctuation signs),
    • or name does look as SQL-identifier but has at least one lowercase character and was intentionally enclosed in quotes
  • and its state has been changed to full shutdown

-- then it can not be returned to online using Services API.

Steps to reproduce:
0) open firebird.conf and set there:

AuthClient = Srp
AuthServer = Srp
UserManager = Srp
  1. open databases.conf and make alias for self-secutity database:
ss_alias = c:\temp\ss_test.fdb
{
    SecurityDatabase = ss_alias
}
  1. open batch file from attached .zip (its encoding: utf8) and adjust there:
    2.1) home path to FB instance (variable fbc)
    2.2) uncomment any of following cases:
@rem set DB_OWNR=john_smith
@rem set DB_OWNR="john o'hara"
@rem set DB_OWNR="john_low"
@rem set DB_OWNR="Джон О'Хара"

One may to start uncomment this: set DB_OWNR="john o'hara"

Successful completion of this batch must show following tail:

C:\FB\60SS\gfix ss_alias -user \""john o'hara"\" -pas "yes, it's me" -online
        Attributes              force write
Step #4 +++ passed +++
Bye-bye, retcode=0

Commands that fail are commented out and gathered under title

@rem ######################################################
@rem ###    P R O B L E M A T I C     C O M M A N D S   ###
@rem ######################################################

All these commands try to bring DB online.
Uncomment any line from this block that looks like
@rem set run_cmd=%fbc%\fbsvcmgr ...
-- and run batch.

You will see somewhat like:
data base file name (o'hara) already given
or
no permission for bring online access to database

Checked on WI-6.0.0.1394
self-sec-shutdown-online.zip

This is overall outcome:
Image
(see also attached .zip, there is appropriate Excel file)

PS.
NOTE: batch assumes that there is no important DB with name c:\temp\ss_test.fdb (it will drop / create DB with such name).

PPS.
SQL standard definition of "SQL identifier":

SQL-2011, page 173 "5.4 Names and identifiers"
-----------------------------------------------
    <SQL language identifier> ::= <SQL language identifier start>[ <SQL language identifier part>... ]
        <SQL language identifier start> ::= <simple Latin letter>
        <SQL language identifier part> ::= <simple Latin letter> | <digit> | <underscore>
...
2) An <SQL language identifier>is equivalent to an <SQL language identifier>in which every letter that is
a lower-case letter is replaced by the corresponding upper-case letter or letters.
-----------------------------------------------

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions