Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Su invocation is not escaped properly for TS work [JIRA: TOOLS-167] #192

Open
macintux opened this issue Nov 24, 2015 · 6 comments
Open

Comments

@macintux
Copy link
Contributor

When using TS packages, riak-admin is crippled for defining bucket types because of the need to use su to the riak user.

As seen below from sh -x, the JSON is not wrapped properly, and the shell complains.

exec su - riak -c '/usr/sbin/riak-admin bucket-type create testone \{\"props\":\{\"table_def\":\"CREATE TABLE testone (field1 varchar not null, field2 varchar not null, time timestamp not null, PRIMARY KEY((field1, field2, quantum(time, 15, s)), field1, field2, time))\"\}\}'
@Basho-JIRA Basho-JIRA changed the title Su invocation is not escaped properly for TS work Su invocation is not escaped properly for TS work [JIRA: TOOLS-167] Nov 24, 2015
@macintux
Copy link
Contributor Author

Valid workaround: su to the riak user before executing the riak-admin command.

@macintux
Copy link
Contributor Author

(discovered by @binarytemple)

@Basho-JIRA
Copy link

A PR was submitted that should resolve this- see #193

_[posted via JIRA by Greg Cymbalski]_

@Basho-JIRA
Copy link

Packages that demonstrate this change are up at s3://builds.basho.com/nightlies/riak-ts/1/centos-6/

_[posted via JIRA by Greg Cymbalski]_

@Basho-JIRA
Copy link

Fix looks good to me:

[centos@ip-172-31-27-220 ~]$ sudo /usr/sbin/riak-admin bucket-type create testone '{"props":{"table_def":"CREATE TABLE testone (field1 varchar not null, field2 varchar not null, time timestamp not null, PRIMARY KEY((field1, field2, quantum(time, 15, s)), field1, field2, time))"}}'
testone created

WARNING: After activating testone, nodes in this cluster
can no longer be downgraded to a version of Riak prior to 2.0

_[posted via JIRA by Paul Hagan]_

@kesslerm
Copy link
Contributor

kesslerm commented Aug 8, 2016

As reported by a Solaris user on 2.0.7, the fix broke execution on Solaris10:

/opt/riak/sbin/riak: syntax error at line 242:ESCAPED_ARGS=$' unexpected`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants