diff options
-rw-r--r-- | sfshare-daemon/src/samba_share.c | 8 | ||||
-rw-r--r-- | sfshare-daemon/src/sfshared.c | 11 |
2 files changed, 10 insertions, 9 deletions
diff --git a/sfshare-daemon/src/samba_share.c b/sfshare-daemon/src/samba_share.c index 076cdf7..a0d5965 100644 --- a/sfshare-daemon/src/samba_share.c +++ b/sfshare-daemon/src/samba_share.c @@ -520,7 +520,7 @@ gint WriteShare(GPtrArray *shared_items, TSmbConfItem *share) } } - //Change atributes - Boolean variables case-insensitive - yes, no, true, false, 1, or 0 + //Change share atributes if(found) switch(i) { @@ -536,7 +536,7 @@ gint WriteShare(GPtrArray *shared_items, TSmbConfItem *share) // path = case PATH_ID: { - //no change + //no change - path must be same g_string_append(smb_conf_new,orig); } break; @@ -600,7 +600,7 @@ gint WriteShare(GPtrArray *shared_items, TSmbConfItem *share) g_free(orig); } - + //Create new share if(new_share) { g_sprintf(tmp,"\n[%s]\n",share->name->str); @@ -635,7 +635,7 @@ gint WriteShare(GPtrArray *shared_items, TSmbConfItem *share) } } - //Write deleted share to smb.conf + //Write new share to smb.conf WriteSmbConf(smb_conf_new->str); fclose(smb_file); diff --git a/sfshare-daemon/src/sfshared.c b/sfshare-daemon/src/sfshared.c index 8a0ddee..1dc9f74 100644 --- a/sfshare-daemon/src/sfshared.c +++ b/sfshare-daemon/src/sfshared.c @@ -4,15 +4,16 @@ #include <glib/gstdio.h> #include "samba_share.h" + int main()
{ - //SetSmbConfPath("smb.conf"); + //SetSmbConfPath("smb.conf"); // Uncomment to set smb.conf path GPtrArray *shared_items = SharedItemsArray_new();
LoadSmbConf(shared_items); - //DeleteShare(shared_items,"/test/cesta"); + //DeleteShare(shared_items,"/test/cesta"); // Uncomment to delete share specify by path TSmbConfItem *test; for(int i = 0; i < shared_items->len; i++) @@ -25,15 +26,15 @@ int main() shared_items = SharedItemsArray_new();
LoadSmbConf(shared_items); - test = SmbConfItem_new("TEST", "/absolutni/cesta", "simple file share comment", TRUE, TRUE); + test = SmbConfItem_new("TEST", "/absolutni/cesta", "My Own New Comment", TRUE, TRUE); - //WriteShare(shared_items, test); + //WriteShare(shared_items, test); // Uncomment to write new share item (test) SmbConfItem_free(test); SharedItemsArray_free(shared_items); - ReloadService(); + //ReloadService(); // Uncomment to reload samba daemon return 0;
}
|