diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index 6da2a21..484f91a 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -137,6 +137,7 @@ bool ExternalCommandHelper::WriteFstab(const QByteArray& fileContents) QString fstabPath = QStringLiteral("/etc/fstab"); QFile fstabFile(fstabPath); + // WriteOnly implies O_TRUNC auto flags = QIODevice::WriteOnly | QIODevice::Unbuffered; if (!fstabFile.open(flags)) { qCritical() << xi18n("Could not open file %1 for writing.", fstabPath);