Article View: comp.unix.programmer
Article #105getlogin() problem
From: Don Costello
Date: Thu, 23 Jul 1992 20:55
Date: Thu, 23 Jul 1992 20:55
26 lines
1390 bytes
1390 bytes
Hi. I've labored over this for quite some time and can't seem to figure it out. I have a C program that checks for new/existing mail. I use the getlogin call, appended to "/usr/spool/mail/" to get the mailbox for the user checking his/her mail. The problem is when I "su" from one login to another (su - otheruser) and run the program, getlogin() returns the login id of the original user (the one su'ed from) not the current login. Is there an explanation/fix for this?? If it matters, I'm on a Gould 9050 running BSD4.3. However, it behaves the same on a 3B2 (Sys V Rel 3.2.2) and Gould NP1 (BSD4.3). Any help would greatly reduce the risk of hair loss :-). -- dcc -- -- +------------------------------------+---------------------------+ | Don Costello, DASC-ZSC | It's hard to cram this | | DLA Cameron Station, VA | signature into just 4 | | TEL: (703) 274-7215 AV: 284-7215 | lines!!! |
Technical Details
Message-ID:
<832@hq.dla.mil>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!udecc.engr.udayton.edu!blackbird.afit.af.mil!dsacg3.dsac.dla.mil!dsac.dla.mil!hq.dla.mil!fazc016Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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 From: fazc016@hq.dla.mil (Don Costello) Newsgroups: comp.unix.programmer Subject: getlogin() problem Message-ID: <832@hq.dla.mil> Date: 23 Jul 92 20:55:05 GMT Organization: HQ Defense Logistics Agency/DASC, Cameron Station, VA Lines: 26 X-Newsreader: Tin 1.1 PL4