#include <errno.h>
#include <ctype.h>
#include <getopt.h>
+#include <stdbool.h>
#include "islocal.h"
#include "setpwnam.h"
#endif /* REQUIRE_PASSWORD */
-typedef unsigned char boolean;
-#define false 0
-#define true 1
-
static char buf[1024];
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 */
int main (int argc, char **argv) {
uid_t uid;
struct finfo oldf, newf;
- boolean interactive;
+ int interactive;
int status;
sanitize_env();
* 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' },
* 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; }
#include <errno.h>
#include <ctype.h>
#include <getopt.h>
+#include <stdbool.h>
#include "c.h"
#include "islocal.h"
#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
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)
{
* 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];