Changeset 740 for vendor/current/lib/util/util_pw.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified vendor/current/lib/util/util_pw.c ¶
r414 r740 4 4 Safe versions of getpw* calls 5 5 6 Copyright (C) Andrew Tridgell 1992-1998 7 Copyright (C) Jeremy Allison 1998-2005 6 8 Copyright (C) Andrew Bartlett 2002 9 Copyright (C) Timur Bakeyev 2005 10 Copyright (C) Bjoern Jacke 2006-2007 11 7 12 8 13 This program is free software; you can redistribute it and/or modify … … 21 26 22 27 #include "includes.h" 28 #include "system/passwd.h" 29 #include "lib/util/util_pw.h" 23 30 24 static struct passwd *alloc_copy_passwd(TALLOC_CTX *mem_ctx, 25 const struct passwd *from) 31 /************************************************************************** 32 Wrappers for setpwent(), getpwent() and endpwent() 33 ****************************************************************************/ 34 35 void sys_setpwent(void) 36 { 37 setpwent(); 38 } 39 40 struct passwd *sys_getpwent(void) 41 { 42 return getpwent(); 43 } 44 45 void sys_endpwent(void) 46 { 47 endpwent(); 48 } 49 50 /************************************************************************** 51 Wrappers for getpwnam(), getpwuid(), getgrnam(), getgrgid() 52 ****************************************************************************/ 53 54 struct passwd *sys_getpwnam(const char *name) 55 { 56 return getpwnam(name); 57 } 58 59 struct passwd *sys_getpwuid(uid_t uid) 60 { 61 return getpwuid(uid); 62 } 63 64 struct group *sys_getgrnam(const char *name) 65 { 66 return getgrnam(name); 67 } 68 69 struct group *sys_getgrgid(gid_t gid) 70 { 71 return getgrgid(gid); 72 } 73 74 struct passwd *tcopy_passwd(TALLOC_CTX *mem_ctx, 75 const struct passwd *from) 26 76 { 27 77 struct passwd *ret = talloc_zero(mem_ctx, struct passwd); … … 41 91 } 42 92 43 struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name) 93 struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name) 44 94 { 45 95 struct passwd *temp; … … 56 106 } 57 107 58 return alloc_copy_passwd(mem_ctx, temp);108 return tcopy_passwd(mem_ctx, temp); 59 109 } 60 110 61 struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) 111 /**************************************************************************** 112 talloc'ed version of getpwuid. 113 ****************************************************************************/ 114 115 struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid) 62 116 { 63 117 struct passwd *temp; … … 74 128 } 75 129 76 return alloc_copy_passwd(mem_ctx, temp);130 return tcopy_passwd(mem_ctx, temp); 77 131 }
Note:
See TracChangeset
for help on using the changeset viewer.