Bug 126767 - [patch] german/tipp10: fix problem with not writable database
Summary: [patch] german/tipp10: fix problem with not writable database
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Rong-En Fan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-23 16:20 UTC by Heiner
Modified: 2008-08-24 10:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiner 2008-08-23 16:20:02 UTC
Lucius Windschuh reported, that an ordinary ueser does not have write access 
to the tipp10 database (thanks for the report). The reason is, that the 
database template copied into the users directory has the access mode 444. 
The attached patch corrects this.

Heiner

Fix: See the attached patch. It just adds a file into the files directory


--Boundary-00=_NOCsIbUUf0ctCRM
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="tipp10.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="tipp10.diff"



--Boundary-00=_NOCsIbUUf0ctCRM----HIrtr8HkLhtTLxz2vZpsC3orQjYNPlwj2r2wcPc1brzAdk5s
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -urN ../tipp10.orig/files/patch-sql-connection.h ./files/patch-sql-connection.h
--- ../tipp10.orig/files/patch-sql-connection.h	1970-01-01 01:00:00.000000000 +0100
+++ ./files/patch-sql-connection.h	2008-08-21 23:02:09.000000000 +0200
@@ -0,0 +1,18 @@
+--- sql/connection.h.orig	2008-08-21 22:44:33.000000000 +0200
++++ sql/connection.h	2008-08-21 22:59:21.000000000 +0200
+@@ -170,6 +170,7 @@
+ 				// -> copy database to user home dir
+ 				QFile file(QCoreApplication::applicationDirPath() + "/" + dbNameTemplate);
+ 				if (file.copy(dbPath)) {
++					QFile::setPermissions(dbPath, QFile::permissions(dbPath) | QFile::WriteUser);
+ 					dbExist = true;
+ 				} else {
+ 					ErrorMessage *errorMessage = new ErrorMessage();
+@@ -201,6 +202,7 @@
+ 				dir.cd("tipp10");
+ 				QFile file(dbPath);
+ 				if (file.copy(dir.path() + "/" + dbNameUser)) {
++					QFile::setPermissions(dir.path() + "/" + dbNameUser, QFile::permissions(dir.path() + "/" + dbNameUser) | QFile::WriteUser);
+ 					dbPath = dir.path() + "/" + dbNameUser;
+ 				} else {
+ 					ErrorMessage *errorMessage = new ErrorMessage();
Comment 1 Rong-En Fan freebsd_committer freebsd_triage 2008-08-24 07:14:02 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rafan

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2008-08-24 09:55:17 UTC
rafan       2008-08-24 08:55:09 UTC

  FreeBSD ports repository

  Modified files:
    german/tipp10        Makefile 
  Added files:
    german/tipp10/files  patch-sql-connection.h 
  Log:
  - Fix readonly database problem
  - Bump PORTREVISION
  
  PR:             ports/126767
  Submitted by:   Heiner <h.eichmann at gmx.de> (maintainer)
  
  Revision  Changes    Path
  1.4       +1 -1      ports/german/tipp10/Makefile
  1.1       +18 -0     ports/german/tipp10/files/patch-sql-connection.h (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 3 Rong-En Fan freebsd_committer freebsd_triage 2008-08-24 10:05:52 UTC
State Changed
From-To: open->closed

Committed. Thanks!