Steve Langasek has proposed merging lp:~vorlon/upstart/lp.1244763 into 
lp:upstart.

Requested reviews:
  Adam Conrad (adconrad): qa
  Upstart Reviewers (upstart-reviewers)
Related bugs:
  Bug #1244763 in upstart : "devpts is mounted incorrectly in the non-initrd 
case"
  https://bugs.launchpad.net/upstart/+bug/1244763

For more details, see:
https://code.launchpad.net/~vorlon/upstart/lp.1244763/+merge/192739

Straightforward change to fix bug #1244763.  Adam will test this on an
initramfsless system to confirm it DTRT.
-- 
https://code.launchpad.net/~vorlon/upstart/lp.1244763/+merge/192739
Your team Upstart Reviewers is requested to review the proposed merge of 
lp:~vorlon/upstart/lp.1244763 into lp:upstart.
=== modified file 'ChangeLog'
--- ChangeLog	2013-10-23 22:44:54 +0000
+++ ChangeLog	2013-10-25 19:18:39 +0000
@@ -1,3 +1,10 @@
+2013-10-25  Steve Langasek  <[email protected]>
+
+	* init/main.c, init/system.c, init/system.h: allow mount options
+	  to be passed to system_mount(), and pass the right options when
+	  mounting /dev/pts to match the permissions set by either
+	  initramfs-tools or mountall.  LP: #1244763.
+
 2013-10-23  Dmitrijs Ledkovs  <[email protected]>
 
  	* extra/upstart-socket-bridge.c: use SOCKET_PATH in our event

=== modified file 'init/main.c'
--- init/main.c	2013-07-31 09:28:48 +0000
+++ init/main.c	2013-10-25 19:18:39 +0000
@@ -280,7 +280,8 @@
 			needs_devtmpfs = 1;
 
 		if (needs_devtmpfs) {
-			if (system_mount ("devtmpfs", "/dev", (MS_NOEXEC | MS_NOSUID)) < 0) {
+			if (system_mount ("devtmpfs", "/dev",
+					  MS_NOEXEC | MS_NOSUID, NULL) < 0) {
 				NihError *err;
 
 				err = nih_error_get ();
@@ -296,7 +297,8 @@
 				nih_error ("%s: %s", _("Cannot create directory"), "/dev/pts");
 		}
 
-		if (system_mount ("devpts", "/dev/pts", (MS_NOEXEC | MS_NOSUID)) < 0) {
+		if (system_mount ("devpts", "/dev/pts", MS_NOEXEC | MS_NOSUID,
+				  "gid=5,mode=0620") < 0) {
 			NihError *err;
 
 			err = nih_error_get ();
@@ -356,7 +358,8 @@
 		 * ourselves. Also mount /dev/pts to allow CONSOLE_LOG
 		 * to function if booted in an initramfs-less environment.
 		 */
-		if (system_mount ("proc", "/proc", (MS_NODEV | MS_NOEXEC | MS_NOSUID)) < 0) {
+		if (system_mount ("proc", "/proc",
+				  MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL) < 0) {
 			NihError *err;
 
 			err = nih_error_get ();
@@ -365,7 +368,8 @@
 			nih_free (err);
 		}
 
-		if (system_mount ("sysfs", "/sys", (MS_NODEV | MS_NOEXEC | MS_NOSUID)) < 0) {
+		if (system_mount ("sysfs", "/sys",
+				  MS_NODEV | MS_NOEXEC | MS_NOSUID, NULL) < 0) {
 			NihError *err;
 
 			err = nih_error_get ();

=== modified file 'init/system.c'
--- init/system.c	2012-08-03 15:47:59 +0000
+++ init/system.c	2013-10-25 19:18:39 +0000
@@ -165,21 +165,20 @@
  * system_mount:
  * @type: filesystem type,
  * @dir: mountpoint,
- * @flags: mount flags.
- *
- * Mount the kernel filesystem @type at @dir with @flags, if not already mounted.  This
- * is used to ensure that the proc and sysfs filesystems are always
- * available.
- *
- * Filesystems are always mounted with the MS_NODEV, MS_NOEXEC and MS_NOSUID
- * mount options, which are sensible for /proc and /sys.
+ * @flags: mount flags,
+ * @options: mount options.
+ *
+ * Mount the kernel filesystem @type at @dir with @flags and mount options
+ * @options, if not already mounted.  This is used to ensure that the proc
+ * and sysfs filesystems are always available.
  *
  * Returns: zero on success, negative value on raised error.
  **/
 int
 system_mount (const char *type,
 	      const char *dir,
-	      unsigned long flags)
+	      unsigned long flags,
+	      const char *options)
 {
 	nih_local char *parent = NULL;
 	char *          ptr;
@@ -208,7 +207,7 @@
 		return 0;
 
 	/* Mount the filesystem */
-	if (mount ("none", dir, type, flags, NULL) < 0)
+	if (mount ("none", dir, type, flags, options) < 0)
 		nih_return_system_error (-1);
 
 	return 0;

=== modified file 'init/system.h'
--- init/system.h	2012-08-03 15:47:59 +0000
+++ init/system.h	2013-10-25 19:18:39 +0000
@@ -36,7 +36,7 @@
 	__attribute__ ((warn_unused_result));
 
 int system_mount         (const char *type, const char *dir,
-			  unsigned long flags)
+			  unsigned long flags, const char *options)
 	__attribute__ ((warn_unused_result));
 
 void system_mknod        (const char *path, mode_t mode, dev_t dev);

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to