[wishlist] sed: can't create temp file: permission denied #3

Open
opened 2023-01-27 19:13:41 +00:00 by reese · 0 comments
Owner

command: !neko wishlist remove tape measure

result:

exit status 1
&{%!s(int=32768) + cmd='remove tape measure'
+ wishlist=wishlist.txt
+ '[' -f wishlist.txt ]
+ wishlist_remove 'remove tape measure'
+ printf '%s' 'remove tape measure'
+ sed -E 's/^remove +//g'
+ item='tape measure'
+ '[' -z 'tape measure' ]
+ sed -E 's/^tape measure$//g' -i wishlist.txt
sed: can't create temp file 'wishlist.txtXXXXXX': Permission denied
  %!s(int=0) %!s(int64=0)}

it appears that wishlist.txt was somehow created just fine and nekobot has write perms, but new files in the root cannot be created. this is a problem on the production machine as it doesn't happen in my local testing.

i propose creating a directory called var/ and making sure the permissions are correct on startup, then either:

  1. running scripts inside of it (or even a subdir?) so anything they write in $PWD will go there
  2. just having it available and making a note in the readme if u want ur scripts to be able to write stuff.
command: `!neko wishlist remove tape measure` result: ``` exit status 1 &{%!s(int=32768) + cmd='remove tape measure' + wishlist=wishlist.txt + '[' -f wishlist.txt ] + wishlist_remove 'remove tape measure' + printf '%s' 'remove tape measure' + sed -E 's/^remove +//g' + item='tape measure' + '[' -z 'tape measure' ] + sed -E 's/^tape measure$//g' -i wishlist.txt sed: can't create temp file 'wishlist.txtXXXXXX': Permission denied %!s(int=0) %!s(int64=0)} ``` it appears that wishlist.txt was somehow created just fine and nekobot has write perms, but new files in the root cannot be created. this is a problem on the production machine as it doesn't happen in my local testing. i propose creating a directory called `var/` and making sure the permissions are correct on startup, then either: 1) running scripts inside of it (or even a subdir?) so anything they write in `$PWD` will go there 2) just having it available and making a note in the readme if u want ur scripts to be able to write stuff.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cyberia/nekobot#3
No description provided.