summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog2
-rw-r--r--coreutils/mknod.c3
-rw-r--r--miscutils/update.c2
-rw-r--r--mknod.c3
-rw-r--r--update.c2
5 files changed, 8 insertions, 4 deletions
diff --git a/Changelog b/Changelog
index b7e40e6..f185e90 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,8 @@
* Added mktemp, contributed by Daniel Jacobowitz <dan@debian.org>
* Fix for ping warnings from Sascha Ziemann <szi@aibon.ping.de>
* More doc updates
+ * Fixed update segfault
+ * Fixed mknod -- minor number was always 0
0.43
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index 0c93df6..caa234f 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -58,6 +58,7 @@ int mknod_main(int argc, char **argv)
argc--;
argv++;
parse_mode(*argv, &perm);
+ umask(0);
break;
default:
usage(mknod_usage);
@@ -87,7 +88,7 @@ int mknod_main(int argc, char **argv)
}
if (mode == S_IFCHR || mode == S_IFBLK) {
- dev = (atoi(argv[2]) << 8) | atoi(argv[1]);
+ dev = (atoi(argv[2]) << 8) | atoi(argv[3]);
}
mode |= perm;
diff --git a/miscutils/update.c b/miscutils/update.c
index 1e3e032..18b13e8 100644
--- a/miscutils/update.c
+++ b/miscutils/update.c
@@ -52,7 +52,7 @@ extern int update_main(int argc, char **argv)
argc--;
argv++;
- while (**argv == '-') {
+ while (argc>0 && **argv == '-') {
while (*++(*argv)) {
switch (**argv) {
case 'S':
diff --git a/mknod.c b/mknod.c
index 0c93df6..caa234f 100644
--- a/mknod.c
+++ b/mknod.c
@@ -58,6 +58,7 @@ int mknod_main(int argc, char **argv)
argc--;
argv++;
parse_mode(*argv, &perm);
+ umask(0);
break;
default:
usage(mknod_usage);
@@ -87,7 +88,7 @@ int mknod_main(int argc, char **argv)
}
if (mode == S_IFCHR || mode == S_IFBLK) {
- dev = (atoi(argv[2]) << 8) | atoi(argv[1]);
+ dev = (atoi(argv[2]) << 8) | atoi(argv[3]);
}
mode |= perm;
diff --git a/update.c b/update.c
index 1e3e032..18b13e8 100644
--- a/update.c
+++ b/update.c
@@ -52,7 +52,7 @@ extern int update_main(int argc, char **argv)
argc--;
argv++;
- while (**argv == '-') {
+ while (argc>0 && **argv == '-') {
while (*++(*argv)) {
switch (**argv) {
case 'S':