Commit e1647e16 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

New option: -c (Consider an unset change_name an error).

(unset_change_name_is_error): New variable.
(check_persons): Check change_name if unset_change_name_is_error is
set.  Set it if -r is given, or offer to set it if -i is given.
(main): Recognize -c and set unset_change_name_is_error if given.
parent b6f6282c
/*
* $Id: dbck.c,v 0.22 1994/06/18 19:52:46 ceder Exp $
* $Id: dbck.c,v 0.23 1994/06/18 21:05:43 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -28,7 +28,7 @@
* Author: Per Cederqvist.
*/
static char *rcsid = "$Id: dbck.c,v 0.22 1994/06/18 19:52:46 ceder Exp $";
static char *rcsid = "$Id: dbck.c,v 0.23 1994/06/18 21:05:43 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -77,7 +77,10 @@ int iflag=0; /* Interactive - prompt user and repair. */
int rflag=0; /* Repair simple error without confirmation. */
int gflag=0; /* Garbage collect text-file. */
int sflag=0; /* Statistic flag. */
/* The following variable corresponds to the -c flag, and is
present here due to a bug in lyskomd 1.6.1. */
int unset_change_name_is_error=0;
int modifications = 0;
typedef struct {
......@@ -866,6 +869,21 @@ check_persons(void)
errors += (check_created_texts(cp, &pstat->created_texts)
+ check_membership_list(cp, &pstat->conferences));
}
if (unset_change_name_is_error == 1
&& pstat->privileges.change_name == 0)
{
log("Person %lu has no change_name capability.\n",
(unsigned long)cp);
if (rflag || confirm("Grant him the capability"))
{
pstat->privileges.change_name = 1;
mark_person_as_changed(cp);
modifications++;
}
else
errors++;
}
}
if (vflag)
......@@ -1272,9 +1290,13 @@ main (int argc,
sflag++;
break;
case 'c': /* Consider an unset change_name an error. */
unset_change_name_is_error = 1;
break;
default:
restart_kom("usage: %s %s [config_file]\n",
argv[0], "[-d ...] [-i] [-r] [-v] [-g] [-s]");
argv[0], "[-d ...] [-i] [-r] [-v] [-g] [-s] [-c]");
}
}
......@@ -1293,7 +1315,7 @@ main (int argc,
if (i != argc)
restart_kom("usage: %s %s [config_file]\n",
argv[0], "[-d ...] [-i] [-r] [-v] [-g] [-s]");
argv[0], "[-d ...] [-i] [-r] [-v] [-g] [-s] [-c]");
s_set_storage_management(smalloc, srealloc, sfree);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment