diff --git a/src/add-ons/kernel/file_systems/netfs/authentication_server/AuthenticationServer.cpp b/src/add-ons/kernel/file_systems/netfs/authentication_server/AuthenticationServer.cpp
index e648624..67eef1b 100644
a
|
b
|
AuthenticationServer::_RequestThread()
|
350 | 350 | context, server, share, badPassword, request.ReplyPort(), |
351 | 351 | request.ReplyToken()); |
352 | 352 | if (!task) { |
353 | | ERROR("AuthenticationServer::_RequestThread(): ERROR: " |
354 | | "failed to allocate "); |
| 353 | ERROR(("AuthenticationServer::_RequestThread(): ERROR: " |
| 354 | "failed to allocate ")); |
355 | 355 | continue; |
356 | 356 | } |
357 | 357 | status_t error = taskManager.RunTask(task); |
358 | 358 | if (error != B_OK) { |
359 | | ERROR("AuthenticationServer::_RequestThread(): Failed to " |
360 | | "start server info task: %s\n", strerror(error)); |
| 359 | ERROR(("AuthenticationServer::_RequestThread(): Failed to " |
| 360 | "start server info task: %s\n", strerror(error))); |
361 | 361 | continue; |
362 | 362 | } |
363 | 363 | } |
diff --git a/src/add-ons/kernel/file_systems/netfs/client/QueryManager.cpp b/src/add-ons/kernel/file_systems/netfs/client/QueryManager.cpp
index 33be9bc..101562c 100644
a
|
b
|
QueryManager::PutIterator(QueryIterator* iterator)
|
200 | 200 | delete iteratorList; |
201 | 201 | } |
202 | 202 | } else { |
203 | | ERROR("QueryManager::PutIterator(): ERROR: No iterator list " |
204 | | "for volume %p!\n", iterator->GetVolume()); |
| 203 | ERROR(("QueryManager::PutIterator(): ERROR: No iterator list " |
| 204 | "for volume %p!\n", iterator->GetVolume())); |
205 | 205 | } |
206 | 206 | |
207 | 207 | // free the iterator and surrender its volume reference |
diff --git a/src/add-ons/kernel/file_systems/netfs/client/ServerManager.cpp b/src/add-ons/kernel/file_systems/netfs/client/ServerManager.cpp
index e443f43..35f569e 100644
a
|
b
|
public:
|
76 | 76 | // create a socket |
77 | 77 | fFD = socket(AF_INET, SOCK_STREAM, 0); |
78 | 78 | if (fFD < 0) { |
79 | | ERROR("ServerManager::ServerInfoTask: ERROR: Failed to create " |
80 | | "socket: %s\n", strerror(errno)); |
| 79 | ERROR(("ServerManager::ServerInfoTask: ERROR: Failed to create " |
| 80 | "socket: %s\n", strerror(errno))); |
81 | 81 | return errno; |
82 | 82 | } |
83 | 83 | return B_OK; |
… |
… |
public:
|
89 | 89 | sockaddr_in addr = fServerInfo->GetAddress().GetAddress(); |
90 | 90 | addr.sin_port = htons(kDefaultServerInfoPort); |
91 | 91 | if (connect(fFD, (sockaddr*)&addr, sizeof(addr)) < 0) { |
92 | | ERROR("ServerManager::ServerInfoTask: ERROR: Failed to connect " |
93 | | "to server info port: %s\n", strerror(errno)); |
| 92 | ERROR(("ServerManager::ServerInfoTask: ERROR: Failed to connect " |
| 93 | "to server info port: %s\n", strerror(errno))); |
94 | 94 | return errno; |
95 | 95 | } |
96 | 96 | |
… |
… |
public:
|
102 | 102 | Request* _request; |
103 | 103 | status_t error = requestChannel.ReceiveRequest(&_request); |
104 | 104 | if (error != B_OK) { |
105 | | ERROR("ServerManager::ServerInfoTask: ERROR: Failed to receive " |
106 | | "server info request: %s\n", strerror(errno)); |
| 105 | ERROR(("ServerManager::ServerInfoTask: ERROR: Failed to receive " |
| 106 | "server info request: %s\n", strerror(errno))); |
107 | 107 | return error; |
108 | 108 | } |
109 | 109 | ObjectDeleter<Request> requestDeleter(_request); |
110 | 110 | ServerInfoRequest* request = dynamic_cast<ServerInfoRequest*>(_request); |
111 | 111 | if (!request) { |
112 | | ERROR("ServerManager::ServerInfoTask: ERROR: Received request " |
113 | | "is not a server info request.\n"); |
| 112 | ERROR(("ServerManager::ServerInfoTask: ERROR: Received request " |
| 113 | "is not a server info request.\n")); |
114 | 114 | return B_BAD_DATA; |
115 | 115 | } |
116 | 116 | |
… |
… |
ServerManager::_BroadcastListener()
|
396 | 396 | } |
397 | 397 | status_t error = taskManager.RunTask(task); |
398 | 398 | if (error != B_OK) { |
399 | | ERROR("ServerManager::_BroadcastListener(): Failed to start server " |
400 | | "info task: %s\n", strerror(error)); |
| 399 | ERROR(("ServerManager::_BroadcastListener(): Failed to start server " |
| 400 | "info task: %s\n", strerror(error))); |
401 | 401 | continue; |
402 | 402 | } |
403 | 403 | } |
… |
… |
ServerManager::_InitBroadcastListener()
|
418 | 418 | addr.sin_port = htons(kDefaultBroadcastPort); |
419 | 419 | addr.sin_addr.s_addr = INADDR_ANY; |
420 | 420 | if (bind(fBroadcastListenerSocket, (sockaddr*)&addr, sizeof(addr)) < 0) { |
421 | | ERROR("ServerManager::_InitBroadcastListener(): ERROR: bind()ing the " |
422 | | "broadcasting socket failed: %s\n", strerror(errno)); |
| 421 | ERROR(("ServerManager::_InitBroadcastListener(): ERROR: bind()ing the " |
| 422 | "broadcasting socket failed: %s\n", strerror(errno))); |
423 | 423 | safe_closesocket(fBroadcastListenerSocket); |
424 | 424 | return errno; |
425 | 425 | } |
… |
… |
ServerManager::_ServerAdded(ExtendedServerInfo* serverInfo)
|
470 | 470 | fListener->ServerAdded(serverInfo); |
471 | 471 | } |
472 | 472 | } else { |
473 | | WARN("ServerManager::_ServerAdded(%p): WARNING: Unexpected server " |
474 | | "info.\n", serverInfo); |
| 473 | WARN(("ServerManager::_ServerAdded(%p): WARNING: Unexpected server " |
| 474 | "info.\n", serverInfo)); |
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
… |
… |
ServerManager::_ServerUpdated(ExtendedServerInfo* serverInfo)
|
505 | 505 | } |
506 | 506 | oldInfo->ReleaseReference(); |
507 | 507 | } else { |
508 | | WARN("ServerManager::_ServerUpdated(%p): WARNING: Unexpected server " |
509 | | "info.\n", serverInfo); |
| 508 | WARN(("ServerManager::_ServerUpdated(%p): WARNING: Unexpected server " |
| 509 | "info.\n", serverInfo)); |
510 | 510 | } |
511 | 511 | } |
512 | 512 | |
… |
… |
ServerManager::_AddingServerFailed(ExtendedServerInfo* serverInfo)
|
528 | 528 | fListener->ServerRemoved(serverInfo); |
529 | 529 | } |
530 | 530 | } else { |
531 | | WARN("ServerManager::_AddingServerFailed(%p): WARNING: Unexpected " |
532 | | "server info.\n", serverInfo); |
| 531 | WARN(("ServerManager::_AddingServerFailed(%p): WARNING: Unexpected " |
| 532 | "server info.\n", serverInfo)); |
533 | 533 | } |
534 | 534 | } |
535 | 535 | |
… |
… |
ServerManager::_UpdatingServerFailed(ExtendedServerInfo* serverInfo)
|
557 | 557 | serverInfo->SetState(STATE_OBSOLETE); |
558 | 558 | oldInfo->SetState(STATE_READY); |
559 | 559 | } else { |
560 | | WARN("ServerManager::_UpdatingServerFailed(%p): WARNING: Unexpected " |
561 | | "server info.\n", serverInfo); |
| 560 | WARN(("ServerManager::_UpdatingServerFailed(%p): WARNING: Unexpected " |
| 561 | "server info.\n", serverInfo)); |
562 | 562 | } |
563 | 563 | } |
564 | 564 | |
diff --git a/src/add-ons/kernel/file_systems/netfs/client/ServerVolume.cpp b/src/add-ons/kernel/file_systems/netfs/client/ServerVolume.cpp
index a99fecf..9725727 100644
a
|
b
|
ServerVolume::SetServerInfo(ExtendedServerInfo* serverInfo)
|
104 | 104 | PRINT((" adding share: %s\n", shareInfo->GetShareName())); |
105 | 105 | status_t error = _AddShare(shareInfo); |
106 | 106 | if (error != B_OK) { |
107 | | ERROR("ServerVolume::SetServerInfo(): ERROR: Failed to add " |
108 | | "share `%s': %s\n", shareName, strerror(error)); |
| 107 | ERROR(("ServerVolume::SetServerInfo(): ERROR: Failed to add " |
| 108 | "share `%s': %s\n", shareName, strerror(error))); |
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
… |
… |
ServerVolume::Init(const char* name)
|
139 | 139 | |
140 | 140 | error = _AddShare(shareInfo); |
141 | 141 | if (error != B_OK) { |
142 | | ERROR("ServerVolume::Init(): ERROR: Failed to add share `%s': " |
143 | | "%s\n", shareInfo->GetShareName(), strerror(error)); |
| 142 | ERROR(("ServerVolume::Init(): ERROR: Failed to add share `%s': " |
| 143 | "%s\n", shareInfo->GetShareName(), strerror(error))); |
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
diff --git a/src/add-ons/kernel/file_systems/netfs/client/ShareVolume.cpp b/src/add-ons/kernel/file_systems/netfs/client/ShareVolume.cpp
index 0e64c71..42fd45d 100644
a
|
b
|
PRINT(("ShareVolume::~ShareVolume()\n"));
|
190 | 190 | if (fNodes) { |
191 | 191 | // there shouldn't be any more nodes |
192 | 192 | if (fNodes->Size() > 0) { |
193 | | WARN("ShareVolume::~ShareVolume(): WARNING: There are still " |
194 | | "%ld nodes\n", fNodes->Size()); |
| 193 | WARN(("ShareVolume::~ShareVolume(): WARNING: There are still " |
| 194 | "%ld nodes\n", fNodes->Size())); |
195 | 195 | } |
196 | 196 | for (NodeMap::Iterator it = fNodes->GetIterator(); it.HasNext();) |
197 | 197 | delete it.Next().value; |
… |
… |
PRINT(("ShareVolume::~ShareVolume()\n"));
|
202 | 202 | if (fEntries) { |
203 | 203 | // there shouldn't be any more entries |
204 | 204 | if (fEntries->Size() > 0) { |
205 | | WARN("ShareVolume::~ShareVolume(): WARNING: There are still " |
206 | | "%ld entries\n", fEntries->Size()); |
| 205 | WARN(("ShareVolume::~ShareVolume(): WARNING: There are still " |
| 206 | "%ld entries\n", fEntries->Size())); |
207 | 207 | } |
208 | 208 | for (EntryMap::Iterator it = fEntries->GetIterator(); it.HasNext();) |
209 | 209 | delete it.Next().value; |
… |
… |
PRINT(("ShareVolume::PrepareToUnmount()\n"));
|
356 | 356 | PRINT((" %ld nodes to remove\n", count)); |
357 | 357 | vnode_id* ids = new(std::nothrow) vnode_id[count]; |
358 | 358 | if (!ids) { |
359 | | ERROR("ShareVolume::PrepareToUnmount(): ERROR: Insufficient memory to " |
360 | | "allocate the node ID array!\n"); |
| 359 | ERROR(("ShareVolume::PrepareToUnmount(): ERROR: Insufficient memory to " |
| 360 | "allocate the node ID array!\n")); |
361 | 361 | return; |
362 | 362 | } |
363 | 363 | ArrayDeleter<vnode_id> _(ids); |
… |
… |
void
|
415 | 415 | ShareVolume::RemoveChildVolume(Volume* volume) |
416 | 416 | { |
417 | 417 | // should never be called |
418 | | WARN("WARNING: ShareVolume::RemoveChildVolume(%p) invoked!\n", volume); |
| 418 | WARN(("WARNING: ShareVolume::RemoveChildVolume(%p) invoked!\n", volume)); |
419 | 419 | } |
420 | 420 | |
421 | 421 | |
… |
… |
ShareVolume::_ReadRemoteDir(ShareDir* directory,
|
2137 | 2137 | |
2138 | 2138 | // add the entry |
2139 | 2139 | if (!iterator->AddEntry(entry)) { |
2140 | | ERROR("ShareVolume::_ReadRemoteDir(): ERROR: Failed to add " |
2141 | | "entry to remote iterator!\n"); |
| 2140 | ERROR(("ShareVolume::_ReadRemoteDir(): ERROR: Failed to add " |
| 2141 | "entry to remote iterator!\n")); |
2142 | 2142 | } |
2143 | 2143 | } |
2144 | 2144 | |
… |
… |
ShareVolume::_RemoveAttrDirIterator(ShareNode* node,
|
2741 | 2741 | DoublyLinkedList<ShareAttrDirIterator>* iteratorList |
2742 | 2742 | = fAttrDirIterators->Get(node->GetID()); |
2743 | 2743 | if (!iteratorList) { |
2744 | | WARN("ShareVolume::_RemoveAttrDirIterator(): Iterator list not " |
2745 | | "found: node: %lld\n", node->GetID()); |
| 2744 | WARN(("ShareVolume::_RemoveAttrDirIterator(): Iterator list not " |
| 2745 | "found: node: %lld\n", node->GetID())); |
2746 | 2746 | return; |
2747 | 2747 | } |
2748 | 2748 | |
diff --git a/src/add-ons/kernel/file_systems/netfs/headers/shared/BlockingQueue.h b/src/add-ons/kernel/file_systems/netfs/headers/shared/BlockingQueue.h
index 2ba67c3..06261ec 100644
a
|
b
|
BlockingQueue<Element>::Remove(Element* element)
|
175 | 175 | return B_ENTRY_NOT_FOUND; |
176 | 176 | } |
177 | 177 | if (count > 1) { |
178 | | ERROR("ERROR: BlockingQueue::Remove(): Removed %ld elements!\n", |
179 | | count); |
| 178 | ERROR(("ERROR: BlockingQueue::Remove(): Removed %ld elements!\n", |
| 179 | count)); |
180 | 180 | } |
181 | 181 | return error; |
182 | 182 | } |
diff --git a/src/add-ons/kernel/file_systems/netfs/headers/shared/DebugSupport.h b/src/add-ons/kernel/file_systems/netfs/headers/shared/DebugSupport.h
index 8e0dc49..b023970 100644
a
|
b
|
void dbg_printf_end();
|
121 | 121 | dbg_printf_end(); \ |
122 | 122 | } |
123 | 123 | |
124 | | #define TPRINT(x...) DEBUG_CONTEXT( __out(x) ) |
| 124 | #define TPRINT(x) DEBUG_CONTEXT( __out x ) |
125 | 125 | #define TREPORT_ERROR(status) \ |
126 | 126 | DEBUG_CONTEXT_LINE( __out("%s\n", strerror(status)) ) |
127 | 127 | #define TRETURN_ERROR(err) \ |
… |
… |
void dbg_printf_end();
|
138 | 138 | TREPORT_ERROR(_status); \ |
139 | 139 | var = _status; \ |
140 | 140 | } |
141 | | #define TFUNCTION(x...) DEBUG_CONTEXT_FUNCTION( ": ", __out(x) ) |
| 141 | #define TFUNCTION(x) DEBUG_CONTEXT_FUNCTION( ": ", __out x ) |
142 | 142 | #define TFUNCTION_START() DEBUG_CONTEXT_FUNCTION( "\n", ) |
143 | 143 | #define TFUNCTION_END() DEBUG_CONTEXT_FUNCTION( " done\n", ) |
144 | 144 | |
145 | 145 | #if DEBUG |
146 | | #define PRINT(x...) TPRINT(x) |
| 146 | #define PRINT(x) TPRINT(x) |
147 | 147 | #define REPORT_ERROR(status) TREPORT_ERROR(status) |
148 | 148 | #define RETURN_ERROR(err) TRETURN_ERROR(err) |
149 | 149 | #define SET_ERROR(var, err) TSET_ERROR(var, err) |
150 | | #define FATAL(x...) DEBUG_CONTEXT( __out(x) ) |
151 | | #define ERROR(x...) DEBUG_CONTEXT( __out(x) ) |
152 | | #define WARN(x...) DEBUG_CONTEXT( __out(x) ) |
153 | | #define INFORM(x...) DEBUG_CONTEXT( __out(x) ) |
154 | | #define FUNCTION(x...) TFUNCTION(x) |
| 150 | #define FATAL(x) DEBUG_CONTEXT( __out x ) |
| 151 | #define ERROR(x) DEBUG_CONTEXT( __out x ) |
| 152 | #define WARN(x) DEBUG_CONTEXT( __out x ) |
| 153 | #define INFORM(x) DEBUG_CONTEXT( __out x ) |
| 154 | #define FUNCTION(x) TFUNCTION(x) |
155 | 155 | #define FUNCTION_START() TFUNCTION_START() |
156 | 156 | #define FUNCTION_END() TFUNCTION_END() |
157 | 157 | #define DARG(x) x |
158 | 158 | #define D(x) {x;}; |
159 | 159 | #else |
160 | | #define PRINT(x...) ; |
| 160 | #define PRINT(x) ; |
161 | 161 | #define REPORT_ERROR(status) ; |
162 | 162 | #define RETURN_ERROR(status) return status; |
163 | 163 | #define SET_ERROR(var, err) var = err; |
164 | | #define FATAL(x...) DEBUG_CONTEXT( __out(x) ) |
165 | | #define ERROR(x...) DEBUG_CONTEXT( __out(x) ) |
166 | | #define WARN(x...) DEBUG_CONTEXT( __out(x) ) |
167 | | #define INFORM(x...) DEBUG_CONTEXT( __out(x) ) |
168 | | #define FUNCTION(x...) ; |
| 164 | #define FATAL(x) DEBUG_CONTEXT( __out x ) |
| 165 | #define ERROR(x) DEBUG_CONTEXT( __out x ) |
| 166 | #define WARN(x) DEBUG_CONTEXT( __out x ) |
| 167 | #define INFORM(x) DEBUG_CONTEXT( __out x ) |
| 168 | #define FUNCTION(x) ; |
169 | 169 | #define FUNCTION_START() ; |
170 | 170 | #define FUNCTION_END() ; |
171 | 171 | #define DARG(x) |
diff --git a/src/add-ons/kernel/file_systems/netfs/server/ClientConnection.cpp b/src/add-ons/kernel/file_systems/netfs/server/ClientConnection.cpp
index 8e2bd1d..7608f06 100644
a
|
b
|
ClientConnection::VisitWriteAttrRequest(WriteAttrRequest* request)
|
2201 | 2201 | if (fInverseClientEndianess) { |
2202 | 2202 | if (_KnownAttributeType(type)) { |
2203 | 2203 | if (pos != 0) { |
2204 | | WARN("WriteAttr(): WARNING: Need to convert attribute " |
| 2204 | WARN(("WriteAttr(): WARNING: Need to convert attribute " |
2205 | 2205 | "endianess, but position is not 0: attribute: %s, " |
2206 | 2206 | "pos: %lld, size: %ld\n", request->name.GetString(), |
2207 | | pos, size); |
| 2207 | pos, size)); |
2208 | 2208 | } |
2209 | 2209 | swap_data(type, buffer, size, B_SWAP_ALWAYS); |
2210 | 2210 | } else |
… |
… |
ClientConnection::ProcessQueryEvent(NodeMonitoringEvent* event)
|
2566 | 2566 | } else { |
2567 | 2567 | // We only support "entry created" and "entry removed" query events. |
2568 | 2568 | // "entry moved" is split by the volume manager into those. |
2569 | | ERROR("Ignoring unexpected query event: opcode: 0x%lx\n", |
2570 | | event->opcode); |
| 2569 | ERROR(("Ignoring unexpected query event: opcode: 0x%lx\n", |
| 2570 | event->opcode)); |
2571 | 2571 | return; |
2572 | 2572 | } |
2573 | 2573 | PRINT(("ClientConnection::ProcessQueryEvent(): event: %p, type: %s: directory: (%ld, %lld)\n", event, typeid(event).name(), volumeID, directoryID)); |
diff --git a/src/add-ons/kernel/file_systems/netfs/server/NetFSServer.cpp b/src/add-ons/kernel/file_systems/netfs/server/NetFSServer.cpp
index b425c67..712f7d3 100644
a
|
b
|
public:
|
168 | 168 | // send the request |
169 | 169 | status_t error = requestChannel.SendRequest(&request); |
170 | 170 | if (error != B_OK) { |
171 | | ERROR("ServerInfoSender: ERROR: Failed to send request: %s\n", |
172 | | strerror(error)); |
| 171 | ERROR(("ServerInfoSender: ERROR: Failed to send request: %s\n", |
| 172 | strerror(error))); |
173 | 173 | } |
174 | 174 | |
175 | 175 | SetDone(true); |
… |
… |
NetFSServer::Init()
|
328 | 328 | fBroadcaster = spawn_thread(&_BroadcasterEntry, "broadcaster", |
329 | 329 | B_NORMAL_PRIORITY, this); |
330 | 330 | if (fBroadcaster < 0) { |
331 | | WARN("NetFSServer::Init(): Failed to spawn broadcaster thread " |
332 | | "(%s). Continuing anyway.\n", strerror(fBroadcaster)); |
| 331 | WARN(("NetFSServer::Init(): Failed to spawn broadcaster thread " |
| 332 | "(%s). Continuing anyway.\n", strerror(fBroadcaster))); |
333 | 333 | } |
334 | 334 | } |
335 | 335 | return B_OK; |
… |
… |
NetFSServer::_LoadSecurityContext(SecurityContext** _securityContext)
|
809 | 809 | const char* userName = parameter.ValueAt(0); |
810 | 810 | const char* password = parameter.GetParameterValue("password"); |
811 | 811 | if (!userName) { |
812 | | WARN("Skipping nameless user settings entry.\n"); |
| 812 | WARN(("Skipping nameless user settings entry.\n")); |
813 | 813 | continue; |
814 | 814 | } |
815 | 815 | // PRINT(("user: %s, password: %s\n", parameter.ValueAt(0), |
816 | 816 | // parameter.GetParameterValue("password"))); |
817 | 817 | error = securityContext->AddUser(userName, password); |
818 | 818 | if (error != B_OK) |
819 | | ERROR("ERROR: Failed to add user `%s'\n", userName); |
| 819 | ERROR(("ERROR: Failed to add user `%s'\n", userName)); |
820 | 820 | } |
821 | 821 | |
822 | 822 | // load shares |
… |
… |
NetFSServer::_LoadSecurityContext(SecurityContext** _securityContext)
|
825 | 825 | const char* shareName = parameter.ValueAt(0); |
826 | 826 | const char* path = parameter.GetParameterValue("path"); |
827 | 827 | if (!shareName || !path) { |
828 | | WARN("settings: Skipping invalid share settings entry (no name" |
829 | | " or no path).\n"); |
| 828 | WARN(("settings: Skipping invalid share settings entry (no name" |
| 829 | " or no path).\n")); |
830 | 830 | continue; |
831 | 831 | } |
832 | 832 | // PRINT(("share: %s, path: %s\n", parameter.ValueAt(0), |
… |
… |
NetFSServer::_LoadSecurityContext(SecurityContext** _securityContext)
|
834 | 834 | Share* share; |
835 | 835 | error = securityContext->AddShare(shareName, path, &share); |
836 | 836 | if (error != B_OK) { |
837 | | ERROR("ERROR: Failed to add share `%s'\n", shareName); |
| 837 | ERROR(("ERROR: Failed to add share `%s'\n", shareName)); |
838 | 838 | continue; |
839 | 839 | } |
840 | 840 | BReference<Share> shareReference(share, true); |
… |
… |
NetFSServer::_LoadSecurityContext(SecurityContext** _securityContext)
|
847 | 847 | // PRINT((" user: %s\n", userName)); |
848 | 848 | User* user = securityContext->FindUser(userName); |
849 | 849 | if (!user) { |
850 | | ERROR("ERROR: Undefined user `%s'.\n", userName); |
| 850 | ERROR(("ERROR: Undefined user `%s'.\n", userName)); |
851 | 851 | continue; |
852 | 852 | } |
853 | 853 | BReference<User> userReference(user, true); |
… |
… |
NetFSServer::_LoadSecurityContext(SecurityContext** _securityContext)
|
877 | 877 | error = securityContext->SetNodePermissions(share->GetPath(), user, |
878 | 878 | permissions); |
879 | 879 | if (error != B_OK) { |
880 | | ERROR("ERROR: Failed to set permissions for share `%s'\n", |
881 | | share->GetName()); |
| 880 | ERROR(("ERROR: Failed to set permissions for share `%s'\n", |
| 881 | share->GetName())); |
882 | 882 | } |
883 | 883 | } |
884 | 884 | } |
… |
… |
NetFSServer::_InitSettings()
|
894 | 894 | { |
895 | 895 | status_t error = _LoadSettings(); |
896 | 896 | if (error != B_OK) { |
897 | | WARN("NetFSServer::_InitSettings(): WARNING: Failed to load settings " |
898 | | "file: %s - falling back to driver settings.\n", strerror(error)); |
| 897 | WARN(("NetFSServer::_InitSettings(): WARNING: Failed to load settings " |
| 898 | "file: %s - falling back to driver settings.\n", strerror(error))); |
899 | 899 | |
900 | 900 | // fall back to the driver settings file |
901 | 901 | error = _LoadSecurityContext(&fSecurityContext); |
902 | 902 | if (error != B_OK) { |
903 | | WARN("NetFSServer::_InitSettings(): WARNING: Failed to load " |
904 | | "settings from driver settings: %s\n", strerror(error)); |
| 903 | WARN(("NetFSServer::_InitSettings(): WARNING: Failed to load " |
| 904 | "settings from driver settings: %s\n", strerror(error))); |
905 | 905 | |
906 | 906 | // use defaults |
907 | 907 | // create a security context |
… |
… |
NetFSServer::_ConnectionListener()
|
1117 | 1117 | connection); |
1118 | 1118 | if (initializer) { |
1119 | 1119 | if (initializer->Run() != B_OK) { |
1120 | | ERROR("Failed to run connection initializer.\n") |
| 1120 | ERROR(("Failed to run connection initializer.\n")) |
1121 | 1121 | delete initializer; |
1122 | 1122 | } |
1123 | 1123 | } else { |
1124 | | ERROR("Failed to create connection initializer.\n") |
| 1124 | ERROR(("Failed to create connection initializer.\n")) |
1125 | 1125 | delete connection; |
1126 | 1126 | } |
1127 | 1127 | |
… |
… |
NetFSServer::_Broadcaster()
|
1169 | 1169 | // create the socket |
1170 | 1170 | fBroadcastingSocket = socket(AF_INET, SOCK_DGRAM, 0); |
1171 | 1171 | if (fBroadcastingSocket < 0) { |
1172 | | WARN("NetFSServer::_Broadcaster(): WARN: Failed to init broadcasting: " |
1173 | | "%s.\n", strerror(errno)); |
| 1172 | WARN(("NetFSServer::_Broadcaster(): WARN: Failed to init broadcasting: " |
| 1173 | "%s.\n", strerror(errno))); |
1174 | 1174 | return errno; |
1175 | 1175 | } |
1176 | 1176 | |
… |
… |
NetFSServer::_Broadcaster()
|
1179 | 1179 | int soBroadcastValue = 1; |
1180 | 1180 | if (setsockopt(fBroadcastingSocket, SOL_SOCKET, SO_BROADCAST, |
1181 | 1181 | &soBroadcastValue, sizeof(soBroadcastValue)) < 0) { |
1182 | | WARN("NetFSServer::_Broadcaster(): WARN: Failed to set " |
1183 | | "SO_BROADCAST on socket: %s.\n", strerror(errno)); |
| 1182 | WARN(("NetFSServer::_Broadcaster(): WARN: Failed to set " |
| 1183 | "SO_BROADCAST on socket: %s.\n", strerror(errno))); |
1184 | 1184 | } |
1185 | 1185 | #endif |
1186 | 1186 | |
… |
… |
NetFSServer::_Broadcaster()
|
1205 | 1205 | ssize_t bytesSent = sendto(fBroadcastingSocket, &message, |
1206 | 1206 | sizeof(message), 0, (sockaddr*)&addr, addrSize); |
1207 | 1207 | if (bytesSent < 0) { |
1208 | | WARN("NetFSServer::_Broadcaster(): WARN: sending failed: %s.\n", |
1209 | | strerror(errno)); |
| 1208 | WARN(("NetFSServer::_Broadcaster(): WARN: sending failed: %s.\n", |
| 1209 | strerror(errno))); |
1210 | 1210 | return errno; |
1211 | 1211 | } |
1212 | 1212 | |
… |
… |
NetFSServer::_GetServerInfo(ServerInfo& serverInfo)
|
1297 | 1297 | // set the server name and the connection method |
1298 | 1298 | char hostName[1024]; |
1299 | 1299 | if (gethostname(hostName, sizeof(hostName)) < 0) { |
1300 | | ERROR("NetFSServer::_GetServerInfo(): ERROR: Failed to get host " |
1301 | | "name."); |
| 1300 | ERROR(("NetFSServer::_GetServerInfo(): ERROR: Failed to get host " |
| 1301 | "name.")); |
1302 | 1302 | return B_ERROR; |
1303 | 1303 | } |
1304 | 1304 | status_t error = serverInfo.SetServerName(hostName); |
diff --git a/src/add-ons/kernel/file_systems/netfs/server/Node.cpp b/src/add-ons/kernel/file_systems/netfs/server/Node.cpp
index b36c78a..1474167 100644
a
|
b
|
Node::UpdateStat()
|
150 | 150 | |
151 | 151 | // check if it is the same node |
152 | 152 | if (st.st_dev != fStat.st_dev || st.st_ino != fStat.st_ino) { |
153 | | ERROR("Node::UpdateStat(): ERROR: GetPath() returned path that " |
| 153 | ERROR(("Node::UpdateStat(): ERROR: GetPath() returned path that " |
154 | 154 | "doesn't point to this node: node: (%ld, %lld), path: `%s'\n", |
155 | | GetVolumeID(), GetID(), path.GetPath()); |
| 155 | GetVolumeID(), GetID(), path.GetPath())); |
156 | 156 | return B_ENTRY_NOT_FOUND; |
157 | 157 | } |
158 | 158 | |
diff --git a/src/add-ons/kernel/file_systems/netfs/shared/RequestChannel.cpp b/src/add-ons/kernel/file_systems/netfs/shared/RequestChannel.cpp
index 348231f..8644b0f 100644
a
|
b
|
PRINT(("%p->RequestChannel::SendRequest(): request: %p, type: %s\n", this, reque
|
169 | 169 | if (error != B_OK) |
170 | 170 | RETURN_ERROR(error); |
171 | 171 | if (size < 0 || size > kMaxSaneRequestSize) { |
172 | | ERROR("RequestChannel::SendRequest(): ERROR: Invalid request size: " |
173 | | "%ld\n", size); |
| 172 | ERROR(("RequestChannel::SendRequest(): ERROR: Invalid request size: " |
| 173 | "%ld\n", size)); |
174 | 174 | RETURN_ERROR(B_BAD_DATA); |
175 | 175 | } |
176 | 176 | |
… |
… |
RequestChannel::ReceiveRequest(Request** _request)
|
208 | 208 | header.type = B_HOST_TO_BENDIAN_INT32(header.type); |
209 | 209 | header.size = B_HOST_TO_BENDIAN_INT32(header.size); |
210 | 210 | if (header.size < 0 || header.size > kMaxSaneRequestSize) { |
211 | | ERROR("RequestChannel::ReceiveRequest(): ERROR: Invalid request size: " |
212 | | "%ld\n", header.size); |
| 211 | ERROR(("RequestChannel::ReceiveRequest(): ERROR: Invalid request size: " |
| 212 | "%ld\n", header.size)); |
213 | 213 | RETURN_ERROR(B_BAD_DATA); |
214 | 214 | } |
215 | 215 | |