1 /***************************************************************************
2 * Copyright (C) 2005-2018 by the Quassel Project *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) version 3. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
33 # include <QSslSocket>
34 # include "sslserver.h"
36 # include <QTcpSocket>
37 # include <QTcpServer>
40 #include "authenticator.h"
41 #include "bufferinfo.h"
42 #include "deferredptr.h"
43 #include "identserver.h"
45 #include "oidentdconfiggenerator.h"
46 #include "sessionthread.h"
47 #include "singleton.h"
51 class CoreAuthHandler;
59 class AbstractSqlMigrationReader;
60 class AbstractSqlMigrationWriter;
62 class Core : public QObject, public Singleton<Core>
72 /*** Storage access ***/
73 // These methods are threadsafe.
77 * \param userName The user's login name
78 * \param password The user's uncrypted password
79 * \return The user's ID if valid; 0 otherwise
81 static inline UserId validateUser(const QString &userName, const QString &password) {
82 return instance()->_storage->validateUser(userName, password);
85 //! Authenticate user against auth backend
87 * \param userName The user's login name
88 * \param password The user's uncrypted password
89 * \return The user's ID if valid; 0 otherwise
91 static inline UserId authenticateUser(const QString &userName, const QString &password) {
92 return instance()->_authenticator->validateUser(userName, password);
95 //! Add a new user, exposed so auth providers can call this without being the storage.
97 * \param userName The user's login name
98 * \param password The user's uncrypted password
99 * \param authenticator The name of the auth provider service used to log the user in, defaults to "Database".
100 * \return The user's ID if valid; 0 otherwise
102 static inline UserId addUser(const QString &userName, const QString &password, const QString &authenticator = "Database") {
103 return instance()->_storage->addUser(userName, password, authenticator);
106 //! Does a comparison test against the authenticator in the database and the authenticator currently in use for a UserID.
108 * \param userid The user's ID (note: not login name).
109 * \param authenticator The name of the auth provider service used to log the user in, defaults to "Database".
110 * \return True if the userid was configured with the passed authenticator, false otherwise.
112 static inline bool checkAuthProvider(const UserId userid, const QString &authenticator) {
113 return instance()->_storage->getUserAuthenticator(userid) == authenticator;
116 //! Change a user's password
118 * \param userId The user's ID
119 * \param password The user's unencrypted new password
120 * \return true, if the password change was successful
122 static bool changeUserPassword(UserId userId, const QString &password);
124 //! Check if we can change a user password.
126 * \param userID The user's ID
127 * \return true, if we can change their password, false otherwise
129 static bool canChangeUserPassword(UserId userId);
131 //! Store a user setting persistently
133 * \param userId The users Id
134 * \param settingName The Name of the Setting
135 * \param data The Value
137 static inline void setUserSetting(UserId userId, const QString &settingName, const QVariant &data)
139 instance()->_storage->setUserSetting(userId, settingName, data);
143 //! Retrieve a persistent user setting
145 * \param userId The users Id
146 * \param settingName The Name of the Setting
147 * \param defaultValue Value to return in case it's unset.
148 * \return the Value of the Setting or the default value if it is unset.
150 static inline QVariant getUserSetting(UserId userId, const QString &settingName, const QVariant &defaultValue = QVariant())
152 return instance()->_storage->getUserSetting(userId, settingName, defaultValue);
156 /* Identity handling */
157 static inline IdentityId createIdentity(UserId user, CoreIdentity &identity)
159 return instance()->_storage->createIdentity(user, identity);
163 static bool updateIdentity(UserId user, const CoreIdentity &identity)
165 return instance()->_storage->updateIdentity(user, identity);
169 static void removeIdentity(UserId user, IdentityId identityId)
171 instance()->_storage->removeIdentity(user, identityId);
175 static QList<CoreIdentity> identities(UserId user)
177 return instance()->_storage->identities(user);
181 //! Create a Network in the Storage and store it's Id in the given NetworkInfo
182 /** \note This method is thredsafe.
184 * \param user The core user
185 * \param networkInfo a NetworkInfo definition to store the newly created ID in
186 * \return true if successfull.
188 static bool createNetwork(UserId user, NetworkInfo &info);
190 //! Apply the changes to NetworkInfo info to the storage engine
191 /** \note This method is thredsafe.
193 * \param user The core user
194 * \param networkInfo The Updated NetworkInfo
195 * \return true if successfull.
197 static inline bool updateNetwork(UserId user, const NetworkInfo &info)
199 return instance()->_storage->updateNetwork(user, info);
203 //! Permanently remove a Network and all the data associated with it.
204 /** \note This method is thredsafe.
206 * \param user The core user
207 * \param networkId The network to delete
208 * \return true if successfull.
210 static inline bool removeNetwork(UserId user, const NetworkId &networkId)
212 return instance()->_storage->removeNetwork(user, networkId);
216 //! Returns a list of all NetworkInfos for the given UserId user
217 /** \note This method is thredsafe.
219 * \param user The core user
220 * \return QList<NetworkInfo>.
222 static inline QList<NetworkInfo> networks(UserId user)
224 return instance()->_storage->networks(user);
228 //! Get a list of Networks to restore
229 /** Return a list of networks the user was connected at the time of core shutdown
230 * \note This method is threadsafe.
232 * \param user The User Id in question
234 static inline QList<NetworkId> connectedNetworks(UserId user)
236 return instance()->_storage->connectedNetworks(user);
240 //! Update the connected state of a network
241 /** \note This method is threadsafe
243 * \param user The Id of the networks owner
244 * \param networkId The Id of the network
245 * \param isConnected whether the network is connected or not
247 static inline void setNetworkConnected(UserId user, const NetworkId &networkId, bool isConnected)
249 return instance()->_storage->setNetworkConnected(user, networkId, isConnected);
253 //! Get a hash of channels with their channel keys for a given network
254 /** The keys are channel names and values are passwords (possibly empty)
255 * \note This method is threadsafe
257 * \param user The id of the networks owner
258 * \param networkId The Id of the network
260 static inline QHash<QString, QString> persistentChannels(UserId user, const NetworkId &networkId)
262 return instance()->_storage->persistentChannels(user, networkId);
266 //! Update the connected state of a channel
267 /** \note This method is threadsafe
269 * \param user The Id of the networks owner
270 * \param networkId The Id of the network
271 * \param channel The name of the channel
272 * \param isJoined whether the channel is connected or not
274 static inline void setChannelPersistent(UserId user, const NetworkId &networkId, const QString &channel, bool isJoined)
276 return instance()->_storage->setChannelPersistent(user, networkId, channel, isJoined);
280 //! Get a hash of buffers with their ciphers for a given network
281 /** The keys are channel names and values are ciphers (possibly empty)
282 * \note This method is threadsafe
284 * \param user The id of the networks owner
285 * \param networkId The Id of the network
287 static inline QHash<QString, QByteArray> bufferCiphers(UserId user, const NetworkId &networkId)
289 return instance()->_storage->bufferCiphers(user, networkId);
293 //! Update the cipher of a buffer
294 /** \note This method is threadsafe
296 * \param user The Id of the networks owner
297 * \param networkId The Id of the network
298 * \param bufferName The Cname of the buffer
299 * \param cipher The cipher for the buffer
301 static inline void setBufferCipher(UserId user, const NetworkId &networkId, const QString &bufferName, const QByteArray &cipher)
303 return instance()->_storage->setBufferCipher(user, networkId, bufferName, cipher);
307 //! Update the key of a channel
308 /** \note This method is threadsafe
310 * \param user The Id of the networks owner
311 * \param networkId The Id of the network
312 * \param channel The name of the channel
313 * \param key The key of the channel (possibly empty)
315 static inline void setPersistentChannelKey(UserId user, const NetworkId &networkId, const QString &channel, const QString &key)
317 return instance()->_storage->setPersistentChannelKey(user, networkId, channel, key);
321 //! retrieve last known away message for session restore
322 /** \note This method is threadsafe
324 * \param user The Id of the networks owner
325 * \param networkId The Id of the network
327 static inline QString awayMessage(UserId user, NetworkId networkId)
329 return instance()->_storage->awayMessage(user, networkId);
333 //! Make away message persistent for session restore
334 /** \note This method is threadsafe
336 * \param user The Id of the networks owner
337 * \param networkId The Id of the network
338 * \param awayMsg The current away message of own user
340 static inline void setAwayMessage(UserId user, NetworkId networkId, const QString &awayMsg)
342 return instance()->_storage->setAwayMessage(user, networkId, awayMsg);
346 //! retrieve last known user mode for session restore
347 /** \note This method is threadsafe
349 * \param user The Id of the networks owner
350 * \param networkId The Id of the network
352 static inline QString userModes(UserId user, NetworkId networkId)
354 return instance()->_storage->userModes(user, networkId);
358 //! Make our user modes persistent for session restore
359 /** \note This method is threadsafe
361 * \param user The Id of the networks owner
362 * \param networkId The Id of the network
363 * \param userModes The current user modes of own user
365 static inline void setUserModes(UserId user, NetworkId networkId, const QString &userModes)
367 return instance()->_storage->setUserModes(user, networkId, userModes);
371 //! Get the unique BufferInfo for the given combination of network and buffername for a user.
372 /** \note This method is threadsafe.
374 * \param user The core user who owns this buffername
375 * \param networkId The network id
376 * \param type The type of the buffer (StatusBuffer, Channel, etc.)
377 * \param buffer The buffer name (if empty, the net's status buffer is returned)
378 * \param create Whether or not the buffer should be created if it doesnt exist
379 * \return The BufferInfo corresponding to the given network and buffer name, or 0 if not found
381 static inline BufferInfo bufferInfo(UserId user, const NetworkId &networkId, BufferInfo::Type type, const QString &buffer = "", bool create = true)
383 return instance()->_storage->bufferInfo(user, networkId, type, buffer, create);
387 //! Get the unique BufferInfo for a bufferId
388 /** \note This method is threadsafe
389 * \param user The core user who owns this buffername
390 * \param bufferId The id of the buffer
391 * \return The BufferInfo corresponding to the given buffer id, or an invalid BufferInfo if not found.
393 static inline BufferInfo getBufferInfo(UserId user, const BufferId &bufferId)
395 return instance()->_storage->getBufferInfo(user, bufferId);
399 //! Store a Message in the storage backend and set it's unique Id.
400 /** \note This method is threadsafe.
402 * \param message The message object to be stored
403 * \return true on success
405 static inline bool storeMessage(Message &message)
407 return instance()->_storage->logMessage(message);
411 //! Store a list of Messages in the storage backend and set their unique Id.
412 /** \note This method is threadsafe.
414 * \param messages The list message objects to be stored
415 * \return true on success
417 static inline bool storeMessages(MessageList &messages)
419 return instance()->_storage->logMessages(messages);
423 //! Request a certain number messages stored in a given buffer.
424 /** \param buffer The buffer we request messages from
425 * \param first if != -1 return only messages with a MsgId >= first
426 * \param last if != -1 return only messages with a MsgId < last
427 * \param limit if != -1 limit the returned list to a max of \limit entries
428 * \return The requested list of messages
430 static inline QList<Message> requestMsgs(UserId user, BufferId bufferId, MsgId first = -1, MsgId last = -1, int limit = -1)
432 return instance()->_storage->requestMsgs(user, bufferId, first, last, limit);
436 //! Request a certain number messages stored in a given buffer, matching certain filters
437 /** \param buffer The buffer we request messages from
438 * \param first if != -1 return only messages with a MsgId >= first
439 * \param last if != -1 return only messages with a MsgId < last
440 * \param limit if != -1 limit the returned list to a max of \limit entries
441 * \param type The Message::Types that should be returned
442 * \return The requested list of messages
444 static inline QList<Message> requestMsgsFiltered(UserId user, BufferId bufferId, MsgId first = -1, MsgId last = -1,
445 int limit = -1, Message::Types type = Message::Types{-1},
446 Message::Flags flags = Message::Flags{-1})
448 return instance()->_storage->requestMsgsFiltered(user, bufferId, first, last, limit, type, flags);
452 //! Request a certain number of messages across all buffers
453 /** \param first if != -1 return only messages with a MsgId >= first
454 * \param last if != -1 return only messages with a MsgId < last
455 * \param limit Max amount of messages
456 * \return The requested list of messages
458 static inline QList<Message> requestAllMsgs(UserId user, MsgId first = -1, MsgId last = -1, int limit = -1)
460 return instance()->_storage->requestAllMsgs(user, first, last, limit);
464 //! Request a certain number of messages across all buffers, matching certain filters
465 /** \param first if != -1 return only messages with a MsgId >= first
466 * \param last if != -1 return only messages with a MsgId < last
467 * \param limit Max amount of messages
468 * \param type The Message::Types that should be returned
469 * \return The requested list of messages
471 static inline QList<Message> requestAllMsgsFiltered(UserId user, MsgId first = -1, MsgId last = -1, int limit = -1,
472 Message::Types type = Message::Types{-1},
473 Message::Flags flags = Message::Flags{-1})
475 return instance()->_storage->requestAllMsgsFiltered(user, first, last, limit, type, flags);
479 //! Request a list of all buffers known to a user.
480 /** This method is used to get a list of all buffers we have stored a backlog from.
481 * \note This method is threadsafe.
483 * \param user The user whose buffers we request
484 * \return A list of the BufferInfos for all buffers as requested
486 static inline QList<BufferInfo> requestBuffers(UserId user)
488 return instance()->_storage->requestBuffers(user);
492 //! Request a list of BufferIds for a given NetworkId
493 /** \note This method is threadsafe.
495 * \param user The user whose buffers we request
496 * \param networkId The NetworkId of the network in question
497 * \return List of BufferIds belonging to the Network
499 static inline QList<BufferId> requestBufferIdsForNetwork(UserId user, NetworkId networkId)
501 return instance()->_storage->requestBufferIdsForNetwork(user, networkId);
505 //! Remove permanently a buffer and it's content from the storage backend
506 /** This call cannot be reverted!
507 * \note This method is threadsafe.
509 * \param user The user who is the owner of the buffer
510 * \param bufferId The bufferId
511 * \return true if successfull
513 static inline bool removeBuffer(const UserId &user, const BufferId &bufferId)
515 return instance()->_storage->removeBuffer(user, bufferId);
520 /** \note This method is threadsafe.
521 * \param user The id of the buffer owner
522 * \param bufferId The bufferId
523 * \param newName The new name of the buffer
524 * \return true if successfull
526 static inline bool renameBuffer(const UserId &user, const BufferId &bufferId, const QString &newName)
528 return instance()->_storage->renameBuffer(user, bufferId, newName);
532 //! Merge the content of two Buffers permanently. This cannot be reversed!
533 /** \note This method is threadsafe.
534 * \param user The id of the buffer owner
535 * \param bufferId1 The bufferId of the remaining buffer
536 * \param bufferId2 The buffer that is about to be removed
537 * \return true if successfulln
539 static inline bool mergeBuffersPermanently(const UserId &user, const BufferId &bufferId1, const BufferId &bufferId2)
541 return instance()->_storage->mergeBuffersPermanently(user, bufferId1, bufferId2);
545 //! Update the LastSeenDate for a Buffer
546 /** This Method is used to make the LastSeenDate of a Buffer persistent
547 * \note This method is threadsafe.
549 * \param user The Owner of that Buffer
550 * \param bufferId The buffer id
551 * \param MsgId The Message id of the message that has been just seen
553 static inline void setBufferLastSeenMsg(UserId user, const BufferId &bufferId, const MsgId &msgId)
555 return instance()->_storage->setBufferLastSeenMsg(user, bufferId, msgId);
559 //! Get a usable sysident for the given user in oidentd-strict mode
560 /** \param user The user to retrieve the sysident for
561 * \return The authusername
563 QString strictSysIdent(UserId user) const;
566 //! Get a Hash of all last seen message ids
567 /** This Method is called when the Quassel Core is started to restore the lastSeenMsgIds
568 * \note This method is threadsafe.
570 * \param user The Owner of the buffers
572 static inline QHash<BufferId, MsgId> bufferLastSeenMsgIds(UserId user)
574 return instance()->_storage->bufferLastSeenMsgIds(user);
578 //! Update the MarkerLineMsgId for a Buffer
579 /** This Method is used to make the marker line position of a Buffer persistent
580 * \note This method is threadsafe.
582 * \param user The Owner of that Buffer
583 * \param bufferId The buffer id
584 * \param MsgId The Message id where the marker line should be placed
586 static inline void setBufferMarkerLineMsg(UserId user, const BufferId &bufferId, const MsgId &msgId)
588 return instance()->_storage->setBufferMarkerLineMsg(user, bufferId, msgId);
592 //! Get a Hash of all marker line message ids
593 /** This Method is called when the Quassel Core is started to restore the MarkerLineMsgIds
594 * \note This method is threadsafe.
596 * \param user The Owner of the buffers
598 static inline QHash<BufferId, MsgId> bufferMarkerLineMsgIds(UserId user)
600 return instance()->_storage->bufferMarkerLineMsgIds(user);
603 //! Update the BufferActivity for a Buffer
604 /** This Method is used to make the activity state of a Buffer persistent
605 * \note This method is threadsafe.
607 * \param user The Owner of that Buffer
608 * \param bufferId The buffer id
609 * \param MsgId The Message id where the marker line should be placed
611 static inline void setBufferActivity(UserId user, BufferId bufferId, Message::Types activity) {
612 return instance()->_storage->setBufferActivity(user, bufferId, activity);
616 //! Get a Hash of all buffer activity states
617 /** This Method is called when the Quassel Core is started to restore the BufferActivity
618 * \note This method is threadsafe.
620 * \param user The Owner of the buffers
622 static inline QHash<BufferId, Message::Types> bufferActivities(UserId user) {
623 return instance()->_storage->bufferActivities(user);
626 //! Get the bitset of buffer activity states for a buffer
627 /** This method is used to load the activity state of a buffer when its last seen message changes.
628 * \note This method is threadsafe.
630 * \param bufferId The buffer
631 * \param lastSeenMsgId The last seen message
633 static inline Message::Types bufferActivity(BufferId bufferId, MsgId lastSeenMsgId) {
634 return instance()->_storage->bufferActivity(bufferId, lastSeenMsgId);
637 //! Update the highlight count for a Buffer
638 /** This Method is used to make the highlight count state of a Buffer persistent
639 * \note This method is threadsafe.
641 * \param user The Owner of that Buffer
642 * \param bufferId The buffer id
643 * \param MsgId The Message id where the marker line should be placed
645 static inline void setHighlightCount(UserId user, BufferId bufferId, int highlightCount) {
646 return instance()->_storage->setHighlightCount(user, bufferId, highlightCount);
650 //! Get a Hash of all highlight count states
651 /** This Method is called when the Quassel Core is started to restore the highlight count
652 * \note This method is threadsafe.
654 * \param user The Owner of the buffers
656 static inline QHash<BufferId, int> highlightCounts(UserId user) {
657 return instance()->_storage->highlightCounts(user);
659 //! Get the highlight count states for a buffer
660 /** This method is used to load the highlight count of a buffer when its last seen message changes.
661 * \note This method is threadsafe.
663 * \param bufferId The buffer
664 * \param lastSeenMsgId The last seen message
666 static inline int highlightCount(BufferId bufferId, MsgId lastSeenMsgId) {
667 return instance()->_storage->highlightCount(bufferId, lastSeenMsgId);
670 static inline QDateTime startTime() { return instance()->_startTime; }
671 static inline bool isConfigured() { return instance()->_configured; }
674 * Whether or not strict ident mode is enabled, locking users' idents to Quassel username
676 * @return True if strict mode enabled, otherwise false
678 static inline bool strictIdentEnabled() { return instance()->_strictIdentEnabled; }
680 static bool sslSupported();
682 static QVariantList backendInfo();
683 static QVariantList authenticatorInfo();
685 static QString setup(const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData, const QString &authenticator, const QVariantMap &authSetupMap);
687 static inline QTimer *syncTimer() { return &instance()->_storageSyncTimer; }
689 inline OidentdConfigGenerator *oidentdConfigGenerator() const { return _oidentdConfigGenerator; }
690 inline IdentServer *identServer() const { return _identServer; }
692 static const int AddClientEventId;
695 //! Sent when a BufferInfo is updated in storage.
696 void bufferInfoUpdated(UserId user, const BufferInfo &info);
698 //! Relay from CoreSession::sessionState(). Used for internal connection only
699 void sessionState(const Protocol::SessionState &sessionState);
701 //! Emitted when database schema upgrade starts or ends
702 void dbUpgradeInProgress(bool inProgress);
704 //! Emitted when a fatal error was encountered during async initialization
705 void exitRequested(int exitCode, const QString &reason);
712 * @note This method is threadsafe.
717 * Reload SSL certificates used for connection with clients.
719 * @return True if certificates reloaded successfully, otherwise false.
723 void cacheSysIdent();
725 QString setupCore(const QString &adminUser, const QString &adminPassword, const QString &backend, const QVariantMap &setupData, const QString &authenticator, const QVariantMap &authSetupMap);
727 void connectInternalPeer(QPointer<InternalPeer> peer);
730 void customEvent(QEvent *event) override;
733 bool startListening();
734 void stopListening(const QString &msg = QString());
735 void incomingConnection();
736 void clientDisconnected();
738 bool initStorage(const QString &backend, const QVariantMap &settings,
739 const QProcessEnvironment &environment, bool loadFromEnvironment,
741 bool initAuthenticator(const QString &backend, const QVariantMap &settings,
742 const QProcessEnvironment &environment, bool loadFromEnvironment,
745 void socketError(QAbstractSocket::SocketError err, const QString &errorString);
746 void setupClientSession(RemotePeer *, UserId);
748 bool changeUserPass(const QString &username);
751 SessionThread *sessionForUser(UserId userId, bool restoreState = false);
752 void addClientHelper(RemotePeer *peer, UserId uid);
753 //void processCoreSetup(QTcpSocket *socket, QVariantMap &msg);
754 QString setupCoreForInternalUsage();
755 void setupInternalClientSession(QPointer<InternalPeer> peer);
759 template<typename Storage>
760 void registerStorageBackend();
762 template<typename Authenticator>
763 void registerAuthenticator();
765 void registerStorageBackends();
766 void registerAuthenticators();
768 DeferredSharedPtr<Storage> storageBackend(const QString& backendId) const;
769 DeferredSharedPtr<Authenticator> authenticator(const QString& authenticatorId) const;
771 bool selectBackend(const QString &backend);
772 bool selectAuthenticator(const QString &backend);
774 bool saveBackendSettings(const QString &backend, const QVariantMap &settings);
775 void saveAuthenticatorSettings(const QString &backend, const QVariantMap &settings);
780 template<typename Backend>
781 QVariantMap promptForSettings(const Backend *backend);
784 static Core *_instance;
785 QSet<CoreAuthHandler *> _connectingClients;
786 QHash<UserId, SessionThread *> _sessions;
787 DeferredSharedPtr<Storage> _storage; ///< Active storage backend
788 DeferredSharedPtr<Authenticator> _authenticator; ///< Active authenticator
789 QMap<UserId, QString> _authUserNames;
791 QTimer _storageSyncTimer;
794 SslServer _server, _v6server;
796 QTcpServer _server, _v6server;
799 OidentdConfigGenerator *_oidentdConfigGenerator {nullptr};
801 std::vector<DeferredSharedPtr<Storage>> _registeredStorageBackends;
802 std::vector<DeferredSharedPtr<Authenticator>> _registeredAuthenticators;
804 QDateTime _startTime;
806 IdentServer *_identServer {nullptr};
808 bool _initialized{false};
809 bool _configured{false};
811 QPointer<InternalPeer> _pendingInternalConnection;
813 /// Whether or not strict ident mode is enabled, locking users' idents to Quassel username
814 bool _strictIdentEnabled;
816 static std::unique_ptr<AbstractSqlMigrationReader> getMigrationReader(Storage *storage);
817 static std::unique_ptr<AbstractSqlMigrationWriter> getMigrationWriter(Storage *storage);
818 static void stdInEcho(bool on);
819 static inline void enableStdInEcho() { stdInEcho(true); }
820 static inline void disableStdInEcho() { stdInEcho(false); }