Changeset b7ee0369 in mainline for uspace/lib/posix/pwd.c


Ignore:
Timestamp:
2011-07-31T05:08:44Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d3e241a
Parents:
051e6ac (diff), 27a8d1d (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.
Message:

Merge libposix changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/pwd.c

    r051e6ac rb7ee0369  
    3939#include "errno.h"
    4040
    41 // TODO: documentation
    42 
    4341static bool entry_read = false;
    4442
     
    4644static const struct posix_passwd dummy_pwd = {
    4745        .pw_name = (char *) "user",
    48         .pw_uid = 1,
    49         .pw_gid = 1,
     46        .pw_uid = 0,
     47        .pw_gid = 0,
    5048        .pw_dir = (char *) "/",
    5149        .pw_shell = (char *) "/app/bdsh"
     
    115113{
    116114        assert(name != NULL);
     115        assert(pwd != NULL);
     116        assert(buffer != NULL);
     117        assert(result != NULL);
    117118       
    118119        if (posix_strcmp(name, "user") != 0) {
     
    121122        }
    122123       
    123         return posix_getpwuid_r(1, pwd, buffer, bufsize, result);
     124        return posix_getpwuid_r(0, pwd, buffer, bufsize, result);
    124125}
    125126
     
    132133struct posix_passwd *posix_getpwuid(posix_uid_t uid)
    133134{
    134         if (uid != 1) {
     135        if (uid != 0) {
    135136                return NULL;
    136137        }
     
    159160            '/', '\0', 'b', 'd', 's', 'h', '\0' };
    160161       
    161         if (uid != 1) {
     162        if (uid != 0) {
    162163                *result = NULL;
    163164                return 0;
     
    171172
    172173        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;
    175176        pwd->pw_dir = (char *) bf + 5;
    176177        pwd->pw_shell = (char *) bf + 7;
Note: See TracChangeset for help on using the changeset viewer.