EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: sscan/ saveData problem with RW permission, and not an NFS issue
From: Vesna Samardzic-Boban <[email protected]>
To: "[email protected]" <[email protected]>
Date: Tue, 16 Apr 2013 11:52:30 +1000
Hi All,


Found a problem as follows:

Running a scan record on a vxWorks IOC and when entering 'File system' in scan_saveData.adl screen, an error message in the 'Save status' field follows:
"RW permission denied !!!"

At first I suspected NFS but after checking it found that my problem was in the sscan's saveData.c and/or VxWorks is 6.9

Tried two versions of sscan, 2-6-6 and 2-8-2, they gave the same result as above. These two versions are same regarding the
saveData.c and its function
    checkRWpermission(char* path)
and specifically the line

    file= creat(tmpfile, O_RDWR);

that creates test file "rix_" with file permissions 002 (because O_RDRW = 2)
(O_RDRW is flag "Open for reading and writing" or File Access Options)

The file permissions 002 become
-------w-  in   terms of    rwxrwxrwx
and hence the error "RW permission denied !!!"

Found a solution by using vxWorks function open() instead of creat().
open() - opens a file and optionally creates a file if it does not exist.
open() - also offers a parameter for "mode" i.e. file permissions, which i set to 0x666 in the example below

     file = open (tmpfile, O_CREAT | O_RDWR, 0666);

Then scan data can be saved as expected.

BTW
saveData.c uses open() for creating 'subdirectory'.
          fd = open (local_pathname, O_RDWR | O_CREAT,
                           FSTAT_DIR | DEFAULT_DIR_PERM | 0775);


Has anyone had similar problems ?
Is this an sscan/saveData.c issue or vxWorks 6.9 issue (I do not have any other version of vxWorks) ?
How about sscan/saveData on OS's other than vxWorks?


Thanks Vesna

P.S.
In my vxWorks 6.9 and its ioLib.c, creat() does not offer file permissions (set to 0 as below):
int creat
    (
    const char *name,           /* name of the file to create */
    int         flag            /* file permissions */
    )
    {
    return (ioCreateOrOpen (name, flag, 0, TRUE));
    }

SUPPLIERS: As of 1 January 2013, the Australian Synchrotron Company Ltd has changed its business name. However, the trading name will remain Australian Synchrotron.
Please address all quotations and invoices to: Synchrotron Light Source Australia Pty Ltd (SLSA), ABN: 18 159 468 256


Replies:
Re: sscan/ saveData problem with RW permission, and not an NFS issue Tim Mooney

Navigate by Date:
Prev: Re: CSS opi refresh Kasemir, Kay
Next: Problem in installing asyn4-19 Priyabrata Jenamani
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: CSS opi refresh Kasemir, Kay
Next: Re: sscan/ saveData problem with RW permission, and not an NFS issue Tim Mooney
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·