diff lib/config_file.c @ 58:c01d91c10f6c

2002-11-20 Brian Masney <masneyb@gftp.org> * lib/protocols.c lib/gftp.h - added gftp_get_line(), gftp_read(), gftp_write(), gftp_writefmt(), and gftp_set_sockblocking() functions. Added struct_gftp_getline_buffer for gftp_get_line function() * lib/cache.c lib/gftp.h lib/local.c lib/misc.c lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/ssh.c lib/sshv2.c - *_get_file() returns off_t instead of long. *_{get,put}_next_file_chunk returns ssize_t instead of size_t. Added *_set_config_options function to gftp_request structure and protocol files. Use the new network functions documented above. Convert usage of ANSI C IO (FILE *) to standard BSD sockets so that I can use timeouts properly with select * lib/misc.c (ssh_start_login_sequence) - use gftp_set_sockblock(), gftp_read() and gftp_write() functions * lib/protocols.c - move some protocol specific code to the protocol specific files * lib/local.c - log succesful messages to gftp_logging_misc instead of gftp_logging_error * lib/cache.c - log some more error conditions to the user * lib/rfc959.c - added rfc959_getcwd(). In, rfc959_accept_active_connection(), set set socket to blocking mode before calling accept() * src/text/gftk-text.c - If we get no files in gftp_text_ls(), return instead of segfaulting * src/gtk/gftp-gtk.c - expand the port field in the toolbar to be 45 pixels wide * src/text/gftp-text.c src/gtk/misc-gtk.c src/gtk/transfer.c src/gtk/view_dialog.c - changes for conversion of request->{sock,data} from ANSI C IO (FILE *) to standard BSD sockets
author masneyb
date Thu, 21 Nov 2002 00:33:51 +0000
parents a12bcbc2fce4
children 618423504fe0
line wrap: on
line diff
--- a/lib/config_file.c	Tue Nov 12 00:04:44 2002 +0000
+++ b/lib/config_file.c	Thu Nov 21 00:33:51 2002 +0000
@@ -248,7 +248,7 @@
       temp1str = expand_path (BASE_CONF_DIR);
       if (access (temp1str, F_OK) == -1)
 	{
-	  if (mkdir (temp1str, 0700) != 0)
+	  if (mkdir (temp1str, S_IRUSR | S_IWUSR | S_IXUSR) != 0)
 	    {
 	      printf (_("gFTP Error: Could not make directory %s: %s\n"),
 		      temp1str, g_strerror (errno));
@@ -268,7 +268,7 @@
       copyfile (temp1str, tempstr);
       g_free (temp1str);
     }
-  chmod (tempstr, S_IRUSR | S_IWUSR);
+
   if ((conffile = fopen (tempstr, "r")) == NULL)
     {
       printf (_("gFTP Error: Cannot open config file %s: %s\n"), CONFIG_FILE,
@@ -539,18 +539,6 @@
 
   if (access (tempstr, F_OK) == -1)
     {
-      temp1str = expand_path (BASE_CONF_DIR);
-      if (access (temp1str, F_OK) == -1)
-	{
-	  if (mkdir (temp1str, 0700) != 0)
-	    {
-	      printf (_("gFTP Error: Could not make directory %s: %s\n"),
-		      temp1str, g_strerror (errno));
-	      exit (-1);
-	    }
-	}
-      g_free (temp1str);
-
       temp1str = g_strdup_printf ("%s/bookmarks", SHARE_DIR);
       if (access (temp1str, F_OK) == -1)
 	{
@@ -562,7 +550,7 @@
       copyfile (temp1str, tempstr);
       g_free (temp1str);
     }
-  chmod (tempstr, S_IRUSR | S_IWUSR);
+
   if ((bmfile = fopen (tempstr, "r")) == NULL)
     {
       printf (_("gFTP Error: Cannot open bookmarks file %s: %s\n"), tempstr,