~ubuntu-branches/ubuntu/lucid/ecryptfs-utils/lucid-security

« back to all changes in this revision

Viewing changes to src/libecryptfs/decision_graph.c

  • Committer: Bazaar Package Importer
  • Author(s): Dustin Kirkland, Dustin Kirkland, Tyler Hicks, Michal Hlavinka, anrxc & Dustin Kirkland, Daniel Baumann & Dustin Kirkland, Arfrever Frehtes Taifersar Arahesis, Frédéric Guihéry
  • Date: 2009-05-02 11:44:56 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20090502114456-x714at0k2jxgmwae
Tags: 75-0ubuntu1
[ Dustin Kirkland ]
* debian/rules: drop hackery that moves stuff /usr/share/ecryptfs-utils
* src/utils/mount.ecryptfs_private.c: update inline documentation
* debian/changelog, src/libecryptfs/cmd_ln_parser.c,
  src/libecryptfs/key_management.c, src/pam_ecryptfs/pam_ecryptfs.c,
  src/utils/ecryptfs_add_passphrase.c,
  src/utils/ecryptfs_insert_wrapped_passphrase_into_keyring.c,
  src/utils/ecryptfs_rewrap_passphrase.c,
  src/utils/ecryptfs_unwrap_passphrase.c,
  src/utils/ecryptfs_wrap_passphrase.c: silence some useless logging,
  LP: #313330
* include/ecryptfs.h, libecryptfs/key_management.c,
  utils/ecryptfs_insert_wrapped_passphrase_into_keyring.c,
  utils/ecryptfs_unwrap_passphrase.c: if the file to unwrap is
  unspecified, try to use the default ~/.ecryptfs/wrapped-passphrase
  before bailing out, LP: #359997
* src/utils/ecryptfs-setup-private: unix_chkpwd is not always present
  (eg, gentoo), LP: #332341

[ Tyler Hicks ]
* doc/manpage/ecryptfs.7: ecryptfs_encrypted_view option desription
  was wrong LP: #328761

[ Michal Hlavinka ]
* decision_graph.c: fix uninitialized return code
* mount.ecryptfs.c: don't pass verbosity option to kernel

[ anrxc & Dustin Kirkland ]
* doc/Makefile.am, src/desktop/Makefile.am: fix automake installation from
  /usr/share to /usr/share/ecryptfs-utils

[ Daniel Baumann & Dustin Kirkland ]
* debian/rules, debian/control: sync differences between Debian & Ubuntu's
  packaging

[ Arfrever Frehtes Taifersar Arahesis ]
* src/key_mod/ecryptfs_key_mod_gpg.c,
  src/key_mod/ecryptfs_key_mod_pkcs11_helper.c: fix implicit declations

[ Frédéric Guihéry ]
* key_mod/ecryptfs_key_mod_tspi.c, utils/ecryptfs_generate_tpm_key.c:
  the SRK password should be set to 20 bytes of NULL (wellknown
  password), in order for different tools to request key protection
  with the Storage Root Key

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
                                if ((*next = tn->next_token))
256
256
                                        return 0;
257
257
                                else
258
 
                                        return EINVAL;
 
258
                                        return -EINVAL;
259
259
                        } else if (trans_func_tok_id == NULL_TOK) {
260
260
                                if ((*next = tn->next_token))
261
261
                                        return 0;
262
262
                                else
263
 
                                        return EINVAL;
 
263
                                        return -EINVAL;
264
264
                        }
265
265
                        nvp = nvp->next;
266
266
                }
275
275
                                trans_func_tok_id =
276
276
                                        tn->trans_func(ctx, current,
277
277
                                                       mnt_params, foo);
 
278
                        if (trans_func_tok_id == WRONG_VALUE && 
 
279
                            (ctx->verbosity || 
 
280
                             (current->flags & STDIN_REQUIRED))) {
 
281
                            *next = current;
 
282
                            return 0;
 
283
                        }
278
284
                        if (trans_func_tok_id == MOUNT_ERROR || 
279
 
                            trans_func_tok_id > 0)
 
285
                            trans_func_tok_id < 0)
280
286
                                return trans_func_tok_id;
281
287
                        if ((*next = tn->next_token))
282
288
                                return 0;
283
 
                        else return EINVAL;
 
289
                        else return -EINVAL;
284
290
                }
285
291
        }
286
292
        return NULL_TOK;
366
372
        int val;
367
373
        int value_retrieved;
368
374
        int i;
369
 
        int rc;
 
375
        int rc = 0;
 
376
        int tries = 0;
370
377
 
371
378
        if (ecryptfs_verbosity)
372
379
                syslog(LOG_INFO, "%s: Called on node->mnt_opt_names[0] = [%s]",
599
606
                                syslog(LOG_INFO, "%s: DISPLAY_TRANSITION_NODE_"
600
607
                                       "VALS not set\n", __FUNCTION__);
601
608
obtain_value:
 
609
                        if (++tries > 3) return EINVAL;
602
610
                        if (node->suggested_val)
603
611
                                rc = asprintf(&prompt, "%s [%s]", node->prompt,
604
612
                                         node->suggested_val);
619
627
                                (&(node->val), prompt,
620
628
                                 (node->flags
621
629
                                  & ECRYPTFS_PARAM_FLAG_ECHO_INPUT));
 
630
                        if (node->val[0] == '\0' && 
 
631
                            (node->flags & ECRYPTFS_NONEMPTY_VALUE_REQUIRED)) {
 
632
                                fprintf(stderr,"Wrong input, non-empty value "
 
633
                                        "required!\n");
 
634
                                goto obtain_value;
 
635
                        }
622
636
                        free(prompt);
623
637
                        if (node->flags & VERIFY_VALUE) {
624
638
                                rc = asprintf(&verify_prompt, "Verify %s",
702
716
 
703
717
        memset(*mnt_params, 0, sizeof(struct val_node));
704
718
        rc = eval_param_tree(ctx, root_node, nvp_head, mnt_params);
705
 
        if (rc > 0)
706
 
                return -rc;
707
 
        if (rc != MOUNT_ERROR)
 
719
        if ((rc > 0) && (rc != MOUNT_ERROR))
708
720
                return 0;
709
721
        return rc;
710
722
}
949
961
                rc = -ENOMEM;
950
962
                goto out;
951
963
        }
 
964
        rc = 0;
952
965
        subgraph_ctx = (struct ecryptfs_subgraph_ctx *)(*foo);
953
966
        walker = &subgraph_ctx->head_val_node;
954
967
        while (walker->next)
1023
1036
                rc = -ENOMEM;
1024
1037
                goto out_free_list_and_subgraph_ctx;
1025
1038
        }
1026
 
        rc = 0;
1027
 
        stack_push(mnt_params, sig_mnt_opt);
 
1039
        rc = stack_push(mnt_params, sig_mnt_opt);
1028
1040
out_free_list_and_subgraph_ctx:
1029
1041
        curr = subgraph_ctx->head_val_node.next;
1030
1042
        while (curr) {