mirror of https://github.com/schoebel/mars
sio: do not follow symlinks
This commit is contained in:
parent
3883b2bf10
commit
a5576d5ad3
|
@ -625,7 +625,7 @@ static int sio_switch(struct sio_brick *brick)
|
|||
int status = 0;
|
||||
|
||||
if (brick->power.button) {
|
||||
int flags = O_CREAT | O_RDWR | O_LARGEFILE;
|
||||
int flags = O_CREAT | O_NOFOLLOW | O_RDWR | O_LARGEFILE;
|
||||
int index;
|
||||
|
||||
if (brick->power.led_on)
|
||||
|
@ -640,8 +640,12 @@ static int sio_switch(struct sio_brick *brick)
|
|||
|
||||
output->mf = mapfree_get(path, flags);
|
||||
if (unlikely(IS_ERR(output->mf))) {
|
||||
MARS_ERR("could not open file = '%s' flags = %d\n", path, flags);
|
||||
status = -ENOENT;
|
||||
status = PTR_ERR(output->mf);
|
||||
output->mf = NULL;
|
||||
MARS_ERR("open '%s' flags=%d status=%d\n",
|
||||
path,
|
||||
flags,
|
||||
status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue