Push the following patches to GIT from Bug 1499:

tdelibs: disable kfiledialogbox OK button if user has no permission on file
 tdelibs: fix https loop
 tdelibs: fix groups in kdialogpropertiesdialog
 tdelibs: avoid assertion in tdeio karchive
(cherry picked from commit 9cb7d73182)
v3.5.13-sru
Timothy Pearson 10 years ago committed by Slávek Banko
parent 1af590f88a
commit 1bdb69cbcb

@ -1764,7 +1764,6 @@ KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin( KPropertiesDialog *_pr
*/ */
int i, maxEntries = 1000; int i, maxEntries = 1000;
struct passwd *user; struct passwd *user;
struct group *ge;
/* File owner: For root, offer a KLineEdit with autocompletion. /* File owner: For root, offer a KLineEdit with autocompletion.
* For a user, who can never chown() a file, offer a TQLabel. * For a user, who can never chown() a file, offer a TQLabel.
@ -1800,27 +1799,31 @@ KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin( KPropertiesDialog *_pr
strUser = user->pw_name; strUser = user->pw_name;
#ifdef Q_OS_UNIX #ifdef Q_OS_UNIX
setgrent(); gid_t *groups = NULL;
for (i=0; ((ge = getgrent()) != 0L) && (i < maxEntries); i++) int ng = 1;
{ struct group *mygroup;
if (IamRoot) gid_t *newgroups = NULL;
groupList += TQString::fromLatin1(ge->gr_name);
else groups = (gid_t *) malloc(ng * sizeof(gid_t));
{
/* pick the groups to which the user belongs */ if (getgrouplist(strUser, user->pw_gid, groups, &ng) == -1) {
char ** members = ge->gr_mem; newgroups = (gid_t *) malloc(ng * sizeof(gid_t));
char * member; if (newgroups != NULL) {
while ((member = *members) != 0L) { free(groups);
if (strUser == member) { groups = newgroups;
groupList += TQString::fromLocal8Bit(ge->gr_name); getgrouplist(strUser, user->pw_gid, groups, &ng);
break; } else ng = 1;
}
++members;
}
}
} }
endgrent();
#endif //Q_OS_UNIX for (i = 0; i < ng; i++) {
mygroup = getgrgid(groups[i]);
if (mygroup != NULL) groupList += TQString::fromLocal8Bit(mygroup->gr_name);
}
free(groups);
#else //Q_OS_UNIX
struct group *ge;
/* add the effective Group to the list .. */ /* add the effective Group to the list .. */
ge = getgrgid (getegid()); ge = getgrgid (getegid());
@ -1831,6 +1834,7 @@ KFilePermissionsPropsPlugin::KFilePermissionsPropsPlugin( KPropertiesDialog *_pr
if (groupList.find(name) == groupList.end()) if (groupList.find(name) == groupList.end())
groupList += name; groupList += name;
} }
#endif //Q_OS_UNIX
bool isMyGroup = groupList.contains(strGroup); bool isMyGroup = groupList.contains(strGroup);
@ -2081,6 +2085,7 @@ void KFilePermissionsPropsPlugin::slotShowAdvancedPermissions() {
} }
// Draw Checkboxes // Draw Checkboxes
bool allDisable = true;
TQCheckBox *cba[3][4]; TQCheckBox *cba[3][4];
for (int row = 0; row < 3 ; ++row) { for (int row = 0; row < 3 ; ++row) {
for (int col = 0; col < 4; ++col) { for (int col = 0; col < 4; ++col) {
@ -2091,6 +2096,9 @@ void KFilePermissionsPropsPlugin::slotShowAdvancedPermissions() {
if ( aPartialPermissions & fperm[row][col] ) if ( aPartialPermissions & fperm[row][col] )
{ {
cb->setTristate(); cb->setTristate();
if( d->canChangePermissions ) {
allDisable = false;
}
cb->setNoChange(); cb->setNoChange();
} }
else if (d->cbRecursive && d->cbRecursive->isChecked()) else if (d->cbRecursive && d->cbRecursive->isChecked())
@ -2152,6 +2160,10 @@ void KFilePermissionsPropsPlugin::slotShowAdvancedPermissions() {
} }
#endif #endif
if ( allDisable ) {
dlg.enableButtonOK( false );
}
if (dlg.exec() != KDialogBase::Accepted) if (dlg.exec() != KDialogBase::Accepted)
return; return;

@ -588,7 +588,9 @@ const KArchiveEntry* KArchiveDirectory::entry( TQString name ) const
void KArchiveDirectory::addEntry( KArchiveEntry* entry ) void KArchiveDirectory::addEntry( KArchiveEntry* entry )
{ {
Q_ASSERT( !entry->name().isEmpty() ); if( entry->name().isEmpty() ) {
return;
}
if( m_entries[ entry->name() ] ) { if( m_entries[ entry->name() ] ) {
kdWarning() << "KArchiveDirectory::addEntry: directory " << name() kdWarning() << "KArchiveDirectory::addEntry: directory " << name()
<< " has entry " << entry->name() << " already" << endl; << " has entry " << entry->name() << " already" << endl;

@ -1095,7 +1095,13 @@ int TCPSlaveBase::verifyCertificate()
KConfig *config = new KConfig("kioslaverc"); KConfig *config = new KConfig("kioslaverc");
config->setGroup("Notification Messages"); config->setGroup("Notification Messages");
if (!config->readBoolEntry("WarnOnEnterSSLMode", true)) { bool dialogBoxStatus = false;
if( config->hasKey("WarnOnEnterSSLMode") ) {
dialogBoxStatus = true;
}
bool keyStatus = config->readBoolEntry("WarnOnEnterSSLMode", true);
dialogBoxStatus = dialogBoxStatus && keyStatus;
if (!keyStatus) {
config->deleteEntry("WarnOnEnterSSLMode"); config->deleteEntry("WarnOnEnterSSLMode");
config->sync(); config->sync();
d->kssl->settings()->setWarnOnEnter(false); d->kssl->settings()->setWarnOnEnter(false);
@ -1122,6 +1128,10 @@ int TCPSlaveBase::verifyCertificate()
"showSSLInfoDialog(TQString,KIO::MetaData,int)", "showSSLInfoDialog(TQString,KIO::MetaData,int)",
data, ignoretype, ignore); data, ignoretype, ignore);
} }
//Laurent: If we disable message box we can't click on KMessageBox::No
if(dialogBoxStatus) {
break;
}
} while (result != KMessageBox::No); } while (result != KMessageBox::No);
} }

Loading…
Cancel
Save