
Code: Select all
chmod_("/etc/cron.daily/fstrim", 0755)
Code: Select all
chmod_("/etc/cron.daily/fstrim", 0755)
Code: Select all
chmod_("/etc/cron.daily/fstrim",strtol_("0755",0,8))
I just wanted to be sure of the parameters, seems like chmod_() is quite a fatal function if not used properly.auser wrote:0755 is wrong. It would be 493 in that case. You could use strtol() to get your value:Code: Select all
chmod_("/etc/cron.daily/fstrim",strtol_("0755",0,8))
auser wrote:0755 is wrong. It would be 493 in that case. You could use strtol() to get your value:Code: Select all
chmod_("/etc/cron.daily/fstrim",strtol_("0755",0,8))
Code: Select all
strtol_("0755", 0, 8)
I think strtol() and strtoul() are both bugged. Both with normal and su privileges return 0 on Ubuntu 14.04.1 LTS.Opcode wrote:Always returns 0. I tried chmod once again and like last time it bricked my Ubuntu install (had to reinstall, again...).Code: Select all
strtol_("0755", 0, 8)
If you think some code to test can be risky, consider using a virtual machine. At the touch of a button you can restore its previous state without reinstalling.Opcode wrote:How would I properly use the Linux chmod_() function. I tried once and it completely destroyed my Linux install.![]()
...
I tried chmod once again and like last time it bricked my Ubuntu install (had to reinstall, again...)
Two of the most simple and widely used C library functions bugged.... do you think is likely ?Opcode wrote: I think strtol() and strtoul() are both bugged. Both with normal and su privileges return 0 on Ubuntu 14.04.1 LTS.
Code: Select all
long int strtol(const char *nptr, char **endptr, int base);
Code: Select all
ImportC ""
strtol_(nptr.p-utf8, *endptr, base) As "strtol"
EndImport
Code: Select all
Debug strtol_("0755", 0, 8) ; 0 in unicode
Debug strtol_("0755", 0, 8) ; 493 in unicode with the fixed import
luis wrote:Two of the most simple and widely used C library functions bugged.... do you think is likely ?
Or are you compiling with Unicode enabled ?