diff --git a/iso/kiso.cpp b/iso/kiso.cpp --- a/iso/kiso.cpp +++ b/iso/kiso.cpp @@ -268,7 +268,8 @@ if (!special) { if (iso->joliet) { for (i = 0;i < (isonum_711(idr->name_len) - 1);i += 2) { - QChar ch(be2me_16(*((ushort*)&(idr->name[i])))); + void *p = &(idr->name[i]); + QChar ch(be2me_16(*(ushort *)p)); if (ch == ';') break; path += ch; } diff --git a/krArc/krarc.cpp b/krArc/krarc.cpp --- a/krArc/krarc.cpp +++ b/krArc/krarc.cpp @@ -347,14 +347,26 @@ ba.prepend(arcTempDirEnc); fd = QT_OPEN(ba, O_CREAT | O_TRUNC | O_WRONLY, initialMode); } + QByteArray buffer; int readResult; + bool isIncomplete = false; do { dataReq(); readResult = readData(buffer); - ::write(fd, buffer.data(), buffer.size()); + auto bytesWritten = ::write(fd, buffer.data(), buffer.size()); + if (bytesWritten < buffer.size()) { + isIncomplete = true; + break; + } } while (readResult > 0); ::close(fd); + + if (isIncomplete) { + error(ERR_COULD_NOT_WRITE, getPath(url)); + return; + } + // pack the file KrLinecountingProcess proc; proc << putCmd << getPath(arcFile->url()) << localeEncodedString(tempFile); diff --git a/krusader/JobMan/krjob.cpp b/krusader/JobMan/krjob.cpp --- a/krusader/JobMan/krjob.cpp +++ b/krusader/JobMan/krjob.cpp @@ -53,7 +53,7 @@ const QUrl &destination, KIO::JobFlags flags, KIO::CopyJob *job, KIO::DropJob *dropJob) { - Type type; + Type type(Copy); QString description; switch (mode) { case KIO::CopyJob::Copy: diff --git a/krusader/Synchronizer/synchronizer.cpp b/krusader/Synchronizer/synchronizer.cpp --- a/krusader/Synchronizer/synchronizer.cpp +++ b/krusader/Synchronizer/synchronizer.cpp @@ -1048,8 +1048,11 @@ if (g != 0L) newGroupID = g->gr_gid; } - chown((const char *)(leftURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), newOwnerID, (gid_t) - 1); - chown((const char *)(leftURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), (uid_t) - 1, newGroupID); + int status1 = chown((const char *)(leftURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), newOwnerID, (gid_t) - 1); + int status2 = chown((const char *)(leftURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), (uid_t) - 1, newGroupID); + if (status1 < 0 || status2 < 0) { + // synchronizer currently ignores chown errors + } chmod((const char *)(leftURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), item->rightMode() & 07777); @@ -1085,8 +1088,11 @@ if (g != 0L) newGroupID = g->gr_gid; } - chown((const char *)(rightURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), newOwnerID, (uid_t) - 1); - chown((const char *)(rightURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), (uid_t) - 1, newGroupID); + int status1 = chown((const char *)(rightURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), newOwnerID, (uid_t) - 1); + int status2 = chown((const char *)(rightURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), (uid_t) - 1, newGroupID); + if (status1 < 0 || status2 < 0) { + // synchronizer currently ignores chown errors + } chmod((const char *)(rightURL.adjusted(QUrl::StripTrailingSlash).path().toLocal8Bit()), item->leftMode() & 07777);