On Friday 17 June 2005 03:03 pm, Julian Elischer wrote:
> Aziz Kezzou wrote:
> >>Aziz Kezzou wrote:
> >>>Hi all,
> >>>I am trying to check that a process (struct proc) has root powers when
> >>>it calls my KLD system call.
> >>>I know fro
Aziz Kezzou wrote:
Aziz Kezzou wrote:
Hi all,
I am trying to check that a process (struct proc) has root powers when
it calls my KLD system call.
I know from kern_jail.c that I can use suser() but this function takes
a struct thread* instead of struct proc* although the credentials
> Aziz Kezzou wrote:
> > Hi all,
> > I am trying to check that a process (struct proc) has root powers when
> > it calls my KLD system call.
> > I know from kern_jail.c that I can use suser() but this function takes
> > a struct thread* instead of struct proc* alt
Aziz Kezzou wrote:
Hi all,
I am trying to check that a process (struct proc) has root powers when
it calls my KLD system call.
I know from kern_jail.c that I can use suser() but this function takes
a struct thread* instead of struct proc* although the credentials
(struct ucred *p_ucred;) are
> I am trying to check that a process (struct proc) has root
> powers when it calls my KLD system call.
Don't you get a 'struct thread *' as an argument to your
system call entry point?
The 'flag' argument to suser_cred(9) is documented in its
manual page.
Hi all,
I am trying to check that a process (struct proc) has root powers when
it calls my KLD system call.
I know from kern_jail.c that I can use suser() but this function takes
a struct thread* instead of struct proc* although the credentials
(struct ucred *p_ucred;) are stored in proc !
Is
On Mon, 2004-09-13 at 22:51, Peter Pentchev wrote:
> On Mon, Sep 13, 2004 at 10:30:31PM +1000, Sam Lawrance wrote:
> > On Mon, 2004-09-13 at 22:01, Joanna Sledzik wrote:
> > > Hi :)
> > > I'm very very begginer in Unix system programming.
> > > What funct
On Mon, Sep 13, 2004 at 02:01:39PM +0200, Joanna Sledzik wrote:
> Hi :)
> I'm very very begginer in Unix system programming.
> What function should I use to catch the struct proc for some process?
> Is it possible to get the pointer to struct proc using for example the
> pid_
On Mon, Sep 13, 2004 at 10:30:31PM +1000, Sam Lawrance wrote:
> On Mon, 2004-09-13 at 22:01, Joanna Sledzik wrote:
> > Hi :)
> > I'm very very begginer in Unix system programming.
> > What function should I use to catch the struct proc for some process?
> > Is i
On Mon, 2004-09-13 at 22:01, Joanna Sledzik wrote:
> Hi :)
> I'm very very begginer in Unix system programming.
> What function should I use to catch the struct proc for some process?
> Is it possible to get the pointer to struct proc using for example the pid_t pid
> as
Hi :)
I'm very very begginer in Unix system programming.
What function should I use to catch the struct proc for some process?
Is it possible to get the pointer to struct proc using for example the pid_t pid
as an argument?
Thanks for help
Joanna Sl
On Wed, Mar 17, 2004 at 09:36:39PM +0300, Roman Bogorodskiy wrote:
> static int
> new_open(struct proc *p, register struct open_args *uap)
Er, the first argument passed to a system call in 5.x is a `struct
thread', not a `struct proc'.
Cheers,
--
Jacques Vidrine / [EMAIL PRO
John wrote:
> Also, you might consider using strncmp() to make the code a bit easier to
> read, i.e.:
>
> if (strncmp(name, "/tmp/", 5) == 0)
> printf("open(2): %s by pid %d (%s)\n", name, td->td_proc->p_pid,
> td->td_proc->p_comm);
Thank you very much, it
e full code:
module.c
>---cut 8<---
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
static int new_open(struct proc *p, register struct open_args *);
static int offset = NO_SYSCALL;
static int
new_open(struct proc *p, register
On Wed, Mar 17, 2004 at 04:45:30PM +0100, Toni Andjelkovic wrote:
> On Wed, Mar 17 2004 (17:00:02 +0200), Artis Caune wrote:
> > "pid_t" is signed int type, or am I missing something?
>
> You are right, pid_t is __int32_t, which is signed, so "%d"
> is the correct format.
That's only correct for
On Wed, Mar 17 2004 (17:00:02 +0200), Artis Caune wrote:
> "pid_t" is signed int type, or am I missing something?
You are right, pid_t is __int32_t, which is signed, so "%d"
is the correct format.
I assumed that in this case, the signed integer overflowed,
so maybe interpreting it as an unsigned
ing in `/tmp' dir. I've wrote a simple
> "syscall" module which replaces open(2) syscall. My new open(2) looks
>
> like this:
> >---cut 8<---
>
> static int
> new_open(struct proc *p, register struct open_args *uap)
> {
> char name[NAME_MA
"pid_t" is signed int type, or am I missing something?
try this one:
static int
new_open (struct proc *p, register struct open_args *uap)
{
pid_t pid;
pid = p->p_pid;
printf("open(2): pid: %d\n", pid);
return (open(p,uap));
}
On Wed, 17 Mar 2004 17:24:51 +
Toni wrote:
> pid_t is an unsigned number, so try "%u" in printf() instead.
> There's no need to cast a pid_t to int.
Doesn't help. It shows wrong pid's again...
-Roman Bogorodskiy
pgp0.pgp
Description: PGP signature
On Tue, Mar 16, 2004 at 07:39:56PM +0300, Roman Bogorodskiy wrote:
+> I hope it's a right place for kernel module programming related
+> questions, in another case I'd be glad if you point me to the right
+> maillist.
+>
+> So, my aim is to log every file opening in `/tmp' dir. I've wrote a
On Tue, Mar 16 2004 (19:39:56 +0300), Roman Bogorodskiy wrote:
[...]
> printf("open(2): %s pid: %i\n", name, (int)p->p_pid);
[...]
> Mar 16 19:15:44 nov kernel: open(2): /tmp/asfdasfsaf pid: -1002890624
pid_t is an unsigned number, so try "%u" in printf() instead.
There's no need to
open(2) syscall. My new open(2) looks
like this:
>---cut 8<---
static int
new_open(struct proc *p, register struct open_args *uap)
{
char name[NAME_MAX];
size_t size;
if((const void*)copyinstr(uap->path, name,
_vm . vm_rssize ( like top )
but from inside the struct proc what do I use ? I have tried the struct
vmspace but it give me strange numbers (well, maybe not strange but are
they in pages ? bytes ? and why are they 0 sometimes ? ) I have looked
and explored all over the headers, but I am stuck.
Any help w
On Mon, 26 Jun 2000, Matthew Dillon wrote:
> This whole p vs curproc thing is a huge mess. 95% of the time
> p == curproc. The only places where it might not is in I/O ops
> that are completed by an interrupt or (in the case of NFS) some
> other process.
Any chances to
:>p is the process that made the syscall, curproc is the current
:> running process. You should be using p for the process that
:> called my_syscall.
:
:Since only one process can enter the kernel at a time (currently),
:and p is the process that made the system call, it is also the
:current
In article <[EMAIL PROTECTED]>,
Chris Costello <[EMAIL PROTECTED]> wrote:
> On Monday, June 26, 2000, Fox Anderson wrote:
> > What is the difference between p and curproc in my syscall?
> >
> > static int
> > my_syscall(struct proc *p, my_sysc
On Monday, June 26, 2000, Fox Anderson wrote:
> Hi all!
>
> What is the difference between p and curproc in my syscall?
>
> static int
> my_syscall(struct proc *p, my_syscallargs *uap) {
> curproc->..
> }
p is the process that made the sysc
Hi all!
What is the difference between p and curproc in my syscall?
static int
my_syscall(struct proc *p, my_syscallargs *uap) {
curproc->..
}
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message
28 matches
Mail list logo