Bug 114731 - Unable to change permissions in Konqueror
Summary: Unable to change permissions in Konqueror
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: 3.5
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Till Adam
URL:
Keywords:
: 117249 117984 118376 123368 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-10-20 00:50 UTC by
Modified: 2006-03-10 23:01 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 2005-10-20 00:50:03 UTC
Version:           3.4.92 (using KDE 3.4.92 (beta2, >= 20051010), Mandrake Linux Cooker i586 - Cooker)
Compiler:          Target: i586-mandriva-linux-gnu
OS:                Linux (i686) release 2.6.12-12mdk

Im using kdebase revision 472066 and in konqueror when i right click in a file to change permissions or owner i get an error message with the path of the file in question, however the permission/owner is changed.

But if severall files are selected only the first file gets permissions/owner changed, but it continues to appear the error message with the path of the file.
Comment 1 Thiago Macieira 2005-10-20 12:42:26 UTC
You can't change the owner in Konqueror.

I don't even get the Advanced dialog. I can change the standard permissions easily and without error messages, but not the detailed ones.

KDE was built without libacl present.

Till, since this is your code, would you care to comment?
Comment 2 2005-10-20 23:12:34 UTC
Em Quinta, 20 de Outubro de 2005 11:42, Thiago Macieira escreveu:
[bugs.kde.org quoted mail]
Wit pleasure, i dont get why you say that konqueror doesnt change owner and 
also why you in kde-3.5.0 can change the permissions in konqueror without the 
error messages i get and ther user i talked with in #kde of freenode get.

And i compiled with libacl and liattr.
Comment 3 Till Adam 2005-10-21 01:39:15 UTC
Likely a regression, I'll look at it tomorrow.
Comment 4 Till Adam 2005-10-22 20:39:54 UTC
SVN commit 473134 by tilladam:

Make the extended permissions dialog work again for people without acl
support.

BUG: 114731


 M  +1 -1      kpropertiesdialog.cpp  


--- branches/KDE/3.5/kdelibs/kio/kfile/kpropertiesdialog.cpp #473133:473134
@@ -2080,9 +2080,9 @@
     if ( properties->items().first()->isDir() )
       extendedACLs->setAllowDefaults( true );
   }
+#endif
   if (dlg.exec() != KDialogBase::Accepted)
     return;
-#endif
 
   mode_t andPermissions = mode_t(~0);
   mode_t orPermissions = 0;
Comment 5 2005-10-24 10:12:25 UTC
I continue having the same problem.
I dont think this has anything to do with libacl since i always libacl installed.
Comment 6 Harm van Bakel 2005-12-02 19:20:54 UTC
I have the same problem, using kde 3.5 final
Comment 7 Kde 2005-12-02 21:46:38 UTC
Having the same problems here. SUSE 10 final using KDE 3.5 final. Standard everything (kernel, etc.) apart from the upgrade to KDE 3.5.
Happens on 32 and 64 bit.
Comment 8 Till Adam 2005-12-08 10:51:55 UTC
Can you guys check whether your filesystem is mounted with support for ACLs or not? 
Comment 9 2005-12-08 16:03:25 UTC
I have build with ACL support
Comment 10 Till Adam 2005-12-08 16:19:31 UTC
I know, that's not what I asked. Are your partitions mounted with acl support? Check /etc/fstab, please.
Comment 11 2005-12-08 16:48:50 UTC
Partitions mounted with ACL?
My fstab is like always, theres no ACL.
Comment 12 Rex Dieter 2005-12-12 17:40:02 UTC
*** Bug 117249 has been marked as a duplicate of this bug. ***
Comment 13 Rex Dieter 2005-12-12 18:46:37 UTC
Confirmed (kde-3.5.0) that problem goes away when mounting filesystem with 'acl' option.  

There's still a bug here, in that the user should not be presented with an empty error when the acl mount option is not used.
Comment 14 Thiago Macieira 2005-12-15 14:36:57 UTC
*** Bug 118376 has been marked as a duplicate of this bug. ***
Comment 15 Thiago Macieira 2005-12-15 14:37:19 UTC
*** Bug 117984 has been marked as a duplicate of this bug. ***
Comment 16 James Spencer 2005-12-15 15:53:03 UTC
"There's still a bug here, in that the user should not be presented with an empty error when the acl mount option is not used."

I'm being bitten by this. I running the KDE 3.5.0 packages for Debian unstable available on alioth. It affects all filesystems, my primary filesystem is ext3, mounted with the 'noatime' option.

I get the message: "Error: /path/to/file/goes/here". If I launch konqueror from konsole there is no aditional output. The bug hits regardless of the # of files selected, how they were selected, and under the default and advanced view. Fortunately chmod is my friend, but users who aren't fond of chmod might find this behaviour highly annoying (Especially if they don't have a use for ACLs or know what they are). I'd love to see a fix for this in 3.5.1.

Random musing: Given all of the talk on the dot recently about automated QA testing, mounting and unmounting filesystems with various options and playing with their premissions might be a good candidate for automation :)
Comment 17 Till Adam 2005-12-17 16:59:09 UTC
I'm still having a hard time reproducing this. For the people seeing this, are you on Linux systems,  or something else? Also, can you please try with the properties dialog tester in kio/tests whether you can reproduce it with that one as well?
Comment 18 James Spencer 2005-12-21 14:23:29 UTC
For the people seeing this, are you on Linux systems,  or something else?

Linux / Debian (Unstable) / Alioth KDE Packages

Also, can you please try with the properties dialog tester in kio/tests whether you can reproduce it with that one as well?

I'd be happy to, but:
-I'm away from my computer (holidays).
-I have no idea where / what the 'properties dialogue tester' is, and more importantly where to find it [I'd like to think I could figure out how to use it :) ].

When I get back in the new year, I'll update my system (see if kde 3.5 made it into unstable), and test vs. whatever instructions are here.
Comment 19 Rex Dieter 2005-12-21 14:36:59 UTC
Re: comment #17, 
Linux?  Yes, Redhat Enterprise/Fedora Core
Comment 20 Sebastian Reitenbach 2005-12-21 15:11:22 UTC
Re: comment +17,

Linux? yes SuSE 9.3
the filesystem with the ACL's is a nfs mounted volume
Comment 21 2005-12-22 13:20:35 UTC
In reply to Comment #17.
Already said previously that i use Mandriva 2006 with kde-3.5.0 from branch_3.5

Can you please explain what you mean with "please try with the properties dialog tester in kio/tests".

I dont get why with all people happens this error and it doesnt happens with you, it seams youre not using kde-3.5.0.
Comment 22 Till Adam 2006-01-16 21:07:55 UTC
There is a little test program in kdelibs/kio/tests called kpropsdlgtest, which you can use to start a propertiesdialog on a file outside of konqueror. It's not compiled by default, I think, but you can compile it by going into the kio/tests directory and issuing a "make kpropsdlgtest" there. Then you can run it by giving it a file to show the properties for as an argument. And I am in fact running 3.5 branch here.
Comment 23 2006-01-18 01:15:56 UTC
that isnt possible, after i do make kpropsdlgtest i got pages and pages of errors; see just this last part:

/usr/include/kpropertiesdialog.h:154: error: 'KPropertiesDialog::KPropertiesDialog(const KURL&, QWidget*, const char*, bool, bool)' is private
kpropsdlgtest.cpp:31: error: within this context
kpropsdlgtest.cpp:32: error: 'class KPropertiesDialog' has no member named 'exec'
/usr/include/kio/global.h: At global scope:
/usr/include/kio/global.h:106: error: storage size of 'KIO::calculateRemaining'

But i dont see what is your doubt, many users have reported this problem, so this doesnt happens just by random.
The problem is when changing a file or files permissions, and if selecting severall files, just the first permissions file are changed and of course, dont forget that always apepars an error window that shows the path of the file in question.
Comment 24 2006-02-03 07:23:08 UTC
It seams impossible that have passed an entire kde version and this problem continues existing.

Till why cant you reproduce this?
Dont you know how to just disable ACL option in fstab, or just remount partitions without acl option?

Due to this im forced to remove ACL build support to kde, to dont have more users complaining about MDE mandriva kde rpms.

Its a pitty that kde cant just do things for distros that dont have ACL enabled by default...
Comment 25 Till Adam 2006-02-03 08:00:21 UTC
> Till why cant you reproduce this? 
> Dont you know how to just disable ACL option in fstab, or just remount
> partitions without acl option? 

Of course I tried that, and it works fine here. I've also tried various file systems which don't have acl support at all, and those didn't cause problems either. If you can give me access to a system which shows this, I can debug it further.
Comment 26 2006-02-03 09:41:55 UTC
As you know i use mandriva 2006 and all that use it have this kind of problem, 
if u dont know anyone who haves in last case u can access mine.
Comment 27 Till Adam 2006-02-03 12:20:42 UTC
SVN commit 505171 by tilladam:

Make sure that if a filesystem is not mounted with acl support, but the
acl support is compiled in, the metadata for acl setting is not set,
thus preventing and error on save, and as a result of that failure to
set permissions for all but the first file (in the multiple files case).

Thanks David, for helping me out with a Mandrake system that showed
this.

BUG: 114731


 M  +25 -14    kpropertiesdialog.cpp  


--- branches/KDE/3.5/kdelibs/kio/kfile/kpropertiesdialog.cpp #505170:505171
@@ -1493,6 +1493,7 @@
   bool hasExtendedACL;
   KACL extendedACL;
   KACL defaultACL;
+  bool fileSystemSupportsACLs;
 };
 
 #define UniOwner    (S_IRUSR|S_IWUSR|S_IXUSR)
@@ -1550,6 +1551,7 @@
   d->hasExtendedACL = item->ACL().isExtended() || item->defaultACL().isValid();
   d->extendedACL = item->ACL();
   d->defaultACL = item->defaultACL();
+  d->fileSystemSupportsACLs = false;
 
   if ( properties->items().count() > 1 )
   {
@@ -1849,6 +1851,22 @@
   box->addStretch (10);
 }
 
+#ifdef USE_POSIX_ACL
+static bool fileSystemSupportsACL( const QCString& pathCString )
+{
+    bool fileSystemSupportsACLs = false;
+#ifdef Q_OS_FREEBSD
+    struct statfs buf;
+    fileSystemSupportsACLs = ( statfs( pathCString.data(), &buf ) == 0 ) && ( buf.f_flags & MNT_ACLS );
+#else
+    fileSystemSupportsACLs =
+      getxattr( pathCString.data(), "system.posix_acl_access", NULL, 0 ) >= 0 || errno == ENODATA;
+#endif
+    return fileSystemSupportsACLs;
+}
+#endif
+
+
 void KFilePermissionsPropsPlugin::slotShowAdvancedPermissions() {
 
   bool isDir = (d->pmode == PermissionsOnlyDirs) || (d->pmode == PermissionsMixed);
@@ -2053,20 +2071,13 @@
 
 #ifdef USE_POSIX_ACL
   KACLEditWidget *extendedACLs = 0;
-  bool fileSystemSupportsACLs = false;
 
   // FIXME make it work with partial entries
   if ( properties->items().count() == 1 ) {
-    QCString pathCString = QFile::encodeName( properties->item()->url().path() );
-#ifdef Q_OS_FREEBSD
-    struct statfs buf;
-    fileSystemSupportsACLs = ( statfs( pathCString.data(), &buf ) == 0 ) && ( buf.f_flags & MNT_ACLS );
-#else
-    fileSystemSupportsACLs =
-      getxattr( pathCString.data(), "system.posix_acl_access", NULL, 0 ) >= 0 || errno == ENODATA;
-#endif
+      QCString pathCString = QFile::encodeName( properties->item()->url().path() );
+      d->fileSystemSupportsACLs = fileSystemSupportsACL( pathCString );
   }
-  if ( fileSystemSupportsACLs  ) {
+  if ( d->fileSystemSupportsACLs  ) {
     std::for_each( theNotSpecials.begin(), theNotSpecials.end(), std::mem_fun( &QWidget::hide ) );
     extendedACLs = new KACLEditWidget( mainVBox );
     if ( d->extendedACL.isValid() && d->extendedACL.isExtended() )
@@ -2465,9 +2476,9 @@
   if (files.count() > 0) {
     job = KIO::chmod( files, orFilePermissions, ~andFilePermissions,
         owner, group, false );
-    if ( ACLChange )
+    if ( ACLChange && d->fileSystemSupportsACLs )
       job->addMetaData( "ACL_STRING", d->extendedACL.isValid()?d->extendedACL.asString():"ACL_DELETE" );
-    if ( defaultACLChange )
+    if ( defaultACLChange && d->fileSystemSupportsACLs )
       job->addMetaData( "DEFAULT_ACL_STRING", d->defaultACL.isValid()?d->defaultACL.asString():"ACL_DELETE" );
 
     connect( job, SIGNAL( result( KIO::Job * ) ),
@@ -2481,9 +2492,9 @@
   if (dirs.count() > 0) {
     job = KIO::chmod( dirs, orDirPermissions, ~andDirPermissions,
         owner, group, recursive );
-    if ( ACLChange )
+    if ( ACLChange && d->fileSystemSupportsACLs )
       job->addMetaData( "ACL_STRING", d->extendedACL.isValid()?d->extendedACL.asString():"ACL_DELETE" );
-    if ( defaultACLChange )
+    if ( defaultACLChange && d->fileSystemSupportsACLs )
       job->addMetaData( "DEFAULT_ACL_STRING", d->defaultACL.isValid()?d->defaultACL.asString():"ACL_DELETE" );
 
     connect( job, SIGNAL( result( KIO::Job * ) ),
Comment 28 Thiago Macieira 2006-02-04 15:46:38 UTC
For the record, I cannot reproduce the problem on a Mandriva 2006 system, on KDE 3.5 r500000 (i.e., before the latest fix). I've tried on filesystems mounted with and without acl support.

Everything just worked fine.
Comment 29 2006-02-04 17:50:33 UTC
If you didnt had any probs its because or build kde with libacl-devel 
installed and with that would have problems unless you would mount partitions 
with acl option (adding it to fstab or through mcc), or just build kde 
without libacl-devel installed in mandriva system, then there it all would 
run ok like i was forced to do, build kde without ACL.
Comment 30 Thiago Macieira 2006-02-07 19:20:49 UTC
It's built with libacl.
Comment 31 Kde 2006-02-10 18:23:33 UTC
This is still broken under KDE 3.5.1 on SUSE 10.0 on x86_64 with a standard 64bit SUSE kernel and their default ReiserFS.
The fstab entry is:
/dev/sda2       /       reiserfs        acl,user_xattr 1 1
Comment 32 Will Stephenson 2006-02-10 18:42:18 UTC
I'll add it to the suse 3.5.1 packages.
Comment 33 mgolden 2006-03-10 04:35:25 UTC
For the record, this is still broken on 3.5.1 fedora core 4 packages.  I get the error dialog box, the permissions are changed on the first file but none of the others.
Comment 34 2006-03-10 05:21:15 UTC
Thats a fedora issue since this is already fixed for quite some time.
Comment 35 mgolden 2006-03-10 09:03:16 UTC
It might be helpful to know that I saw exactly the same bug in KDevelop when I used the file permissions dialog there:

Open a project in KDevelop:C/C++. (Again, I'm using Fedora Core 4, updated)
Open the File Selector.
Right click on some file or other.
Choose Properties.
Go to Permissions tab.
Change a permission.
Click OK.
Listen to glass breaking.

Assuming it's a Fedora issue, where should we be looking?
Comment 36 Rex Dieter 2006-03-10 15:54:20 UTC
Re: comment #34
> Thats a fedora issue since this is already fixed for quite some time. 

Since it was fixed only *after* kde-3.5.1 was released, IMO that doesn't count as "quite some time".
Comment 37 Jens Dagerbo 2006-03-10 23:01:36 UTC
*** Bug 123368 has been marked as a duplicate of this bug. ***