home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3884 < prev    next >
Encoding:
Internet Message Format  |  1992-07-23  |  1.3 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!dsacg3.dsac.dla.mil!dsac.dla.mil!hq.dla.mil!fazc016
  2. From: fazc016@hq.dla.mil (Don Costello)
  3. Newsgroups: comp.unix.programmer
  4. Subject: getlogin() problem
  5. Message-ID: <832@hq.dla.mil>
  6. Date: 23 Jul 92 20:55:05 GMT
  7. Organization: HQ Defense Logistics Agency/DASC, Cameron Station, VA
  8. Lines: 26
  9. X-Newsreader: Tin 1.1 PL4
  10.  
  11.  
  12. Hi.  I've labored over this for quite some time and can't seem to figure
  13. it out.
  14.  
  15. I have a C program that checks for new/existing mail.  I use the
  16. getlogin call, appended to "/usr/spool/mail/" to get the mailbox for the
  17. user checking his/her mail.
  18.  
  19. The problem is when I "su" from one login to another (su - otheruser)
  20. and run the program, getlogin() returns the login id of the original
  21. user (the one su'ed from) not the current login.
  22.  
  23. Is there an explanation/fix for this??
  24.  
  25. If it matters, I'm on a Gould 9050 running BSD4.3.  However, it behaves the
  26. same on a 3B2 (Sys V Rel 3.2.2) and Gould NP1 (BSD4.3).
  27.  
  28. Any help would greatly reduce the risk of hair loss :-).
  29.  
  30.  -- dcc --
  31.  
  32. -- 
  33. +------------------------------------+---------------------------+
  34. | Don Costello, DASC-ZSC             |  It's hard to cram this   |
  35. | DLA Cameron Station, VA            |  signature into just 4    |
  36. | TEL: (703) 274-7215  AV: 284-7215  |  lines!!!                 | 
  37.