mcstrans: fix glob() error checking
Stephen Smalley
maintainerPATCH 1/2 mcstrans: fix glob() error checking
glob(3) returns 0 on success, > 0 on various error conditions.
Signed-off-by Stephen Smalley <[email protected]>
--- mcstrans/src/mcstrans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mcstrans/src/mcstrans.c +1 -1
@@ -854,7 +854,7 @@ static int process_trans(char *buffer)unsigned int n;glob_t g; g.gl_offs =0 ; -if (glob (tok,GLOB_ERR ,NULL , &g) <0 ) { +if (glob (tok,GLOB_ERR ,NULL , &g) !=0 ) {globfree (&g);return -1 ; }
Signature · 1 line
2.54.0
Stephen Smalley
maintainerPATCH 2/2 restorecond: fix glob() error checking
glob(3) returns 0 on success, > 0 on various error conditions.
Signed-off-by Stephen Smalley <[email protected]>
--- restorecond/watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
restorecond/watch.c +1 -1
@@ -193,7 +193,7 @@ void watch_list_add(int fd, const char *path) globbuf.gl_lstat = nofollow_lstat; globbuf.gl_stat = nofollow_lstat;/* never follow symlinks */ if (glob (path,GLOB_TILDE |GLOB_PERIOD |GLOB_ALTDIRFUNC ,NULL , - &globbuf) >=0 ) { + &globbuf) ==0 ) {for (i =0 ; i < globbuf.gl_pathc; i++) {const char *p = globbuf.gl_pathv[i];
Signature · 1 line
2.54.0
Stephen Smalley
maintainerRe: [PATCH 2/2] restorecond: fix glob() error checking
Quoted 4 lines · Stephen Smalley
glob(3) returns 0 on success, > 0 on various error conditions.
Signed-off-by Stephen Smalley <[email protected]>
This series was merged.
Quoted 20 lines
--- restorecond/watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)restorecond/watch.c +1
-2@@ -193,7 +193,7 @@ void watch_list_add(int fd, const char *path) globbuf.gl_lstat = nofollow_lstat; globbuf.gl_stat = nofollow_lstat;/* never follow symlinks */ if (glob (path,GLOB_TILDE |GLOB_PERIOD |GLOB_ALTDIRFUNC ,NULL , - &globbuf) >=0 ) { + &globbuf) ==0 ) {for (i =0 ; i < globbuf.gl_pathc; i++) {const char *p = globbuf.gl_pathv[i]; --2.54.0
Quoted 4 lines · Stephen Smalley
glob(3) returns 0 on success, > 0 on various error conditions.
Signed-off-by Stephen Smalley <[email protected]>
For these two patches:
Acked-by James Carter <[email protected]>
Quoted 20 lines
--- mcstrans/src/mcstrans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mcstrans/src/mcstrans.c +1
-2@@ -854,7 +854,7 @@ static int process_trans(char *buffer)unsigned int n;glob_t g; g.gl_offs =0 ; -if (glob (tok,GLOB_ERR ,NULL , &g) <0 ) { +if (glob (tok,GLOB_ERR ,NULL , &g) !=0 ) {globfree (&g);return -1 ; } --2.54.0
Stephen Smalley
maintainerQuoted 10 lines · James Carter
Quoted 4 lines · Stephen Smalley
glob(3) returns 0 on success, > 0 on various error conditions.
Signed-off-by Stephen Smalley <[email protected]>For these two patches:
Acked-by James Carter <[email protected]>
Merged.
Quoted 21 lines
Quoted 21 lines
--- mcstrans/src/mcstrans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mcstrans/src/mcstrans.c +1
-2@@ -854,7 +854,7 @@ static int process_trans(char *buffer)unsigned int n;glob_t g; g.gl_offs =0 ; -if (glob (tok,GLOB_ERR ,NULL , &g) <0 ) { +if (glob (tok,GLOB_ERR ,NULL , &g) !=0 ) {globfree (&g);return -1 ; } --2.54.0