philcryer / lipsync

lipsync sets up a lightweight service that provides command-line, Dropbox like syncing
http://lipsync.info
BSD 3-Clause "New" or "Revised" License
855 stars 58 forks source link

install.sh clears user's entire crontab #26

Closed kvz closed 13 years ago

philcryer commented 13 years ago

this is fixed, as per this commit: https://github.com/philcryer/lipsync/blob/ee817c13476bc71b157584e7c72c63a5bc8af918/install.sh#L153

thanks!

Thynix commented 13 years ago

This still happens if install.sh is run as root. This is because it sets the target user's crontab to the current user's crontab with the line appended. The target user's contab may disappear or otherwise be modified in unexpected ways if the current user is root.

(crontab -l; echo "$newcronjob") | crontab -u $username - #list crontab, read entry from crontab, add line from stdin to crontab

should therefore be

(crontab -u $username -l; echo "$newcronjob") | crontab -u $username - #list crontab, read entry from crontab, add line from stdin to crontab