Monitoring File Permission Changes with dTrace?

Hi,
We have a file whose permissions are getting changed occasionally, and we're trying to determine which process is changing them.
Can someone describe how to do this with dTrace?
Thanks in advance!
-Rocky
Edited by: umuc-rocky on Mar 31, 2009 10:50 AM

Try this clause for starters:
syscall::chmod:entry
printf("Calling program: %s\n", execname);
printf("Target file: %s\n", fds[arg0].fi_name);
}

Similar Messages

  • Monitoring file permission changes [ solved, kind of]

    I have a configuration file on my server for a program that runs on Windows desktops.  For some reason, the permissions on that file keep getting changed, and it isn't being done manually by anyone.  I'm not sure why this is happening, and it seems to happen at random intervals.
    Is there a way to monitor when the permissions on this file get changed?
    Last edited by timm (2009-04-03 19:47:00)

    http://fileschanged.sourceforge.net/
    fileschanged is a GNU/Linux command-line utility that reports when files have been altered.
    You'll need either fam or gamin installed to use this. I was gonna write a similar program myself. It'll most likely be better than having an infinitely look in a script or having crontab calling a script every second.

  • /dev/null file permission changes frequently

    Hi,
    We are experiencing file permission change issue frequently for the
    following files:
    root@domain5 # ls -l /devices/pseudo/mm@0:null
    crw-rw-rw- 1 root sys 13, 2 Apr 22 2009
    /devices/pseudo/mm@0:null
    root@domain5 # ls -l /dev/null
    crw-rw-rw- 1 root sys 13, 2 Oct 25 07:01 /dev/null
    By default, above is the file permission settings. If the file permission
    changes, it will look like as below:
    root@domain5 # ls -l /devices/pseudo/mm@0:null
    cr--r--r-- 1 root sys 13, 2 Apr 22 2009
    /devices/pseudo/mm@0:null
    root@domain5 # ls -l /dev/null
    cr--r--r-- 1 root sys 13, 2 Oct 25 07:01 /dev/null
    Due to this file permission change the script which uses this file loose
    the write permission and the script fails. To fix this issue, we will be
    manually changing the permission. Can you please help me to know the cause for
    this file permission change.
    Thanks,
    Ram.

    You need to correlate any changes on the system to when you have the problem, or see the date on /dev/null change. Software packages can change this, applications can change this, sometimes even patch installs.
    Even certain administrative practices.
    Here's one example, where touching a vendor software-created printer config with native Solaris admintool would change /dev/null permissions
    http://www.rootunix.org/SOLARIS/printFAQ.txt
    10) ONLY ROOT CAN SEND PRINT JOBS:
    This problem is caused by network spooling software that for a
    network printer that uses /dev/null for the printer device. The
    software monitors the queue and spools the print requests over the
    network to the printer. If the printer setup is modified in any
    way with Admintool, the printer device (/dev/null) permissions will
    change to 600 owner lp.

  • Listen to File Permission Change

    I want to listen to any change in permissions (specifically whether a file is read only or not) of certain text files from within my program. How do I do it?
    Basically, I want to get notifications when an relevant file's read-only attribute toggles. This is to implement a feature where editing of a document is disabled if the document is read-only. The editor should detect the change in this property and allow editing when appropriate. This feature is implemented in several Java IDEs like Eclipse, IntelliJ etc.
    Please provide sample code.
    Thanks,
    Krishna

    This isn't directly possible in a pure Java implementation.
    However, you can implement it quite easily yourself......
    Have a Timer task (or similar) that you schedule to run at whatever frequency is suitable for your use, and have it inspect the files that you have registered interest in (check out the File 'canRead' and 'canWrite' methods).
    Its then quite easy to set up a notification based system:
    * Something capable of monitoring files for changes to their permissions and of notifying
    * registered listeners
    public interface FilePermissionsMonitor {
      void addPermissionsChangeListener(PermissionsChangeListener p, File target);
      void removePermissionsChangeListener(PermissionsChangeListener p);
      void removeListenersFor(File target);
    public interace PermissionsChangeListener {
      // could make this more swanky by introducing a PermissionsChangeEvent 'describing' the change.
      // e.g, it could provide the 'last known' previous permissions in addition to the target file.
      // For brevity, we'll just provide the target File here....
      void permissionsChanged(File target);
    * A FilePermissionsMonitor which uses a timer to periodically check for changes in permissions
    public class PeriodicMonitor implements FilePermissionsMonitor  {
        Implement this as described at the top of this post. I.e, schedule a TimerTask periodically
        which checks the permissions of all Files for which listeners are registered (you'll need to keep hold
        of the 'last known' permissions for each file you are interested in. Notify the relevant listeners when
        you find a change in permissions
    }

  • Can you please advice on RAW device file permission change to crw-r-----

    Currently we have Oracle9i (9.2.0.5) RAC on IBM AIX 5.2 system with 2 node cluster.
    We use the RAW device for Oracle data file default file permission for raw device is crw-rw---- can we change to crw-r-----(remove write permission from group).
    Can you please advice.
    Thanks & Regards

    Hi,
    What is your intention behind this? If protection, there can ve other ways possible.
    Regards,
    Ankit

  • Have video/file specs changed with the latest generation of iPod?

    I have just purchased a 120 GB iPod to replace an older 160 GB model. When syncing the new iPod, I received several messages that select videos could not be copied and were 'grayed out' on the iPod sync pages in iTunes. These videos did copy over on the new unit but were resident and used on the older 160 GB model. All my videos are .mpg. Has something changed with file/video specs with the latest generation on iPod Classics?
    Thanks,
    Brian

    Ran the diagnostic tool and it found a problem and 2nd time it passed , then in the help menu it has just let me update the software to 1.1.5. saying that is the latest.?
    Has just let me name the ipod and is downloading all Music and  photos.
    Wondering now is there anyway of getting it to accept APPS ?

  • Kernel Panic from system file permission changes

    A friend and i were trying to share some image files with each-other so we firewire connected our two macs... (both mac book pros mine a intel core on snow-leopard hers the latest is7 operating system -prob Lion) when the corresponding computer did not appear on our desktops I entered "sharing" console on my system prefs and attempted to allow her computer to see and read/write mine... I got a pop up prompt asking if i wished to share all my internal files and I said "yes"  Shortly thereafter a repeat prompt kept popping up on my computer saying something like ~"can't share system files" I pressed "ok" each time it appeared and after a few pop ups it all seemed ok...
    By now as a backup attempt to share my files i had plugged in my external (open permissions) hard-drive which at this point suddenly told me i am not allowed to read or write on it... I ejected it and since the whole system was still spinning and wanting to share permissions I force-quit the finder and selected "shut down" my system to start fresh but when attempting to restart finder I first a few moments later I got that - multilingual kernel panic prompt
    it won't start up - it won't boot from disc (at start i hold down option and insert operating disc) it wont start up (I've depressed shift after start and arrived at a spinning wheel that never ends... i'm also out of my warranty and hoping to solve this without paying for a new mac

    Unfortunately, the log files are full of scary-sounding messages. Unless you have some specific problem other than the logs, there is usually no need to worry about it. Sometimes, a problem may be reflected in the logs, but you can't start with the logs. You'll never finish.

  • Why iTunes Library file is changing with no reason ?

    I noticed that even when there is no activity in iTunes, the file located at
    "~/Music/iTunes/iTunes Library" is changing regularly, causing Time Machine to backup it every time.
    At the end of the day I have around 500MB transfered for nothing on my backup disk (24h * 20MB).
    Apparently iPhoto files "AlbumData.xml" and "Library6.iPhoto" have the same behaviour.
    Any idea on how this can be improved ? I don't want to exclude these files, nor I want to shut down iTunes when I leave my Mac open at home.
    PS : I found this tool very useful to track Time Machine activity :
    http://fernlightning.com/doku.php?id=software:misc:tms

    Two points:
    First, are you sure you don't have podcasts automatically downloading, or something else making changes to your library file? Since you've got tms you can look and see exactly what's changed, which will probably explain itself.
    Second, quoting from the marketing blurb about Leopard, "Time Machine saves the hourly backups for the past 24 hours, daily backups for the past month, and weekly backups for everything older than a month." So I don't think you'll run out of backup space any time soon because of these hourly copies of your library file.
    Most important, ya gotta keep something flowing through them tubes, or they freeze up, right?

  • [request] peek: monitor files for changes

    http://www.matusiak.eu/numerodix/blog/i … ix+blog%29

    Hmm.. it would never occur to me to package something like this. I just DLed it straight to my ~/bin, chmod +x, and it runs fine.
    I suppose a package would be better.. but it's just a script...

  • Changing oracle file permission with ftp / sql

    Hi, i have a question:
    I've configure webdav to browse my /i folder.
    I can use as well filezilla, connecting with hostname / uname: system / pass / myoraclesystem pass.
    Is there a way to change file permission attributes with ftp?
    Thank you

    Hi,
    Check out ORDSYS.ORDImage type from Oracle Intermedia, and especially its "process" method.
    It possesses various commands to change image properties.
    HTH.

  • Desktop permission changes

    I would like some help regarding permissions. In our office, each employee uses their own iMac and we are on a small Ethernet network. There are four iMacs and each is running Snow Leopard. I have configured it so that each iMac is sharing its desktop. In our office workflow, my co-workers and I intuitively share files by dropping them onto each other's desktops.No need to hunt in our drop boxes which are buried a few levels.
    ISSUE: When I put a file onto a co-worker's desktop, the file permission changes to 'nobody'. If they continue to work on the file and try to save it, they can't. So in order to continue working on a file they have to 'Get Info' first and change the permissions to 'Read & Write' for themselves. However, if I ask my co-worker to get the file from my desktop, the file's permissions are fine and they can open, modified, and save the file without a problem.
    QUESTION: Is there a way to configure our settings so that files can be put onto the desktop's of other co-workers without having to mess with the permissions each time? Why does it work one way (get) but not the other way (put)?

    You don't have permissions to modify an item you do not own.  When you copy a file to another account, it keeps your ownership and permissions, which means only you can write to it.  When another user copies your files, they own the copies, which lets them write to it (you might not have noticed, but you won't have permission to write to their copies, either).
    You can use ACL (Access Control List) entries to give additional permissions - each user's Drop Box folder is also set up this way.

  • EXC_BAD_ACCESS (SIGBUS) with .pkg file after permission change on my HDD

    Hi everybody excuse my english, i'm form french.
    I'm here because I can not install my mobile modem 3G driver (.pkg). When I try to install I have this message *Setup can not open the package. It is likely that the executable file for applications installation has no property rights and / or authorizations.* and after crash and give me exception error *KERNPROTECTIONFAILURE at 0x0000000000000027*.
    Thanks for your help

    Nobody can help me?? I think my installer.app is corrupted due to permission change and I tried all disk authorization repair but nothing to do. There are no apple responsable support in this forum??
    thanks

  • The file "Notes" was change with out my permission, how do I recover the erased notes?

    The File with my notes in the IPhone (IPad as well)  was changed with out me asking, there where some critical notes eliminated from this File, how can I recover this information??

    Hide the App store via Restrictions. See:
    iOS: Understanding Restrictions

  • Workflow to change file permission in SharePoint Online Document Library

    1.What are my options with SPD 2013 If I want to change a documents file permission in a workflow?
    2.Where does SPO host 2013 Workfows?
    3.If connecting to SPO Can I use Worklow Manager 1.0?
    4.Will I need to host my Workflow Manager workflows on server or Azure if running against o365/SPO?
    5.If I wish to create SPO 2013 workflows with Visual Studio 2012, what do I need and will I be limited to actions I see in SPD 2013?
    ============================
    Thank You
    cyberpine.com

    You can host this workflow as a SharePoint App in SharePoint Online or use SharePoint Designer to create this workflow as long as you use the app step. Managing the permissions can be done with a REST call.  The initiator of the workflow must have
    been granted the right to "Manage Permissions" and the app must have full control of the Site Collection.   We have done so for several of our clients.   I know you asked this question some time ago, but I thought the info might still be helpful.

  • Permission issues with files put on desktop by Vista

    Hi Folks,
    I posted this before and got no response so I'm trying again.
    Trying to finally solve an issue that has dogged me ever since upgrading to Lion in the summer. Since installing Lion 10.7 (clean install), I now seem to be having File Sharing issues with a fellow colleague who is on Vista. When trying to open a file placed on my desktop by this user (who has been set up as a "real" network user in Sys Prefs) I get the following message:
    "You do not have permission to open the document "Some_Image.jpg".
    Contact your computer or network administrator for assistance.
    I have to do the following In order to gain access:
    1. Unlock small lock icon in bottom right of Get Info Window
    2. Enter Password in dialog that says "Finder wants to make changes. Type your password to allow this."
    3. Click the now enabled plus sign below list
    4. Select my self from the list of users
    5. Change privilege to "Read & Write" in Privilege column adjacent to my user name.
    Both Vista Machines do this to me although Windows 7 does not. UPDATE: one user has updated his vista install to WIndows 7 and I have this problem again.
    I had hoped that the 10.7.3 update would have fixed this problem for me as I read that the update addresses some Networking issues, but it hasn't.
    Any thoughts here?
    Thank you,
    J.E. Flynn

    Oddly enough, I can't even seem to provide "Write Only (Drop Box)" access to the Windows clients.
    My limited understanding of Widows networking and sharing is starting to rear it's ugly head.
    If I set up File Sharing and give the windows client access to a shared folder. It can copy files but still I do not have access to those (as described above).
    The only way I can get a Windows machine to access my Mac is for them to type my computers local IP in the Explorer address bar " \\192.168.1.XX " and login as me. Obviously, this is not desirable
    All other attempts to login from a Windows client are now failing.

Maybe you are looking for

  • One computer on network will not print.

    I am using a HP LasterJet P2055dn network printer on a small office network that has 3 computers on it. All computer are wired. For some reason I can not get one of the printers to print. It is using XP. I have used all the HP utilities to try and fi

  • Trying To Sync my Outlook Calendar to my BB Tour

    BB Tour (Verizon) Device Manager 5.0 Outlook 2007 Windows vista ( if that matters) Ok so I have read through some other post to see if I could fix my problem, but yet to resolve it.  I have the new BB Tour, my first BB.  I am trying to sync my outloo

  • How to implement Product Licensing

    Hi all, In our company we are developing a web application(using java/JSP Servlets and any app server) for some warehouse. and i want to implement how to do licensing in my application. For example i want to give some one evaluation of my web applica

  • Creating a Return to warehouse in SIM 13.2.1 gives error on screen

    Hi All, When i try to create an Return to Warehouse in SIM 13.2.1 i get the error "Item must be supplied by source". As far as i can remember no association exists in SIM between an item and a warehouse. The association exist in SIM only between an i

  • SAP script linking with internal table

    Hi all, This is my program to print invoices REPORT  z_g_test. TABLES: sbook. DATA sflights_wa TYPE sflights. DATA: itcpo LIKE itcpo. DATA itcpp LIKE itcpp. DATA sflights_itab TYPE TABLE OF sflights WITH HEADER LINE. DATA sbook_itab TYPE TABLE OF sbo