Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified vendor/current/lib/util/util_pw.c

    r414 r740  
    44   Safe versions of getpw* calls
    55
     6   Copyright (C) Andrew Tridgell 1992-1998
     7   Copyright (C) Jeremy Allison  1998-2005
    68   Copyright (C) Andrew Bartlett 2002
     9   Copyright (C) Timur Bakeyev        2005
     10   Copyright (C) Bjoern Jacke    2006-2007
     11
    712   
    813   This program is free software; you can redistribute it and/or modify
     
    2126
    2227#include "includes.h"
     28#include "system/passwd.h"
     29#include "lib/util/util_pw.h"
    2330
    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
     35void sys_setpwent(void)
     36{
     37        setpwent();
     38}
     39
     40struct passwd *sys_getpwent(void)
     41{
     42        return getpwent();
     43}
     44
     45void sys_endpwent(void)
     46{
     47        endpwent();
     48}
     49
     50/**************************************************************************
     51 Wrappers for getpwnam(), getpwuid(), getgrnam(), getgrgid()
     52****************************************************************************/
     53
     54struct passwd *sys_getpwnam(const char *name)
     55{
     56        return getpwnam(name);
     57}
     58
     59struct passwd *sys_getpwuid(uid_t uid)
     60{
     61        return getpwuid(uid);
     62}
     63
     64struct group *sys_getgrnam(const char *name)
     65{
     66        return getgrnam(name);
     67}
     68
     69struct group *sys_getgrgid(gid_t gid)
     70{
     71        return getgrgid(gid);
     72}
     73
     74struct passwd *tcopy_passwd(TALLOC_CTX *mem_ctx,
     75                            const struct passwd *from)
    2676{
    2777        struct passwd *ret = talloc_zero(mem_ctx, struct passwd);
     
    4191}
    4292
    43 struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name) 
     93struct passwd *getpwnam_alloc(TALLOC_CTX *mem_ctx, const char *name)
    4494{
    4595        struct passwd *temp;
     
    56106        }
    57107
    58         return alloc_copy_passwd(mem_ctx, temp);
     108        return tcopy_passwd(mem_ctx, temp);
    59109}
    60110
    61 struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid)
     111/****************************************************************************
     112 talloc'ed version of getpwuid.
     113****************************************************************************/
     114
     115struct passwd *getpwuid_alloc(TALLOC_CTX *mem_ctx, uid_t uid)
    62116{
    63117        struct passwd *temp;
     
    74128        }
    75129
    76         return alloc_copy_passwd(mem_ctx, temp);
     130        return tcopy_passwd(mem_ctx, temp);
    77131}
Note: See TracChangeset for help on using the changeset viewer.