From 87ac18575287d0eb9deb74a875baf0a423ce4575 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 20 Apr 2009 11:43:36 +0000 Subject: [PATCH] * libmisc/setugid.c: Updated comments. --- ChangeLog | 4 ++++ libmisc/setugid.c | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03b53268..6986e898 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-20 Nicolas François + + * libmisc/setugid.c: Updated comments. + 2009-04-20 Nicolas François * libmisc/failure.h, libmisc/failure.c, src/login.c: Added diff --git a/libmisc/setugid.c b/libmisc/setugid.c index 80c5f6dc..997095e9 100644 --- a/libmisc/setugid.c +++ b/libmisc/setugid.c @@ -2,7 +2,7 @@ * Copyright (c) 1989 - 1994, Julianne Frances Haugh * Copyright (c) 1996 - 1998, Marek Michałkiewicz * Copyright (c) 2003 - 2005, Tomasz Kłoczko - * Copyright (c) 2008 , Nicolas François + * Copyright (c) 2008 - 2009, Nicolas François * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,10 +45,16 @@ #include "defines.h" #include #include "getdef.h" + /* - * setup_uid_gid() split in two functions for PAM support - - * pam_setcred() needs to be called after initgroups(), but - * before setuid(). + * setup_groups - set the group credentials + * set the group ID to the value from the password file entry + * set the supplementary group IDs + * + * In case of PAM enabled configurations, this shall be called before + * pam_setcred. + * + * Returns 0 on success, or -1 on failure. */ int setup_groups (const struct passwd *info) { @@ -81,6 +87,11 @@ int setup_groups (const struct passwd *info) return 0; } +/* + * change_uid - Set the real UID + * + * Returns 0 on success, or -1 on failure. + */ int change_uid (const struct passwd *info) { /*