🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

4 total messages Started by Dan_Jacobson Tue, 12 Feb 1991 15:10
touch: got to be owner if use date string
#355
Author: Dan_Jacobson
Date: Tue, 12 Feb 1991 15:10
12 lines
885 bytes
spotted on Amdahl UTS 5.2.6....

$ ls -l lcircle10.300pk
-rw-rw-rw-   1 dvorak   dvorak      4340 Feb 12 07:51 lcircle10.300pk
$ id
uid=47941(danj1) gid=47941(danj1) fsid=8(45262)
$ touch lcircle10.300pk
#that worked, why not this?  works when I'm owner...
$ touch 1231235999 lcircle10.300pk
touch: cannot change times on lcircle10.300pk
-- 
Dan_Jacobson@ATT.COM  Naperville IL USA  +1 708-979-6364
Re: touch: got to be owner if use date string
#356
Author: John F Haugh II
Date: Tue, 12 Feb 1991 18:21
28 lines
1662 bytes
In article <DANJ1.91Feb12091029@cbnewse.ATT.COM> Dan_Jacobson@ATT.COM writes:
>spotted on Amdahl UTS 5.2.6....
>
>$ ls -l lcircle10.300pk
>-rw-rw-rw-   1 dvorak   dvorak      4340 Feb 12 07:51 lcircle10.300pk
>$ id
>uid=47941(danj1) gid=47941(danj1) fsid=8(45262)
>$ touch lcircle10.300pk
>#that worked, why not this?  works when I'm owner...
>$ touch 1231235999 lcircle10.300pk
>touch: cannot change times on lcircle10.300pk

Not sure which part should be the bug.

In the olden days, touch without an argument read and wrote the
first byte of the file.  That was sufficient to change the file
modification time.

Nowadays, touch takes a date and uses the utime(2) system call
to change the last read or written dates.  This calls requires
the user to be the file owner or root.

The initial question I raised concerns whether the "old style"
behavior should still work.  I think the answer is "why not."
-- 
John F. Haugh II      |      I've Been Moved     |    MaBellNet: (512) 838-4340
SneakerNet: 809/1D064 |          AGAIN !         |      VNET: LCCB386 at AUSVMQ
BangNet: ..!cs.utexas.edu!ibmchs!auschs!snowball.austin.ibm.com!jfh (e-i-e-i-o)
Re: touch: got to be owner if use date string
#357
Author: Jonathan E. Quist
Date: Tue, 12 Feb 1991 21:30
22 lines
1325 bytes
In article <DANJ1.91Feb12091029@cbnewse.ATT.COM> Dan_Jacobson@ATT.COM writes:
>spotted on Amdahl UTS 5.2.6....
>
>$ ls -l lcircle10.300pk
>-rw-rw-rw-   1 dvorak   dvorak      4340 Feb 12 07:51 lcircle10.300pk
>$ id
>uid=47941(danj1) gid=47941(danj1) fsid=8(45262)
>$ touch lcircle10.300pk
>#that worked, why not this?  works when I'm owner...
>$ touch 1231235999 lcircle10.300pk
>touch: cannot change times on lcircle10.300pk

touch() calls utime(file,0) to set the current time.
to set a particular time, it calls utime(file,&utimbuf),
with the contents of utimbuf set to the desired time.
The first requires only write permission; the second
requires ownership.  (ref. utime(2))

--
Jonathan E. Quist				INTERACTIVE Systems Corporation
jeq@i88.isc.com     					Naperville, IL
DoD #094/ '71 CL450-K4 "Gleep"
Re: touch: got to be owner if use date string
#359
Author: Dan_Jacobson
Date: Wed, 13 Feb 1991 23:37
22 lines
1477 bytes
>>>>> On 12 Feb 91 21:30:24 GMT, jeq@i88.isc.com (Jonathan E. Quist) said:

J> touch() calls utime(file,0) to set the current time.
J> to set a particular time, it calls utime(file,&utimbuf),
J> with the contents of utimbuf set to the desired time.
J> The first requires only write permission; the second
J> requires ownership.  (ref. utime(2))

OK, fine, than the touch man page should say

BUGS
	The optional timestring doesn't work if you don't own the file,
	even though you can write to it.  In that case consider
	copying the file, touching it to the preferred date, moving it
	to the original file name, if possible, then chown(1) and
	chgrp(1)ing the file to the original owner.

[I haven't considered any of the options letters.]

[Also thanks to Sam Ho]
-- 
Dan_Jacobson@ATT.COM  Naperville IL USA  +1 708-979-6364
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads