Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Feb 2003 02:38:04 +0800
From:      "Tomazo Lujiano" <tomazo@fastermail.com>
To:        freebsd-questions@freebsd.org
Subject:   FreeBSD sysctls
Message-ID:  <20030227183804.20910.qmail@fastermail.com>

next in thread | raw e-mail | index | archive | help
Hello, FreeBSD hackers!
And here is my problem:
I use FreeBSD-4.7 Stable at home. My machine also provides an Internet access
in our local network. That's why I set different firewalls, ipfilters and other
stuff to provide the security in our private net. So, I'd also like to defend
my server from OS-detectors, such as nmap and some others and change TCP-stack as well.
And what I do:
sysctl kern.ostype
kern.ostype: FreeBSD
Well, everything is clear. Then I type:
sysctl kern.ostype=Lotus_Notes/DOMINO
but see:
sysctl: oid 'kern.ostype' is read only
Hm, well, in file /usr/src/sbin/sysctl.c I see the following:
if (!(kind&CTLFLAG_WR)) errx(1, "oid '%s' is read only", bufp);
Ok, let it be. sysctl.c depends on the header file, /usr/include/sys/sysctl.h
-bash-2.05b$ cat /usr/include/sys/sysctl.h | grep CTLFLAG_WR
#define CTLFLAG_WR      0x40000000      /* Allow writes to the variable */
#define CTLFLAG_RW      (CTLFLAG_RD|CTLFLAG_WR)
-bash-2.05b$
As far as I understand, CTLFLAG_WR declaration allows to chande sysctls.
And so, I can't change the value of sysctl, if this sysctl follows to the
condition-"if (!(kind&CTLFLAG_WR))" in /usr/src/sbin/sysctl.c file.
Than's all clear. But one thing: from where does the sysctl take the information
or command to return "false" after being "asked" by condition "if (!(kind&CTLFLAG_WR))"???
Why some sysctl names follow to this condition, return "true" and could be changed accordingly,
and others don't follow, return "false" and so, remain unchangeable???
I want to change kern.ostype anyway!

And another question:
I wanna take participating in FreeBSD project. May be there are some sites or links, where this question is described, but I wanna ask you directly: I want to translate documentation from English into Russian. Please, tell me, which topics aren't occupied yet by other interpriters - and I 'll do all possible to translate them!...
Thank you very much.
Best Regards!
-- 
_______________________________________________
Get your free email from http://www.fastermail.com

Powered by Outblaze

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030227183804.20910.qmail>