Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84792
b: refs/heads/master
c: b87a267
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Feb 8, 2008
1 parent 40302f1 commit 09b7d2a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e55e212c083f0c51a7d4eccd1746b6dca40ffc41
refs/heads/master: b87a267eb7291d075df76ebabd43c7f961b12f67
21 changes: 18 additions & 3 deletions trunk/fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
#include <linux/devpts_fs.h>
#include <linux/parser.h>
#include <linux/fsnotify.h>
#include <linux/seq_file.h>

#define DEVPTS_SUPER_MAGIC 0x1cd1

#define DEVPTS_DEFAULT_MODE 0600

static struct vfsmount *devpts_mnt;
static struct dentry *devpts_root;

Expand All @@ -32,7 +35,7 @@ static struct {
uid_t uid;
gid_t gid;
umode_t mode;
} config = {.mode = 0600};
} config = {.mode = DEVPTS_DEFAULT_MODE};

enum {
Opt_uid, Opt_gid, Opt_mode,
Expand All @@ -54,7 +57,7 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
config.setgid = 0;
config.uid = 0;
config.gid = 0;
config.mode = 0600;
config.mode = DEVPTS_DEFAULT_MODE;

while ((p = strsep(&data, ",")) != NULL) {
substring_t args[MAX_OPT_ARGS];
Expand All @@ -81,7 +84,7 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
case Opt_mode:
if (match_octal(&args[0], &option))
return -EINVAL;
config.mode = option & ~S_IFMT;
config.mode = option & S_IALLUGO;
break;
default:
printk(KERN_ERR "devpts: called with bogus options\n");
Expand All @@ -92,9 +95,21 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
return 0;
}

static int devpts_show_options(struct seq_file *seq, struct vfsmount *vfs)
{
if (config.setuid)
seq_printf(seq, ",uid=%u", config.uid);
if (config.setgid)
seq_printf(seq, ",gid=%u", config.gid);
seq_printf(seq, ",mode=%03o", config.mode);

return 0;
}

static const struct super_operations devpts_sops = {
.statfs = simple_statfs,
.remount_fs = devpts_remount,
.show_options = devpts_show_options,
};

static int
Expand Down

0 comments on commit 09b7d2a

Please sign in to comment.