~ubuntu-branches/debian/jessie/systemd/jessie

« back to all changes in this revision

Viewing changes to src/remount-api-vfs.c

  • Committer: Package Import Robot
  • Author(s): Tollef Fog Heen, Tollef Fog Heen, Michael Biebl
  • Date: 2012-04-03 19:59:17 UTC
  • mfrom: (1.1.10) (6.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20120403195917-l532urrbg4pkreas
Tags: 44-1
[ Tollef Fog Heen ]
* New upstream version.
  - Backport 3492207: journal: PAGE_SIZE is not known on ppc and other
    archs
  - Backport 5a2a2a1: journal: react with immediate rotation to a couple
    of more errors
  - Backport 693ce21: util: never follow symlinks in rm_rf_children()
    Fixes CVE-2012-1174, closes: #664364
* Drop output message from init-functions hook, it's pointless.
* Only rmdir /lib/init/rw if it exists.
* Explicitly order debian-fixup before sysinit.target to prevent a
  possible race condition with the creation of sockets.  Thanks to
  Michael Biebl for debugging this.
* Always restart the initctl socket on upgrades, to mask sysvinit
  removing it.

[ Michael Biebl ]
* Remove workaround for non-interactive sessions from pam config again.
* Create compat /dev/initctl symlink in case we are upgrading from a system
  running a newer version of sysvinit (using /run/initctl) and sysvinit is
  replaced with systemd-sysv during the upgrade. Closes: #663219
* Install new man pages.
* Build-Depend on valac (>= 0.12) instead of valac-0.12. Closes: #663323

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
                return EXIT_FAILURE;
49
49
        }
50
50
 
51
 
        log_set_target(LOG_TARGET_SYSLOG_OR_KMSG);
 
51
        log_set_target(LOG_TARGET_AUTO);
52
52
        log_parse_environment();
53
53
        log_open();
54
54
 
55
55
        umask(0022);
56
56
 
57
 
        if (!(f = setmntent("/etc/fstab", "r"))) {
 
57
        f = setmntent("/etc/fstab", "r");
 
58
        if (!f) {
58
59
                log_error("Failed to open /etc/fstab: %m");
59
60
                goto finish;
60
61
        }
61
62
 
62
 
        if (!(pids = hashmap_new(trivial_hash_func, trivial_compare_func))) {
 
63
        pids = hashmap_new(trivial_hash_func, trivial_compare_func);
 
64
        if (!pids) {
63
65
                log_error("Failed to allocate set");
64
66
                goto finish;
65
67
        }
76
78
 
77
79
                log_debug("Remounting %s", me->mnt_dir);
78
80
 
79
 
                if ((pid = fork()) < 0) {
 
81
                pid = fork();
 
82
                if (pid < 0) {
80
83
                        log_error("Failed to fork: %m");
81
 
                        ret = 1;
 
84
                        ret = EXIT_FAILURE;
82
85
                        continue;
83
86
                }
84
87
 
101
104
                /* Parent */
102
105
 
103
106
                s = strdup(me->mnt_dir);
104
 
 
105
 
                if ((k = hashmap_put(pids, UINT_TO_PTR(pid), s)) < 0) {
 
107
                if (!s) {
 
108
                        log_error("Out of memory.");
 
109
                        ret = EXIT_FAILURE;
 
110
                        continue;
 
111
                }
 
112
 
 
113
 
 
114
                k = hashmap_put(pids, UINT_TO_PTR(pid), s);
 
115
                if (k < 0) {
106
116
                        log_error("Failed to add PID to set: %s", strerror(-k));
107
117
                        ret = EXIT_FAILURE;
108
118
                        continue;
124
134
                        break;
125
135
                }
126
136
 
127
 
                if ((s = hashmap_remove(pids, UINT_TO_PTR(si.si_pid)))) {
 
137
                s = hashmap_remove(pids, UINT_TO_PTR(si.si_pid));
 
138
                if (s) {
128
139
                        if (!is_clean_exit(si.si_code, si.si_status)) {
129
140
                                if (si.si_code == CLD_EXITED)
130
141
                                        log_error("/bin/mount for %s exited with exit status %i.", s, si.si_status);