/* Quickly scan for the -h option -- if it is present don't do anything
* but print out some help and exit. */
@@ -104,7 +105,11 @@
return(0);
/* Get the username and use it to create a default mailfile name */
- strcat(mailfile_str, cuserid(username));
+ if (!(uid = getpwuid(geteuid()))) {
+ printf("Couldn't determine your username. Exiting.\n");
+ return 1;
+ }
+ strcat(mailfile_str, uid->pw_name);
/* Initialize the renderer */
rend_init(&argc, argv, (float)150.0);
Here is a patch
--- coolmail- 1.3.orig/ coolmail. c 1.3/coolmail. c
+++ coolmail-
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <pwd.h>
#ifdef AUDIO L_cuserid] ;
#include <string.h>
@@ -96,7 +97,7 @@
int main(int argc, char *argv[])
{
int reason;
- char username[
+ struct passwd *uid;
/* Quickly scan for the -h option -- if it is present don't do anything
* but print out some help and exit. */
@@ -104,7 +105,11 @@
return(0);
/* Get the username and use it to create a default mailfile name */ mailfile_ str, cuserid(username)); geteuid( )))) { mailfile_ str, uid->pw_name);
- strcat(
+ if (!(uid = getpwuid(
+ printf("Couldn't determine your username. Exiting.\n");
+ return 1;
+ }
+ strcat(
/* Initialize the renderer */ init(&argc, argv, (float)150.0);
rend_