summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2013-11-09mach-defpager: turn dealloc_direct into a normal functionJustus Winter
* mach-defpager/default_pager.c (dealloc_direct): Move function definition outside of pager_truncate.
2013-11-09auth: fix use of uninitialized variable errJustus Winter
Previously a plausible execution path existed so the value of err was undefined at the end of the function, making the function return arbitrary error values. Fix this by initializing it to 0. Found using the Clang Static Analyzer. * auth/auth.c (S_auth_server_authenticate): Initialize err to 0.
2013-11-09init: fix memory leakJustus Winter
Found using the Clang Static Analyzer. * init/init.c (process_signal): Fix memory leak.
2013-11-09proc: fix error handling in S_proc_exception_raiseJustus Winter
Found using the Clang Static Analyzer. * proc/mgt.c (S_proc_exception_raise): Fix error propagation.
2013-11-09proc: fix a use-after-free errorJustus Winter
If we have to create a new process group, we have to do this before leaving the current one. The current process group is deallocated if the process is the last process in that group. Likewise, if the current group was the last group in the current groups session, the session is deallocated. Found using the Clang Static Analyzer. * proc/pgrp.c (S_proc_setpgrp): Fix use-after-free error.
2013-11-09proc: fix the declaraton of genpidJustus Winter
* proc/proc.h (genpid): Fix declaration.
2013-11-09proc: remove declaration of nested functions from proc.hJustus Winter
Remove the declaration of count_up and strore_pid from proc.h. The functions are defined as nested functions in S_proc_getallpids, there is no need to declare them. Furthermore, the declaration does not match the definition. * proc/proc.h: Remove declaration of count_up and strore_pid.
2013-11-09utils: implement settrans --pid-fileJustus Winter
This switch makes settrans write the pid file of the active translator it starts to a file. This makes the pid easily retrievable for test suites. * utils/settrans.c (options): Add --pid-file. (main): Add variable pid_file. (parse_opt): Handle --pid-file switch. (open_node): Write pid file.
2013-11-09libports: fix the thread counts in case the thread creation failsJustus Winter
Previously the number of total threads and the number of unused threads was wrong if at one point the creation of a thread failed. Fix this by decrementing both counters that were previously optimistically incremented. Adjust the comment accordingly. * libports/manage-multithread.c (ports_manage_port_operations_multithread): Fix the thread counts in case the thread creation fails.
2013-11-09Normalize whitespace at the end of each file to '\n'Justus Winter
Some files were not normalized. In console/motd.UTF8 the additional newline is intentional. Empty files were excluded as well.
2013-11-06pfinet: fix emission on the loopback deviceRichard Braun
Unlike other devices, sending packets on the loopback device causes the netif_rx() function to be called from the net_bh worker thread. Since the thread is already running, it can't wake itself up when calling mark_bh(). Use a new variable to indicate when net_bh work is pending. * glue-include/linux/interrupt.h (net_bh_raised): Declare new global variable. (mark_bh): Set net_bh_raised to 1 before waking up net_bh worker thread. * loopback.c (loopback_xmit): Add comment giving details about locking. * sched.c (net_bh_raised): Define new global variable. (net_bh_worker): Wait for net_bh_raised to become true and reset it before processing net_bh work.
2013-11-01libports: fix error handling in _ports_create_port_internalJustus Winter
Previously any err value set before reaching lose: was overwritten and thus not properly propagated. Found using the Clang Static Analyzer. * libports/create-internal.c (_ports_create_port_internal): Fix error handling.
2013-11-01Fix use after freeSamuel Thibault
Reported by Justus Winter * libtrivfs/protid-clean.c (trivfs_clean_protid): New variable `cntl` factorizes access to `cred->po->cntl`, and fixes use after free of cred->po.
2013-11-01libshouldbeinlibc: fix error handling in maptime_mapJustus Winter
Found using the Clang Static Analyzer. * libshouldbeinlibc/maptime.c (maptime_map): Fix error handling.
2013-11-01exec: Remove the remaining BFD related bitsJustus Winter
* exec/Makefile: Remove commented out lines related to BFD. * exec/hostarch.c: Remove all BFD related code. * exec/main.c: Likewise.
2013-10-31configure.ac: properly escape the test for X11/keysymdef.hJustus Winter
* configure.ac: Properly escape the test for X11/keysymdef.h using AC_LANG_SOURCE.
2013-10-28Make boot script accept more fsck valuesSamuel Thibault
* daemons/rc.sh: Accept fsck returning 5 and 9 too.
2013-10-22Add xenl to hurd.tiSamuel Thibault
* console/hurd.ti (xenl): Add capability.
2013-10-22Make CUD more usualSamuel Thibault
Whether CUD scrolls the screen or not is implementation-dependant. Applications are not supposed to assume one way or the other, but they sometimes do, and most implementations do scroll, so let's stick to common practice. * console/display.c (handle_esc_bracket): On CUD/VPR, scroll the screen instead of capping the cursor position.
2013-10-22Make boot script reboot when fsck told soSamuel Thibault
* daemons/rc.sh: When fsck returned 2 or 3, reboot the system.
2013-10-18pflocal: fix message flags on receiveRichard Braun
* pflocal/socket.c (S_socket_recv): Set the memory pointed by out_flags to 0 instead of the pointer.
2013-10-18pflocal: fix port leak when receiving port rightsRichard Braun
The socket_send and socket_recv routines can be used to transmit port rights along data. Unfortunately, pflocal retains a copy of these rights in the socket_recv RPC. These lingering references would in turn lead to other leaks in servers waiting for a no-sender notification to clean their resources. Since these copied rights aren't used at all by the server, it is safe to simply move them to the recipient instead. * pflocal/socket.c (S_socket_recv): Transmit port rights using MACH_MSG_TYPE_MOVE_SEND transfer type instead of MACH_MSG_TYPE_COPY_SEND.
2013-10-18libdiskfs: fix removal of socket nodesRichard Braun
When the file system supports ifsock shortcuts, a socket node can obtain a right on a socket address. This reference is only lost if the address is destroyed, through a dead-name notification. On the other hand, pflocal keeps the address around until all references are dropped. This leads to a situation where socket nodes, addresses, and their associated sockets are leaked. To remedy the situation, make addresses get a light reference on socket nodes, and properly deallocate it when the node is destroyed, which will in turn make pflocal correctly remove the matching address and socket. * libdiskfs/ifsock.c (diskfs_S_ifsock_getsockaddr): Add a light reference instead of a hard one. * libdiskfs/node-nput.c (diskfs_nput): Deallocate right to socket address when cleaning light references.
2013-10-18pflocal: fix destruction of explicitely bound socketsRichard Braun
Sockets must have a weak reference on the address they're bound to so that addr_unbind is properly called before addr_clean. For sockets that are automatically bound, this weak reference is created in ensure_addr. Do the same in sock_bind. * pflocal/sock.c (sock_bind): Handle weak reference on addr.
2013-10-14term: fix read on a closed PTYRichard Braun
* term/ptyio.c (pty_io_read): Return EIO if the terminal has been closed.