Commit Graph
100 Commits
Author SHA1 Message Date
Axel Dörfler e96835a9a4 Added simple test_launch_daemon.
* Expects its config files in /boot/home/test_launch.
* Uses standard I/O, and is always in user mode.
* Also added test_launch_roster command that is able to talk to the test
  server like it does to the real thing.
2017-11-29 17:19:46 +01:00
Axel Dörfler a1eceb4610 rootfs: directories must not be opened writable.
* Also added support for O_DIRECTORY while at it.
* This fixes bug #13573.
2017-07-20 10:10:20 +02:00
Axel Dörfler 84edb1a177 configure: Bumped GCC version to 2.95.3-haiku-2017_07_20.
* Script would fail otherwise, thanks korli!
2017-07-20 10:01:20 +02:00
Axel Dörfler 655aae6a79 KPathTest: Fix build for GCC 5.
* Also fixed a warning in KPath.
* Sorry, again!
2017-04-30 18:17:51 +02:00
Axel Dörfler 16825fd976 VFS: Pass on NULL for NULL paths, if allowed.
* Uses the new KPath::LAZY_ALLOC feature.
* This closes ticket #9625.
2017-04-30 17:37:17 +02:00
Axel Dörfler e9843da357 KPath: Added LAZY_ALLOC flag.
* This allows KPath to not allocate a buffer when initialized
  without path.
* Added test cases for this.
* Added test for LockBuffer().
* Enhanced tests to allow building them in debug mode.
* Moved calling vfs_normalize_path() into own private method.
* Improved error codes; B_NO_MEMORY is now only returned if the
  allocation actually failed.
* If used with LAZY_ALLOC, Path() and LockBuffer() are now allowed
  to return a NULL path.
2017-04-30 17:14:45 +02:00
Axel Dörfler f94671c33d KPath.Adopt(): Fixed path length.
* Issue was hidden due to inappropriate test values; changed test
  to uncover it.
2017-04-30 17:13:45 +02:00
Axel Dörfler eac83fb33e KPath: Replaced booleans with flags field.
* No functional change intended; I chose the flags in a way that it
  should still work even if I missed a reference.
2017-04-30 17:13:39 +02:00
Axel Dörfler e1b4aed0cb KPath: Fixed Normalize() return code, changed Leaf().
* Normalize() now returns the error code that vfs_normalize_path()
  returns.
* Leaf() now returns "" instead of "/" for the root. It's not used
  outside of KPath.
* Adapted RemoveLeaf() to deal with this correctly.
* "KPath = string" no longer changes the buffer size.
* Added missing operator tests for =, ==, and !=.
2017-04-30 17:13:33 +02:00
Axel Dörfler 4c3f62c894 cppunit: Fixed build with gcc 5 on Haiku. 2017-04-29 21:55:23 +02:00
Axel Dörfler afd07b5621 KPathTest: Fixed build with gcc 5. 2017-04-29 21:55:23 +02:00
Axel Dörfler 4be518758d KPath.Adopt() fixed incorrect path/buffer length.
* The other object was left in an inconsistent state.
* This lets the unit test for Adopt() pass.
2017-04-29 19:03:16 +02:00
Axel Dörfler 663b800476 Added unit tests for KPath.
* There are a few oddities, and at least one bug.
2017-04-29 19:02:14 +02:00
Axel Dörfler 3582d4fe85 Minor style cleanup. 2017-04-29 14:37:56 +02:00
Axel Dörfler 3431d8f20e BFS: Fixed readdir() again.
* We still need to return B_BUFFER_OVERFLOW if the passed in buffer was
  smaller than INODE_FILE_NAME_LENGTH, as that's what must be expected
  from the caller.
2017-04-14 14:39:20 +02:00
Axel Dörfler 48063a420c BFS: Use MAX_INDEX_KEY_LENGTH for queries.
* INODE_FILE_NAME_LENGTH makes no sense here, even though this change
  is not supposed to actually change anything besides the naming.
2017-04-08 22:50:54 +02:00
Axel Dörfler 6609c1a03a BFS: Removed match empty string logic.
* This produces more reliable query results no matter which index
  gets chosen to run the query.
* This fixes the final part of #13254.
2017-04-08 22:50:54 +02:00
Axel Dörfler b27b37812e bfsinfo: Added option to list/count B+tree entries.
* -l now lists the contents of string B+trees.
* -c now counts the keys in a B+tree.
* Use BPLUSTREE_MAX_KEY_LENGTH to determine the maximum allowed
  key length (was hardcoded to 255 before).
2017-04-08 22:50:54 +02:00
Axel Dörfler 4069e1f302 BFS: Fixed maximum index key length.
* The maximum key length of the B+tree, and the one BFS uses are now
  separated. This allows to stay BeOS compatible to only put a maximum
  of 255 bytes into the index, but also to handle the already existing
  larger keys (we did allow 256 bytes) without issue.
* TreeIterator::Traverse() now always cuts off string keys at the
  maximum buffer length, and only reports a B_BUFFER_OVERFLOW for the
  fixed length types.
* This fixes the important part of #13254.
2017-04-08 22:50:54 +02:00
Axel Dörfler bc600adbd8 launch_daemon: Don't allow restarting.
* Check if the port already exists on startup. This fixes #12901.
2017-04-07 18:01:14 +02:00
Axel Dörfler 99ccb18d97 Kernel IOBuffer: Fixed potential memory leak.
* IOBuffer::FreeVirtualVecCookie() did not put the last physical page
  back. This was only an issue in case GetNextVirtualVec() wasn't
  iterated through the end, for example in case of an error.
* Fixed the condition when to put back a physical page; the current
  solution will also work with the generic page mapper implementation.
* This fixes the low hanging fruits of Ingo's comment in #5777.
2017-04-06 23:31:48 +02:00
Axel Dörfler f17488662a network stack: Fixed double mutex lock.
* device_removed() no longer uses get_device_interface() to avoid
  the double locking.
* Introduced net_device_interface::busy member to avoid locking in
  device_removed() for too long.
* This should fix #7252.
2017-04-06 18:19:25 +02:00
Axel Dörfler 742b85c1f1 vfs: Let new_vnode() and publish_vnode() wait for busy vnodes.
* Both functions need to wait when encountering a busy vnode, in order
  not to create a race condition in combination with get_vnode().
* This should fix both #5262, and #9839.
* I did not implement Ingo's suggestion to burden the file systems with
  solving the problem for the following reasons:
  - I think the file system interface should be as simple as possible.
  - I can't think of a possible locking issue at least for BFS.
  - The solution on the file system side would look pretty similar to
    what the VFS already does or has to do (minus controlling the locking
    directly), so it would cause quite a functional duplication.
2017-04-02 14:30:45 +02:00
Axel Dörfler fe9ddedc07 BBox: Fixed broken fBounds position update.
* FrameMoved() is only for frame movements; only scrolling affects the
  bounds position.
* Thanks stippi!
2017-03-31 18:21:44 +02:00
Axel Dörfler ff4dee1caf BView/BBox: Fixed FrameResized() handling.
* BView incorrectly passed the current width and height to
  FrameResized(), not the one from the message. Since there is such
  a call for each size change, a Draw() might have been called for
  each of those in return.
* This should also fix such problems in BMenuBar, as it used the size
  from FrameResized() as it should have.
* BBox now correctly takes the update events into account, and no
  longer ignores the size passed to FrameResized().
* This fixes bug #3037.
2017-03-24 16:33:12 +01:00
Axel Dörfler a90df70af5 bfs: Fixed leaking cookie regression.
* Introduced with the last commit.
2017-02-19 18:22:28 +01:00
Axel Dörfler 0ed0f5cb35 bfs: Handle type 'TIME' as int32 in queries.
* This fixes ticket #6734.
2017-01-27 20:03:26 +01:00
Axel Dörfler 3ef97f9a63 hmulti_audio.media_addon: Removed superfluous semaphore.
* The semaphore wasn't really needed to do what it did; using
  atomic_{get|set}() as suggested by jua is much faster, anyway.
* Thanks to Dario for the initial work on this.
2017-01-21 20:45:51 +01:00
Axel Dörfler b9f09f030e Coding style cleanup. 2017-01-21 20:45:44 +01:00
Axel Dörfler 91cdfd96f8 bfs: Never publish the index root node.
* This caused the volume to be un-unmountable when you created an index
  on a non-indexed volume.
2017-01-19 22:14:28 +01:00
Axel Dörfler 9e71fa0e21 mkfs: Added an example to the help text. 2017-01-19 22:12:59 +01:00
Axel Dörfler 3af0b8555e bfs_shell: Fixed (missing) use of the FSSH_B_PRI* macros.
* This closes ticket #12657.
2017-01-19 22:09:16 +01:00
Axel Dörfler f79179975d bfs: Query parser needs to filter out escape char.
* When escaping operator/quote characters, the character was properly
  ignored. However, the escape char was left in the string which
  altered the query.
* This fixes bug #10976.
2017-01-19 22:07:59 +01:00
Axel Dörfler a2eb6bbda4 bfs: Minor cleanup.
* Added helper methods for operator/equation characters.
2017-01-19 22:02:27 +01:00
Axel Dörfler e5022f23b3 Coding style cleanup, no functional change. 2017-01-19 21:57:28 +01:00
Axel Dörfler 83b4b8937b bfs: Attribute creation now honors O_EXCL.
* This fixes ticket #8532.
2017-01-16 00:45:17 +01:00
Axel Dörfler a2703be2fc bfs: Update old modified time if index is missing.
* This is required to avoid spurious last modified time change
  notifications on file systems without index.
* This closes ticket #9834.
2017-01-16 00:44:53 +01:00
Axel Dörfler add77fd637 bfs: The disk clean/dirty flags were written with host endian.
* Not crucial, though, as this field is not actually used for anything.
2017-01-16 00:44:10 +01:00
Axel Dörfler 44c76b26e8 bfs: Made updating the boot block more secure.
* It now also checks the length/offset indepdently from each other,
  so that they cannot benefit from integer overflow.
* This fixes bug #12943.
2017-01-10 09:07:21 +01:00
Axel Dörfler 39f437f77e bfs: Always check if NodeGetter succeeded.
* There were quite a few cases that just assumed that the disk access
  would succeed.
* This also fixes bug #12962.
2017-01-04 23:27:23 +01:00
Axel Dörfler 80d54534fa Coding style cleanup. 2017-01-04 23:26:35 +01:00
Axel Dörfler 9bcf23b1a2 bfs: Made stream code more robust against bad data.
* Avoid divisions by zero. This closes ticket #13094.
2017-01-04 23:25:43 +01:00
Axel Dörfler 2060602c78 Workspaces: Turn off wheel switch for replicant.
* It's turned off by default for the app, so I see no reason why the
  replicant should have it. It's annoying to use, as my touchpad
  obviously scrolls when moving the mouse while having a button pressed.
* A cleaner solution would be to read the settings once if there is no
  WorkspacesWindow, and use the setting from there instead.
2016-12-29 00:27:48 +01:00
Axel Dörfler 4068f2821a MediaPlayer: Make sure the window is on screen.
* The existing check in _ResizeWindow() was avoided when there
  is an initial frame to use (when launching with an audio file).
2016-12-28 17:43:19 +01:00
Axel Dörfler 707717e8be keystore_server: Use path as dummy checksum.
* Slighty better than nothing.
2016-12-28 17:41:04 +01:00
Axel Dörfler bf4c2f93e3 launch_roster: Added restart, start/stop works on targets.
* If the launch_daemon returns B_NAME_NOT_FOUND for a job, it'll
  retry the same name as target.
2016-11-29 23:15:52 +01:00
Axel Dörfler 852e09d61f launch_daemon: Added stop target ability.
* Before, you had to stop each job by itself.
2016-11-29 23:14:36 +01:00
Axel Dörfler 4d99bf9af7 launch_daemon: Added missing reply for launch target.
* Caused BLaunchRoster::Target() to return B_NO_REPLY instead of B_OK.
2016-11-29 23:11:58 +01:00
Axel Dörfler d5f016704d app_server: Also log the incorrect version. 2016-08-26 21:29:00 +02:00
Axel Dörfler eb69155bbf app_server: Fixed/documented uses of new without nothrow.
* This should fix all occurrences except for those in the drawing
  sub directory.
* In some cases, the use of new without nothrow was okay, though.
2016-08-04 22:52:40 +02:00
Axel Dörfler f744935b65 app_server: Fixed broken ServerApp allocation.
* Did not use std::nothrow, but exceptions were not catched.
* MessageLooper::Run() now returns a status code.
* There are a lot more cases of a new without nothrow that need to
  be investigated.
2016-08-04 22:52:30 +02:00
Axel Dörfler 871a4f63c7 app_server: Fixed crash if there is no window. 2016-07-24 23:14:37 +02:00
Axel Dörfler 6331a6bd91 app_server: The client memory allocator is now reference counted.
* Not sure if cursors could also have triggered this, but the memory
  allocator can now outlive its ServerApp.
* However, this may also reveal cases of memory that is not freed
  correctly.
2016-07-24 21:53:04 +02:00
Axel Dörfler df8d92af25 Minor cleanup. 2016-07-24 13:01:09 +02:00
Axel Dörfler a449e2305c Tracker: Made open-with menu scale with font size. 2016-07-19 23:57:26 +02:00
Axel Dörfler 36c80cff6e Tracker: Fixed CachedEntryIterator::GetNextEntry() debug build.
* A "style fix" introduced in 54e2dd7272
  broke the debug version by reversing the assertion logic.
2016-07-19 23:57:26 +02:00
Axel Dörfler 0bcb836563 Tracker: Remove adding BeOS trash icons in trash watcher.
* The icons have been removed in 4e38bdba17
  which caused a debugger call in the debug build.
2016-07-19 23:57:26 +02:00
Axel Dörfler 578fabdea3 net_buffer: Fixed clang warning.
* This closes ticket #12825.
2016-07-19 22:57:18 +02:00
Axel Dörfler 7dc0c7b52d cddb_lookup: Support multiline track response.
* This fixes bug #12808.
* Also, don't accept track numbers above 99, as that's the maximum
  a CD supports.
2016-07-05 20:13:34 +02:00
Axel Dörfler 3008268c9d cddb_lookup: verbose now dumps server response.
* The pretty dump output is now only used for the -d and -i options.
2016-07-05 20:13:09 +02:00
Axel Dörfler df53a4bf21 cddb_lookup: Added options, allow dump/verbose output.
* Added option to dump the track info, and optionally not write the
  data back.
* Added option to use an alternative server.
* Added option to dump verbose track info.
* Added ability to query the CDDB without actual CD in the drive by
  providing category and CDDB ID.
* Added help text.
2016-07-05 20:12:31 +02:00
Axel Dörfler 768544f677 cddb_lookup: Cleanup.
* Use BNode::WriteAttrString() over WriteAttr().
* Use stderr for error output, print error codes when available.
* Use BObjectList instead of just a BList.
* No functional change intended.
2016-07-05 20:11:57 +02:00
Axel Dörfler 67988f501a NodeMonitor: Resolve mount points for B_WATCH_CHILDREN.
* When a watched directory contains a mount point, we need to resolve
  the actual parent directory of the mount point in the file system to
  serve the monitor.
2016-03-28 14:31:27 +02:00
Axel Dörfler 6f7fc2204b NodeMonitor: Added B_WATCH_CHILDREN flag.
* Added a directory argument for notify_{stat/attribute}_changed().
* This allows to watch only a directory, and get the notifications for
  all of its files, not just add/remove entry notifications.
2016-03-28 14:31:27 +02:00
Axel Dörfler 9cbc5b82c2 E-mail: Stop the mail_daemon if there are no accounts left.
* This fixes part of #12347.
2016-02-10 13:55:57 +01:00
Axel Dörfler 1f105f6750 Mail: Fixed double delete in PersonList.
* This should fix #12615.
2016-02-10 13:55:56 +01:00
Axel Dörfler f429e4f442 IMAP: Fixed stream vs. parse exception handling.
* Protocol::HandleNextResponse() will now exit when a stream exception
  occurs.
* This should fix bug #12601.
2016-02-10 13:55:56 +01:00
Axel Dörfler 15216b261a IMAP: Retrieve on-disk folder state async.
* Messages that we don't have info for during synchronization are now
  collected, and synchronized once the folder state is available,
  instead of waiting for that particular entry to become available
  (without proper means to wait).
2016-02-10 13:55:55 +01:00
Axel Dörfler 1870a4b1f9 IMAP: Fixed sync command handling.
* The counter did not take continuation commands into account, so that
  it would never reach zero again.
* Optimized IMAPConnectionWorker::_WaitForCommands() such that it will
  always acquire all available "slots".
2016-02-10 13:55:55 +01:00
Axel Dörfler 7d6cefeb50 IMAP: Ignore \Noselect mailboxes.
* They aren't selectable, so we can just hide them from the user.
* This should fix #12369.
2016-02-10 13:55:31 +01:00
Axel Dörfler 3d2853b218 app_server: Update overlay hooks after mode change.
* They are supposed to be depending on the current mode.
* This should help with #12613.
2016-01-28 19:51:23 +01:00
Axel Dörfler de4b1dede1 BMailProtocol: Removed delete/append methods.
* The mail system is file based which makes these methods pretty much
  superfluous.
2016-01-26 16:01:03 +01:00
Axel Dörfler aeaf68cf4b IMAP: Extra local messages are now deleted.
* When a message on the server is deleted, it will now be deleted
  locally, too.
2016-01-14 21:03:46 +01:00
Axel Dörfler 618cc43b64 IMAP: New folders will now adopt default mail attributes.
* Added a function CopyMailFolderAttributes() that copies the attribute
  layout from the text/x-email default query folder.
* This using the new CopyAttributes() method in libshared that is pretty
  much a copy of a similar method from copyattr. However, I did not
  replace the latter, as that one allows for more fine grained error
  reporting (and attribute filtering).
* Closes ticket #3498.
2016-01-14 21:00:38 +01:00
Axel Dörfler 4681e405ef MatchHeader: Fixed crash with action, use tooltips.
* When an action was already set, a menu item was being selected before
  the menu had been created -- must have happened on some refactoring.
* Use tooltips rather than fill the header/value text controls with some
  help texts.
2016-01-14 20:53:51 +01:00
Axel Dörfler ecd3b5d5f1 E-mail: Fixed view deletion order.
* The FiltersConfigView now ensures that its current filter is deleted
  before itself, as the filter's add-in would already be unloaded at
  that point.
* This fixes crashing when leaving the filter config view.
2016-01-14 20:51:43 +01:00
Axel Dörfler 94834e20a8 E-mail: Use BPathFinder to collect add-ons. 2016-01-14 20:50:18 +01:00
Axel Dörfler 7e267cd3b5 StyledEdit: Make default window size depend on font size. 2016-01-14 20:44:43 +01:00
Axel Dörfler 90fd6af0b6 launch_daemon: Added ability to enable/disable a job.
* Instead of just starting/stopping it.
* Also available via the launch_roster command.
2016-01-12 16:22:47 +01:00
Axel Dörfler 270f0f2f4a launch_daemon: Don't get the token from the registrar.
* It doesn't work, and BMessenger also only uses the preferred token.
* I haven't investigated why it doesn't work yet, though.
2016-01-12 15:57:18 +01:00
Axel Dörfler 59b0036e71 Printers: Workaround for broken print server connection.
* The actual problem is that the launch_daemon does not notice the
  manual launch of system services (because of the missing registrar
  that provides that service).
* So not checking if the print server is running actually solves the
  issue; otherwise the launch_daemon starts its own server, that will
  then get shut down, as there already is a print server (the one
  launched by the Printers preferences).
* Closes ticket #12531.
2016-01-08 21:40:19 +01:00
Axel Dörfler 8180539313 IMAP: setting flags, and body fetching works now.
* The direct methods in BMailProtocol now forward the request to the
  looper; it's no longer the mail_daemon's responsibility to know
  anything about that protocol.
* It's in desperate need of refactoring, but it doesn't hurt to add
  it to the repository as is.
2016-01-05 20:12:26 +01:00
Axel Dörfler 29871039d7 IMAP: Use BStringList instead of STL vector. 2015-12-22 19:35:09 +01:00
Axel Dörfler e69a3a86fc strace: Added option to dump syscall stats.
* Use -c/-C (same as in Linux's strace) to enable the stat output.
* Former -c to turn of colored output is now --no-color.
2015-12-22 19:35:09 +01:00
Axel Dörfler 30ac5550f1 mail_daemon: Only show new message count for new messages.
* Ie. do not show it always when the new message count changes,
  only show it when it increases.
2015-12-22 19:35:09 +01:00
Axel Dörfler 184619e625 IMAP: removed superfluous files from the old implementation. 2015-12-22 19:35:08 +01:00
Axel Dörfler d2eca26b73 Moved per user post install actions to first-login script.
* The same mechanism (and the same PostInstallScript) is used for this.
* If a file first_login exists in ~/config/settings/boot, the first-login
  scripts are launched, and the file removed.
* This fixes adding the deskbar tray icons even when there is no Deskbar
  running yet (for example on first boot when the FirstBootPrompt
  starts), or, IOW bug #12275.
2015-10-19 21:27:02 +02:00
Axel Dörfler d9bb9513c5 launch_daemon: "file_exists" now resolves $HOME, and '~'. 2015-10-19 21:22:21 +02:00
Axel Dörfler 4e8fc45146 Deskbar: converted to BServer. 2015-10-19 21:21:56 +02:00
Axel Dörfler cfe6baf62f cddb_daemon: renamed to cddb_lookup, moved to /src/bin.
* It's now a standard command line tool that is launched automatically
  via the launch_daemon whenver a volume is mounted.
2015-10-19 21:21:21 +02:00
Axel Dörfler a1406a012e launch_daemon: Increased the number of worker threads.
* Since we're disk bound, and not CPU bound, it doesn't make much sense
  to restrict the number of threads on the number of CPUs.
* It's still not completely independent of the number of CPUs now,
  though: we'll have 3 * CPU count worker threads.
2015-10-18 13:11:26 +02:00
Axel Dörfler 4ae4b3ff57 launch_daemon: Fixed the remaining "operation not allowed" bug.
* This was the harmless part: a job was been requeued that already was
  being launched.
* I was already aware of this one, and only accidentally stumbled over
  the non-harmless case in the JobQueue code when I tried to fix that
  little issue... (ie. never ignore warnings, even if you think you
  know what's going on).
2015-10-18 13:11:26 +02:00
Axel Dörfler c80084b025 JobQueue: fixed incorrect requeuing.
* A dependent job was requeued even if it wasn't part of the queue
  before. The code relied on dependent jobs being already enqueued;
  but that cannot be guaranteed.
* If a job failed, its dependent jobs are now also set to failed, so
  that they won't be requeued at a later point.
* This caused some of the "Launching xxx failed: Operation not allowed"
  messages in the boot process. Those actually weren't harmless, and
  could mess up the natural job order.
2015-10-18 13:11:26 +02:00
Axel Dörfler 0f3fcbe437 launch_daemon: Added volume_mounted event.
* Triggered whenever a volume is mounted (surprise!).
* There is no way to specify which volume you are interested in for now
  (if someone knows a good use case, I'd be willing to add that,
  though :-)).
2015-10-17 14:24:57 +02:00
Axel Dörfler 7cd19b7e5c launch_daemon: Implemented sticky events, and registration.
* Sticky events are events that keep their signal raised, ie. even if
  a job is initialized afterwards, it will still be triggered.
* Consolidated naming for external events.
* Events are now registered once they are actually being used. This
  allows them to allocate the resources they need to do their thing.
2015-10-17 14:16:26 +02:00
Axel Dörfler 5ab2b1457b BJob: Added SetState() method. 2015-10-17 14:16:26 +02:00
Axel Dörfler e96f5c3330 launch_daemon: Renamed RegisteredEvent to ExternalEventSource.
* With events being registered, this proved to be confusing, and it also
  helps to differentiate between event objects within the daemon, and
  events coming from external sources.
2015-10-17 14:16:25 +02:00
Axel Dörfler 1034412d56 notification_server: Fixed include order. 2015-10-17 14:16:13 +02:00
Axel Dörfler b5e496b575 notification_server: Converted to BServer, launch on demand. 2015-10-14 22:24:19 +02:00
Axel Dörfler 8f27961801 midi_server: Converted to BServer, launched on demand. 2015-10-14 22:24:01 +02:00