summaryrefslogtreecommitdiffstats
path: root/src/util/confvalidator/confparser.py
diff options
context:
space:
mode:
authorBen Kaduk <kaduk@mit.edu>2012-11-20 13:13:12 -0500
committerBen Kaduk <kaduk@mit.edu>2012-11-27 16:59:19 -0500
commit3070dcd18ea2d07f74afa35fa4a8cada373d9975 (patch)
treecfdca5e5c27399bef1f8b517885ed38c3c5886aa /src/util/confvalidator/confparser.py
parent6a019d5cff9aecb88591accf03ac737c6f910c69 (diff)
Update doxygen markup in krb5.hin
A few places were using the standard C /* comment */ form, but this is rendered poorly by doxygen through to our Sphinx bridge. Use the special /**< comment */ form to get doxygen-specific behavior. If the standard C comment form is used, the full comment (including start and end markers) is included in the value of the macro, and Sphinx then tries to treat the end of the comment as the start of inline markup with no corresponding end-string, which is a warning. Using the doxygen form of the comment, the contents of the comment are put in a separate paragraph block, which is inserted in the body of the generated RST document. The markup for krb5_rd_priv() had a line that ended with an @c markup statement without a symbol following it. This confused doxygen into not parsing any more of the comment. The beginning of the next line is a macro identifier with markup to auto-linkify it. In RST, it is not possible to have a link and a terminal font on the same text, so removing the @c is the appropriate fix. There are also eleven deprecated functions which are replaced by the krb5_c_* family of functions. However, referring to this class of functions as the "krb5_c_" class of functions results in Sphinx attempting to interpret this statement as a link to a label elsewhere in the document, and no such label exists. To avoid this warning, use "krb5_c_*" to refer to the class of functions, which is arguably more correct anyways. ticket: 7447 tags: pullup target_version: 1.11
Diffstat (limited to 'src/util/confvalidator/confparser.py')
0 files changed, 0 insertions, 0 deletions
'n152' href='#n152'>152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 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 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <asm/page.h>
#include <sys/swap.h>
#include <sys/sysmacros.h>
#include <sys/statfs.h>
#include <unistd.h>
#include <zlib.h>

#include "../isys/imount.h"
#include "../isys/isys.h"

#include "commands.h"
#include "idmap.h"
#include "ls.h"
#include "popt.h"
#include "../isys/cpio.h"

static int copyfd(int to, int from);

static int copyfd(int to, int from) {
    char buf[1024];
    int size;

    while ((size = read(from, buf, sizeof(buf))) > 0) {
	if (write(to, buf, size) != size) {
	    fprintf(stderr, "error writing output: %s\n", strerror(errno));
	    return 1;
	}
    }

    if (size < 0) {
	fprintf(stderr, "error reading input: %s\n", strerror(errno));
	return 1;
    }

    return 0;
}

static int catFile(char * filename) {
    int fd;
    int rc;

    fd = open(filename, O_RDONLY);
    if (fd < 0) {
	fprintf(stderr, "cannot open %s: %s\n", filename, strerror(errno));
	return 1;
    }

    rc = copyfd(1, fd);
    close(fd);

    return rc;
}

int catCommand(int argc, char ** argv) {
    char ** argptr = argv + 1;
    int rc;

    if (!*argptr) {
	return copyfd(1, 0);
    } else {
	while (*argptr) {
	    rc = catFile(*argptr);
	    if (rc) return rc;
	    argptr++;
	}
    }

    return 0;
}

int lsmodCommand(int argc, char ** argv) {
    puts("Module:        #pages:  Used by:");
    catFile("/proc/modules");

    return 0;
}

#define MOUNT_USAGE fprintf(stderr, "usage: mount -t <fs> <device> <dir>\n" \
			"       (if /dev/ is left off the device name, a " \
			"temporary node will be created)\n")

int mountCommand(int argc, char ** argv) {
    char * dev, * dir;
    char * fs, * buf;

    if (argc < 2) {
	return catFile("/proc/mounts");
    } else if (argc == 3) {
	if (strchr(argv[1], ':'))
	    fs = "nfs";
	else
	    fs = "ext2";
	dev = argv[1];
	dir = argv[2];
    } else if (argc != 5) {
	MOUNT_USAGE;
	return 1;
    } else {
	if (strcmp(argv[1], "-t")) {
	    MOUNT_USAGE;
	    return 1;
	}
	
	fs = argv[2];
	dev = argv[3];
	dir = argv[4];
    }

    if (!strncmp(dev, "/dev/", 5) && access(dev, X_OK)) {
	dev += 5;
	buf = alloca(strlen(dev) + 10);
	sprintf(buf, "/tmp/%s", dev);
	devMakeInode(dev, buf);
	dev = buf;
    }

    if (doPwMount(dev, dir, fs, 0, 1, NULL, NULL))
	return 1;

    return 0;
}

int umountCommand(int argc, char ** argv) {
    if (argc != 2) {
	fprintf(stderr, "umount expects a single argument\n");
	return 1;
    }

    if (umount(argv[1])) {
	fprintf(stderr, "error unmounting %s: %s\n", argv[1], strerror(errno));
	return 1;
    }

    return 0;
}

int mkdirCommand(int argc, char ** argv) {
    char ** argptr = argv + 1;

    if (argc < 2) {
	fprintf(stderr, "umount expects one or more arguments\n");
	return 1;
    }

    while (*argptr) {
	if (mkdir(*argptr, 0755)) {
	    fprintf(stderr, "error creating directory %s: %s\n", *argptr,
			strerror(errno));
	    return 1;
	}

	argptr++;
    }

    return 0;
}

int mknodCommand(int argc, char ** argv) {
    int major, minor;
    char * path;
    int mode = 0600;
    char *end;

    if (argc != 5 && argc != 2) {
	fprintf(stderr, "usage: mknod <path> [b|c] <major> <minor> or mknod <path>\n");
	return 1;
    }

    path = argv[1];

    if (argc == 2) {
	end = path + strlen(path) - 1;
	while (end > path && *end != '/') end--;
	if (*end == '/') end++;

	if (devMakeInode(end, path)) {
	    return 1;
	}

	return 0;
    }

    if (!strcmp(argv[2], "b")) 
	mode |= S_IFBLK;
    else if (!strcmp(argv[2], "c"))
	mode |= S_IFCHR;
    else {
	fprintf(stderr, "unknown node type %s\n", argv[2]);
	return 1;
    } 

    major = strtol(argv[3], &end, 0);
    if (*end) {
	fprintf(stderr, "bad major number %s\n", argv[3]);
	return 1;
    }

    minor = strtol(argv[4], &end, 0);
    if (*end) {
	fprintf(stderr, "bad minor number %s\n", argv[4]);
	return 1;
    }

    if (mknod(path, mode, makedev(major, minor))) {
	fprintf(stderr, "mknod failed: %s\n", strerror(errno));
	return 1;
    }

    return 0;
}

int lnCommand(int argc, char ** argv) {
    char ** argptr = argv + 1;
    int force = 0, soft = 0;
    int rc;

    while (*argptr && **argptr == '-') {
	if (!strcmp(*argptr, "-f"))
	   force = 1;
	else if (!strcmp(*argptr, "-s"))
	   soft = 1;
	else if (!strcmp(*argptr, "-fs") || !strcmp(*argptr, "-sf"))
	   force = soft = 1;
	else {
	   fprintf(stderr, "ln: unknown argument %s\n", *argptr);
	   return 1;
	}

	argptr++;
    }

    if (!*argptr || !(*argptr + 1) || *(argptr + 2)) {
	fprintf(stderr, "ln requires exactly two filenames\n");
	return 1;
    }

    if (force) unlink(*(argptr + 1));
    if (soft)
	rc = symlink(*argptr, *(argptr + 1));
    else
	rc = link(*argptr, *(argptr + 1));

    if (rc) {
	perror("error");
	return 1;
    }

    return 0;
}

int rmCommand(int argc, char ** argv) {
    char ** argptr = argv + 1;

    if (argc < 2) {
	fprintf(stderr, "rm expects one or more arguments "