site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com struct kern_ctl_reg reginfo; bzero(®info, sizeof(reginfo)); ... reginfo.ctl_flags = CTL_FLAG_PRIVILEGED; ... int nError; nError = ctl_register(®info, NULL, &sRef_RPC); ... -Mike On Nov 24, 2004, at 11:33 AM, Matt Jaffa wrote: Thanks, Matt On Nov 24, 2004, at 9:08 AM, Matt Jaffa wrote: Hi, Thanks, Matt _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... I've done this and found that I needed CTL_FLAG_PRIVILEGED to allow only connections from root processes. Since one must init everything in the kern_ctl_reg struct that one isn't using to zero it follows that simply leaving ctl_flags zero would allow non-privileged processes to connect. I must admit that I haven't ever done it but it makes sense and seems to agree with the xnu sources. When defining the kern_ctl_reg structure so that I can use a sys socket to communicate with my NKE, there is 1 flag I see defined in kern_control.h CTL_FLAG_PRIVELIGED which equals 0x1. But no other flags, so I don't know if non-privileged apps can connect to it, or if you just feed a 0 into the flags for that structure and it will let non-root apps connect to it. Any ideas I have a SYS_PROTO socket defined for nke communication. But I have to run the userland app as root, is it possible to make this socket allow non-root apps to connect to it? This email sent to site_archiver@lists.apple.com
participants (1)
-
Michael Cashwell