summaryrefslogtreecommitdiffstats
path: root/client_wizard/client.wiz
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-09-19 10:09:26 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-09-19 10:09:26 +0000
commit824b458a2526ed8b2e6628a77fd21510e7dc7d4e (patch)
treea9968be7a59d64832f9073186651275c5296187f /client_wizard/client.wiz
parent9838584ce378e5a02d604d8431632f4464fd4e5c (diff)
downloaddrakwizard-824b458a2526ed8b2e6628a77fd21510e7dc7d4e.tar
drakwizard-824b458a2526ed8b2e6628a77fd21510e7dc7d4e.tar.gz
drakwizard-824b458a2526ed8b2e6628a77fd21510e7dc7d4e.tar.bz2
drakwizard-824b458a2526ed8b2e6628a77fd21510e7dc7d4e.tar.xz
drakwizard-824b458a2526ed8b2e6628a77fd21510e7dc7d4e.zip
added dhcp check
Diffstat (limited to 'client_wizard/client.wiz')
-rw-r--r--client_wizard/client.wiz26
1 files changed, 21 insertions, 5 deletions
diff --git a/client_wizard/client.wiz b/client_wizard/client.wiz
index 13611bc3..65475c8d 100644
--- a/client_wizard/client.wiz
+++ b/client_wizard/client.wiz
@@ -3,11 +3,11 @@
<Wizard
name="general"
- libScript="__WIZ_HOME__/common/scripts/functions.sh"
+ libScript="/home/logarno/soft/wizard_perl/test/common/scripts/functions.sh"
wizardTitle="DNS Wizard (add client)"
imagePosition="top"
- defaultImage="__WIZ_HOME__/client_wizard/images/DNS"
- perlModule="__WIZ_HOME__/client_wizard/scripts/Clientconf.pm"
+ defaultImage="/home/logarno/soft/wizard_perl/test/client_wizard/images/DNS"
+ perlModule="/home/logarno/soft/wizard_perl/test/client_wizard/scripts/Clientconf.pm"
rpm="bind"
>
@@ -30,6 +30,7 @@
nextFinish="false"
canBack="true"
canCancel="true"
+ func="check"
>
<Target
@@ -45,7 +46,7 @@
</Target>
<Target
- targetName="error_need_net"
+ targetName="error_dhcp"
jumpIndex="2"
>
</Target>
@@ -77,6 +78,21 @@
>
</Info>
</Page>
+ <Page
+ helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz-web.html"
+ name="error_dhcp"
+ jumpPage="CLIENT"
+ executionLevel="NORMAL"
+ nextFinish="false"
+ canBack="true"
+ canCancel="true"
+ >
+
+ <Info
+ helpText="Warning\nYou are in dhcp, server may not work with your configuration."
+ >
+ </Info>
+ </Page>
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz.html"
@@ -195,7 +211,7 @@
<Page
helpURL="file:/usr/share/doc/mandrake/${LANG}/ref.html/wiz.html"
name="error_need_net"
- subWizard="__WIZ_HOME__/server_wizard/server.wiz"
+ subWizard="/home/logarno/soft/wizard_perl/test/server_wizard/server.wiz"
executionLevel="NORMAL"
nextFinish="false"
canBack="false"
> 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
/*
 * modutils specific implementation of ftw().
 *
 * Copyright 2000:
 *  Keith Owens <kaos@ocs.com.au> August 2000
 *
 * This file is part of the Linux modutils.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

/*
    modutils requires special processing during the file tree walk
    of /lib/modules/<version> and any paths that the user specifies.
    The standard ftw() does a blind walk of all paths and can end
    up following the build symlink down the kernel source tree.
    Although nftw() has the option to get more control such as not
    automatically following symbolic links, even that is not enough
    for modutils.  The requirements are:

    Paths must be directories or symlinks to directories.

    Each directory is read and sorted into alphabetical order
    before processing.

    A directory is type 1 iff it was specified on a path statement
    (either explicit or default) and the directory contains a
    subdirectory with one of the known names and the directory name
    does not end with "/kernel".  Otherwise it is type 2.

    In a type 1 directory, walk the kernel subdirectory if it exists,
    then the old known names in their historical order then any
    remaining directory entries in alphabetical order and finally any
    non-directory entries in alphabetical order.

    Entries in a type 1 directory are filtered against the "prune"
    list.  A type 1 directory can contain additional files which
    are not modules nor symlinks to modules.  The prune list skips
    known additional files, if a distribution wants to store
    additional text files in the top level directory they should be
    added to the prune list.

    A type 2 directory must contain only modules or symlinks to
    modules.  They are processed in alphabetical order, without
    pruning.  Symlinks to directories are an error in type 2
    directories.

    The user function is not called for type 1 directories, nor for
    pruned entries.  It is called for type 2 directories and their
    contents.  It is also called for any files left in a type 1
    directory after pruning and processing type 2 subdirectories.
    The user function never sees symlinks, they are resolved before
    calling the function.

    Why have different directory types?  The original file tree
    walk was not well defined.  Some users specified each directory
    individually, others just pointed at the top level directory.
    Either version worked until the "build" symlink was added.  Now
    users who specify the top level directory end up running the
    entire kernel source tree looking for modules, not nice.  We
    cannot just ignore symlinks because pcmcia uses symlinks to
    modules for backwards compatibility.

    Type 1 is when a user specifies the top level directory which needs
    special processing, type 2 is individual subdirectories.  But the
    only way to tell the difference is by looking at the contents.  The
    "/kernel" directory introduced in 2.3.12 either contains nothing
    (old make modules_install) or contains all the kernel modules using
    the same tree structure as the source.  Because "/kernel" can
    contain old names but is really a type 2 directory, it is detected
    as a special case.
 */

#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>

#include "util.h"
#include "config.h"

extern char *tbpath[];

extern OPT_LIST *prune_list;
extern int n_prune_list;

extern char *tbtype[];

struct xftw_dirent {
    struct stat statbuf;
    char *name;
    char *fullname;
};

#define XFTW_MAXDEPTH 64    /* Maximum directory depth handled */

typedef struct {
    struct xftw_dirent *contents;
    int size;
    int used;
} xftw_tree_t;

static xftw_tree_t tree[XFTW_MAXDEPTH];

/* Free all data for one tree level */
static void xftw_free_tree(int depth)
{
    int i;
    xftw_tree_t *t = tree+depth;
    for (i = 0; i < t->size; ++i) {
	free(t->contents[i].name);
	free(t->contents[i].fullname);
    }
    free(t->contents);
    t->contents = NULL;
    t->size = 0;
    t->used = 0;
}

/* Increment dirents used at this depth, resizing if necessary */
static void xftw_add_dirent(int depth)
{
    xftw_tree_t *t = tree+depth;
    int i, size = t->size;
    if (++t->used < size)
	return;
    size += 10; /* arbitrary increment */
    t->contents = xrealloc(t->contents, size*sizeof(*(t->contents)));
    for (i = t->size; i < size; ++i) {
	memset(&(t->contents[i].statbuf), 0, sizeof(t->contents[i].statbuf));
	t->contents[i].name = NULL;
	t->contents[i].fullname = NULL;
    }
    t->size = size;
}

/* Concatenate directory name and entry name into one string.
 * Note: caller must free result or leak.
 */
static char *xftw_dir_name(const char *directory, const char *entry)
{
    int i = strlen(directory);
    char *name;
    if (entry)
	i += strlen(entry);
    i += 2;
    name = xmalloc(i);
    strcpy(name, directory);	/* safe, xmalloc */
    if (*directory && entry)
	strcat(name, "/");	/* safe, xmalloc */
    if (entry)
	strcat(name, entry);	/* safe, xmalloc */
    return(name);
}

/* Call the user function for a directory entry */
static int xftw_do_name(const char *directory, const char *entry, struct stat *sb, xftw_func_t funcptr)
{
    int ret = 0;
    char *name = xftw_dir_name(directory, entry);

    if (S_ISLNK(sb->st_mode)) {
	char real[PATH_MAX], *newname;
	verbose("resolving %s symlink to ", name);
	if (!(newname = realpath(name, real))) {
	    if (errno == ENOENT) {
		verbose("%s: does not exist, dangling symlink ignored\n", real);
		goto cleanup;
	    }
	    perror("... failed");
	    goto cleanup;
	}
	verbose("%s ", newname);
	if (lstat(newname, sb)) {
	    error("lstat on %s failed ", newname);
	    perror("");
	    goto cleanup;
	}
	free(name);
	name = xstrdup(newname);
    }

    if (!S_ISREG(sb->st_mode) &&
	!S_ISDIR(sb->st_mode)) {
	error("%s is not plain file nor directory\n", name);
	goto cleanup;
    }
	
    verbose("user function %s\n", name);
    ret = (*funcptr)(name, sb);
cleanup:
    free(name);
    return(ret);
}

/* Sort directory entries into alphabetical order */
static int xftw_sortdir(const void *a, const void *b)
{
    return(strcmp(((struct xftw_dirent *)a)->name, ((struct xftw_dirent *)b)->name));
}

/* Read a directory and sort it, ignoring "." and ".." */
static int xftw_readdir(const char *directory, int depth)
{
    DIR *d;
    struct dirent *ent;
    verbose("xftw_readdir %s\n", directory);
    if (!(d = opendir(directory))) {
	perror(directory);
	return(1);
    }
    while ((ent = readdir(d))) {
	char *name;
	struct xftw_dirent *f;
	if (strcmp(ent->d_name, ".") == 0 ||
	    strcmp(ent->d_name, "..") == 0)
	    continue;