~ubuntu-branches/ubuntu/vivid/aptitude/vivid

« back to all changes in this revision

Viewing changes to src/edit_pkg_hier.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-06-22 12:32:56 UTC
  • mfrom: (1.8.6 sid)
  • Revision ID: james.westby@ubuntu.com-20110622123256-8aox9w9ch3x72dci
Tags: 0.6.4-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/05aptitude: never autoremove kernels
  - drop aptitude-doc to Suggests
  - 03_branding.dpatch: ubuntu branding
  - 04_changelog.dpatch: take changelogs from changelogs.ubuntu.com
  - 09_ubuntu_fortify_source.dpatch: Suppress a number of warnings (turned
    into errors by -Werror) triggered by Ubuntu's default of
    -D_FORTIFY_SOURCE=2.
  - 11_ubuntu_uses_sudo.dpatch: fix status line of 'Become root' menu entry
    to not refer to su.
  - 12_point_manpage_to_doc_package.dpatch: point Finnish manpage to the
    correct place for further info
  - 14_html2text_preferred.dpatch: switch back to html2text in favor of
    elinks, since html2text is in main and elinks isn't.
* dropped 01_intltool_update.dpatch
* updated 15_ftbfs_new_apt

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// edit_pkg_hier.cc
2
2
//
3
 
//   Copyright (C) 2000-2001, 2004-2006 Daniel Burrows
 
3
//   Copyright (C) 2000-2001, 2004-2006, 2011 Daniel Burrows
4
4
//
5
5
//   This program is free software; you can redistribute it and/or
6
6
//   modify it under the terms of the GNU General Public License as
332
332
  if(cw::config::global_bindings.key_matches(k, "SaveHier"))
333
333
    {
334
334
      string homedir = get_homedir();
335
 
      string cfgfile;
336
335
 
337
336
      if(homedir.empty())
338
337
        {
339
 
          show_message(_("Unable to look up your home directory, saving to /tmp/function_pkgs!"),
 
338
          // This normally will not happen.  Don't default to a fixed
 
339
          // filename to prevent symlink attacks. (Debian bug #612034)
 
340
          show_message(_("Unable to look up your home directory!"),
340
341
                       NULL,
341
342
                       cw::get_style("Error"));
342
 
          cfgfile = "/tmp/function_pkgs";
343
343
        }
344
344
      else
345
 
        cfgfile = homedir + "/.aptitude/function_pkgs";
346
 
      save_hier(cfgfile);
 
345
        {
 
346
          string cfgfile = homedir + "/.aptitude/function_pkgs";
 
347
          save_hier(cfgfile);
 
348
        }
347
349
    }
348
350
  else if(cw::config::global_bindings.key_matches(k, "Quit"))
349
351
    {