~ubuntu-branches/ubuntu/trusty/landscape-client/trusty-proposed

« back to all changes in this revision

Viewing changes to landscape/lib/initgroups.c

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2009-12-16 10:50:05 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 27.
  • Revision ID: james.westby@ubuntu.com-20091216105005-bmki8i2of1dmcdkc
Tags: 1.4.0-0ubuntu0.9.10.0
* New upstream release (LP: #497351)

* Bug fixes:
  - Fix landscape daemons fail to start when too many groups are
    available (LP: #456124)
  - Fix landscape programs wake up far too much. (LP: #340843)
  - Fix Package manager fails with 'no such table: task' (LP #465846)
  - Fix test suite leaving temporary files around (LP #476418)
  - Fix the 1hr long wait for user data to be uploaded following a
    resynchronisation (LP #369000)

* Add support for Ubuntu release upgrades:
  - Add helper function to fetch many files at once (LP: #450629)
  - Handle release-upgrade messages in the packagemanager
    plugin (LP: #455217)
  - Add a release-upgrader task handler (LP: #462543)
  - Support upgrade-tool environment variables (LP: #463321)

* Add initial support for Smart package locking:
  - Detect and report changes about Smart package locks (#488108)

* Packaging fixes:
  - Turn unnecessary Pre-Depends on python-gobject into a regular Depends
  - If it's empty, remove /etc/landscape upon purge

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 
 
3
  Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
 
4
  
 
5
  This software is subject to the provisions of the Zope Public License,
 
6
  Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 
7
  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 
8
  WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
9
  WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 
10
  FOR A PARTICULAR PURPOSE
 
11
  
 
12
 ****************************************************************************/
 
13
 
 
14
#include "Python.h"
 
15
 
 
16
#include <grp.h>
 
17
#include <sys/types.h>
 
18
#include <unistd.h>
 
19
 
 
20
static PyObject *
 
21
initgroups_initgroups(PyObject *self, PyObject *args)
 
22
{
 
23
    char *username;
 
24
    unsigned int igid;
 
25
    gid_t gid;
 
26
 
 
27
    if (!PyArg_ParseTuple(args, "sI:initgroups", &username, &igid))
 
28
        return NULL;
 
29
 
 
30
    gid = igid;
 
31
 
 
32
    if (initgroups(username, gid) == -1)
 
33
        return PyErr_SetFromErrno(PyExc_OSError);
 
34
 
 
35
    Py_INCREF(Py_None);
 
36
    return Py_None;
 
37
}
 
38
 
 
39
static PyMethodDef InitgroupsMethods[] = {
 
40
    {"initgroups",  initgroups_initgroups,  METH_VARARGS},
 
41
    {NULL,      NULL}
 
42
};
 
43
 
 
44
void
 
45
initinitgroups(void)
 
46
{
 
47
    Py_InitModule("initgroups", InitgroupsMethods);
 
48
}
 
49