1999-08-30 Miguel de Icaza <miguel@gnu.org>

* ftpfs.c (insert_dots): Use g_new here.

	* shared_ftpfs_fish.c: Style fixes and small fixes

1999-09-22  Bjorn Eriksson <mdeans@algonet.se>

	* extfs/uzip.in: Better handling of zip-archives that contain files
	which contain spaces.
This commit is contained in:
Miguel de Icaza 1999-09-25 20:25:20 +00:00
parent af9414eca6
commit 897a4a5c6f
3 changed files with 20 additions and 10 deletions

View File

@ -1,3 +1,9 @@
1999-08-30 Miguel de Icaza <miguel@gnu.org>
* ftpfs.c (insert_dots): Use g_new here.
* shared_ftpfs_fish.c: Style fixes and small fixes
1999-09-22 Bjorn Eriksson <mdeans@algonet.se> 1999-09-22 Bjorn Eriksson <mdeans@algonet.se>
* extfs/uzip.in: Better handling of zip-archives that contain files * extfs/uzip.in: Better handling of zip-archives that contain files

View File

@ -1276,7 +1276,7 @@ insert_dots (struct linklist *file_list, struct connection *bucket)
}; };
for (i = 0; i < 2; i++ ) { for (i = 0; i < 2; i++ ) {
fe = malloc(sizeof(struct direntry)); fe = g_new (struct direntry, 1);
if (fe == NULL) if (fe == NULL)
return; return;
if (vfs_parse_ls_lga (buffer[i], &fe->s, &fe->name, &fe->linkname)) { if (vfs_parse_ls_lga (buffer[i], &fe->s, &fe->name, &fe->linkname)) {
@ -1288,9 +1288,9 @@ insert_dots (struct linklist *file_list, struct connection *bucket)
(fe->s).st_ino = bucket->__inode_counter++; (fe->s).st_ino = bucket->__inode_counter++;
if (!linklist_insert(file_list, fe)) if (!linklist_insert(file_list, fe))
free(fe); g_free(fe);
} else } else
free (fe); g_free (fe);
} }
} }

View File

@ -308,11 +308,15 @@ _get_file_entry(struct connection *bucket, char *file_name,
fmode = S_ISLNK(ent->s.st_mode) fmode = S_ISLNK(ent->s.st_mode)
? ent->l_stat->st_mode ? ent->l_stat->st_mode
: ent->s.st_mode; : ent->s.st_mode;
if (S_ISDIR(fmode)) ERRNOR (EISDIR, NULL); if (S_ISDIR(fmode))
if (!S_ISREG(fmode)) ERRNOR (EPERM, NULL); ERRNOR (EISDIR, NULL);
if ((flags & O_EXCL) && (flags & O_CREAT)) ERRNOR (EEXIST, NULL); if (!S_ISREG(fmode))
ERRNOR (EPERM, NULL);
if ((flags & O_EXCL) && (flags & O_CREAT))
ERRNOR (EEXIST, NULL);
if (ent->remote_filename == NULL) if (ent->remote_filename == NULL)
if (!(ent->remote_filename = g_strdup(file_name))) ERRNOR (ENOMEM, NULL); if (!(ent->remote_filename = g_strdup(file_name)))
ERRNOR (ENOMEM, NULL);
if (ent->local_filename == NULL || if (ent->local_filename == NULL ||
!ent->local_stat.st_mtime || !ent->local_stat.st_mtime ||
stat (ent->local_filename, &sb) < 0 || stat (ent->local_filename, &sb) < 0 ||
@ -354,8 +358,8 @@ _get_file_entry(struct connection *bucket, char *file_name,
int handle; int handle;
ent = g_new (struct direntry, 1); ent = g_new (struct direntry, 1);
ent->freshly_created = 0;
if (ent == NULL) ERRNOR (ENOMEM, NULL); if (ent == NULL) ERRNOR (ENOMEM, NULL);
ent->freshly_created = 0;
ent->count = 1; ent->count = 1;
ent->linkname = NULL; ent->linkname = NULL;
ent->l_stat = NULL; ent->l_stat = NULL;
@ -363,11 +367,11 @@ _get_file_entry(struct connection *bucket, char *file_name,
ent->name = g_strdup(p); ent->name = g_strdup(p);
ent->remote_filename = g_strdup(file_name); ent->remote_filename = g_strdup(file_name);
ent->local_filename = tempnam (NULL, X "fs"); ent->local_filename = tempnam (NULL, X "fs");
if (!ent->name && !ent->remote_filename && !ent->local_filename) { if (!ent->name || !ent->remote_filename || !ent->local_filename) {
direntry_destructor(ent); direntry_destructor(ent);
ERRNOR (ENOMEM, NULL); ERRNOR (ENOMEM, NULL);
} }
handle = creat(ent->local_filename, 0700); handle = open (ent->local_filename, O_CREAT | O_EXCL | O_RDWR | O_TRUNC, 0700);
if (handle == -1) { if (handle == -1) {
my_errno = EIO; my_errno = EIO;
goto error; goto error;