1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

common: Never remove /dev/null.

* common/sysutils.c (gnupg_remove): Detect /dev/null.
--

GnuPG-bug-id: 6556
This commit is contained in:
Werner Koch 2023-09-07 17:21:05 +02:00
parent a02f3cc4e8
commit 7f9e05d73f
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -810,7 +810,12 @@ gnupg_remove (const char *fname)
return -1;
return 0;
#else
return remove (fname);
/* It is common to use /dev/null for testing. We better don't
* remove that file. */
if (fname && !strcmp (fname, "/dev/null"))
return 0;
else
return remove (fname);
#endif
}