Bug 151572 - The first start of net/tucan failed because it can't write its configuration.
Summary: The first start of net/tucan failed because it can't write its configuration.
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: Matthias Andree
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-19 08:20 UTC by Posé Sébastien
Modified: 2011-05-22 22:30 UTC (History)
0 users

See Also:


Attachments
tucan.diff (1003 bytes, patch)
2010-11-21 10:59 UTC, gustau.perez
no flags Details | Diff
tucan_chmod.shar (12.46 KB, text/plain)
2010-11-24 06:59 UTC, gustau.perez
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Posé Sébastien 2010-10-19 08:20:07 UTC
When tucan starts the first time, it copies configurations files from /usr/local/share/tucan/default_plugins to the user home directory (~/.tucan/plugins/). Then the wizard starts and try to save plugins configurations and failed.

Configurations files (service.conf) are not writable by the user:
.tucan/plugins/megaupload:
total 42
-r--r--r--  1 seb  seb     0  7 oct  2009 __init__.py
-r--r--r--  1 seb  seb   134 18 oct 11:59 __init__.pyc
-r--r--r--  1 seb  seb  2055  7 oct  2009 anonymous_download.py
-r--r--r--  1 seb  seb  2328 18 oct 11:59 anonymous_download.pyc
-r--r--r--  1 seb  seb  3065  7 oct  2009 captcha.py
-r--r--r--  1 seb  seb  3351 18 oct 11:59 captcha.pyc
-r--r--r--  1 seb  seb  1938  7 oct  2009 check_links.py
-r--r--r--  1 seb  seb  1812 18 oct 11:59 check_links.pyc
-r--r--r--  1 seb  seb   318  7 oct  2009 favicon_megaupload.ico
-r--r--r--  1 seb  seb  1424  7 oct  2009 premium_cookie.py
-r--r--r--  1 seb  seb  1054 18 oct 11:59 premium_cookie.pyc
-r--r--r--  1 seb  seb  2078  7 oct  2009 premium_download.py
-r--r--r--  1 seb  seb  2095 18 oct 11:59 premium_download.pyc
-r--r--r--  1 seb  seb  2003  7 oct  2009 premium_parser.py
-r--r--r--  1 seb  seb  1909 18 oct 11:59 premium_parser.pyc
-r--r--r--  1 seb  seb   360 18 oct 11:59 service.conf

.tucan/plugins/rapidshare:
total 30
-r--r--r--  1 seb  seb     0  7 oct  2009 __init__.py
-r--r--r--  1 seb  seb   134 18 oct 11:59 __init__.pyc
-r--r--r--  1 seb  seb  2638  7 oct  2009 anonymous_download.py
-r--r--r--  1 seb  seb  3187 18 oct 11:59 anonymous_download.pyc
-r--r--r--  1 seb  seb  1629  7 oct  2009 check_links.py
-r--r--r--  1 seb  seb  1307 18 oct 11:59 check_links.pyc
-r--r--r--  1 seb  seb  1150  7 oct  2009 favicon_rapidshare.ico
-r--r--r--  1 seb  seb  1540  7 oct  2009 premium_cookie.py
-r--r--r--  1 seb  seb  1179 18 oct 11:59 premium_cookie.pyc
-r--r--r--  1 seb  seb  2779  7 oct  2009 premium_download.py
-r--r--r--  1 seb  seb  3334 18 oct 11:59 premium_download.pyc
-r--r--r--  1 seb  seb   361 18 oct 11:59 service.conf

Fix: 

A solution is to add write permission to /usr/local/share/tucan/default_plugins/**/service.conf
Then, you can remove your ~/.tucan and restart the wizard.
How-To-Repeat: Install tucan, start it, and try to complete the wizard.
Comment 1 Tilman Keskinoz freebsd_committer freebsd_triage 2010-11-17 12:44:57 UTC
Hello,

I shortly looked at this problem and the bug is in the upstream software 
in core/config.py.
In line 79 shutil.copytree is used, afterwards the permissions should
be checked and changed if necessary.

Gustau, can you submit this upstream?

Another issue with the port, the COMMENT= is not really descriptive.
Comment 2 gustau.perez 2010-11-21 10:13:47 UTC
    I'll take a look at it as soon as possible.
Comment 3 gustau.perez 2010-11-21 10:59:36 UTC
   This diff should do the trick. I had to use a custom ${FIND} because 
COPYTREE-* change the bits (i think it's because ${SHAREMODE} and I 
don't want to mess with those.

   Best regards,

   Gus
Comment 4 Tilman Keskinoz freebsd_committer freebsd_triage 2010-11-23 14:31:05 UTC
As posted before,

Changing the mode of the files in DATADIR is not the right solution.
config.py should be modified to do the right thing.
Comment 5 gustau.perez 2010-11-24 06:59:23 UTC
   I'm attaching a new shar file that contains the changes to the port. 
It adds a file directory with a patch that changes permissions to each 
service.conf with python when saving a service. I guess it also does the 
permission changes when a service gets updated.

    I tested it with a user without configured-tucan (rm -fr ~/.tucan) 
and seems to work. It also changes the COMMENT entry in the port's 
makefile.

   Please test and commit.
Comment 6 Matthias Andree freebsd_committer freebsd_triage 2011-05-22 18:22:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->mandree

I'll take it.
Comment 7 dfilter service freebsd_committer freebsd_triage 2011-05-22 22:24:12 UTC
mandree     2011-05-22 21:24:04 UTC

  FreeBSD ports repository

  Modified files:
    net/tucan            Makefile pkg-descr 
  Added files:
    net/tucan/files      patch-core__service_config.py 
  Log:
  - Fix first-start failure by correcting permissions in ~/.tucan
    (adds files/patch-core__service_config.py).
  - Bump PORTREVISION.
  - As the README says 'requires Python 2.5', state so in Makefile.
  - Modify COMMENT (maintainer note: limit 70 characters).
  - Remove *.orig file leftover from patching, to avoid installing it
    (it's not in pkg-plist)
  - Upgrade to newer upstream release shelved pending further maintainer
    PR (he rejected ports/155563 and wants to do his own).
  
  Reported by: Posé Sébastien <sebastien.pose@gmail.com>
  Fixed by:    Gustau Pérez <gustau.perez@gmail.com> (maintainer)
  PR:          ports/151572
  
  Revision  Changes    Path
  1.5       +10 -3     ports/net/tucan/Makefile
  1.1       +19 -0     ports/net/tucan/files/patch-core__service_config.py (new)
  1.2       +9 -2      ports/net/tucan/pkg-descr
_______________________________________________
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 8 Matthias Andree freebsd_committer freebsd_triage 2011-05-22 22:24:26 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!