diff --git a/vfs/ChangeLog b/vfs/ChangeLog index f94ecf781..ca6b29324 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,7 @@ +Wed Jun 17 Pavel Machek + * Modified code to use tempnam() instead of tmpnam(), fixed + tempnam() to use NULL instead of 0. + Wed Jun 3 Pavel Machek * libvfs.c: adding libvfs.c which should contain things specific diff --git a/vfs/extfs.c b/vfs/extfs.c index 415af65ab..e5a17635b 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -590,7 +590,7 @@ static void *extfs_open (char *file, int flags, int mode) if (entry->inode->local_filename == NULL) { char *cmd, *archive_name, *p; - entry->inode->local_filename = strdup (tmpnam (NULL)); + entry->inode->local_filename = strdup (tempnam (NULL, "extfs")); p = extfs_get_path_from_entry (entry); q = name_quote (p, 0); free (p); diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index dae118514..14c32be08 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -1754,7 +1754,7 @@ int retrieve_file(struct ftpentry *fe) if (fe->local_filename) return 1; fe->local_stat.st_mtime = 0; - fe->local_filename = tempnam (0, "ftpfs"); + fe->local_filename = tempnam (NULL, "ftpfs"); fe->local_is_temp = 1; if (fe->local_filename == NULL) { ftpfserrno = ENOMEM; @@ -1917,7 +1917,7 @@ _get_file_entry(struct ftpfs_connection *bucket, char *file_name, ent->local_filename = 0; } if (flags & O_TRUNC) { - ent->local_filename = tempnam (0, "ftpfs"); + ent->local_filename = tempnam (NULL, "ftpfs"); if (ent->local_filename == NULL) { ftpfserrno = ENOMEM; return NULL; @@ -1970,7 +1970,7 @@ _get_file_entry(struct ftpfs_connection *bucket, char *file_name, ent->bucket = bucket; ent->name = strdup(p); ent->remote_filename = strdup(file_name); - ent->local_filename = tempnam(0, "ftpfs"); + ent->local_filename = tempnam (NULL, "ftpfs"); if (!ent->name && !ent->remote_filename && !ent->local_filename) { ftpentry_destructor(ent); ftpfserrno = ENOMEM; diff --git a/vfs/tar.c b/vfs/tar.c index 38f29c0c3..81a5700e0 100644 --- a/vfs/tar.c +++ b/vfs/tar.c @@ -347,7 +347,7 @@ static INLINE int uncompress_tar_file (struct tarfs_archive *current_archive, char buffer [8192]; /* Changed to 8K: better transfer size */ current_archive->is_gzipped = tar_uncompressed_local; - current_archive->tmpname = strdup (tmpnam (NULL)); + current_archive->tmpname = strdup (tempnam (NULL, "tarfs")); /* Some security is sometimes neccessary :) */ command = copy_strings ("touch ", current_archive->tmpname,