- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Can I modify a file's ACL without updating it'...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2009 11:23 AM
тАО04-22-2009 11:23 AM
I've always found it annoying that a file's Revised date gets modified whenever the security settings for the file are changed. I understand the need, but I wish there were separate fields for tracking when the contents of a file were changed and when the meta-data surrounding a file was changed. I see there's now a Modified date when using dir/full (ODS-5 feature?), but ours are all null so I'm not sure when/where/how it gets used.
Solved! Go to Solution.
- Tags:
- ACLs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2009 11:44 AM
тАО04-22-2009 11:44 AM
Re: Can I modify a file's ACL without updating it's revised date/time?
a FIB$M_NORECORD/fib$v_norecord thing which
can be used in a program. (Example code
available in UnZip [.vms]vms.c.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2009 02:09 PM
тАО04-22-2009 02:09 PM
Re: Can I modify a file's ACL without updating it's revised date/time?
$ perl -e "my $mt=(stat($ARGV[0]))[8]; `SET ACL $ARGV[0]`; utime $mt,$mt,$ARGV[0];" file.dat
This operates on the file "file.dat", first pulling the modification time out of the return of stat, then spawning a process to run the SET ACL command (which as you've noted, tags the RDT), and finally calling utime to set the modification time back to what we originally retrieved. A side effect of using stat is that since it returns times in seconds, you'll lose the ticks and only reset the time to the nearest second, which may or may not be good enough for you.
My example has no error checking. You could add some, but this three-step hack is never going to be an atomic operation. The stat, the SET ACL, and the utime are three independent operations and if you've got other people adding, removing, or modifying files while you're working on them, there are race conditions here big enough to drive a truck through.
But if you've got or can schedule exclusive access and the nearest second is good enough, this might be all you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2009 06:45 PM
тАО04-22-2009 06:45 PM
SolutionYou did not mention the OpenVMS version, but did mention ODS5 and modified date, so i'm guessing you are up to date and could potentially use
$ rdt = F$FILE(file,"RDT")
$ SET SECU ... 'file'
$ SET FILE/ATTR=REVDATE="rdt'
Except that... some double-negative logic around FIB$V_NORECORD is done backwards (best I can tell in SETFILE. It sets the NORECORD bit UNLESS REVDATE is asked for. SO a SET FILE/ATTR=CREDATE will not change the modified date, but requesting REVDATE will leave norecord cleared and thus the Revision data will end up reflecting the time of the command. :-(.
(Guy... did you not dabble in that area when you were a young lad? :-).
So short of patching SETFILE you may want to use your own tool. For example some code like below.
Hope this helps,
Hein
#include descrip
#include string
#include stdio
#include RMS
main(int argc, char *argv[])
{
struct FAB fab = cc$rms_fab;
struct XABRDT dat = cc$rms_xabrdt;
int stat, sys$open(), sys$bintim(), sys$close();
int date_dx[2];
if (argc < 3) {
printf ("Usage: %s
return 1;
}
date_dx[0] = strlen (argv[2]);
date_dx[1] = (int) argv[2];
fab.fab$l_fna = argv[1];
fab.fab$b_fns = strlen(fab.fab$l_fna);
fab.fab$b_fac = FAB$M_PUT;
fab.fab$l_xab = &dat;
stat = sys$open ( &fab );
if (stat & 1) stat = sys$bintim ( date_dx, &dat.xab$q_rdt);
if (stat & 1) stat = sys$close ( &fab );
return stat;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-22-2009 11:34 PM
тАО04-22-2009 11:34 PM
Re: Can I modify a file's ACL without updating it's revised date/time?
Wim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-23-2009 04:10 PM
тАО04-23-2009 04:10 PM
Re: Can I modify a file's ACL without updating it's revised date/time?
Thanks to all for the replies, but especially to Hein for pointing me to the SET FILE/ATT command.
We're on OpenVMS 8.3 but I was looking at 8.2 docs so I didn't realize there were date options in SET FILE/ATT. I've now got 8.3 docs online so decided to play with the various options.
Here's how the various date attributes work:
- CREDATE, BAKDATE, and EXPDATE work as expected and modify that date.
- REVDATE (as Hein noted) doesn't work because it sets the revised date to the date/time the command is entered rather than the specified value. It also bumps the revised date counter.
- MODDATE and ACCDATE don't do anything -- perhaps this is a future enhancement or something that needs to be turned on?
- ATTDATE modifies the revised date -- this is what I wanted! -- and doesn't bump the revised date counter. However, it only works if I first try to set the REVDATE. I think it's related to bumping the revised date counter (shown in parens to right of Revised date), but I'm not sure.
Following Hein's example, I can now do this:
$ rdt = F$FILE(file,"RDT")
$ SET SECURITY... file
$ SET FILE/ATTR=REVDATE="''rdt'" file
$ SET FILE/ATTR=ATTDATE="''rdt'" file
I found that I can't set the Revised date to earlier than the Create date (makes sense) but I can set it in the future.
I haven't found an explanation for these new dates but it would seem the Attributes date would be for tracking when the file attributes where last modified so the Revised date wouldn't be touched.
I don't know whether to call this a feature or a bug, but I'm taking advantage of it either way. :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2009 12:55 AM
тАО04-24-2009 12:55 AM
Re: Can I modify a file's ACL without updating it's revised date/time?
on an ODS5 disk without volume characteristics set to ACCESS_DATES at volume initialization time or with a SET VOLUME.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2009 01:07 AM
тАО04-24-2009 01:07 AM
Re: Can I modify a file's ACL without updating it's revised date/time?
$ mc dfu set file.dat//REVISION_DATE=xxx/RVCOUNT=...
Jur.