From 8f714033acc23dfbd252617806287fb1b7be7ae5 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 6 Mar 2006 20:58:08 +0000 Subject: [PATCH] Fixed chmod on home (now chmod is not executed when a directory is user's home) --- src/common/weechat.c | 10 ++++++++-- weechat/src/common/weechat.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/common/weechat.c b/src/common/weechat.c index d94878514..7acf4d5d3 100644 --- a/src/common/weechat.c +++ b/src/common/weechat.c @@ -750,7 +750,10 @@ weechat_create_config_dirs () dir1 = weechat_strreplace (cfg_log_path, "~", getenv ("HOME")); dir2 = weechat_strreplace (dir1, "%h", weechat_home); if (weechat_create_dir (dir2)) - chmod (dir2, 0700); + { + if (strcmp (dir2, getenv ("HOME")) != 0) + chmod (dir2, 0700); + } else fprintf (stderr, _("%s unable to create \"%s\" directory\n"), WEECHAT_WARNING, dir2); @@ -763,7 +766,10 @@ weechat_create_config_dirs () dir1 = weechat_strreplace (cfg_dcc_download_path, "~", getenv ("HOME")); dir2 = weechat_strreplace (dir1, "%h", weechat_home); if (weechat_create_dir (dir2)) - chmod (dir2, 0700); + { + if (strcmp (dir2, getenv ("HOME")) != 0) + chmod (dir2, 0700); + } else fprintf (stderr, _("%s unable to create \"%s\" directory\n"), WEECHAT_WARNING, dir2); diff --git a/weechat/src/common/weechat.c b/weechat/src/common/weechat.c index d94878514..7acf4d5d3 100644 --- a/weechat/src/common/weechat.c +++ b/weechat/src/common/weechat.c @@ -750,7 +750,10 @@ weechat_create_config_dirs () dir1 = weechat_strreplace (cfg_log_path, "~", getenv ("HOME")); dir2 = weechat_strreplace (dir1, "%h", weechat_home); if (weechat_create_dir (dir2)) - chmod (dir2, 0700); + { + if (strcmp (dir2, getenv ("HOME")) != 0) + chmod (dir2, 0700); + } else fprintf (stderr, _("%s unable to create \"%s\" directory\n"), WEECHAT_WARNING, dir2); @@ -763,7 +766,10 @@ weechat_create_config_dirs () dir1 = weechat_strreplace (cfg_dcc_download_path, "~", getenv ("HOME")); dir2 = weechat_strreplace (dir1, "%h", weechat_home); if (weechat_create_dir (dir2)) - chmod (dir2, 0700); + { + if (strcmp (dir2, getenv ("HOME")) != 0) + chmod (dir2, 0700); + } else fprintf (stderr, _("%s unable to create \"%s\" directory\n"), WEECHAT_WARNING, dir2);