Rename some variables in getpwnam_alloc() for clarity
authorVolker Lendecke <vl@samba.org>
Fri, 14 Nov 2008 12:13:40 +0000 (13:13 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 18 Nov 2008 09:06:55 +0000 (10:06 +0100)
(cherry picked from commit fe4e662a2b0df2d3cd4cc9ca8611dd062e1b52b6)

source/lib/util_pw.c

index e6abd05998b72803b87cde1c8f91011b40b1cd99..f0f3f008955ac3c100813a77231f11a619b7eae2 100644 (file)
@@ -44,27 +44,28 @@ void flush_pwnam_cache(void)
 
 struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name)
 {
-       struct passwd *temp, *cached;
+       struct passwd *pw, *for_cache;
 
-       temp = (struct passwd *)memcache_lookup_talloc(
+       pw = (struct passwd *)memcache_lookup_talloc(
                NULL, GETPWNAM_CACHE, data_blob_string_const(name));
-       if (temp != NULL) {
-               return tcopy_passwd(mem_ctx, temp);
+       if (pw != NULL) {
+               return tcopy_passwd(mem_ctx, pw);
        }
 
-       temp = sys_getpwnam(name);
-       if (temp == NULL) {
+       pw = sys_getpwnam(name);
+       if (pw == NULL) {
                return NULL;
        }
 
-       cached = tcopy_passwd(talloc_autofree_context(), temp);
-       if (cached == NULL) {
+       for_cache = tcopy_passwd(talloc_autofree_context(), pw);
+       if (for_cache == NULL) {
                return NULL;
        }
 
        memcache_add_talloc(NULL, GETPWNAM_CACHE, data_blob_string_const(name),
-                           cached);
-       return tcopy_passwd(mem_ctx, temp);
+                           for_cache);
+
+       return tcopy_passwd(mem_ctx, pw);
 }
 
 struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid)