After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 547412 - Temporary directories not deleted
Temporary directories not deleted
Status: RESOLVED DUPLICATE of bug 720482
Product: gvfs
Classification: Core
Component: daemon
0.99.x
Other Solaris
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
: 581711 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-08-12 11:14 UTC by padraig.obriain
Modified: 2014-04-23 07:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description padraig.obriain 2008-08-12 11:14:57 UTC
After a user has logged in and logged out 6 directories whose name starts with gvfs-<username> are left. They are in /var/tmp or /tmp/<username>.

Five are created by gvfsd-trash and one by gvfsd-burn.

They are created when daemon_handle_get_connection 
calls generate_addresses.

A temporary directory whose name starts with virtual-<name> is also created. It is created by try_mount in gvfsbackendburn.c.
Comment 1 padraig.obriain 2008-08-12 12:34:02 UTC
Does gvfs need a program like linc-cleanup-sockets?
Comment 2 padraig.obriain 2008-08-13 14:38:36 UTC
I have noticed that the directory starting with virtual-<username> is empty after login.

The directories starting with gvfs-<username> contain one socket socket2 which is dead.
Comment 3 padraig.obriain 2008-08-14 10:23:13 UTC
In each of the temporary directories two sockets socket1 and socket2 are created. Subsequently socket1 is unlinked but socket2 is not.

There is a call to unlink socket2 in unix_socket_at() but this is called before the socket is created.

There is a call to rmdir the temporary directory in new_conection_data_free but this fails with EEXIST.

This call is made before socket1 is unlinked so even if socket2 were unlinked the call would this fail.
Comment 4 Matthias Clasen 2008-08-15 20:38:58 UTC
Does this patch look right and fix your problem ?

Index: daemon/gvfsdaemon.c
===================================================================
--- daemon/gvfsdaemon.c (revision 1885)
+++ daemon/gvfsdaemon.c (working copy)
@@ -684,7 +684,6 @@
   strncpy (&addr.sun_path[1], path, path_len);
 #else /* USE_ABSTRACT_SOCKETS */
   strncpy (addr.sun_path, path, path_len);
-  unlink (path);
 #endif /* ! USE_ABSTRACT_SOCKETS */

   if (bind (fd, (struct sockaddr*) &addr,
@@ -694,6 +693,10 @@
       return -1;
     }

+#ifndef USE_ABSTRACT_SOCKETS
+  unlink (path);
+#endif
+
   if (listen (fd, 30 /* backlog */) < 0)
     {
       close (fd);
Comment 5 padraig.obriain 2008-08-18 13:45:51 UTC
This patch does not fix the problem.
Comment 6 Felix Möller 2012-07-30 10:04:18 UTC
I think bug #581711 should be dupped on this one.
Comment 7 Ross Lagerwall 2013-10-30 13:27:29 UTC
*** Bug 581711 has been marked as a duplicate of this bug. ***
Comment 8 Ross Lagerwall 2014-04-23 07:33:09 UTC

*** This bug has been marked as a duplicate of bug 720482 ***