* futimes()?
@ 2003-02-02 1:53 H. Peter Anvin
2003-02-02 8:48 ` futimes()? Abramo Bagnara
2003-02-02 12:07 ` futimes()? Alex Riesen
0 siblings, 2 replies; 5+ messages in thread
From: H. Peter Anvin @ 2003-02-02 1:53 UTC (permalink / raw)
To: linux-kernel
In the general vein of avoiding security holes by using file
descriptors when doing repeated operations on the same filesystem
object, I have noticed that there doesn't seem to be a way to set
mtime using a file descriptor. Do we need a futimes() syscall?
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: cris ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: futimes()?
2003-02-02 1:53 futimes()? H. Peter Anvin
@ 2003-02-02 8:48 ` Abramo Bagnara
2003-02-02 12:07 ` futimes()? Alex Riesen
1 sibling, 0 replies; 5+ messages in thread
From: Abramo Bagnara @ 2003-02-02 8:48 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: linux-kernel
"H. Peter Anvin" wrote:
>
> In the general vein of avoiding security holes by using file
> descriptors when doing repeated operations on the same filesystem
> object, I have noticed that there doesn't seem to be a way to set
> mtime using a file descriptor. Do we need a futimes() syscall?
Parallel to that, there is the long time needed lutimes() syscall.
Who has never been annoyed that restoring a backup there's no way to
restore former symlink mtime?
--
Abramo Bagnara mailto:abramo.bagnara@libero.it
Opera Unica Phone: +39.546.656023
Via Emilia Interna, 140
48014 Castel Bolognese (RA) - Italy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: futimes()?
2003-02-02 1:53 futimes()? H. Peter Anvin
2003-02-02 8:48 ` futimes()? Abramo Bagnara
@ 2003-02-02 12:07 ` Alex Riesen
2003-02-03 19:07 ` futimes()? H. Peter Anvin
1 sibling, 1 reply; 5+ messages in thread
From: Alex Riesen @ 2003-02-02 12:07 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: linux-kernel
H. Peter Anvin, Sun, Feb 02, 2003 02:53:22 +0100:
> In the general vein of avoiding security holes by using file
> descriptors when doing repeated operations on the same filesystem
> object, I have noticed that there doesn't seem to be a way to set
> mtime using a file descriptor. Do we need a futimes() syscall?
There is a small problem with close(). It can update mtime as well.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: futimes()?
@ 2003-02-02 18:59 Adam J. Richter
0 siblings, 0 replies; 5+ messages in thread
From: Adam J. Richter @ 2003-02-02 18:59 UTC (permalink / raw)
To: linux-kernel; +Cc: abramo.bagnara, hpa
>Abramo Bagnara wrote:
>"H. Peter Anvin" wrote:
>>
>> In the general vein of avoiding security holes by using file
>> descriptors when doing repeated operations on the same filesystem
>> object, I have noticed that there doesn't seem to be a way to set
>> mtime using a file descriptor. Do we need a futimes() syscall?
>
>Parallel to that, there is the long time needed lutimes() syscall.
>
>Who has never been annoyed that restoring a backup there's no way to
>restore former symlink mtime?
I wonder if we could have an open flags similar to O_NOFOLLOW
that would allow a symbolic link to be "opened" just so it could
be referred to by f{stat,chown,chmod} so that programs that use this
style handle symbolic links the same way.
Also, if you want to add another system call for setting stat
information, perhaps we could take the opportunity to reduce the
number of system calls per file being restored by programs like tar by
creating an fsetstat() system call that would take some kind of
extensible flags field so that programs like tar could do their
business in a single system call. The kernel already seems to do this
internally through inode_operations.setattr. (sys_chown -->
chown_common --> notify_change --> inode_setattr). That way it
would be less likely that we'd have to add a new system calls again
if people think of new file attributes.
Adam J. Richter __ ______________ 575 Oroville Road
adam@yggdrasil.com \ / Milpitas, California 95035
+1 408 309-6081 | g g d r a s i l United States of America
"Free Software For The Rest Of Us."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: futimes()?
2003-02-02 12:07 ` futimes()? Alex Riesen
@ 2003-02-03 19:07 ` H. Peter Anvin
0 siblings, 0 replies; 5+ messages in thread
From: H. Peter Anvin @ 2003-02-03 19:07 UTC (permalink / raw)
To: linux-kernel
Followup to: <20030202120752.GK5239@riesen-pc.gr05.synopsys.com>
By author: Alex Riesen <alexander.riesen@synopsys.COM>
In newsgroup: linux.dev.kernel
>
> H. Peter Anvin, Sun, Feb 02, 2003 02:53:22 +0100:
> > In the general vein of avoiding security holes by using file
> > descriptors when doing repeated operations on the same filesystem
> > object, I have noticed that there doesn't seem to be a way to set
> > mtime using a file descriptor. Do we need a futimes() syscall?
>
> There is a small problem with close(). It can update mtime as well.
>
Presumably it shouldn't unless the file descriptor has been written
to since the last fsync().
-hpa
--
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
Architectures needed: cris ia64 m68k mips64 ppc ppc64 s390 s390x sh v850 x86-64
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2003-02-03 18:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-02 1:53 futimes()? H. Peter Anvin
2003-02-02 8:48 ` futimes()? Abramo Bagnara
2003-02-02 12:07 ` futimes()? Alex Riesen
2003-02-03 19:07 ` futimes()? H. Peter Anvin
-- strict thread matches above, loose matches on Subject: below --
2003-02-02 18:59 futimes()? Adam J. Richter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox