bug-sysutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-sysutils] Use filesystem checks when EUID != 0


From: Jeff Bailey
Subject: [Bug-sysutils] Use filesystem checks when EUID != 0
Date: Sat, 25 Mar 2006 12:28:03 -0500

This is a patch that weakens the permission checks such that if we're not running as UID 0, we let the filesystem decide if we have rights to edit.  We can then change SYSCONFDIR to point our test directory, and use the same code for functional tests.

2006-03-25  eff Bailey  <address@hidden>

        * src/chfn.c: Let permission checks fall through to the filesystem when euid != 0

Index: chfn.c
===================================================================
RCS file: /sources/sysutils/sysutils/src/chfn.c,v
retrieving revision 1.12
diff -u -p -r1.12 chfn.c
--- chfn.c      23 Mar 2006 19:05:15 -0000      1.12
+++ chfn.c      25 Mar 2006 17:22:43 -0000
@@ -184,6 +184,7 @@ int main(int argc, char *argv[])

        error_t status = 0;
        int isadmin = 0;
+       u_int my_euid = geteuid();

        char *pwwname = NULL;
        char *pwbname = NULL;
@@ -316,8 +317,11 @@ int main(int argc, char *argv[])

        /* Unless the user requests to change information about himself,
         * or calls the program as root, deny the request
+        *
+        * If the euid is not zero, let the filesystem decide
+        * if the password file is edittable.
         */
-       if (username && !isadmin) {
+       if (username && !isadmin && !my_euid) {
                int retval = is_caller(username);

                if (retval == -1) {

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée


reply via email to

[Prev in Thread] Current Thread [Next in Thread]