1 /* |
1 /* |
2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
46 ESidToPackage, // accessible by all clients |
46 ESidToPackage, // accessible by all clients |
47 ESeparatorMinimumWriteUserData, // accessible by NetworkServices + WriteUserData clients only |
47 ESeparatorMinimumWriteUserData, // accessible by NetworkServices + WriteUserData clients only |
48 ESeparatorMinimumTCB, // accessible by TCB clients only |
48 ESeparatorMinimumTCB, // accessible by TCB clients only |
49 ESeparatorMinimumReadUserData2, // accessible by ReadUserData clients only |
49 ESeparatorMinimumReadUserData2, // accessible by ReadUserData clients only |
50 ESetComponentState, // requests coming from SIF |
50 ESetComponentState, // requests coming from SIF |
51 EAddAppRegInfo, // TCB only |
|
52 ESeparatorEndAll, // not supported from there on |
51 ESeparatorEndAll, // not supported from there on |
53 }; |
52 }; |
54 |
53 |
55 const TUint8 CSisRegistryServer::iElementsIndex[iRangeCount] = |
54 const TUint8 CSisRegistryServer::iElementsIndex[iRangeCount] = |
56 { |
55 { |
63 0, // all clients can have access |
62 0, // all clients can have access |
64 4, // WriteUserData clients only |
63 4, // WriteUserData clients only |
65 2, // Used by SWIS only, so TCB is needed - check on cap and SID. |
64 2, // Used by SWIS only, so TCB is needed - check on cap and SID. |
66 1, // ReadUserData clients only |
65 1, // ReadUserData clients only |
67 5, // requests coming from SIF |
66 5, // requests coming from SIF |
68 6, // all clients having TCB |
|
69 CPolicyServer::ENotSupported, |
67 CPolicyServer::ENotSupported, |
70 }; |
68 }; |
71 |
69 |
72 const CPolicyServer::TPolicyElement CSisRegistryServer::iPolicyElements[] = |
70 const CPolicyServer::TPolicyElement CSisRegistryServer::iPolicyElements[] = |
73 { |
71 { |
75 {_INIT_SECURITY_POLICY_C1(ECapabilityReadUserData), CPolicyServer::EFailClient}, |
73 {_INIT_SECURITY_POLICY_C1(ECapabilityReadUserData), CPolicyServer::EFailClient}, |
76 {_INIT_SECURITY_POLICY_S1(KSwisSecureId, ECapabilityTCB), CPolicyServer::EFailClient}, |
74 {_INIT_SECURITY_POLICY_S1(KSwisSecureId, ECapabilityTCB), CPolicyServer::EFailClient}, |
77 {_INIT_SECURITY_POLICY_S0(KDaemonSecureId), CPolicyServer::EFailClient}, |
75 {_INIT_SECURITY_POLICY_S0(KDaemonSecureId), CPolicyServer::EFailClient}, |
78 {_INIT_SECURITY_POLICY_C2(ECapabilityWriteUserData, ECapabilityNetworkServices), CPolicyServer::EFailClient}, |
76 {_INIT_SECURITY_POLICY_C2(ECapabilityWriteUserData, ECapabilityNetworkServices), CPolicyServer::EFailClient}, |
79 {_INIT_SECURITY_POLICY_S0(KSifServerSecureId), CPolicyServer::EFailClient}, |
77 {_INIT_SECURITY_POLICY_S0(KSifServerSecureId), CPolicyServer::EFailClient}, |
80 {_INIT_SECURITY_POLICY_C1(ECapabilityTCB), CPolicyServer::EFailClient}, |
|
81 }; |
78 }; |
82 |
79 |
83 const CPolicyServer::TPolicy CSisRegistryServer::iPolicy = |
80 const CPolicyServer::TPolicy CSisRegistryServer::iPolicy = |
84 { |
81 { |
85 CPolicyServer::EAlwaysPass, // so that any client can connect |
82 CPolicyServer::EAlwaysPass, // so that any client can connect |
122 CSecurityPolicy::ReleaseResource(); |
119 CSecurityPolicy::ReleaseResource(); |
123 delete iShutdown; |
120 delete iShutdown; |
124 iShutdown = NULL; //required in case the server dies before the session |
121 iShutdown = NULL; //required in case the server dies before the session |
125 } |
122 } |
126 |
123 |
127 CSession2* CSisRegistryServer::NewSessionL(const TVersion& aClientVersion, const RMessage2& aMessage) const |
124 CSession2* CSisRegistryServer::NewSessionL(const TVersion& aClientVersion, const RMessage2&) const |
128 // |
125 // |
129 // Create a new client session. This should really check the version number. |
126 // Create a new client session. This should really check the version number. |
130 // |
127 // |
131 { |
128 { |
132 if (aClientVersion == TVersion(1,0,0)) |
129 if (aClientVersion == TVersion(1,0,0)) |
133 { |
130 { |
134 return new(ELeave) CSisRegistrySession(aMessage.SecureId()); |
131 return new(ELeave) CSisRegistrySession(); |
135 } |
132 } |
136 else |
133 else |
137 { |
134 { |
138 User::Leave(KErrCouldNotConnect); |
135 User::Leave(KErrCouldNotConnect); |
139 return NULL; |
136 return NULL; |