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

Fix generated chown command (#1151) #1152

Merged
merged 1 commit into from
Aug 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ trait DebianPluginLike {
streams: TaskStreams): (String, String) = {
// how to create the chownCmd. TODO maybe configurable?
def chownCmd(user: String, group: String)(path: String): String =
s"chown $user:$group $path"
s"chown $user:$group '$path'"

val header = "# Chown definitions created by SBT Native Packager\n"
// Check for non root user/group and create chown commands
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/debian/daemon-group-gid-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ TaskKey[Unit]("checkControlFiles") := {
"postinst misses useradd for daemonuser: " + postinst
)
assert(
postinst contains "chown daemonuser:daemongroup /var/log/debian-test",
"postinst misses chown daemonuser /var/log/debian-test: " + postinst
postinst contains "chown daemonuser:daemongroup '/var/log/debian-test'",
"postinst misses chown daemonuser '/var/log/debian-test': " + postinst
)
assert(!(postinst contains "addgroup --system daemonuser"), "postinst has addgroup for daemonuser: " + postinst)
assert(
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/daemon-user-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ TaskKey[Unit]("checkControlFiles") := {
"postinst misses useradd for daemonuser: " + postinst
)
assert(
postinst contains "chown daemonuser:daemongroup /var/log/debian-test",
"postinst misses chown daemonuser /var/log/debian-test: " + postinst
postinst contains "chown daemonuser:daemongroup '/var/log/debian-test'",
"postinst misses chown daemonuser '/var/log/debian-test': " + postinst
)
assert(!(postinst contains "addgroup --system daemonuser"), "postinst has addgroup for daemonuser: " + postinst)
assert(
Expand All @@ -37,7 +37,7 @@ TaskKey[Unit]("checkControlFiles") := {
assert(!(postinst contains "chown daemonuser:debian-test"), "postinst contains wrong group: \n" + postinst)
assert(!(postinst contains "chown debian-test:debian-test"), "postinst contains wrong user and group: \n" + postinst)
assert(
!(postinst contains "chown daemonuser:daemongroup /usr/share/debian-test"),
!(postinst contains "chown daemonuser:daemongroup '/usr/share/debian-test'"),
"postinst contains chown /usr/share/app_name: \n" + postinst
)
streams.value.log.success("Successfully tested upstart control files")
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/daemon-user-uid-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ TaskKey[Unit]("checkControlFiles") := {
"postinst misses useradd for daemonuser: " + postinst
)
assert(
postinst contains "chown daemonuser:daemongroup /var/log/debian-test",
"postinst misses chown daemonuser /var/log/debian-test: " + postinst
postinst contains "chown daemonuser:daemongroup '/var/log/debian-test'",
"postinst misses chown daemonuser '/var/log/debian-test': " + postinst
)
assert(!(postinst contains "addgroup --system daemonuser"), "postinst has addgroup for daemonuser: " + postinst)
assert(
Expand All @@ -38,7 +38,7 @@ TaskKey[Unit]("checkControlFiles") := {
assert(!(postinst contains "chown daemonuser:debian-test"), "postinst contains wrong group: \n" + postinst)
assert(!(postinst contains "chown debian-test:debian-test"), "postinst contains wrong user and group: \n" + postinst)
assert(
!(postinst contains "chown daemonuser:daemongroup /usr/share/debian-test"),
!(postinst contains "chown daemonuser:daemongroup '/usr/share/debian-test'"),
"postinst contains chown /usr/share/app_name: \n" + postinst
)
streams.value.log.success("Successfully tested upstart control files")
Expand Down