Bug 97335 - Creating a (read-only) file resource for a file owned by a different user not possible in kaddressbook
Summary: Creating a (read-only) file resource for a file owned by a different user not...
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-18 13:42 UTC by Reinhold Kainhofer
Modified: 2009-08-05 16:21 UTC (History)
0 users

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 Reinhold Kainhofer 2005-01-18 13:42:58 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

I have a vcf file and the kde accounts file on my harddisk owned by user and group reinhold. The permissions are:
-rw-r--r--   1 reinhold reinhold 12139 Jan 18 13:37 Institut.vcf
-rw-r--r--   1 reinhold reinhold 64457 Jan 18 13:35 accounts

As user kdetest (who has read-only permissions to the above files) I try to add a new file resource in kaddressbook for these files (and mark them as read-only). After pressing OK in the Resource configuration dialog, nothing happens: The new resource is not added, but also no error dialog appears.

As soon as I make the file writable for the user kdetest (e.g. by setting the permissions to 666 or changing the owner to kdetest), things work as usual.

Cheers,
Reinhold
Comment 1 Tobias Koenig 2005-01-19 16:37:41 UTC
CVS commit by tokoe: 

Open file in read-only mode when we've no write access.
Fixes #97335

BUG:97335


  M +7 -2      resourcefile.cpp   1.34


--- kdelibs/kabc/plugins/file/resourcefile.cpp  #1.33:1.34
@@ -178,6 +178,11 @@ bool ResourceFile::doOpen()
     return ok;
   } else {
+    if ( readOnly() ) {
+      if ( !file.open( IO_ReadOnly ) )
+        return false;
+    } else {
     if ( !file.open( IO_ReadWrite ) )
       return false;
+    }
 
     if ( file.size() == 0 ) {


Comment 2 Tobias Koenig 2009-08-05 16:21:47 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.