diff options
author | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:35 -0500 |
---|---|---|
committer | Simon Quigley <tsimonq2@ubuntu.com> | 2017-06-19 14:38:35 -0500 |
commit | 720f5023a8f68aaaa54cb6b7bf46efee23b5b4c3 (patch) | |
tree | 26a8d91183787418455f65c2bb44ed641800dad3 /arch/linux/common/nfs.h | |
parent | 854292407779593a401a1d5ce71add51880fa84f (diff) |
Import Upstream version 0.4.1
Diffstat (limited to 'arch/linux/common/nfs.h')
-rw-r--r-- | arch/linux/common/nfs.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/linux/common/nfs.h b/arch/linux/common/nfs.h new file mode 100644 index 00000000..5ae22797 --- /dev/null +++ b/arch/linux/common/nfs.h @@ -0,0 +1,29 @@ +static gchar *nfs_shares_list = NULL; +void +scan_nfs_shared_directories(void) +{ + FILE *exports; + gchar buf[512]; + + if (nfs_shares_list) { + g_free(nfs_shares_list); + } + + nfs_shares_list = g_strdup(""); + + exports = fopen("/etc/exports", "r"); + if (!exports) + return; + + while (fgets(buf, 512, exports)) { + if (buf[0] != '/') + continue; + + strend(buf, ' '); + strend(buf, '\t'); + + nfs_shares_list = g_strconcat(nfs_shares_list, buf, "=\n", NULL); + } + fclose(exports); +} + |