Summary: | Editing of a user in KUser destroys it. | ||
---|---|---|---|
Product: | [Unmaintained] kuser | Reporter: | Jānis Legzdiņš <dj_jl> |
Component: | general | Assignee: | Maksim Orlovich <maksim> |
Status: | RESOLVED FIXED | ||
Severity: | grave | CC: | alex323, fallstorm, greg_g, gyurco, jheled, magnus.larsson.k, raid517, superandrzej, xeroc_ |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Jānis Legzdiņš
2005-02-28 15:56:02 UTC
I can confirm - using kde 3.4.0-rc1 (from gentoo portage), gcc 3.4.3 I noticed this misbehavior when adding a new user. As I've read on the Gentoo forums I am not the only one affected. *** This bug has been confirmed by popular vote. *** *** Bug 102613 has been marked as a duplicate of this bug. *** *** Bug 102734 has been marked as a duplicate of this bug. *** Does http://bugs.kde.org/attachment.cgi?id=10409&action=view patch apply for this one as well? Yes, it fixes the problem. The patch fixed the trouble for me too. Closing as issue seems to have been resolved. Has the patch been committed already? Nope, but will do so in half a week or so reopen until applied CVS commit by orlovich: Do not access cbposix if it's not initialized (also set it to 0 in that case, so the app crashes but does not corrupt data in case of other unguarded access; this probably should be done for the other conditionally created widgets as well, but that's up to KUser folks). Avoids damaging accounts in people's password files(!!!!), and crashing when editting all over the place. CCBUG:100443 M +7 -3 propdlg.cpp 1.85 --- kdeadmin/kuser/propdlg.cpp #1.84:1.85 @@ -211,4 +211,6 @@ void propdlg::initDlg() connect(cbposix, SIGNAL(stateChanged(int)), this, SLOT(cbposixChanged())); addRow(frame, layout, row++, cbposix, i18n("Disable &POSIX account information"), whatstr); + } else { + cbposix = 0; } frontrow = row; @@ -707,5 +709,6 @@ void propdlg::mergeUser( KUser *user, KU newuser->copy( user ); - if ( cbposix->state() != QButton::NoChange ) { + + if ( kug->getUsers().getCaps() & KUsers::Cap_Disable_POSIX && cbposix->state() != QButton::NoChange ) { if ( cbposix->isChecked() ) newuser->setCaps( newuser->getCaps() & ~KUser::Cap_POSIX ); @@ -874,5 +877,5 @@ bool propdlg::check() { bool one = ( mUsers.getFirst() == mUsers.getLast() ); - bool posix = !( cbposix->isChecked() ); + bool posix = !( kug->getUsers().getCaps() & KUsers::Cap_Disable_POSIX ) || !( cbposix->isChecked() ); if ( one && posix && leid->text().isEmpty() ) { @@ -929,5 +932,6 @@ void propdlg::slotOk() uid_t newuid = leid->text().toULong(); - if ( one && !cbposix->isChecked() && olduid != newuid ) + if ( one && ( !( kug->getUsers().getCaps() & KUsers::Cap_Disable_POSIX ) || !cbposix->isChecked() ) + && olduid != newuid ) { if (kug->getUsers().lookup(newuid)) { CVS commit by orlovich: Backport the fix to the grave #100443: do not scribble over uninitialized pointers, damaging account data. BUG:100443 M +7 -3 propdlg.cpp 1.84.2.1 --- kdeadmin/kuser/propdlg.cpp #1.84:1.84.2.1 @@ -211,4 +211,6 @@ void propdlg::initDlg() connect(cbposix, SIGNAL(stateChanged(int)), this, SLOT(cbposixChanged())); addRow(frame, layout, row++, cbposix, i18n("Disable &POSIX account information"), whatstr); + } else { + cbposix = 0; } frontrow = row; @@ -707,5 +709,6 @@ void propdlg::mergeUser( KUser *user, KU newuser->copy( user ); - if ( cbposix->state() != QButton::NoChange ) { + + if ( kug->getUsers().getCaps() & KUsers::Cap_Disable_POSIX && cbposix->state() != QButton::NoChange ) { if ( cbposix->isChecked() ) newuser->setCaps( newuser->getCaps() & ~KUser::Cap_POSIX ); @@ -874,5 +877,5 @@ bool propdlg::check() { bool one = ( mUsers.getFirst() == mUsers.getLast() ); - bool posix = !( cbposix->isChecked() ); + bool posix = !( kug->getUsers().getCaps() & KUsers::Cap_Disable_POSIX ) || !( cbposix->isChecked() ); if ( one && posix && leid->text().isEmpty() ) { @@ -929,5 +932,6 @@ void propdlg::slotOk() uid_t newuid = leid->text().toULong(); - if ( one && !cbposix->isChecked() && olduid != newuid ) + if ( one && ( !( kug->getUsers().getCaps() & KUsers::Cap_Disable_POSIX ) || !cbposix->isChecked() ) + && olduid != newuid ) { if (kug->getUsers().lookup(newuid)) { *** Bug 100342 has been marked as a duplicate of this bug. *** *** Bug 104247 has been marked as a duplicate of this bug. *** *** Bug 102317 has been marked as a duplicate of this bug. *** *** Bug 106092 has been marked as a duplicate of this bug. *** *** Bug 106820 has been marked as a duplicate of this bug. *** I have this problem but I don't undestand how I can resolve it.. can somebody help me? The problem (with kuser meshing up the /etc/password file, changing uid to 0 etc) exists again with kde 3.4.2, please reopen the bug. Can you attach the debug output of KUser when the UID erasing happens? |