RE: KLD and UID

2004-03-19 Thread Simon Timms

What version of FreeBSD are you trying this on?

You might want to look at this thread on hackers@, it's very similar to
what you're trying to do, I think:

Yes, I think I found that thread yesterday.  I am trying it on the 5.x
series and I notice that the proc pointer argument of a syscall has
become a thread pointer.  That would, of course, explain the horrible
crashes.  It is just a shame that I discovered that after my assignment
was handed in, ah well such is life.  

Thanks for your help,
Simon


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: KLD and UID

2004-03-18 Thread Chris Pressey
On Tue, 16 Mar 2004 23:09:36 -0700
Simon Timms [EMAIL PROTECTED] wrote:

 Hi there, I am playing around with kernel modules trying to learn
 something and hopefully not destroy my computer too badly.  Right now
 my goal is to print out the user id from an open() call.  I am basing
 my work around that found at http://www.nux-acid.org/src/open.c.  To
 that basic code I added (in the new_open method) 
  
 printf(uid %u\n, p-p_ucred-cr_uid);
  
 However this completely doesn't work and I end up crashing the kernel.
 I notice in other places people do things like
  
 uid_t uid = p-p_cred-p_svuid;
  
 however I don't see a p_cred member in the proc structure.  Is there
 something obvious I am missing here?  Complete code listing at
 http://simon.ma.cx/module.c.  Any additional comments/criticisms
 always appreciated.  
  
 Thanks, Simon

What version of FreeBSD are you trying this on?

You might want to look at this thread on hackers@, it's very similar to
what you're trying to do, I think:

  http://docs.freebsd.org/cgi/mid.cgi?20040316163956.GD638

-Chris
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


KLD and UID

2004-03-16 Thread Simon Timms
Hi there, I am playing around with kernel modules trying to learn
something and hopefully not destroy my computer too badly.  Right now my
goal is to print out the user id from an open() call.  I am basing my
work around that found at http://www.nux-acid.org/src/open.c.  To that
basic code I added (in the new_open method) 
 
printf(uid %u\n, p-p_ucred-cr_uid);
 
However this completely doesn't work and I end up crashing the kernel.
I notice in other places people do things like
 
uid_t uid = p-p_cred-p_svuid;
 
however I don't see a p_cred member in the proc structure.  Is there
something obvious I am missing here?  Complete code listing at
http://simon.ma.cx/module.c.  Any additional comments/criticisms always
appreciated.  
 
Thanks, Simon
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]