Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb45124' into 'master'
[lipstick] don't save screenshots with privileged group. JB#45124

See merge request mer-core/lipstick!121
  • Loading branch information
frajo committed Oct 7, 2019
2 parents 4214ea2 + 00158c2 commit 46b0711
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/screenshotservice.cpp
Expand Up @@ -141,6 +141,12 @@ void ScreenshotWriter::run()
const quint64 status = m_image.save(m_path)
? ScreenshotResult::Finished
: ScreenshotResult::Error;
const QByteArray path = m_path.toUtf8();
int r = chown(path.constData(), getuid(), getgid());
if (r != 0) {
qWarning() << "Screenshot owner/group could not be set" << strerror(errno);
}

ssize_t unused = ::write(m_notifierId, &status, sizeof(status));
Q_UNUSED(unused);
}
Expand Down

0 comments on commit 46b0711

Please sign in to comment.