summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-12-04trans: fix transparent reauthentication in fakerootJustus Winter
When looking up files, fakeroot intercepts reauthentication requests and executes io_reauthenticate and auth_user_authenticate transparently for the client. This, however, makes the client incorrectly assume that the lookup is finished (assuming /media/scratch is a translator): % cd /media/scratch && fakeroot-hurd pwd pwd: reading directory `..': Bad file descriptor Make the reauthentication completely transparent to the client by re-doing the lookup ourselves. * trans/fakeroot.c (netfs_S_dir_lookup): Fix transparent reauthentication.
2013-12-04trans: fix the creation of files in fakerootJustus Winter
Previously, fakeroot failed to create files in certain circumstances, e. g. assuming /tmp is a tmpfs and /tmp/some_file does not exist: % cd /tmp && fakeroot-hurd /bin/sh -c ':>/tmp/some_file' /bin/sh: 1: cannot create /tmp/some_file: Is a directory Fix this by sanitizing the flags value not to contain O_WRITE if we're not at the last path component. * trans/fakeroot.c (netfs_S_dir_lookup): Strip O_WRITE from flags when looking up all but the last path component.
2013-12-04trans: improve the netfs_demuxer function in fakeroot.cJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * trans/fakeroot.c (netfs_demuxer): Improve the demuxer function.
2013-12-04trans: remove unused declaration from fakeroot.cJustus Winter
Any messages we do not intercept are forwarded to the underlying file. * trans/fakeroot.c (netfs_demuxer): Remove unused declaration of function netfs_ifsock_server.
2013-12-04utils: improve the auth_demuxer function in fakeauth.cJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * utils/fakeauth.c (auth_demuxer): Improve the demuxer function.
2013-12-04auth: improve the auth_demuxer functionJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * auth/auth.c (auth_demuxer): Improve the demuxer function.
2013-12-02pflocal: improve the demuxer functionsJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * pflocal/pflocal.c (pf_demuxer): Improve the demuxer function. * pflocal/sserver.c (sock_demuxer): Likewise.
2013-12-02pfinet: improve the pfinet_demuxer functionJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * pfinet/main.c (pfinet_demuxer): Improve the demuxer function.
2013-12-02proc: improve the message_demuxer functionJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * proc/main.c (message_demuxer): Improve the demuxer function.
2013-12-02exec: improve the exec_demuxer functionJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. Furthermore, move the exec_startup_server_routine to the end of the chain, as the startup related functions are only needed at system bootstrap time. * exec/main.c (exec_demuxer): Improve the demuxer function.
2013-12-02libtrivfs: improve the trivfs_demuxer functionJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * libtriv/demuxer.c (trivfs_demuxer): Improve the demuxer function.
2013-12-02libnetfs: improve the netfs_demuxer functionJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. * libnetfs/demuxer.c (netfs_demuxer): Improve the demuxer function.
2013-12-02libdiskfs: improve the diskfs_demuxer functionJustus Winter
Handle multiple request types as recommended by the Mach Server Writer's Guide section 4, subsection "Handling Multiple Request Types". This avoids initializing the reply message in every X_server function. The reply message has already been properly initialized in libports, so there is no need to call mig_reply_setup. Furthermore, move diskfs_exec_startup_server_routine to the end of the chain, as the startup related functions are only needed at system bootstrap time in the root filesystem. * libdiskfs/demuxer.c (diskfs_demuxer): Improve the demuxer function.
2013-11-30libports: another right leak fixRichard Braun
* libports/manage-multithread.c (adjust_priority): Deallocate host right before returning.
2013-11-28libfshelp: improve error handling in fshelp_start_translator_longJustus Winter
Properly deallocate all ports and terminate the started translator if an error occurs. * libfshelp/start-translator-long.c (fshelp_start_translator_long): Improve error handling.
2013-11-28proc: store the device master port in _hurd_device_masterJustus Winter
* proc/host.c (S_proc_getprivports): Adapt accordingly. * proc/main.c (main): Store the device master port in _hurd_device_master. * proc/proc.h (master_device_port): Remove unused variable.
2013-11-28proc: store the privileged host port in _hurd_host_privJustus Winter
Store the privileged host port in _hurd_host_priv like it is done in the root filesystem. This fixes the thread priority adjustment in the proc server. Prior to this fix, a warning message "unable to adjust libports thread priority" sometimes appeared early in the boot process. * proc/host.c (S_proc_getprivports): Adapt accordingly. (S_proc_register_version): Likewise. * proc/mgt.c (add_tasks): Likewise. * proc/msg.c (tickle_init): Likewise. * proc/main.c (main): Store the privileged host port in _hurd_host_priv. * proc/proc.h: Remove unused variable master_host_port. fixup_store_priv_port
2013-11-28libports: improve error reporting in adjust_priorityJustus Winter
By using error instead of perror, the warning can be proprely attributed to the process. * libports/manage-multithread.c (adjust_priority): Use error instead of perror to print the warning.
2013-11-28libdiskfs: improve error reporting in diskfs_start_disk_pagerJustus Winter
* libdiskfs/disk-pager.c (diskfs_start_disk_pager): Improve error reporting.
2013-11-28libports: improve error handling in ports_transfer_rightJustus Winter
* libports/transfer-right.c (ports_transfer_right): Improve error handling.
2013-11-28libports: improve error handling in ports_reallocate_from_externalJustus Winter
* libports/reallocate-from-external.c (ports_reallocate_from_external): Improve error handling.
2013-11-28libports: improve error handling in ports_reallocate_portJustus Winter
* libports/reallocate-port.c (ports_reallocate_port): Improve error handling.
2013-11-28proc: update commentsJustus Winter
* proc/main.c (main): Update comment. The proc server is no longer PID 0. * proc/proc.h: Likewise.
2013-11-28init: fix port leakJustus Winter
* init/init.c (S_startup_essential_task): Fix port leak.
2013-11-28libshouldbeinlibc: fix minor port leak in maptime_mapJustus Winter
Deallocate the device port after creating the mapping. The mapping is independent of the device port. * libshouldbeinlibc/maptime.c (maptime_map): Deallocate device port.
2013-11-26libports: fix right leaks when adjusting prioritiesRichard Braun
* libports/manage-multithread.c (adjust_priority): Deallocate processor set rights before returning.
2013-11-21libshouldbeinlibc: fix error handling in maptime_mapJustus Winter
Found using the Clang Static Analyzer. * libshouldbeinlibc/maptime.c (maptime_map): Fix error handling.
2013-11-21mach-defpager: drop all register qualifiersJustus Winter
* mach-defpager/default_pager.c: Drop register qualifiers. * mach-defpager/kalloc.c: Likewise. * mach-defpager/queue.h: Likewise. * mach-defpager/wiring.c: Likewise.
2013-11-21usermux: actually use the computed flags value in netfs_attempt_utimesJustus Winter
If either atime or mtime is NULL, the respective time should be set to the current time. Found using the Clang Static Analyzer. * usermux/node.c (netfs_attempt_utimes): Use flags in call to fshelp_touch.
2013-11-21nfsd: fix error handling in op_removeJustus Winter
Found using the Clang Static Analyzer. * nfsd/ops.c (op_remove): Fix error handling.
2013-11-21fatfs: fix error handling in diskfs_get_directsJustus Winter
Found using the Clang Static Analyzer. * fatfs/dir.c (diskfs_get_directs): Fix error handling.
2013-11-21fatfs: fix error handling in diskfs_lookup_hardJustus Winter
Found using the Clang Static Analyzer. * fatfs/dir.c (diskfs_lookup_hard): Fix error handling.
2013-11-21libps: fix the length computation in fprint_frac_valueJustus Winter
Found using the Clang Static Analyzer. * libps/spec.c (fprint_frac_value): Fix computation of value_len.
2013-11-21utils: fix dead initializationJustus Winter
Found using the Clang Static Analyzer. * utils/frobauth.c (posix_parse_opt): Fix dead initialization. (no_ugids_parse_opt): Likewise.
2013-11-19Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurdSamuel Thibault
2013-11-19Make sure created netfs nodes have stat validatedSamuel Thibault
Just like it always is in libnetfs' normal netfs_S_dir_lookup. * trans/fakeroot.c (netfs_S_dir_lookup): Call netfs_validate_stat after calling new_node.
2013-11-16libports: implement lockless management of threadsJustus Winter
ports_manage_port_operations_multithread uses two values, totalthreads and nreqthreads, to manage the threads it creates. Previously a lock was used to synchronize the access to them. Use atomic operations instead. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Use atomic operations instead of a lock to synchronize the access to totalthreads and nreqthreads.
2013-11-16Clean up the included header filesJustus Winter
* libihash/ihash.c: Clean up the included header files. * libshouldbeinlibc/cacheq.c: Likewise. * libshouldbeinlibc/canon-host.c: Likewise. * libshouldbeinlibc/fsysops.c: Likewise. * libshouldbeinlibc/idvec-auth.c: Likewise. * libshouldbeinlibc/idvec.c: Likewise. * libshouldbeinlibc/idvec.h: Likewise. * libshouldbeinlibc/localhost.c: Likewise. * libshouldbeinlibc/maptime.c: Likewise. * libshouldbeinlibc/nullauth.c: Likewise. * libshouldbeinlibc/portxlate.c: Likewise. * libshouldbeinlibc/shared-dom.c: Likewise. * libshouldbeinlibc/ugids-argp.c: Likewise. * libshouldbeinlibc/ugids-auth.c: Likewise. * libshouldbeinlibc/ugids-imply.c: Likewise. * libshouldbeinlibc/ugids-merge.c: Likewise. * libshouldbeinlibc/ugids-subtract.c: Likewise. * libshouldbeinlibc/ugids-verify-auth.c: Likewise. * libshouldbeinlibc/ugids-verify.c: Likewise. * libshouldbeinlibc/ugids.c: Likewise. * libshouldbeinlibc/ugids.h: Likewise. * libshouldbeinlibc/wire.c: Likewise.
2013-11-15mach-defpager: do not remove -Wall from CFLAGSJustus Winter
Bother, said Pooh. * Makefile: Do not remove -Wall from CFLAGS.
2013-11-15mach-defpager: fix the page offsets returned by pager_pagesJustus Winter
Previously the increment was outside the loop body, turning it into a dead increment. Move the increment into the loop body as it is done in the true branch above. This fixes the offsets recorded in the default_pager_page_t objects. Found using the Clang Static Analyzer. * mach-defpager/default_pager.c (pager_pages): Fix returned page offsets.
2013-11-15libshouldbeinlibc: fix dead assignmentJustus Winter
Found using the Clang Static Analyzer. * libshouldbeinlibc/timefmt.c (fmt_past_time): Fix dead assignment, normalize adjacent white space.
2013-11-15ext2fs: fix error handlingJustus Winter
Found using the Clang Static Analyzer. * ext2fs/dir.c (diskfs_lookup_hard): Fix error handling.
2013-11-15libdiskfs: fix error handlingJustus Winter
Found using the Clang Static Analyzer. * libdiskfs/dir-renamed.c (diskfs_rename_dir): Fix error handling.
2013-11-15libdiskfs: remove dead assignmentJustus Winter
Found using the Clang Static Analyzer. * libdiskfs/io-write.c (diskfs_S_io_write): Remove dead assignment.
2013-11-10utils: implement portinfo --searchJustus Winter
Implement the --search switch of portinfo. The feature was suggested in the source code and partly implemented. portinfo --search locates the target ports (or all ports) in any other process and prints the port mapping and information about the port in the remote process. * utils/Makefile: Link portinfo against libps. * utils/portinfo.c (options): Enable --search option. (search_for_port): New function. (search_for_ports): Likewise. (main): Call search_for_port{,s} as appropiate.
2013-11-10libshouldbeinlibc: fix reference counting in port_name_xlator_createJustus Winter
Both task ports are deallocated in the destructor, so they must be referenced in the constructor. * libshouldbeinlibc/portxlate.c (port_name_xlator_create): Fix reference counting.
2013-11-10mach-defpager: include errno.hJustus Winter
* mach-defpager/default_pager.c: Include errno.h.
2013-11-10proc: turn count_up and store_pid into normal functionsJustus Winter
Previously count_up and store_pid were defined inside S_proc_getallpids. Move them out of that function and declare them static. * proc/mgt.c: Turn count_up and store_pid into normal functions.
2013-11-10term: fix error handling in hurdio_mdmctlJustus Winter
hurdio_mdmctl allows one to set and clear bits from the modem control bit vector. However, plausible code paths exist that leave oldbits uninitialized. Fix this by returning an error instead if retrieving the oldbits failed and the bit set or clear operation was selected. Found using the Clang Static Analyzer. * term/hurdio.c (hurdio_mdmctl): Fix error handling.
2013-11-09mach-defpager: remove unused variablesJustus Winter
Found using the Clang Static Analyzer. * mach-defpager/default_pager.c (seqnos_memory_object_terminate): Remove unused variables request_refs and name_refs.