summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-10-11Make netfs_S_io_reauthenticate handle allocation errorsSamuel Thibault
* libnetfs/io-reauthenticate.c (netfs_S_io_reauthenticate): Loop when netfs_make_protid fails with EINTR, return error when it fails otherwise.
2015-10-11Drop duplicate port deallocationSamuel Thibault
Follow-up dbfa8a3 * libnetfs/io-reauthenticate.c (netfs_S_io_reauthenticate): Do not deallocate parameter port `rend_port' when an error will be returned. * libtrivfs/io-reauthenticate.c (trivfs_S_io_reauthenticate): Do not deallocate parameter port `rend_port' when an error will be returned.
2015-10-05Add missing null checks in libshouldbeinlibcJames Clarke
The getpwnam_r and similar functions only return non-zero on error, but not finding the given name/UID/GID does not count as an error. When they return 0, the value of the result (*result when looking at the arguments in the man pages) still needs to be checked for null. * libshouldbeinlibc/idvec-rep.c (lookup_uid): Check result for null. (lookup_gid): Likewise. * libshouldbeinlibc/idvec-verify.c (verify_passwd): Likewise. (verify_id): Likewise.
2015-10-05Update NEWS fileJustus Winter
2015-10-05libdiskfs: fflush stdout when pausingJustus Winter
* libdiskfs/boot-start.c (diskfs_start_bootstrap): fflush stdout when pausing for /hurd/startup.
2015-09-29Minor documentation changesJoshua Branson
* .gitignore: Add generated doc/hurd.aux, doc/hurd.cp, doc/hurd.cps, doc/hurd.fn, doc/hurd.ky, doc/hurd.log, doc/hurd.pdf, doc/hurd.pg, doc/hurd.sc, doc/hurd.toc, doc/hurd.tp, doc/hurd.vr files. * doc/hurd.texi: Fix typo, complete explanation about sharing Mach devices. Complete documentation for shutdown. Replace cthreads with POSIX threads.
2015-09-27libtrivfs: deprecate old apiJustus Winter
* libtrivfs/trivfs.h (trivfs_protid_portclasses): Deprecate, and schedule for removal in Hurd 0.8. (trivfs_protid_nportclasses): Likewise. (trivfs_cntl_portclasses): Likewise. (trivfs_cntl_nportclasses): Likewise.
2015-09-27libtrivfs: optimize the object lookup codeJustus Winter
* libtrivfs/mig-decls.h: Remove the specialized cases, they really blow up these functions that are supposed to be inlined. Also, look into the dynamically allocated vectors first, because this is the preferred way of using libtrivfs since 1997.
2015-09-27trans/proxy-defpager: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a severe bug. As no classes are given to `trivfs_startup', they are created and inserted into the dynamic vector of classes. The helper function `allowed', however, used the first item of the previously used static array, which is NULL. This circumvented the typecheck, allowing the default pager protocol to be spoken over control ports, likely resulting in a crash. * trans/proxy-defpager.c: Convert to dynamic classes and buckets.
2015-09-27trans/passwd: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * trans/password.c: Convert to dynamic classes and buckets.
2015-09-27trans/new-fifo: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * trans/new-fifo.c: Convert to dynamic classes and buckets.
2015-09-27trans/magic: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a severe bug. As no classes are given to `trivfs_startup', they are created and inserted into the dynamic vector of classes. The server function `trivfs_S_fsys_forward', however, used the first item of the previously used static array, which is NULL. This circumvented the typecheck. * trans/magic.c: Convert to dynamic classes and buckets.
2015-09-27trans/ifsock: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * trans/ifsock.c: Convert to dynamic classes and buckets.
2015-09-27trans/crash: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * trans/crash.c: Convert to dynamic classes and buckets.
2015-09-27pflocal: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * pflocal/pflocal.c: Convert to dynamic classes and buckets.
2015-09-27pfinet: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * pfinet/main.c: Convert to dynamic classes and buckets. * pfinet/options.c: Likewise. * pfinet/pfinet.h: Likewise. * pfinet/socket-ops.c: Likewise.
2015-09-27exec: convert to trivfs dynamic classes and bucketsJustus Winter
libtrivfs contains two ways of managing more than one port class and bucket. There is the old way of using a statically allocated array with explicit length, and the new way with dynamically allocated vectors. Converting all users to the new way of handling multiple classes and/or buckets, we can simplify the code in libtrivfs. In many cases, the code will be simpler and more expressive for the user. This also fixes a mild bug. The classes and buckets given to `trivfs_startup' end up in the dynamic vectors too, making the object lookup code use the more complicated code path. * exec/main.c: Convert to dynamic classes and buckets.
2015-09-27libdiskfs: fflush stdout when pausingJustus Winter
* libdiskfs/boot-start.c (start_execserver): fflush stdout when pausing.
2015-09-27libdiskfs: improve error handlingJustus Winter
* libdiskfs/boot-start.c (start_execserver): Improve error handling.
2015-09-23exec: add missing includeJustus Winter
* exec/main.c: Include `argz.h'.
2015-09-22libports: remove unused variablesJustus Winter
* libports/inhibit-all-rpcs.c (ports_inhibit_all_rpcs): Remove unused variable `bucket'. * libports/inhibit-class-rpcs.c (ports_inhibit_class_rpcs): Remove unused variables `pi' and `rpc'.
2015-09-19Define TIME_VALUE_TO_TIMESPEC only when not defined alreadySamuel Thibault
* exec/elfcore.c (TIME_VALUE_TO_TIMESPEC) [TIME_VALUE_TO_TIMESPEC]: Do not redefine macro.
2015-09-12Turn EADDRNOTAVAIL to more commonly-understood ECONNREFUSEDSamuel Thibault
Thanks Svante Signell for the investigation. * pflocal/socket.c (S_socket_connect, S_socket_send): When addr_get_sock returns EADDRNOTAVAIL, translate into ECONNREFUSED.
2015-09-12Fix build warningSamuel Thibault
* pflocal/sock.h (sock_bind): Move declaration.
2015-09-12Add support for ANSI.SYS SCP/RCP escape codesJames Clarke
This adds support for CSI s and u, which are equivalent to ESC 7 and 8, saving/restoring the cursor position. * console/display.c (handle_esc_bracket): Added support for CSI s and u.
2015-09-11Fix detection of terminated dgram pflocal serverSamuel Thibault
* libpipe/pipe.c (_pipe_no_readers): Break pipe for connection-less pipes too.
2015-09-11Fix closure of local server socketsSamuel Thibault
Since bound socks always have a ref for their address, they would never get freed. Thanks Svante Signell for the investigation. * pflocal/sock.h (sock_deref): When `sock' has one ref left and is bound to an address, unbound it, and thus shut it down.
2015-09-11Fix sock_bind(sock,NULL) supportSamuel Thibault
* pflocal/sock.c (sock_bind): When addr is NULL, do not take/release its mutex. When old_addr is also NULL, return EINVAL. When old_addr is not NULL, deref old_addr instead of addr.
2015-09-10Install port-deref-deferred.h header for ports.hJames Clarke
* libports/Makefile (installhdrs): Add port-deref-deferred.h for ports.h
2015-09-10Do not install libtrivfs mig stub headersSamuel Thibault
They were not usable anyway. * libtrivfs/Makefile (installhdrs): Remove generated mig stub headers.
2015-09-09libshouldbeinlibc/maptime: use memory fencesJustus Winter
* libshouldbeinlibc/maptime.h (maptime_read): Use memory fences.
2015-09-09pflocal: avoid nested functionJustus Winter
* pflocal/io.c (copy_time): Move function out of `S_io_stat', turning it into a static inline function.
2015-09-09umount: Do not report errors on making the device go awaySamuel Thibault
This fixes umounting bind mounts or other mounts for which the device can not be made away. * utils/umount.c (do_umount): When the --force option is not passed, ignore errors from file_set_translator call on the device file.
2015-09-08Also do not realpath "proc" pseudo-deviceSamuel Thibault
* sutils/fstab.c (fstab_find_device): Do not realpath "proc" pseudo-device.
2015-09-08Make procfs accept none or proc as "device"Samuel Thibault
This allows "mount none /proc -t proc" to work. * procfs/main.c (argp_parser): On ARGP_KEY_ARG, accept and ignore "none" and "proc".
2015-09-08Fix opening a fifo with O_RDWRSamuel Thibault
We should not wait for a writer in that case, since that will be ourself. * trans/fifo.c (open_hook): Do not wait for a writer when flags contains O_WRITE.
2015-09-06Fix race condition in ext2fs when remountingJames Clarke
On some systems, ext2fs.static would regularly hang at startup, as a race condition meant it would process paging requests while remounting. To fix this, libpager has been altered to allow inhibiting and resuming its worker threads, and ext2fs uses this to inhibit paging while remounting. * console/pager.c (pager_requests): New variable. (user_pager_init): Updated call to pager_start_workers to use new pager_requests variable. * daemons/runsystem.sh: Removed artificial delay working around the race condition. * ext2fs/ext2fs.c (diskfs_reload_global_state): Call new inhibit_ext2_pager and resume_ext2_pager functions, and leave sblock as non-NULL so it will be munmapped. * ext2fs/ext2fs.h (inhibit_ext2_pager,resume_ext2_pager): New functions. * ext2fs/pager.c (file_pager_requests): New variable. (create_disk_pager): Updated call to pager_start_workers to use new file_pager_requests variable. (inhibit_ext2_pager,resume_ext2_pager): New functions. * fatfs/fatfs.h (inhibit_fat_pager,resume_fat_pager): New functions. * fatfs/pager.c (file_pager_requests): New variable. (create_fat_pager): Updated call to pager_start_workers to use new file_pager_requests variable. (inhibit_fat_pager,resume_fat_pager): New functions. * libdiskfs/disk-pager.c (diskfs_disk_pager_requests): New variable. (diskfs_start_disk_pager): Updated call to pager_start_workers to use new diskfs_disk_pager_requests variable. * libdiskfs/diskfs-pager.h (diskfs_disk_pager_requests): New variable. * libpager/demuxer.c (struct pager_requests): Renamed struct requests to struct pager_requests. Replaced queue with queue_in and queue_out pointers. Added inhibit_wakeup field. (pager_demuxer): Updated to use new queue_in/queue_out pointers. Only wake up workers if not inhibited. (worker_func): Updated to use new queue_in/queue_out pointers. Final worker thread to sleep notifies the inhibit_wakeup condition variable. (pager_start_workers): Added out parameter for the requests instance. Allocate heap space shared by both queues. Initialise new inhibit_wakeup condition. (pager_inhibit_workers,pager_resume_workers): New functions. * libpager/pager.h (struct pager_requests): Public forward definition. (pager_start_workers): Added out parameter for the requests instance. (pager_inhibit_workers,pager_resume_workers): New functions. * libpager/queue.h (queue_empty): New function. * storeio/pager.c (pager_requests): New variable. (init_dev_paging): Updated call to pager_start_workers to use new pager_requests variable.
2015-08-31Fix build against glibc 2.21Samuel Thibault
* Makeconf (CPPFLAGS): Remove -D_IO_MTSAFE_IO. * libthreads/lockfile.c (_IO_MTSAFE_IO): Define macro. (IS_IN): Define macro to 0.
2015-08-25libdiskfs: rename `error' variableJustus Winter
* libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Rename `error' to `err'. * libdiskfs/file-getcontrol.c (diskfs_S_file_getcontrol): Likewise. * libdiskfs/file-syncfs.c (diskfs_S_file_syncfs): Likewise.
2015-08-25libdiskfs: add missing declarationsJustus Winter
* libdiskfs/diskfs.h (diskfs_node_disknode): Add missing declaration. (diskfs_disknode_node): Likewise.
2015-08-25libdiskfs: fix typoJustus Winter
* libdiskfs/diskfs.h: Fix typo.
2015-08-20libdiskfs: fix parent lookup in the name cacheJustus Winter
* libdiskfs/name-cache.c (diskfs_check_lookup_cache): Drop stray negation.
2015-08-15ext2fs: provide unconditional debug macroJustus Winter
* ext2fs/ext2fs.h (ext2_debug_): New macro that unconditionally prints the given message. (ext2_debug): Use the new macro.
2015-08-15ext2fs: improve ext2fs debuggingJustus Winter
* ext2fs/ext2fs.h (ext2_debug): Print to stderr. (printf): Drop declaration.
2015-08-14Fake full file access only for faked nodesSamuel Thibault
Otherwise some scripts may try to modify system files just because they find they seem to be able to. * trans/fakeroot.c (netfs_report_access): When FAKE_MODE is not set on `np', call file_check_access on the underlying node instead of returning O_RDWR|O_EXEC.
2015-08-14Make fakeroot return file types from underly fsSamuel Thibault
Fakeroot does not support faking them anyway, and they may change on the underlying fs, e.g. when creating a local socket. * trans/fakeroot.c (netfs_validate_stat): Return S_IFMT part of st_mode as provided by underlying filesystem.
2015-08-14libports: clarify why we emulate protected payloadsJustus Winter
The Hurd uses protected payloads to improve the receiver lookup on the server side to the point that we no longer do a hash table lookup in the dispatch code. If the kernel does not support protected payloads, we degrade gracefully, do one lookup in libports' dispatching code, and emulate the protected payload feature to still save one hash table lookup in the intrans function. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Add comment. * libports/manage-one-thread.c (ports_manage_port_operations_one_thread): Likewise.
2015-08-14pflocal: fix receiver lookupJustus Winter
* pflocal/mig-decls.h (begin_using_addr_payload): Use `ports_lookup_payload'.
2015-08-08Print which path init tried to execvSamuel Thibault
* init/init.c (main): On execv failure, print which path failed.
2015-07-14exec: fix setting the name of early serversJustus Winter
Previously, the exec server did not set the name of the servers started before the proc server. Instead this was done by the startup server, but this was merely a workaround, missing notably the startup server itself. * exec/exec.c (set_name): New function. (do_exec): Move the code setting the name to a new function, and also call it if the proc server is not started yet. * startup/startup.c (run): Drop hack.