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

Grisbi Bug Tracker bugtracker at grisbi.org
Lun 22 Avr 00:04:43 CEST 2019


The following issue has been ASSIGNED. 
====================================================================== 
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:                     assigned
OS:                         Tous(All) 
Unstable Impact:            Yes 
Version OS:                 Wheezy and WinXP 
Version GTK:                 
====================================================================== 
Date Submitted:             2013-12-12 22:23 CET
Last Modified:              2019-04-22 00:04 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. 

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
======================================================================



Plus d'informations sur la liste de diffusion bugsreports