gnome-user-share r242 - in trunk: . data src
- From: hadess svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-user-share r242 - in trunk: . data src
- Date: Tue, 22 Apr 2008 10:19:41 +0100 (BST)
Author: hadess
Date: Tue Apr 22 09:19:41 2008
New Revision: 242
URL: http://svn.gnome.org/viewvc/gnome-user-share?rev=242&view=rev
Log:
2008-04-15 Baptiste Mille-Mathias <baptiste millemathias gmail com>
* data/dav_user_2.0.conf:
* data/dav_user_2.2.conf.in:
* src/file-share-properties.c (write_out_password):
* src/http.c (ensure_conf_dir), (spawn_httpd):
* src/user_share.c (migrate_old_configuration), (main):
move the configuration to Freedesktop
compliant location (Closes: #519058)
Modified:
trunk/ChangeLog
trunk/data/dav_user_2.0.conf
trunk/data/dav_user_2.2.conf.in
trunk/src/file-share-properties.c
trunk/src/http.c
trunk/src/user_share.c
Modified: trunk/data/dav_user_2.0.conf
==============================================================================
--- trunk/data/dav_user_2.0.conf (original)
+++ trunk/data/dav_user_2.0.conf Tue Apr 22 09:19:41 2008
@@ -1,4 +1,4 @@
-ServerRoot ${HOME}/.gnome2/user-share
+ServerRoot ${XDG_CONFIG_HOME}/user-share
PidFile pid
LockFile lock
LogLevel crit
@@ -20,7 +20,7 @@
AuthType Digest
AuthName "Please log in as the user guest"
AuthDigestDomain /
- AuthDigestFile ${HOME}/.gnome2/user-share/passwd
+ AuthDigestFile ${XDG_CONFIG_HOME}/user-share/passwd
<IfDefine RequirePasswordAlways>
Modified: trunk/data/dav_user_2.2.conf.in
==============================================================================
--- trunk/data/dav_user_2.2.conf.in (original)
+++ trunk/data/dav_user_2.2.conf.in Tue Apr 22 09:19:41 2008
@@ -1,4 +1,4 @@
-ServerRoot ${HOME}/.gnome2/user-share
+ServerRoot ${XDG_CONFIG_HOME}/user-share
PidFile pid
LockFile lock
LogLevel crit
@@ -24,7 +24,7 @@
AuthDigestDomain /
AuthDigestProvider file
- AuthUserFile ${HOME}/.gnome2/user-share/passwd
+ AuthUserFile ${XDG_CONFIG_HOME}/user-share/passwd
AuthGroupFile @DATADIR@/gnome-user-share/dav_groupfile
Modified: trunk/src/file-share-properties.c
==============================================================================
--- trunk/src/file-share-properties.c (original)
+++ trunk/src/file-share-properties.c Tue Apr 22 09:19:41 2008
@@ -53,7 +53,7 @@
line = g_strdup_printf ("%s:%s:%s\n", USER, REALM, ascii_digest);
g_free (ascii_digest);
- filename = g_build_filename (g_get_home_dir (), ".gnome2/user-share/passwd", NULL);
+ filename = g_build_filename (g_get_user_config_dir (), "user-share", "passwd", NULL);
file = fopen (filename, "w");
if (file != NULL) {
Modified: trunk/src/http.c
==============================================================================
--- trunk/src/http.c (original)
+++ trunk/src/http.c Tue Apr 22 09:19:41 2008
@@ -429,7 +429,7 @@
{
char *dirname;
- dirname = g_build_filename (g_get_home_dir (), ".gnome2", "user-share", NULL);
+ dirname = g_build_filename (g_get_user_config_dir (), "user-share", NULL);
g_mkdir_with_parents (dirname, 0755);
g_free (dirname);
}
@@ -455,7 +455,7 @@
static gboolean
spawn_httpd (int port, pid_t *pid_out)
{
- char *free1, *free2, *free3;
+ char *free1, *free2, *free3, *free4;
gboolean res;
char *argv[10];
char *env[10];
@@ -499,12 +499,13 @@
argv[i] = NULL;
i = 0;
- free2 = env[i++] = g_strdup_printf("HOME=%s", g_get_home_dir());
- free3 = env[i++] = g_strdup_printf("XDG_PUBLICSHARE_DIR=%s", public_dir);
+ free2 = env[i++] = g_strdup_printf ("HOME=%s", g_get_home_dir());
+ free3 = env[i++] = g_strdup_printf ("XDG_PUBLICSHARE_DIR=%s", public_dir);
+ free4 = env[i++] = g_strdup_printf ("XDG_CONFIG_HOME=%s", g_get_user_config_dir ());
env[i++] = "LANG=C";
env[i] = NULL;
- pid_filename = g_build_filename (g_get_home_dir (), ".gnome2/user-share/pid", NULL);
+ pid_filename = g_build_filename (g_get_user_config_dir (), "user-share", "pid", NULL);
/* Remove pid file before spawning to avoid races with child and old pidfile */
unlink (pid_filename);
@@ -519,6 +520,7 @@
g_free (free1);
g_free (free2);
g_free (free3);
+ g_free (free4);
g_free (public_dir);
if (!res) {
Modified: trunk/src/user_share.c
==============================================================================
--- trunk/src/user_share.c (original)
+++ trunk/src/user_share.c Tue Apr 22 09:19:41 2008
@@ -80,6 +80,20 @@
}
static void
+migrate_old_configuration (void)
+{
+ const char *old_config_dir;
+ const char *new_config_dir;
+
+ old_config_dir = g_build_filename (g_get_home_dir (), ".gnome2", "user-share", NULL);
+ new_config_dir = g_build_filename (g_get_user_config_dir (), "user-share", NULL);
+ if (g_file_test (old_config_dir, G_FILE_TEST_IS_DIR)) {
+ g_rename (old_config_dir, new_config_dir);
+ }
+
+}
+
+static void
require_password_changed (GConfClient* client,
guint cnxn_id,
GConfEntry *entry,
@@ -276,6 +290,8 @@
return 1;
}
+ migrate_old_configuration ();
+
client = gconf_client_get_default ();
if (gconf_client_get_bool (client, FILE_SHARING_ENABLED, NULL) == FALSE &&
gconf_client_get_bool (client, FILE_SHARING_BLUETOOTH_ENABLED, NULL) == FALSE &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]