diff options
Diffstat (limited to 'hardinfo2/arch')
| -rw-r--r-- | hardinfo2/arch/linux/common/nfs.h | 26 | ||||
| -rw-r--r-- | hardinfo2/arch/linux/common/samba.h | 16 | ||||
| l--------- | hardinfo2/arch/linux/m68k/nfs.h | 1 | ||||
| l--------- | hardinfo2/arch/linux/mips/nfs.h | 1 | ||||
| l--------- | hardinfo2/arch/linux/parisc/nfs.h | 1 | ||||
| l--------- | hardinfo2/arch/linux/ppc/nfs.h | 1 | ||||
| l--------- | hardinfo2/arch/linux/sparc/nfs.h | 1 | ||||
| l--------- | hardinfo2/arch/linux/x86/nfs.h | 1 | 
8 files changed, 40 insertions, 8 deletions
| diff --git a/hardinfo2/arch/linux/common/nfs.h b/hardinfo2/arch/linux/common/nfs.h new file mode 100644 index 00000000..675bc851 --- /dev/null +++ b/hardinfo2/arch/linux/common/nfs.h @@ -0,0 +1,26 @@ +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"); +    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); +} + diff --git a/hardinfo2/arch/linux/common/samba.h b/hardinfo2/arch/linux/common/samba.h index 538659a6..9da8518b 100644 --- a/hardinfo2/arch/linux/common/samba.h +++ b/hardinfo2/arch/linux/common/samba.h @@ -16,9 +16,9 @@   *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA   */ -static gchar *shares_list = NULL; +static gchar *smb_shares_list = NULL;  void -scan_shared_directories(void) +scan_samba_shared_directories(void)  {      GKeyFile *keyfile;      GError *error = NULL; @@ -26,14 +26,14 @@ scan_shared_directories(void)      gchar *smbconf;      gsize length; -    if (shares_list) { -        g_free(shares_list); +    if (smb_shares_list) { +        g_free(smb_shares_list);      }      keyfile = g_key_file_new();      if (!g_file_get_contents("/etc/samba/smb.conf", &smbconf, &length, &error)) { -        shares_list = g_strdup("Cannot open /etc/samba/smb.conf=\n"); +        smb_shares_list = g_strdup("Cannot open /etc/samba/smb.conf=\n");          g_error_free(error);          goto cleanup;      } @@ -43,12 +43,12 @@ scan_shared_directories(void)          if (*_smbconf == ';') *_smbconf = '\0';      if (!g_key_file_load_from_data(keyfile, smbconf, length, 0, &error)) { -        shares_list = g_strdup("Cannot parse smb.conf=\n"); +        smb_shares_list = g_strdup("Cannot parse smb.conf=\n");          g_error_free(error);          goto cleanup;      } -    shares_list = g_strdup(""); +    smb_shares_list = g_strdup("");      groups = g_key_file_get_groups(keyfile, NULL);      gchar **_groups = groups; @@ -60,7 +60,7 @@ scan_shared_directories(void)              if (g_str_equal(available, "yes")) {                  gchar *path = g_key_file_get_string(keyfile, *groups, "path", NULL); -                shares_list = g_strconcat(shares_list, *groups, "=", +                smb_shares_list = g_strconcat(smb_shares_list, *groups, "=",                                            path, "\n", NULL);                  g_free(path);              } diff --git a/hardinfo2/arch/linux/m68k/nfs.h b/hardinfo2/arch/linux/m68k/nfs.h new file mode 120000 index 00000000..3d1048da --- /dev/null +++ b/hardinfo2/arch/linux/m68k/nfs.h @@ -0,0 +1 @@ +../../linux/common/nfs.h
\ No newline at end of file diff --git a/hardinfo2/arch/linux/mips/nfs.h b/hardinfo2/arch/linux/mips/nfs.h new file mode 120000 index 00000000..3d1048da --- /dev/null +++ b/hardinfo2/arch/linux/mips/nfs.h @@ -0,0 +1 @@ +../../linux/common/nfs.h
\ No newline at end of file diff --git a/hardinfo2/arch/linux/parisc/nfs.h b/hardinfo2/arch/linux/parisc/nfs.h new file mode 120000 index 00000000..3d1048da --- /dev/null +++ b/hardinfo2/arch/linux/parisc/nfs.h @@ -0,0 +1 @@ +../../linux/common/nfs.h
\ No newline at end of file diff --git a/hardinfo2/arch/linux/ppc/nfs.h b/hardinfo2/arch/linux/ppc/nfs.h new file mode 120000 index 00000000..3d1048da --- /dev/null +++ b/hardinfo2/arch/linux/ppc/nfs.h @@ -0,0 +1 @@ +../../linux/common/nfs.h
\ No newline at end of file diff --git a/hardinfo2/arch/linux/sparc/nfs.h b/hardinfo2/arch/linux/sparc/nfs.h new file mode 120000 index 00000000..3d1048da --- /dev/null +++ b/hardinfo2/arch/linux/sparc/nfs.h @@ -0,0 +1 @@ +../../linux/common/nfs.h
\ No newline at end of file diff --git a/hardinfo2/arch/linux/x86/nfs.h b/hardinfo2/arch/linux/x86/nfs.h new file mode 120000 index 00000000..3d1048da --- /dev/null +++ b/hardinfo2/arch/linux/x86/nfs.h @@ -0,0 +1 @@ +../../linux/common/nfs.h
\ No newline at end of file | 
