We have a file foobar not owned by me, but it is in my group:
$ ll
total 4,0K
-rw-rw-r-- 1 root hbogert 4 jan 19 12:27 foobar
I can touch it and it will update all times:
$ stat foobar
File: 'foobar'
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 4869333 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 0/ root) Gid: ( 1000/ hbogert)
Access: 2017-01-19 12:27:04.499412133 +0100
Modify: 2017-01-19 12:27:04.499412133 +0100
Change: 2017-01-19 12:27:04.499412133 +0100
Birth: -
$ touch foobar
$ stat foobar
File: 'foobar'
Size: 4 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 4869333 Links: 1
Access: (0664/-rw-rw-r--) Uid: ( 0/ root) Gid: ( 1000/ hbogert)
Access: 2017-01-19 12:32:04.375412133 +0100
Modify: 2017-01-19 12:32:04.375412133 +0100
Change: 2017-01-19 12:32:04.375412133 +0100
Birth: -
However, when I just want to change the modification time, it fails:
$ touch -m foobar
touch: setting times of 'foobar': Operation not permitted
Is this expected behaviour?