who is accessing file fom c???

who is accessing file fom c???

Post by Becker Cuell » Sun, 22 Jan 1995 07:51:21



        Hello world,

        I wonder if somebody could hint me in the right direction in this
little thing I'm trying to develop:  

     Box:
        Solaris 2.3 on sparc-2

     Case:
        Working on a tool that would run in the background and among the many
things it'd do, it will find who accessed some specific files (and also when)
Started with "stat" that tells if such a file was accessed but I've been unable
to find something that'll tell me who. Is this the right way to do it
or there is a better/more elegant way to do it

        Any hint, flame appreciated

,-----------------------------------------------------------------------,
|       |             |  /           :   KD4NFF                         |

|       |__| |--' |__ | `\ |--' |    :                                  |
|            `--           `--       :                                  |
`-----------------------------------------------------------------------'

 
 
 

who is accessing file fom c???

Post by Chris Howa » Sun, 22 Jan 1995 21:12:31



>    Hello world,

>    I wonder if somebody could hint me in the right direction in this
>little thing I'm trying to develop:

>     Box:
>    Solaris 2.3 on sparc-2

>     Case:
>    Working on a tool that would run in the background and among the many
>things it'd do, it will find who accessed some specific files (and also when)
>Started with "stat" that tells if such a file was accessed but I've been unable
>to find something that'll tell me who. Is this the right way to do it
>or there is a better/more elegant way to do it

I think what you'll have to do is run through Kernal structures for each process, and
find the open files from that angle.  Then you would know a) what files are in use per
process, and b) what username owns the process.

There is no historical data on who opened what files at whatever times.  You would
have to catch it as it happens.
--
Chris Howard
daylight software                       http://www.infonet.com/showcase/dsshow

 
 
 

1. File Access - Does Owner Access Override Group Access?

I was experimenting with file access permissions and came across the
following.  

I created a text file in my home directory.  It had read and write access
for the owner (that's me) and read only access at both the group and world
level.  I then did a chmod on the file and gave it 077 as the access mask.
This gave it full access to both group and world but took away all access
at the owner level.  I did an ls -gl and a groups command and the file did
belong to the group of which I was a member.  However, when I tried to cat
the file, the system returned the message 'Permission denied'.  

Does this mean that owner level access overrides group and/or world access?

Even stranger - I next tried to remove the file with the rm command and
it worked!  

I tried looking in the manuals for something to explain about access modes
but have so far been unsuccessful.  Perhaps someone out there could explain
what is going on.  

The system I am using is a SUN 3/260 running version 4.2 release 3.5.  I do
not know if this is unique to SUN or not.
--
Charlie Dennett - Eastman Kodak Company
UUCP: ...rutgers!rochester!kodak!dennett
      ...rutgers!rochester!kodak!cygnus!dennett

2. Q. X11 version

3. Command produces no output if run fom cron.

4. FS: Redhat Linux

5. can't install 4.4 fom Sony CDROM

6. How to remove a file named '-b'?

7. Mail (fom)

8. BOCA 4Port not dialing out/in

9. 'Lame server' message fom DNS?

10. is there a 100 mb PCI to 25 mb FOM adapter?

11. File corruption accessing files on a large-file-enabled fs using RM-Cobol

12. any way to access .mdb(ms-access) files from unix..?

13. Different accesses acording to the newsgroups in nnrp.access file