Changeset 00c2de63 in mainline for uspace/lib/posix/pwd.c
- Timestamp:
- 2011-07-29T14:50:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b6759f4
- Parents:
- 6c69d19 (diff), 7ae249d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/pwd.c
r6c69d19 r00c2de63 39 39 #include "errno.h" 40 40 41 // TODO: documentation42 43 41 static bool entry_read = false; 44 42 … … 46 44 static const struct posix_passwd dummy_pwd = { 47 45 .pw_name = (char *) "user", 48 .pw_uid = 1,49 .pw_gid = 1,46 .pw_uid = 0, 47 .pw_gid = 0, 50 48 .pw_dir = (char *) "/", 51 49 .pw_shell = (char *) "/app/bdsh" … … 115 113 { 116 114 assert(name != NULL); 115 assert(pwd != NULL); 116 assert(buffer != NULL); 117 assert(result != NULL); 117 118 118 119 if (posix_strcmp(name, "user") != 0) { … … 121 122 } 122 123 123 return posix_getpwuid_r( 1, pwd, buffer, bufsize, result);124 return posix_getpwuid_r(0, pwd, buffer, bufsize, result); 124 125 } 125 126 … … 132 133 struct posix_passwd *posix_getpwuid(posix_uid_t uid) 133 134 { 134 if (uid != 1) {135 if (uid != 0) { 135 136 return NULL; 136 137 } … … 159 160 '/', '\0', 'b', 'd', 's', 'h', '\0' }; 160 161 161 if (uid != 1) {162 if (uid != 0) { 162 163 *result = NULL; 163 164 return 0; … … 171 172 172 173 pwd->pw_name = (char *) bf; 173 pwd->pw_uid = 1;174 pwd->pw_gid = 1;174 pwd->pw_uid = 0; 175 pwd->pw_gid = 0; 175 176 pwd->pw_dir = (char *) bf + 5; 176 177 pwd->pw_shell = (char *) bf + 7;
Note:
See TracChangeset
for help on using the changeset viewer.