1
1

Modified code to use tempnam() instead of tmpnam(), fixed tempnam() to use NULL instead of 0.

Этот коммит содержится в:
Pavel Machek 1998-06-17 16:42:53 +00:00
родитель 1060e8fa67
Коммит c57c593179
4 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Wed Jun 17 Pavel Machek <pavel@ucw.cz>
* Modified code to use tempnam() instead of tmpnam(), fixed
tempnam() to use NULL instead of 0.
Wed Jun 3 Pavel Machek <pavel@ucw.cz>
* libvfs.c: adding libvfs.c which should contain things specific

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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,