Re: RFC: O_PONIES semantics (well O_REWRITE)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
> On Fri, Jun 12, 2009 at 03:07:38AM +0100, Jamie Lokier wrote:
> > > Some of the common failures are:
> > > - program overwrites the old config file
> > > - program writes a new file, but forgets to fsync before rename
> > > - program writes the new file in /tmp, so the rename fails on
> > >   some systems
> > > - program writes a new file and fsyncs, but forgets to give the
> > >   new file the same file ownership, permission and/or extended
> > >   attributes as the old file
> > 
> > It's also really hard to do those things from shell scripts, so they
> > are almost never done there.
> 
> That's a good point, but O_(PONIES|REWRITE) doesn't fix that problem,
> since shell scripts can't specify it, and shells can't do it automatically
> for all files created.
Well, it's not really the shells that need to be able to do it, it's the helper utilities that shell scripts use.

For instance, sed should use O_REWRITE if -i is passed.

Still, you could imagine a new type of redirection operator that exposed O_REWRITE, e.g.,

cat >>> config-file.cfg << EOF
[config]
Value=foo
EOF

--Ray
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux