Does anyone know a simple, fool-proof way of identifying the user in the Korn shell?
The environment variable USER is writable, so anyone can change its value to whatever they want.
For a while I thought that LOGNAME would do it, but then I realized that you can get around its protections and change its value as well.
The best I have come up with so far is to create a temporary file, do a ls -l on it, and read in the owner name.
Somewhere, though, the system has to have stored who the current user is, and I ought to be able to read this information without pulling stunts like that.
The environment variable USER is writable, so anyone can change its value to whatever they want.
For a while I thought that LOGNAME would do it, but then I realized that you can get around its protections and change its value as well.
The best I have come up with so far is to create a temporary file, do a ls -l on it, and read in the owner name.
Somewhere, though, the system has to have stored who the current user is, and I ought to be able to read this information without pulling stunts like that.