diff options
author | Justin P. Mattock <justinmattock@gmail.com> | 2010-04-21 03:02:11 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-04-22 20:10:23 -0400 |
commit | c5b60b5e67af8be4c58d3ffcc36894f69c4fbdc1 (patch) | |
tree | 5ca471fad635ee8d91a24c7b5448dbcad3de74ef | |
parent | 822cceec7248013821d655545ea45d1c6a9d15b3 (diff) |
security: whitespace coding style fixes
Whitespace coding style fixes.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r-- | security/commoncap.c | 4 | ||||
-rw-r--r-- | security/device_cgroup.c | 2 | ||||
-rw-r--r-- | security/keys/key.c | 2 | ||||
-rw-r--r-- | security/keys/keyctl.c | 58 | ||||
-rw-r--r-- | security/keys/keyring.c | 20 | ||||
-rw-r--r-- | security/keys/permission.c | 2 | ||||
-rw-r--r-- | security/keys/proc.c | 2 |
7 files changed, 45 insertions, 45 deletions
diff --git a/security/commoncap.c b/security/commoncap.c index c45c4d20baa8..4e015996dd4d 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
@@ -570,7 +570,7 @@ int cap_inode_setxattr(struct dentry *dentry, const char *name, | |||
570 | } | 570 | } |
571 | 571 | ||
572 | if (!strncmp(name, XATTR_SECURITY_PREFIX, | 572 | if (!strncmp(name, XATTR_SECURITY_PREFIX, |
573 | sizeof(XATTR_SECURITY_PREFIX) - 1) && | 573 | sizeof(XATTR_SECURITY_PREFIX) - 1) && |
574 | !capable(CAP_SYS_ADMIN)) | 574 | !capable(CAP_SYS_ADMIN)) |
575 | return -EPERM; | 575 | return -EPERM; |
576 | return 0; | 576 | return 0; |
@@ -596,7 +596,7 @@ int cap_inode_removexattr(struct dentry *dentry, const char *name) | |||
596 | } | 596 | } |
597 | 597 | ||
598 | if (!strncmp(name, XATTR_SECURITY_PREFIX, | 598 | if (!strncmp(name, XATTR_SECURITY_PREFIX, |
599 | sizeof(XATTR_SECURITY_PREFIX) - 1) && | 599 | sizeof(XATTR_SECURITY_PREFIX) - 1) && |
600 | !capable(CAP_SYS_ADMIN)) | 600 | !capable(CAP_SYS_ADMIN)) |
601 | return -EPERM; | 601 | return -EPERM; |
602 | return 0; | 602 | return 0; |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 6cf8fd2b79e8..37c5af6ac493 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -469,7 +469,7 @@ struct cgroup_subsys devices_subsys = { | |||
469 | .name = "devices", | 469 | .name = "devices", |
470 | .can_attach = devcgroup_can_attach, | 470 | .can_attach = devcgroup_can_attach, |
471 | .create = devcgroup_create, | 471 | .create = devcgroup_create, |
472 | .destroy = devcgroup_destroy, | 472 | .destroy = devcgroup_destroy, |
473 | .populate = devcgroup_populate, | 473 | .populate = devcgroup_populate, |
474 | .subsys_id = devices_subsys_id, | 474 | .subsys_id = devices_subsys_id, |
475 | }; | 475 | }; |
diff --git a/security/keys/key.c b/security/keys/key.c index e50d264c9ad1..c70da6fb82ce 100644 --- a/security/keys/key.c +++ b/security/keys/key.c | |||
@@ -355,7 +355,7 @@ EXPORT_SYMBOL(key_alloc); | |||
355 | */ | 355 | */ |
356 | int key_payload_reserve(struct key *key, size_t datalen) | 356 | int key_payload_reserve(struct key *key, size_t datalen) |
357 | { | 357 | { |
358 | int delta = (int) datalen - key->datalen; | 358 | int delta = (int)datalen - key->datalen; |
359 | int ret = 0; | 359 | int ret = 0; |
360 | 360 | ||
361 | key_check(key); | 361 | key_check(key); |
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c index 34b302b40dea..8f4dce1987c4 100644 --- a/security/keys/keyctl.c +++ b/security/keys/keyctl.c | |||
@@ -212,15 +212,15 @@ SYSCALL_DEFINE4(request_key, const char __user *, _type, | |||
212 | ret = key->serial; | 212 | ret = key->serial; |
213 | 213 | ||
214 | key_put(key); | 214 | key_put(key); |
215 | error5: | 215 | error5: |
216 | key_type_put(ktype); | 216 | key_type_put(ktype); |
217 | error4: | 217 | error4: |
218 | key_ref_put(dest_ref); | 218 | key_ref_put(dest_ref); |
219 | error3: | 219 | error3: |
220 | kfree(callout_info); | 220 | kfree(callout_info); |
221 | error2: | 221 | error2: |
222 | kfree(description); | 222 | kfree(description); |
223 | error: | 223 | error: |
224 | return ret; | 224 | return ret; |
225 | 225 | ||
226 | } /* end sys_request_key() */ | 226 | } /* end sys_request_key() */ |
@@ -246,7 +246,7 @@ long keyctl_get_keyring_ID(key_serial_t id, int create) | |||
246 | 246 | ||
247 | ret = key_ref_to_ptr(key_ref)->serial; | 247 | ret = key_ref_to_ptr(key_ref)->serial; |
248 | key_ref_put(key_ref); | 248 | key_ref_put(key_ref); |
249 | error: | 249 | error: |
250 | return ret; | 250 | return ret; |
251 | 251 | ||
252 | } /* end keyctl_get_keyring_ID() */ | 252 | } /* end keyctl_get_keyring_ID() */ |
@@ -275,7 +275,7 @@ long keyctl_join_session_keyring(const char __user *_name) | |||
275 | ret = join_session_keyring(name); | 275 | ret = join_session_keyring(name); |
276 | kfree(name); | 276 | kfree(name); |
277 | 277 | ||
278 | error: | 278 | error: |
279 | return ret; | 279 | return ret; |
280 | 280 | ||
281 | } /* end keyctl_join_session_keyring() */ | 281 | } /* end keyctl_join_session_keyring() */ |
@@ -322,9 +322,9 @@ long keyctl_update_key(key_serial_t id, | |||
322 | ret = key_update(key_ref, payload, plen); | 322 | ret = key_update(key_ref, payload, plen); |
323 | 323 | ||
324 | key_ref_put(key_ref); | 324 | key_ref_put(key_ref); |
325 | error2: | 325 | error2: |
326 | kfree(payload); | 326 | kfree(payload); |
327 | error: | 327 | error: |
328 | return ret; | 328 | return ret; |
329 | 329 | ||
330 | } /* end keyctl_update_key() */ | 330 | } /* end keyctl_update_key() */ |
@@ -356,7 +356,7 @@ long keyctl_revoke_key(key_serial_t id) | |||
356 | ret = 0; | 356 | ret = 0; |
357 | 357 | ||
358 | key_ref_put(key_ref); | 358 | key_ref_put(key_ref); |
359 | error: | 359 | error: |
360 | return ret; | 360 | return ret; |
361 | 361 | ||
362 | } /* end keyctl_revoke_key() */ | 362 | } /* end keyctl_revoke_key() */ |
@@ -381,7 +381,7 @@ long keyctl_keyring_clear(key_serial_t ringid) | |||
381 | ret = keyring_clear(key_ref_to_ptr(keyring_ref)); | 381 | ret = keyring_clear(key_ref_to_ptr(keyring_ref)); |
382 | 382 | ||
383 | key_ref_put(keyring_ref); | 383 | key_ref_put(keyring_ref); |
384 | error: | 384 | error: |
385 | return ret; | 385 | return ret; |
386 | 386 | ||
387 | } /* end keyctl_keyring_clear() */ | 387 | } /* end keyctl_keyring_clear() */ |
@@ -413,9 +413,9 @@ long keyctl_keyring_link(key_serial_t id, key_serial_t ringid) | |||
413 | ret = key_link(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref)); | 413 | ret = key_link(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref)); |
414 | 414 | ||
415 | key_ref_put(key_ref); | 415 | key_ref_put(key_ref); |
416 | error2: | 416 | error2: |
417 | key_ref_put(keyring_ref); | 417 | key_ref_put(keyring_ref); |
418 | error: | 418 | error: |
419 | return ret; | 419 | return ret; |
420 | 420 | ||
421 | } /* end keyctl_keyring_link() */ | 421 | } /* end keyctl_keyring_link() */ |
@@ -447,9 +447,9 @@ long keyctl_keyring_unlink(key_serial_t id, key_serial_t ringid) | |||
447 | ret = key_unlink(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref)); | 447 | ret = key_unlink(key_ref_to_ptr(keyring_ref), key_ref_to_ptr(key_ref)); |
448 | 448 | ||
449 | key_ref_put(key_ref); | 449 | key_ref_put(key_ref); |
450 | error2: | 450 | error2: |
451 | key_ref_put(keyring_ref); | 451 | key_ref_put(keyring_ref); |
452 | error: | 452 | error: |
453 | return ret; | 453 | return ret; |
454 | 454 | ||
455 | } /* end keyctl_keyring_unlink() */ | 455 | } /* end keyctl_keyring_unlink() */ |
@@ -529,9 +529,9 @@ okay: | |||
529 | } | 529 | } |
530 | 530 | ||
531 | kfree(tmpbuf); | 531 | kfree(tmpbuf); |
532 | error2: | 532 | error2: |
533 | key_ref_put(key_ref); | 533 | key_ref_put(key_ref); |
534 | error: | 534 | error: |
535 | return ret; | 535 | return ret; |
536 | 536 | ||
537 | } /* end keyctl_describe_key() */ | 537 | } /* end keyctl_describe_key() */ |
@@ -616,17 +616,17 @@ long keyctl_keyring_search(key_serial_t ringid, | |||
616 | 616 | ||
617 | ret = key_ref_to_ptr(key_ref)->serial; | 617 | ret = key_ref_to_ptr(key_ref)->serial; |
618 | 618 | ||
619 | error6: | 619 | error6: |
620 | key_ref_put(key_ref); | 620 | key_ref_put(key_ref); |
621 | error5: | 621 | error5: |
622 | key_type_put(ktype); | 622 | key_type_put(ktype); |
623 | error4: | 623 | error4: |
624 | key_ref_put(dest_ref); | 624 | key_ref_put(dest_ref); |
625 | error3: | 625 | error3: |
626 | key_ref_put(keyring_ref); | 626 | key_ref_put(keyring_ref); |
627 | error2: | 627 | error2: |
628 | kfree(description); | 628 | kfree(description); |
629 | error: | 629 | error: |
630 | return ret; | 630 | return ret; |
631 | 631 | ||
632 | } /* end keyctl_keyring_search() */ | 632 | } /* end keyctl_keyring_search() */ |
@@ -673,7 +673,7 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen) | |||
673 | } | 673 | } |
674 | 674 | ||
675 | /* the key is probably readable - now try to read it */ | 675 | /* the key is probably readable - now try to read it */ |
676 | can_read_key: | 676 | can_read_key: |
677 | ret = key_validate(key); | 677 | ret = key_validate(key); |
678 | if (ret == 0) { | 678 | if (ret == 0) { |
679 | ret = -EOPNOTSUPP; | 679 | ret = -EOPNOTSUPP; |
@@ -686,9 +686,9 @@ long keyctl_read_key(key_serial_t keyid, char __user *buffer, size_t buflen) | |||
686 | } | 686 | } |
687 | } | 687 | } |
688 | 688 | ||
689 | error2: | 689 | error2: |
690 | key_put(key); | 690 | key_put(key); |
691 | error: | 691 | error: |
692 | return ret; | 692 | return ret; |
693 | 693 | ||
694 | } /* end keyctl_read_key() */ | 694 | } /* end keyctl_read_key() */ |
@@ -1282,16 +1282,16 @@ long keyctl_session_to_parent(void) | |||
1282 | 1282 | ||
1283 | /* the parent must have the same effective ownership and mustn't be | 1283 | /* the parent must have the same effective ownership and mustn't be |
1284 | * SUID/SGID */ | 1284 | * SUID/SGID */ |
1285 | if (pcred-> uid != mycred->euid || | 1285 | if (pcred->uid != mycred->euid || |
1286 | pcred->euid != mycred->euid || | 1286 | pcred->euid != mycred->euid || |
1287 | pcred->suid != mycred->euid || | 1287 | pcred->suid != mycred->euid || |
1288 | pcred-> gid != mycred->egid || | 1288 | pcred->gid != mycred->egid || |
1289 | pcred->egid != mycred->egid || | 1289 | pcred->egid != mycred->egid || |
1290 | pcred->sgid != mycred->egid) | 1290 | pcred->sgid != mycred->egid) |
1291 | goto not_permitted; | 1291 | goto not_permitted; |
1292 | 1292 | ||
1293 | /* the keyrings must have the same UID */ | 1293 | /* the keyrings must have the same UID */ |
1294 | if (pcred ->tgcred->session_keyring->uid != mycred->euid || | 1294 | if (pcred->tgcred->session_keyring->uid != mycred->euid || |
1295 | mycred->tgcred->session_keyring->uid != mycred->euid) | 1295 | mycred->tgcred->session_keyring->uid != mycred->euid) |
1296 | goto not_permitted; | 1296 | goto not_permitted; |
1297 | 1297 | ||
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index fe0763a18c17..ce7c44b857d0 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
@@ -39,7 +39,7 @@ static inline unsigned keyring_hash(const char *desc) | |||
39 | unsigned bucket = 0; | 39 | unsigned bucket = 0; |
40 | 40 | ||
41 | for (; *desc; desc++) | 41 | for (; *desc; desc++) |
42 | bucket += (unsigned char) *desc; | 42 | bucket += (unsigned char)*desc; |
43 | 43 | ||
44 | return bucket & (KEYRING_NAME_HASH_SIZE - 1); | 44 | return bucket & (KEYRING_NAME_HASH_SIZE - 1); |
45 | } | 45 | } |
@@ -235,7 +235,7 @@ static long keyring_read(const struct key *keyring, | |||
235 | ret = qty; | 235 | ret = qty; |
236 | } | 236 | } |
237 | 237 | ||
238 | error: | 238 | error: |
239 | return ret; | 239 | return ret; |
240 | 240 | ||
241 | } /* end keyring_read() */ | 241 | } /* end keyring_read() */ |
@@ -506,7 +506,7 @@ key_ref_t __keyring_search_one(key_ref_t keyring_ref, | |||
506 | rcu_read_unlock(); | 506 | rcu_read_unlock(); |
507 | return ERR_PTR(-ENOKEY); | 507 | return ERR_PTR(-ENOKEY); |
508 | 508 | ||
509 | found: | 509 | found: |
510 | atomic_inc(&key->usage); | 510 | atomic_inc(&key->usage); |
511 | rcu_read_unlock(); | 511 | rcu_read_unlock(); |
512 | return make_key_ref(key, possessed); | 512 | return make_key_ref(key, possessed); |
@@ -563,7 +563,7 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check) | |||
563 | read_unlock(&keyring_name_lock); | 563 | read_unlock(&keyring_name_lock); |
564 | keyring = ERR_PTR(-ENOKEY); | 564 | keyring = ERR_PTR(-ENOKEY); |
565 | 565 | ||
566 | error: | 566 | error: |
567 | return keyring; | 567 | return keyring; |
568 | 568 | ||
569 | } /* end find_keyring_by_name() */ | 569 | } /* end find_keyring_by_name() */ |
@@ -596,7 +596,7 @@ static int keyring_detect_cycle(struct key *A, struct key *B) | |||
596 | sp = 0; | 596 | sp = 0; |
597 | 597 | ||
598 | /* start processing a new keyring */ | 598 | /* start processing a new keyring */ |
599 | descend: | 599 | descend: |
600 | if (test_bit(KEY_FLAG_REVOKED, &subtree->flags)) | 600 | if (test_bit(KEY_FLAG_REVOKED, &subtree->flags)) |
601 | goto not_this_keyring; | 601 | goto not_this_keyring; |
602 | 602 | ||
@@ -605,7 +605,7 @@ static int keyring_detect_cycle(struct key *A, struct key *B) | |||
605 | goto not_this_keyring; | 605 | goto not_this_keyring; |
606 | kix = 0; | 606 | kix = 0; |
607 | 607 | ||
608 | ascend: | 608 | ascend: |
609 | /* iterate through the remaining keys in this keyring */ | 609 | /* iterate through the remaining keys in this keyring */ |
610 | for (; kix < keylist->nkeys; kix++) { | 610 | for (; kix < keylist->nkeys; kix++) { |
611 | key = keylist->keys[kix]; | 611 | key = keylist->keys[kix]; |
@@ -631,7 +631,7 @@ static int keyring_detect_cycle(struct key *A, struct key *B) | |||
631 | 631 | ||
632 | /* the keyring we're looking at was disqualified or didn't contain a | 632 | /* the keyring we're looking at was disqualified or didn't contain a |
633 | * matching key */ | 633 | * matching key */ |
634 | not_this_keyring: | 634 | not_this_keyring: |
635 | if (sp > 0) { | 635 | if (sp > 0) { |
636 | /* resume the checking of a keyring higher up in the tree */ | 636 | /* resume the checking of a keyring higher up in the tree */ |
637 | sp--; | 637 | sp--; |
@@ -642,15 +642,15 @@ static int keyring_detect_cycle(struct key *A, struct key *B) | |||
642 | 642 | ||
643 | ret = 0; /* no cycles detected */ | 643 | ret = 0; /* no cycles detected */ |
644 | 644 | ||
645 | error: | 645 | error: |
646 | rcu_read_unlock(); | 646 | rcu_read_unlock(); |
647 | return ret; | 647 | return ret; |
648 | 648 | ||
649 | too_deep: | 649 | too_deep: |
650 | ret = -ELOOP; | 650 | ret = -ELOOP; |
651 | goto error; | 651 | goto error; |
652 | 652 | ||
653 | cycle_detected: | 653 | cycle_detected: |
654 | ret = -EDEADLK; | 654 | ret = -EDEADLK; |
655 | goto error; | 655 | goto error; |
656 | 656 | ||
diff --git a/security/keys/permission.c b/security/keys/permission.c index 0ed802c9e698..28645502cd0d 100644 --- a/security/keys/permission.c +++ b/security/keys/permission.c | |||
@@ -109,7 +109,7 @@ int key_validate(struct key *key) | |||
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
112 | error: | 112 | error: |
113 | return ret; | 113 | return ret; |
114 | 114 | ||
115 | } /* end key_validate() */ | 115 | } /* end key_validate() */ |
diff --git a/security/keys/proc.c b/security/keys/proc.c index 9d01021ca0c8..81bf98d67c6b 100644 --- a/security/keys/proc.c +++ b/security/keys/proc.c | |||
@@ -307,7 +307,7 @@ static void *proc_key_users_start(struct seq_file *p, loff_t *_pos) | |||
307 | static void *proc_key_users_next(struct seq_file *p, void *v, loff_t *_pos) | 307 | static void *proc_key_users_next(struct seq_file *p, void *v, loff_t *_pos) |
308 | { | 308 | { |
309 | (*_pos)++; | 309 | (*_pos)++; |
310 | return key_user_next((struct rb_node *) v); | 310 | return key_user_next((struct rb_node *)v); |
311 | } | 311 | } |
312 | 312 | ||
313 | static void proc_key_users_stop(struct seq_file *p, void *v) | 313 | static void proc_key_users_stop(struct seq_file *p, void *v) |