diff options
-rw-r--r-- | login-utils/chfn.c | 19 | ||||
-rw-r--r-- | login-utils/chsh.c | 11 | ||||
-rw-r--r-- | login-utils/setpwnam.c | 8 |
3 files changed, 14 insertions, 24 deletions
diff --git a/login-utils/chfn.c b/login-utils/chfn.c index f2f514833..1ddd5864b 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -32,6 +32,7 @@ #include <errno.h> #include <ctype.h> #include <getopt.h> +#include <stdbool.h> #include "islocal.h" #include "setpwnam.h" @@ -62,10 +63,6 @@ #endif /* REQUIRE_PASSWORD */ -typedef unsigned char boolean; -#define false 0 -#define true 1 - static char buf[1024]; struct finfo { @@ -78,12 +75,12 @@ struct finfo { char *other; }; -static boolean parse_argv (int argc, char *argv[], struct finfo *pinfo); +static int parse_argv (int argc, char *argv[], struct finfo *pinfo); static void parse_passwd (struct passwd *pw, struct finfo *pinfo); static void ask_info (struct finfo *oldfp, struct finfo *newfp); static char *prompt (char *question, char *def_val); static int check_gecos_string (char *msg, char *gecos); -static boolean set_changed_data (struct finfo *oldfp, struct finfo *newfp); +static int set_changed_data (struct finfo *oldfp, struct finfo *newfp); static int save_new_data (struct finfo *pinfo); /* we do not accept gecos field sizes longer than MAX_FIELD_SIZE */ @@ -108,7 +105,7 @@ static void __attribute__((__noreturn__)) usage(FILE *fp) int main (int argc, char **argv) { uid_t uid; struct finfo oldf, newf; - boolean interactive; + int interactive; int status; sanitize_env(); @@ -217,10 +214,10 @@ int main (int argc, char **argv) { * parse the command line arguments. * returns true if no information beyond the username was given. */ -static boolean parse_argv(int argc, char *argv[], struct finfo *pinfo) +static int parse_argv(int argc, char *argv[], struct finfo *pinfo) { int index, c, status; - boolean info_given; + int info_given; static struct option long_options[] = { { "full-name", required_argument, 0, 'f' }, @@ -403,9 +400,9 @@ static int check_gecos_string(char *msg, char *gecos) * set_changed_data () -- * incorporate the new data into the old finger info. */ -static boolean set_changed_data(struct finfo *oldfp, struct finfo *newfp) +static int set_changed_data(struct finfo *oldfp, struct finfo *newfp) { - boolean changed = false; + int changed = false; if (newfp->full_name) { oldfp->full_name = newfp->full_name; changed = true; } diff --git a/login-utils/chsh.c b/login-utils/chsh.c index f84baba54..043022ee6 100644 --- a/login-utils/chsh.c +++ b/login-utils/chsh.c @@ -31,6 +31,7 @@ #include <errno.h> #include <ctype.h> #include <getopt.h> +#include <stdbool.h> #include "c.h" #include "islocal.h" @@ -61,10 +62,6 @@ #include "selinux_utils.h" #endif -typedef unsigned char boolean; -#define false 0 -#define true 1 - /* Only root is allowed to assign a luser a non-listed shell, by default */ #define ONLY_LISTED_SHELLS 1 @@ -76,7 +73,7 @@ struct sinfo { static void parse_argv (int argc, char *argv[], struct sinfo *pinfo); static char *prompt (char *question, char *def_val); static int check_shell (char *shell); -static boolean get_shell_list (char *shell); +static int get_shell_list (char *shell); static void __attribute__((__noreturn__)) usage (FILE *fp) { @@ -345,10 +342,10 @@ check_shell (char *shell) { * return true. if not, return false. * if the given shell is NULL, /etc/shells is outputted to stdout. */ -static boolean +static int get_shell_list (char *shell_name) { FILE *fp; - boolean found; + int found; int len; char buf[PATH_MAX]; diff --git a/login-utils/setpwnam.c b/login-utils/setpwnam.c index c1e6efb17..9299ffa83 100644 --- a/login-utils/setpwnam.c +++ b/login-utils/setpwnam.c @@ -61,15 +61,11 @@ #include <sys/resource.h> #include <sys/stat.h> #include <paths.h> +#include <stdbool.h> #include "setpwnam.h" #include "c.h" -#define false 0 -#define true 1 - -typedef int boolean; - static void pw_init(void); /* @@ -83,7 +79,7 @@ setpwnam (struct passwd *pwd) { FILE *fp = NULL, *pwf = NULL; int x, save_errno, fd, ret; - boolean found; + int found; int oldumask; int namelen; int buflen = 256; |