From d9c763dc32bea097a7e77703e8931f673987ea93 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 23 Apr 2016 19:56:31 +0100 Subject: [PATCH] with-authinfo-kludge.1: Don't bother digging into the password database. A result of feedback from Ian Jackson. --- with-authinfo-kludge.1 | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/with-authinfo-kludge.1 b/with-authinfo-kludge.1 index 138c5f8..c8f1827 100644 --- a/with-authinfo-kludge.1 +++ b/with-authinfo-kludge.1 @@ -429,11 +429,6 @@ The user's home directory is determined, as follows. If the environment variable .B HOME is set, then its value is used. -Otherwise, the current effective uid is looked up -in the password database -(using -.BR getpwuid (3)); -and the home directory taken from the record. Let .I home be the home directory so determined, if any. @@ -507,24 +502,7 @@ denote its value; then .IB run /with-authinfo-kludge is used as the runtime directory. -.hP 3. -The user's name is determined, as follows. -If the environment variable -.B USER -is set, then its value is used. -Otherwise, if, the environment variable -.B LOGNAME -is set, then its value is used. -Otherwise, the current effective uid is looked up -in the password database -(using -.BR getpwuid (3)); -and the name taken from the record. -Let -.I user -be the user name so determined, if any. -.hP 4 -If no user name could be determined, then skip this step. +.hP 3 If the environment variable .B TMPDIR is set, then let @@ -534,28 +512,31 @@ otherwise, let .I tmp be .BR /tmp . +Let +.I uid +be the current effective uid, in decimal, +without leading zeroes +(if the superuser is foolish enough to run this program then +.I uid +is +.BR 0 ). If -.IB tmp/ with-authinfo-kludge- user +.IB tmp/ with-authinfo-kludge- uid exists, is a directory (and not a symbolic link), is owned by the current effective uid, and has no permissions for group or others; or if it does not exist but can be created with the above properties; then it is used as the runtime directory. -.hP 5. +.hP 4. The user's home directory is determined, as follows. If the environment variable .B HOME is set, then its value is used. -Otherwise, the current effective uid is looked up -in the password database -(using -.BR getpwuid (3)); -and the home directory taken from the record. Let .I home be the home directory so determined, if any. -.hP 6. +.hP 5. A `cache home' directory is determined, as follows. If the environment variable .B XDG_CACHE_HOME @@ -569,7 +550,7 @@ Let denote the cache home directory so determined. If the cache home directory does not exist, then it is created with mode 0777 (as modified by the umask). -.hP 7. +.hP 6. Let .I hostname be the local machine's hostname, -- 2.11.0