lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m1y7gjw8cw.fsf@ebiederm.dsl.xmission.com>
Date:	Fri, 10 Aug 2007 12:30:07 -0600
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, Alexey Dobriyan <adobriyan@...ru>,
	axboe@...nel.dk
Subject: Re: [PATCH 08/10] sysctl: Remove broken cdrom binary sysctls

Alan Cox <alan@...rguk.ukuu.org.uk> writes:

>> I just wanted something stupid and simple, so the -mm tree would not
>> be full of broken sysctls.
>
> Well I'd like you to not replace one pile of hard to clean up but easy to
> locate crap by smearing other hard to fix in one go crap over the kernel.

I'm not certain I see the difference. I just replaced the comparison
of one label with another.  There may have been more beauty in one or
the other but it really should not have made a difference maintenance
wise.  Perhaps I'm just short some cdrom context here to understand
your problem.

Regardless.  Looking at the code I think we can do something straightforward
and even more stupid without needing any comparisons.

Alan does this look a little better?

static int cdrom_sysctl_handler(struct ctl_table *ctl, int write, struct file * filp,
				void __user *buffer, size_t *lenp, loff_t *ppos)
{
	int *valp = ctl->data;
	int val = *valp;
	int ret;
	
	ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos);

	if (write) {
	
		/* we only care for 1 or 0. */
		autoclose        = !!cdrom_sysctl_settings.autoclose;
		autoeject        = !!cdrom_sysctl_settings.autoeject;
		debug	         = !!cdrom_sysctl_settings.debug;
		lockdoor         = !!cdrom_sysctl_settings.lock;
		check_media_type = !!cdrom_sysctl_settings.check;

		/* update the option flags according to the changes. we
		   don't have per device options through sysctl yet,
		   but we will have and then this will disappear. */
		cdrom_update_settings();
	}

        return ret;
}

Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ