umount: respect fs search path
PATCH 1/1 umount: respect fs search path
This brings search path support to umount to match existing behavior in fsck and mount.
Signed-off-by Mike Frysinger <[email protected]>
--- mount/umount.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)
mount/umount.c +10 -3
@@ -100,7 +100,8 @@ static int fake = 0;static int check_special_umountprog (const char *node,const char *type,int *status) { -char umountprog[120 ]; +char search_path[] =FS_SEARCH_PATH ; +char *path, umountprog[150 ];struct stat statbuf;int res;
@@ -110,10 +111,16 @@ check_special_umountprog(const char *node,if (type ==NULL ||strcmp (type,"none" ) ==0 )return 0 ; -if (strlen (type) <100 ) { + path =strtok (search_path,":" ); +while (path) {int type_opt =0 ; -sprintf (umountprog,"/sbin/umount.%s" , type); + res =snprintf (umountprog,sizeof (umountprog),"%s/umount.%s" , + path, type); + path =strtok (NULL ,":" ); +if (res <0 || (size_t ) res >=sizeof (umountprog)) +continue ; + res =stat (umountprog, &statbuf);if (res ==-1 && errno ==ENOENT &&strchr (type,'.' )) {/* If type ends with ".subtype" try without it */
Signature · 1 line
1.7.8.4
Quoted 2 lines · Mike Frysinger
mount/umount.c | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com