aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/auth_gss
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c18
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c4
2 files changed, 15 insertions, 7 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 909dc0c31aab..911ef008b701 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -192,17 +192,23 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct
192 const void *q; 192 const void *q;
193 unsigned int seclen; 193 unsigned int seclen;
194 unsigned int timeout; 194 unsigned int timeout;
195 unsigned long now = jiffies;
195 u32 window_size; 196 u32 window_size;
196 int ret; 197 int ret;
197 198
198 /* First unsigned int gives the lifetime (in seconds) of the cred */ 199 /* First unsigned int gives the remaining lifetime in seconds of the
200 * credential - e.g. the remaining TGT lifetime for Kerberos or
201 * the -t value passed to GSSD.
202 */
199 p = simple_get_bytes(p, end, &timeout, sizeof(timeout)); 203 p = simple_get_bytes(p, end, &timeout, sizeof(timeout));
200 if (IS_ERR(p)) 204 if (IS_ERR(p))
201 goto err; 205 goto err;
202 if (timeout == 0) 206 if (timeout == 0)
203 timeout = GSSD_MIN_TIMEOUT; 207 timeout = GSSD_MIN_TIMEOUT;
204 ctx->gc_expiry = jiffies + (unsigned long)timeout * HZ * 3 / 4; 208 ctx->gc_expiry = now + ((unsigned long)timeout * HZ);
205 /* Sequence number window. Determines the maximum number of simultaneous requests */ 209 /* Sequence number window. Determines the maximum number of
210 * simultaneous requests
211 */
206 p = simple_get_bytes(p, end, &window_size, sizeof(window_size)); 212 p = simple_get_bytes(p, end, &window_size, sizeof(window_size));
207 if (IS_ERR(p)) 213 if (IS_ERR(p))
208 goto err; 214 goto err;
@@ -237,9 +243,11 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct
237 p = ERR_PTR(ret); 243 p = ERR_PTR(ret);
238 goto err; 244 goto err;
239 } 245 }
246 dprintk("RPC: %s Success. gc_expiry %lu now %lu timeout %u\n",
247 __func__, ctx->gc_expiry, now, timeout);
240 return q; 248 return q;
241err: 249err:
242 dprintk("RPC: %s returning %ld\n", __func__, -PTR_ERR(p)); 250 dprintk("RPC: %s returns error %ld\n", __func__, -PTR_ERR(p));
243 return p; 251 return p;
244} 252}
245 253
@@ -1145,7 +1153,7 @@ gss_marshal(struct rpc_task *task, __be32 *p)
1145 1153
1146 /* We compute the checksum for the verifier over the xdr-encoded bytes 1154 /* We compute the checksum for the verifier over the xdr-encoded bytes
1147 * starting with the xid and ending at the end of the credential: */ 1155 * starting with the xid and ending at the end of the credential: */
1148 iov.iov_base = xprt_skip_transport_header(task->tk_xprt, 1156 iov.iov_base = xprt_skip_transport_header(req->rq_xprt,
1149 req->rq_snd_buf.head[0].iov_base); 1157 req->rq_snd_buf.head[0].iov_base);
1150 iov.iov_len = (u8 *)p - (u8 *)iov.iov_base; 1158 iov.iov_len = (u8 *)p - (u8 *)iov.iov_base;
1151 xdr_buf_from_iov(&iov, &verf_buf); 1159 xdr_buf_from_iov(&iov, &verf_buf);
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index b174fcd9ff4c..f0f4eee63a35 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -140,7 +140,7 @@ gss_mech_get(struct gss_api_mech *gm)
140 140
141EXPORT_SYMBOL_GPL(gss_mech_get); 141EXPORT_SYMBOL_GPL(gss_mech_get);
142 142
143struct gss_api_mech * 143static struct gss_api_mech *
144_gss_mech_get_by_name(const char *name) 144_gss_mech_get_by_name(const char *name)
145{ 145{
146 struct gss_api_mech *pos, *gm = NULL; 146 struct gss_api_mech *pos, *gm = NULL;
@@ -205,7 +205,7 @@ mech_supports_pseudoflavor(struct gss_api_mech *gm, u32 pseudoflavor)
205 return 0; 205 return 0;
206} 206}
207 207
208struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor) 208static struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
209{ 209{
210 struct gss_api_mech *gm = NULL, *pos; 210 struct gss_api_mech *gm = NULL, *pos;
211 211