Skip to main content
added 29 characters in body
Source Link
Stéphane Chazelas
  • 585k
  • 96
  • 1.1k
  • 1.7k

chmod 03755 is meant to do a chmod("file", 03755) on the file which in turn will check that you have the right to do so and perform it if possible (and return an error if not) which in turn will at least update the ctime of the file, may cause an audit record to be generated, etc.

If busybox went out of its way to check whether it's necessary or not, the ctime would not be updated and that would be a bug. It would also take away the atomic nature of the operation which would also be a bug.

So there will be some related writing to the storage device even if not done instantly.

So you'll have to do the check yourself.

If the stat applet was enabled in your build of busybox:

[ "$(stat -Lc%a file)" = 3755 ] || chmod 3755 file

chmod 03755 is meant to do a chmod("file", 03755) on the file which in turn will check that you have the right to do so and perform it if possible which in turn will at least update the ctime of the file, may cause an audit record to be generated, etc.

If busybox went out of its way to check whether it's necessary or not, the ctime would not be updated and that would be a bug. It would also take away the atomic nature of the operation which would also be a bug.

So there will be some related writing to the storage device even if not done instantly.

So you'll have to do the check yourself.

If the stat applet was enabled in your build of busybox:

[ "$(stat -Lc%a file)" = 3755 ] || chmod 3755 file

chmod 03755 is meant to do a chmod("file", 03755) on the file which in turn will check that you have the right to do so and perform it if possible (and return an error if not) which in turn will at least update the ctime of the file, may cause an audit record to be generated, etc.

If busybox went out of its way to check whether it's necessary or not, the ctime would not be updated and that would be a bug. It would also take away the atomic nature of the operation which would also be a bug.

So there will be some related writing to the storage device even if not done instantly.

So you'll have to do the check yourself.

If the stat applet was enabled in your build of busybox:

[ "$(stat -Lc%a file)" = 3755 ] || chmod 3755 file
added 125 characters in body
Source Link
Philip Couling
  • 21k
  • 5
  • 64
  • 100

chmod 03755 is meant to do a chmod("file", 03755) on the file which in turn will check that you have the right to do so and perform it if possible which in turn will at least update the ctime of the file, may cause an audit record to be generated, etc.

If itbusybox went out of its way to check whether it's necessary or not, the ctime would not be updated and that would be a bug. It would also take away the atomic nature of the operation which would also be a bug.

So there will be some related writing to the storage device even if not done instantly.

So you'll have to do the check yourself.

If the stat applet was enabled in your build of busybox:

[ "$(stat -Lc%a file)" = 3755 ] || chmod 3755 file

chmod 03755 is meant to do a chmod("file", 03755) on the file which in turn will check that you have the right to do so and perform it if possible which in turn will at least update the ctime of the file, may cause an audit record to be generated, etc.

If it went out of its way to check whether it's necessary or not, that would be a bug.

So there will be some related writing to the storage device even if not done instantly.

So you'll have to do the check yourself.

If the stat applet was enabled in your build of busybox:

[ "$(stat -Lc%a file)" = 3755 ] || chmod 3755 file

chmod 03755 is meant to do a chmod("file", 03755) on the file which in turn will check that you have the right to do so and perform it if possible which in turn will at least update the ctime of the file, may cause an audit record to be generated, etc.

If busybox went out of its way to check whether it's necessary or not, the ctime would not be updated and that would be a bug. It would also take away the atomic nature of the operation which would also be a bug.

So there will be some related writing to the storage device even if not done instantly.

So you'll have to do the check yourself.

If the stat applet was enabled in your build of busybox:

[ "$(stat -Lc%a file)" = 3755 ] || chmod 3755 file
Source Link
Stéphane Chazelas
  • 585k
  • 96
  • 1.1k
  • 1.7k

chmod 03755 is meant to do a chmod("file", 03755) on the file which in turn will check that you have the right to do so and perform it if possible which in turn will at least update the ctime of the file, may cause an audit record to be generated, etc.

If it went out of its way to check whether it's necessary or not, that would be a bug.

So there will be some related writing to the storage device even if not done instantly.

So you'll have to do the check yourself.

If the stat applet was enabled in your build of busybox:

[ "$(stat -Lc%a file)" = 3755 ] || chmod 3755 file