summaryrefslogtreecommitdiff
path: root/sbin
AgeCommit message (Collapse)Author
2015-11-26When prompting for a GPT partition type, use the partition's current type asTim van der Molen
default; OK krw@
2015-11-26When prompting for an LBA, show the min and max values in the prompt; OK krw@Tim van der Molen
2015-11-26Instead, hoist TIOCGWINSZ up to the top, then "tty" pledge is not needed.Theo de Raadt
2015-11-26unbelievable.. this uses TIOCGWINSZ.. how did i miss that. pledge "tty".Theo de Raadt
2015-11-25We can't make a pledge if we're mount_mfs(8) as we need the ability to callMark Kettenis
mount(2). ok deraadt@
2015-11-25Try harder to prevent 0-length partitions from being defined.Kenneth R Westerback
Suggested by & ok tim@
2015-11-25-A needs cflag too. Noted by sthen@ during install.Kenneth R Westerback
2015-11-25Put back 1.305 without breaking the hand rolled inet_net_pton(3) caseMartin Pieuchot
for IPv4. Tested by sebastia@ and krw@
2015-11-25Do not do the early pledge, because hotroot() is a lie. fsck_extfsTheo de Raadt
is not correct duid-aware by itself.
2015-11-24hotroot is calculated late in fsck_ffs, so defer the pledge.Theo de Raadt
2015-11-24Need 'cpath' for op == EDITOR, as '-F' to write out the ascii label inKenneth R Westerback
an arbitrary location is a possibility. Suggested by & ok deraadt@
2015-11-24pledge "stdio rpath wpath disklabel proc exec" throughout, afterTheo de Raadt
krw's refactorings which hoisted disk-opening to the top. tested by krw
2015-11-23Use pledge "disklabel" as needed. The theory here is these tools become moreTheo de Raadt
resistant against memory correctup, if a corrupt filesystem is given to them. ok krw
2015-11-23Cannot pledge() in the hotroot caseTheo de Raadt
Discovered by krw
2015-11-23Revert previous tweak, as discussed on source-changes@mmcc
2015-11-23Replace socket_set_blockmode() and fcntl(fd, F_SETFL, O_NONBLOCK) callsReyk Floeter
with the SOCK_NONBLOCK flag to socket() and accept4(). OK claudio@ jung@
2015-11-23Use pledge "disklabel" as needed. The theory here is these tools become moreTheo de Raadt
resistant against memory correctup, if a corrupt filesystem is given to them. ok krw
2015-11-23"random generation numbers" -> "randomly generated numbers"mmcc
2015-11-23Remove the debugging infrastructure, which was ~1/3 of the code. Makesmmcc
pledging easier, and it was excessive complicated stuff. "Good." deraadt@
2015-11-23Revert previous it introduces a regression found by krw@Martin Pieuchot
2015-11-23ncheck_ffs may be invoked more simply as ncheck,Jason McIntyre
so add an entry to NAME and document it; ok schwarze
2015-11-23Remove more useless comments. This whole file may go eventually, as permmcc
deraadt@'s decree.
2015-11-23Initialize SIOCDIFADDR{_IN6,} argument as intended.Martin Pieuchot
How this could have been unotified for so long? Thanks to sebastia@ for reporting a breakage when re-configuring an IPv6 static address. ok sebastia@
2015-11-22Update log.c: change fatal() and fatalx() into variadic functions,Reyk Floeter
include the process name, and replace all calls of fatal*(NULL) with fatal(__func__) for better debugging. OK benno@
2015-11-21add missing NAME entries; ok schwarzeJason McIntyre
2015-11-21remove mlinks for aliases: ntalkd, mfs, updatedbJason McIntyre
ok schwarze
2015-11-21Bring GPT partition editing into line with MBR partition editingKenneth R Westerback
by presenting the existing offset and size as the defaults. Enhance getuint64() to take a minimum value as ask_num() does. Use this to ensure that GPT partitions are constrained to the valid area of the disk. Leave MBR partition constraints alone for the moment. Original problem(s) noted by tim@
2015-11-21Once again, fix the license text. After many years, we just cannotReyk Floeter
get rid of the "LOSS OF MIND" joke. Haha. We keep on removing it and it shows up again because it accidentally gets synced from somewhere else. bgpd and ospfd don't have it anymore, but their offsprings still carry it. If you see it, remove it, and, in the OpenBSD ISC case, use the original text from /usr/share/misc/license.template. All authors agree.
2015-11-21Move local logging functions to util.c (which is shared with ikectl),Reyk Floeter
sync log.c with relayd and httpd - all three daemons are using a copy of the same file now. Nevertheless, adding "extern int debug/verbose" in util.c is not super nice but helps for now. No functional change.
2015-11-21Nuke long standing annoyance of EDIT() macros and switch both Xedit()Kenneth R Westerback
and Xgedit() to a new mechanism. Keep a copy of the old partition and compare final edited version to that to decide if it is dirty. Fixes a number of (but not all!) nits in editing partitions. Original problem(s) noted by, suggestions from, much testing and ok tim@
2015-11-20De-justify more comments. From FreeBSD.mmcc
2015-11-20Monospace comments are not meant to be justified. From FreeBSD.mmcc
2015-11-20Replace hardcoded "0" with SHUT_RD; from Ricardo MestreJeremie Courreges-Anglas
2015-11-19Simplify all instances of get_string() and get_data() using malloc() andmmcc
strndup(). ok millert@
2015-11-19lexer fixes to work with new flex. from Serguey ParkhomovskyTed Unangst
2015-11-19When an existing partition is modified in LBA mode, ensure that the partitionTim van der Molen
table is marked dirty so that it gets written when "quit" is issued. This commit contains the MBR part of the fix only. The GPT code needs a few adjustments before the GPT part can be fixed properly. OK krw@
2015-11-19Oops. Missed a file.Kenneth R Westerback
Reduce overburden of unnecessary #include's. Note that param.h is included only for DEV_BSIZE. Use INT64_MAX instead of LLONG_MAX so stdint.h is enough. General tidying up of #include sections. ok GCC
2015-11-19Remove some weird comments containing only the name of the next function.mmcc
2015-11-19Don't bother casting memset() argument to void*. No binary change.mmcc
2015-11-19calloc((size_t)1, ...) -> calloc(1, ...)mmcc
No binary change (for real this time).
2015-11-19Reduce overburden of unnecessary #include's. Note that param.h isKenneth R Westerback
included only for DEV_BSIZE. Use INT64_MAX instead of LLONG_MAX so stdint.h is enough. General tidying up of #include sections. ok GCC
2015-11-18use _shadow getpwnam (and crypt_checkpass)Ted Unangst
2015-11-18Change #include <memory.h> to #include <string.h>Kenneth R Westerback
2015-11-18pledge exposed a simple bug: the unprivileged child tried to print theReyk Floeter
policy after receiving it from the parent. print_policy -> print_proto -> getprotobynumber -> pledge abort because it tried to access /etc/protocols without rpath. It was just a debugging message that can be moved to the parent (printing the policy on the sender side and not the receiver side). The parent has rpath and dns. Issue found by sthen@ with "proto etherip" OK sthen@ benno@
2015-11-18opendev() should not use OPENDEV_PART; ok millertTheo de Raadt
2015-11-18Parse the original on-disk MBR into a local variable. Use theKenneth R Westerback
partition table in this variable when doing an 'u'pdate of the MBR. Remove now superfluous MBR_pcopy() and its re-read of the on-disk MBR.
2015-11-18g_flag does not need to be a global. Move it inside main().Kenneth R Westerback
2015-11-18Rejig the MBR file reading logic soKenneth R Westerback
1) If mbr_file is NULL use built-in mbr for -i, -u and 'reinit'. 2) If mbr_file cannot be opened issue a warning and use built-in mbr for -i, -u, and 'reinit'. 3) If mbr_file can't be read, bail out of fdisk. 4) Use the mbr read from mbr_file for -i, -u, and 'reinit'. Remove inappropriate GPT dancing. This restores pre-GPT-editing mbr_file handling and makes the logic clearer at the expense of a tiny bit of duplication.
2015-11-18USER_edit() (a.k.a. -e) edits the on-disk information. So zap GPTKenneth R Westerback
and re-read it from disk if appropriate. i.e. when the re-read MBR is a protective MBR.
2015-11-18Read MBR immediately, and only read the GPT if the MBR is aKenneth R Westerback
protective MBR.