[grisbi-bugs] [Grisbi 0001625]: Locking in /tmp is wrong

Grisbi Bug Tracker bugtracker at grisbi.org
Mer 24 Avr 10:40:48 CEST 2019


The following issue has been RESOLVED. 
====================================================================== 
http://www.grisbi.org/bugsreports/view.php?id=1625 
====================================================================== 
Reported By:                rainglasz
Assigned To:                LudovicRousseau
====================================================================== 
Project:                    Grisbi
Issue ID:                   1625
Category:                   Main
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     resolved
OS:                         Tous(All) 
Unstable Impact:            Yes 
Version OS:                 Wheezy and WinXP 
Version GTK:                 
Resolution:                 fixed
Fixed in Version:           development (git)
====================================================================== 
Date Submitted:             2013-12-12 22:23 CET
Last Modified:              2019-04-24 10:40 CEST
====================================================================== 
Summary:                    Locking in /tmp is wrong
Description: 
A lockfile is created in /tmp (or whatever TEMPDIR is) using the original
filename.
If a data file thus locked is accessed from a remote computer via a file share,
the lock is not honored.
Moreover, two users on a multiuser system using the same name for different data
files get locked out.

Steps to Reproduce: 
- Open grisbi file on Linux
- Open on different computer, e.g. Windows via SMB
- change in both
- save both 
- no lock message, data from the first is lost

Additional Information: 
The lockfile **must** be created in the directory where the datafile is.
====================================================================== 

---------------------------------------------------------------------- 
 (0003706) rainglasz (reporter) - 2013-12-22 16:07
 http://www.grisbi.org/bugsreports/view.php?id=1625#c3706 
---------------------------------------------------------------------- 
On Linux, one would write the PID to the lock file as to easily detect stale
lock files if there is not process with that PID.
No idea if this works on Windows.

 

---------------------------------------------------------------------- 
 (0005028) LudovicRousseau (developer) - 2019-04-22 00:04
 http://www.grisbi.org/bugsreports/view.php?id=1625#c5028 
---------------------------------------------------------------------- 
Grisbi uses g_get_tmp_dir() to get the name of the temporary directory.
https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-tmp-dir

Maybe Grisbi should store the lock file in the same directory as the .gsb file.
That is a good idea. 

---------------------------------------------------------------------- 
 (0005029) LudovicRousseau (developer) - 2019-04-22 15:18
 http://www.grisbi.org/bugsreports/view.php?id=1625#c5029 
---------------------------------------------------------------------- 
Fix proposal in https://github.com/grisbi/grisbi/pull/35 

---------------------------------------------------------------------- 
 (0005039) LudovicRousseau (developer) - 2019-04-24 10:40
 http://www.grisbi.org/bugsreports/view.php?id=1625#c5039 
---------------------------------------------------------------------- 
Fixed in
https://github.com/grisbi/grisbi/commit/8ed61ecba952ed4b334b8f8bd61e732c90741937


Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-12-12 22:23 rainglasz      New Issue                                    
2013-12-12 22:45 rainglasz      Note Added: 0003706                          
2013-12-22 16:07 rainglasz      Note Edited: 0003706                         
2019-04-22 00:04 LudovicRousseauNote Added: 0005028                          
2019-04-22 00:04 LudovicRousseauStatus                   new => acknowledged 
2019-04-22 00:04 LudovicRousseauAssigned To               => LudovicRousseau 
2019-04-22 00:04 LudovicRousseauStatus                   acknowledged =>
assigned
2019-04-22 15:18 LudovicRousseauNote Added: 0005029                          
2019-04-24 10:40 LudovicRousseauStatus                   assigned => resolved
2019-04-24 10:40 LudovicRousseauResolution               open => fixed       
2019-04-24 10:40 LudovicRousseauFixed in Version          => development (git)
2019-04-24 10:40 LudovicRousseauNote Added: 0005039                          
======================================================================



Plus d'informations sur la liste de diffusion bugsreports