Compare commits

..

No commits in common. "caa92556c5089ba398d53764016bb4609ff2a17d" and "af92d5cae8751450221fb93766a2d992400a84d6" have entirely different histories.

11 changed files with 12 additions and 1164 deletions

View file

@ -2549,7 +2549,7 @@ static void write_random_seed(void)
{
const char* will_not = "next boot will not have fresh randomness";
const char* path = "/boot/random.seed";
int fd = open(path, O_RDWR | O_CREAT | O_NOFOLLOW, 0600);
int fd = open(path, O_WRONLY | O_CREAT | O_NOFOLLOW, 0600);
if ( fd < 0 )
{
if ( errno != ENOENT && errno != EROFS )
@ -2568,10 +2568,6 @@ static void write_random_seed(void)
close(fd);
return;
}
// Mix in the old random seed so the sysadmin can add new randomness here.
unsigned char old[256] = {0};
readall(fd, old, sizeof(old));
lseek(fd, 0, SEEK_SET);
// Write out randomness, but mix in some fresh kernel randomness in case the
// randomness used to seed arc4random didn't have enough entropy, there may
// be more now.
@ -2580,7 +2576,7 @@ static void write_random_seed(void)
unsigned char newbuf[256];
getentropy(newbuf, sizeof(newbuf));
for ( size_t i = 0; i < 256; i++ )
buf[i] ^= newbuf[i] ^ old[i];
buf[i] ^= newbuf[i];
size_t done = writeall(fd, buf, sizeof(buf));
explicit_bzero(buf, sizeof(buf));
if ( done < sizeof(buf) )

View file

@ -608,7 +608,7 @@ int Descriptor::utimens(ioctx_t* ctx, const struct timespec* user_times)
return -1;
if ( !valid_utimens_timespec(times[0]) ||
!valid_utimens_timespec(times[1]) )
return errno = EINVAL, -1;
return errno = EINVAL;
// TODO: Regardless of dflags, check if the user/group can utimens.
return vnode->utimens(ctx, times);
}

View file

@ -282,7 +282,7 @@ int sys_ftruncate(int fd, off_t length)
int sys_fstatat(int dirfd, const char* path, struct stat* st, int flags)
{
if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
return errno = EINVAL, -1;
return errno = EINVAL;
char* pathcopy = GetStringFromUser(path);
if ( !pathcopy )
return -1;
@ -319,7 +319,7 @@ int sys_fstatvfs(int fd, struct statvfs* stvfs)
int sys_fstatvfsat(int dirfd, const char* path, struct statvfs* stvfs, int flags)
{
if ( flags & ~(AT_SYMLINK_NOFOLLOW) )
return errno = EINVAL, -1;
return errno = EINVAL;
char* pathcopy = GetStringFromUser(path);
if ( !pathcopy )
return -1;

View file

@ -513,12 +513,10 @@ bool RouteIPEthernet(NetworkInterface* netif,
{
struct ether_addr local_ether;
struct in_addr local_in;
struct in_addr local_router;
struct in_addr local_subnet;
kthread_mutex_lock(&netif->cfg_lock);
memcpy(&local_ether, &netif->cfg.ether.address, sizeof(struct ether_addr));
memcpy(&local_in, &netif->cfg.inet.address, sizeof(struct in_addr));
memcpy(&local_router, &netif->cfg.inet.router, sizeof(struct in_addr));
memcpy(&local_subnet, &netif->cfg.inet.subnet, sizeof(struct in_addr));
kthread_mutex_unlock(&netif->cfg_lock);
if ( be32toh(local_in.s_addr) == INADDR_ANY )
@ -554,13 +552,6 @@ bool RouteIPEthernet(NetworkInterface* netif,
assert(!pkt->next);
if ( !(entry->status & ARP_STATUS_RESOLVING) && !Resolve(netif, entry) )
return false;
// If the address isn't resolved, try send to the router instead.
if ( dst->s_addr != local_router.s_addr &&
local_router.s_addr != INADDR_ANY )
{
lock.Reset();
return RouteIPEthernet(netif, pkt, &local_router);
}
// Drop the packet if the transmission queue is full.
if ( ARP_MAX_PENDING <= entry->pending )
return true;

View file

@ -2016,7 +2016,7 @@ ssize_t TCPSocket::send_unlocked(ioctx_t* ctx,
if ( sockerr )
return errno = sockerr, -1;
if ( ctx->dflags & O_NONBLOCK )
return errno = EWOULDBLOCK, -1;
return errno = EWOULDBLOCK;
if ( !kthread_cond_wait_signal(&transmit_cond, &tcp_lock) )
return errno = EINTR, -1;
}

View file

@ -114,7 +114,7 @@ int sys_sigaction(int signum,
struct sigaction* user_oldact)
{
if ( signum < 0 || signum == 0 /* null signal */ || SIG_MAX_NUM <= signum )
return errno = EINVAL, -1;
return errno = EINVAL;
Process* process = CurrentProcess();
ScopedLock lock(&process->signal_lock);

View file

@ -760,7 +760,7 @@ int TTY::tcflow(ioctx_t* /*ctx*/, int action)
case TCOON: break; // TODO: Resume suspended output.
case TCIOFF: break; // TODO: Transmit STOP character.
case TCION: break; // TODO: Transmit START character.
default: return errno = EINVAL, -1;
default: return errno = EINVAL -1;
}
return 0;
}

View file

@ -1,7 +1,7 @@
diff -Paur --no-dereference -- links.upstream/configure links/configure
--- links.upstream/configure
+++ links/configure
@@ -124,7 +124,7 @@
@@ -122,7 +122,7 @@
includedir='${prefix}/include'
oldincludedir='/usr/include'
infodir='${prefix}/info'
@ -10,7 +10,7 @@ diff -Paur --no-dereference -- links.upstream/configure links/configure
# Initialize some other variables.
subdirs=
@@ -241,7 +241,7 @@
@@ -239,7 +239,7 @@
--includedir=DIR C header files in DIR [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
--infodir=DIR info documentation in DIR [PREFIX/info]

View file

@ -1,10 +1,10 @@
NAME=links
BUILD_LIBRARIES='libssl libbrotli? libevent? liblzma? libz? libzstd? liblzip?'
VERSION=2.29
VERSION=2.28
DISTNAME=links-$VERSION
COMPRESSION=tar.bz2
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=22aa96c0b38e1a6f8f7ed9d7a4167a47fc37246097759ef6059ecf8f9ead7998
SHA256SUM=2fd5499b13dee59457c132c167b8495c40deda75389489c6cccb683193f454b4
UPSTREAM_SITE=http://links.twibright.com/download
UPSTREAM_ARCHIVE=$ARCHIVE
BUILD_SYSTEM=configure

File diff suppressed because it is too large Load diff

View file

@ -1,14 +0,0 @@
NAME=nginx
BUILD_LIBRARIES='libpcre libssl'
VERSION=1.23.3
DISTNAME=$NAME-$VERSION
COMPRESSION=tar.gz
ARCHIVE=$DISTNAME.$COMPRESSION
SHA256SUM=75cb5787dbb9fae18b14810f91cc4343f64ce4c24e27302136fb52498042ba54
UPSTREAM_SITE=https://nginx.org/download/
UPSTREAM_ARCHIVE=$ARCHIVE
LICENSE=BSD-2-Clause
BUILD_SYSTEM=configure
CONFIGURE_ARGS="--buildname=Sortix --user=_nginx --group=_nginx --without-select_module --prefix=/share/nginx --sbin-path=/sbin/nginx --modules-path=/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx/nginx.lock --lock-path=/var/log/nginx.lock --error-log-path=stderr --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-http_addition_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_sub_module --with-threads"
MAKE_BUILD_TARGET=default
MAKE_CLEAN_TARGET=clean