edquota.c (228990) | edquota.c (241848) |
---|---|
1/* 2 * Copyright (c) 1980, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Robert Elz at The University of Melbourne. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 29 unchanged lines hidden (view full) --- 38#endif /* not lint */ 39 40#ifndef lint 41static char sccsid[] = "@(#)edquota.c 8.1 (Berkeley) 6/6/93"; 42#endif /* not lint */ 43#endif 44 45#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1980, 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Robert Elz at The University of Melbourne. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 29 unchanged lines hidden (view full) --- 38#endif /* not lint */ 39 40#ifndef lint 41static char sccsid[] = "@(#)edquota.c 8.1 (Berkeley) 6/6/93"; 42#endif /* not lint */ 43#endif 44 45#include <sys/cdefs.h> |
46__FBSDID("$FreeBSD: head/usr.sbin/edquota/edquota.c 228990 2011-12-30 10:58:14Z uqs $"); | 46__FBSDID("$FreeBSD: head/usr.sbin/edquota/edquota.c 241848 2012-10-22 03:07:05Z eadler $"); |
47 48/* 49 * Disk quota editor. 50 */ 51 52#include <sys/param.h> 53#include <sys/stat.h> 54#include <sys/file.h> --- 393 unchanged lines hidden (view full) --- 448 } 449 warn("fork"); 450 return (0); 451 } 452 if (pid == 0) { 453 const char *ed; 454 455 sigsetmask(omask); | 47 48/* 49 * Disk quota editor. 50 */ 51 52#include <sys/param.h> 53#include <sys/stat.h> 54#include <sys/file.h> --- 393 unchanged lines hidden (view full) --- 448 } 449 warn("fork"); 450 return (0); 451 } 452 if (pid == 0) { 453 const char *ed; 454 455 sigsetmask(omask); |
456 setgid(getgid()); 457 setuid(getuid()); | 456 if (setgid(getgid()) != 0) 457 err(1, "setgid failed"); 458 if (setuid(getuid()) != 0) 459 err(1, "setuid failed"); |
458 if ((ed = getenv("EDITOR")) == (char *)0) 459 ed = _PATH_VI; 460 execlp(ed, ed, tmpf, (char *)0); 461 err(1, "%s", ed); 462 } 463 waitpid(pid, &status, 0); 464 sigsetmask(omask); 465 if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) --- 494 unchanged lines hidden --- | 460 if ((ed = getenv("EDITOR")) == (char *)0) 461 ed = _PATH_VI; 462 execlp(ed, ed, tmpf, (char *)0); 463 err(1, "%s", ed); 464 } 465 waitpid(pid, &status, 0); 466 sigsetmask(omask); 467 if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) --- 494 unchanged lines hidden --- |