vfs: check userland buffers before reading them.
[haiku.git] / src / kits / package / DropRepositoryRequest.cpp
blobea54d8626b6f9a1b4fe3a91c793006bf03162ad9
1 /*
2 * Copyright 2011-2015, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Oliver Tappe <zooey@hirschkaefer.de>
7 */
10 #include <package/DropRepositoryRequest.h>
12 #include <Directory.h>
13 #include <JobQueue.h>
14 #include <Path.h>
16 #include <package/RemoveRepositoryJob.h>
19 namespace BPackageKit {
22 using namespace BPrivate;
25 DropRepositoryRequest::DropRepositoryRequest(const BContext& context,
26 const BString& repositoryName)
28 inherited(context),
29 fRepositoryName(repositoryName)
34 DropRepositoryRequest::~DropRepositoryRequest()
39 status_t
40 DropRepositoryRequest::CreateInitialJobs()
42 status_t result = InitCheck();
43 if (result != B_OK)
44 return B_NO_INIT;
46 RemoveRepositoryJob* removeRepoJob
47 = new (std::nothrow) RemoveRepositoryJob(fContext,
48 BString("Removing repository ") << fRepositoryName,
49 fRepositoryName);
50 if (removeRepoJob == NULL)
51 return B_NO_MEMORY;
52 if ((result = QueueJob(removeRepoJob)) != B_OK) {
53 delete removeRepoJob;
54 return result;
57 return B_OK;
61 } // namespace BPackageKit