------------------------------------------------------------ revno: 1631 committer: Dimitri John Ledkov <dimitri.led...@canonical.com> branch nick: trunk timestamp: Wed 2014-06-04 18:37:59 +0100 message: Revert -r1629 modified: ChangeLog init/log.c util/tests/test_initctl.c
-- lp:upstart https://code.launchpad.net/~upstart-devel/upstart/trunk Your team Upstart Reviewers is subscribed to branch lp:upstart. To unsubscribe from this branch go to https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'ChangeLog' --- ChangeLog 2014-06-04 16:55:28 +0000 +++ ChangeLog 2014-06-04 17:37:59 +0000 @@ -41,13 +41,6 @@ - Clarify default behaviour of 'respawn' stanza. - Add missing 'respawn limit unlimited' details. -2014-04-10 James Hunt <james.h...@ubuntu.com> - - * init/log.c: log_file_open(): Restore umask after opening log file - (LP: #1302117). - * util/tests/test_initctl.c: test_reexec(): New test: - - "ensure re-exec does not disrupt umask". - 2014-03-11 James Hunt <james.h...@ubuntu.com> * NEWS: Release 1.12.1 === modified file 'init/log.c' --- init/log.c 2014-06-04 16:30:21 +0000 +++ init/log.c 2014-06-04 17:37:59 +0000 @@ -405,7 +405,6 @@ struct stat statbuf; int ret = -1; int mode = LOG_DEFAULT_MODE; - mode_t old; int flags = (O_CREAT | O_APPEND | O_WRONLY | O_CLOEXEC | O_NOFOLLOW | O_NONBLOCK); @@ -440,7 +439,7 @@ nih_assert (log->fd == -1); /* Impose some sane defaults. */ - old = umask (LOG_DEFAULT_UMASK); + umask (LOG_DEFAULT_UMASK); /* Non-blocking to avoid holding up the main loop. Without * this, we'd probably need to spawn a thread to handle @@ -448,9 +447,6 @@ */ log->fd = open (log->path, flags, mode); - /* Restore */ - umask (old); - log->open_errno = errno; /* Open may have failed due to path being unaccessible === modified file 'util/tests/test_initctl.c' --- util/tests/test_initctl.c 2014-06-04 16:30:21 +0000 +++ util/tests/test_initctl.c 2014-06-04 17:37:59 +0000 @@ -11052,8 +11052,6 @@ FILE *file; int ok; int ret; - mode_t expected_umask; - size_t len; TEST_GROUP ("re-exec support"); @@ -11319,80 +11317,6 @@ STOP_UPSTART (upstart_pid); /*******************************************************************/ - TEST_FEATURE ("ensure re-exec does not disrupt umask"); - - contents = nih_sprintf (NULL, "exec sh -c umask"); - TEST_NE_P (contents, NULL); - - CREATE_FILE (confdir, "umask.conf", contents); - nih_free (contents); - - start_upstart_common (&upstart_pid, TRUE, TRUE, confdir, logdir, NULL); - - cmd = nih_sprintf (NULL, "%s start umask 2>&1", get_initctl ()); - TEST_NE_P (cmd, NULL); - RUN_COMMAND (NULL, cmd, &output, &lines); - nih_free (output); - - logfile = NIH_MUST (nih_sprintf (NULL, "%s/%s", - logdir, - "umask.log")); - - /* Wait for log to be created */ - ok = FALSE; - for (int i = 0; i < 5; i++) { - sleep (1); - if (! stat (logfile, &statbuf)) { - ok = TRUE; - break; - } - } - TEST_EQ (ok, TRUE); - - contents = nih_file_read (NULL, logfile, &len); - TEST_NE_P (contents, NULL); - TEST_TRUE (len); - - /* overwrite '\n' */ - contents[len-1] = '\0'; - - expected_umask = (mode_t)atoi (contents); - assert0 (unlink (logfile)); - nih_free (contents); - - /* Restart */ - REEXEC_UPSTART (upstart_pid, TRUE); - - /* Re-run job */ - RUN_COMMAND (NULL, cmd, &output, &lines); - nih_free (output); - - /* Wait for log to be recreated */ - ok = FALSE; - for (int i = 0; i < 5; i++) { - sleep (1); - if (! stat (logfile, &statbuf)) { - ok = TRUE; - break; - } - } - TEST_EQ (ok, TRUE); - - contents = nih_file_read (NULL, logfile, &len); - TEST_NE_P (contents, NULL); - TEST_TRUE (len); - - /* overwrite '\n' */ - contents[len-1] = '\0'; - - TEST_EQ (expected_umask, (mode_t)atoi (contents)); - - STOP_UPSTART (upstart_pid); - - DELETE_FILE (confdir, "umask.conf"); - assert0 (unlink (logfile)); - - /*******************************************************************/ TEST_DBUS_END (dbus_pid);
-- upstart-devel mailing list upstart-devel@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/upstart-devel