Skip to content

Commit

Permalink
Fix permissions on /
Browse files Browse the repository at this point in the history
Not having / be readable or executable by group and other caused quite a
few problems, as you can imagine. In particular, autoconf complained
that it couldn't find a sufficiently modern shell.
  • Loading branch information
tbodt committed Jan 19, 2020
1 parent 9c52840 commit afd119b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ - (int)boot {
generic_mknod("/dev/urandom", S_IFCHR|0666, dev_make(MEM_MAJOR, DEV_URANDOM_MINOR));

generic_mkdirat(AT_PWD, "/dev/pts", 0755);


// Permissions on / have been broken for a while, let's fix them
generic_setattrat(AT_PWD, "/", (struct attr) {.type = attr_mode, .mode = 0755}, false);

// Register clipboard device driver and create device node for it
err = dyn_dev_register(&clipboard_dev, DEV_CHAR, DYN_DEV_MAJOR, DEV_CLIPBOARD_MINOR);
if (err != 0) {
Expand Down
5 changes: 4 additions & 1 deletion tools/fakefsify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import sys
from pathlib import Path
import struct
import urllib.request
import tarfile
import sqlite3

Expand Down Expand Up @@ -41,6 +40,10 @@ def extract_member(archive, db, member):
else:
raise ValueError('unrecognized tar entry type')

if path == data:
# Make sure the root has sane permissions. Give everyone at least rx.
mode |= 0o555

if path != data and not path.parent.exists():
parent_member = tarfile.TarInfo(os.path.dirname(member.name))
parent_member.type = tarfile.DIRTYPE
Expand Down

0 comments on commit afd119b

Please sign in to comment.