Why the user is in the group law on the group but the file can not be removed?

fs.unlink

{ Error: EACCES: permission denied unlink '/home/somepath/uploads/dis/f/Images/00006684/00009229.jpg'
errno: -13,
code: 'EACCES',
syscall: 'unlink',
path: '/home/somepath/uploads/dis/f/Images/00006684/00009229.jpg' }


-rw-rw-r-- 1 f importfoto 63486 Dec 3 19:21 00009229.jpg


running node from the user m

/etc/group
importfoto:x:1005: ..., m
April 3rd 20 at 17:42
1 answer
April 3rd 20 at 17:44
you (user) need rights to the directory, not the file
That is, want to say somewhere on the path to the file there are problems with access rights? - marcos.Stehr89 commented on April 3rd 20 at 17:47
@marcos.Stehr89, I want to say that to edit a file you need right to write into a file, to remove - the right to write in directory - Gerda.Klein commented on April 3rd 20 at 17:50
@Gerda.Klein, umask is 0002(
Rights to the folder 775, file 664 - marcos.Stehr89 commented on April 3rd 20 at 17:53
ls-ld /home/somepath/uploads/dis/f/Images/00006684/ what shows?
group importfoto?

and

id m

? - Gerda.Klein commented on April 3rd 20 at 17:56
@Gerda.Klein,
#ll | grep 00006684

drwxrwsr-x 2 f importfoto 4096 Dec 12 18:07 00006684/


#id m

uid=1002(m) gid=1002(m) groups=1002(m),1005(importfoto)
- marcos.Stehr89 commented on April 3rd 20 at 17:59
@marcos.Stehr89,
and try to uninstall from the command line?
my guess is that you recently added the user to the group, and the PHP process has not yet received the new group - Gerda.Klein commented on April 3rd 20 at 18:02
@Gerda.Klein, There is a long time, but the uptime from the server and God forbid it's not php and node)
From the command line under the user easy lyuby deysvtiya produces what you want straight) - marcos.Stehr89 commented on April 3rd 20 at 18:05
@marcos.Stehr89, then 100% when pristatome process he will, too.

However, it is possible to know which groups are now in process https://unix.stackexchange.com/questions/444351/de...

The list of groups under Groups is given in /proc//status; for example,

$ grep '^Groups' /proc/$$/status
Groups: 4 24 27 30 46 110 115 116 1000 - Gerda.Klein commented on April 3rd 20 at 18:08
@Gerda.Klein, Well at the weekend I'll try to make a restart, and then accomplish your goal you about the result) - marcos.Stehr89 commented on April 3rd 20 at 18:11

Find more questions by tags LinuxNode.js