/[mailutils]/mailutils/mailbox/message.c
ViewVC logotype

Diff of /mailutils/mailbox/message.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.64 by sroberts, Thu May 9 02:11:59 2002 UTC revision 1.65 by gray, Tue Aug 13 13:24:57 2002 UTC
# Line 47  Line 47 
47  #include <mailutils/mutil.h>  #include <mailutils/mutil.h>
48  #include <mailutils/observer.h>  #include <mailutils/observer.h>
49  #include <mailutils/stream.h>  #include <mailutils/stream.h>
50    #include <mailutils/mu_auth.h>
51    
52  #define MESSAGE_MODIFIED 0x10000;  #define MESSAGE_MODIFIED 0x10000;
53    
# Line 971  message_sender (envelope_t envelope, cha Line 972  message_sender (envelope_t envelope, cha
972    
973    /* oops! We are still here */    /* oops! We are still here */
974    {    {
975      struct passwd *pw;      struct mu_auth_data *auth = mu_get_auth_by_uid (getuid ());
976      const char *sender;      const char *sender = auth ? auth->name : "unknown";
     pw = mu_getpwuid (getuid ());  
     sender = (pw) ? pw->pw_name : "unknown";  
977      n = strlen (sender);      n = strlen (sender);
978      if (buf && len > 0)      if (buf && len > 0)
979        {        {
980          len--; /* One for the null.  */          len--; /* One for the null.  */
981          n = (n < len) ? n : len;          n = (n < len) ? n : len;
982          memcpy (buf, pw->pw_name, n);          memcpy (buf, auth->name, n);
983          buf[n] = '\0';          buf[n] = '\0';
984        }        }
985        if (auth)
986          mu_auth_data_free (auth);
987    }    }
988    
989    if (pnwrite)    if (pnwrite)

Legend:
Removed from v.1.64  
changed lines
  Added in v.1.65

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26