X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fpt_chown.c;h=46629cf0c7d2c9e4b491589d6463fcf53665737f;hb=cd56634a4a8179fd5a4419fbb3e27211b042ab1c;hp=ccc04fd88af87453709fe25bc7d7c84ed3bc1c2b;hpb=d60f3b0c6b0f93a601acd1cfd3923f94ca05abb0;p=gnulib.git diff --git a/lib/pt_chown.c b/lib/pt_chown.c index ccc04fd88..46629cf0c 100644 --- a/lib/pt_chown.c +++ b/lib/pt_chown.c @@ -1,5 +1,5 @@ -/* pt_chown - helper program for `grantpt'. - Copyright (C) 1998-1999, 2009-2011 Free Software Foundation, Inc. +/* pt_chown - helper program for 'grantpt'. + Copyright (C) 1998-1999, 2009-2014 Free Software Foundation, Inc. Contributed by C. Scott Ananian , 1998. This program is free software: you can redistribute it and/or modify @@ -25,6 +25,8 @@ #include #include +#include "root-uid.h" + #include "pty-private.h" /* For security reasons, we try to minimize the dependencies on libraries @@ -51,7 +53,7 @@ do_pt_chown (void) if (stat (pty, &st) < 0 || !S_ISCHR (st.st_mode)) return FAIL_EINVAL; - /* Get the group ID of the special `tty' group. */ + /* Get the group ID of the special 'tty' group. */ p = getgrnam (TTY_GROUP); gid = p ? p->gr_gid : getgid (); @@ -75,7 +77,7 @@ main (int argc, char *argv[]) { uid_t euid = geteuid (); - if (argc == 1 && euid == 0) + if (argc == 1 && euid == ROOT_UID) { /* Normal invocation of this program is with no arguments and with privileges. */ @@ -152,7 +154,7 @@ main (int argc, char *argv[]) } /* Check if we are properly installed. */ - if (euid != 0) + if (euid != ROOT_UID) { fprintf (stderr, "pt_chown: needs to be installed setuid 'root'\n"); return FAIL_EXEC;