[nautilus-share] Fix false negative in detecting writable option
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Subject: [nautilus-share] Fix false negative in detecting writable option
- Date: Tue, 21 Jul 2009 23:53:40 +0000 (UTC)
commit 4700a8b48e532e70f1283eb1cdd1645da6066c1e
Author: Chow Loong Jin <hyperair gmail com>
Date: Wed Jun 17 15:49:10 2009 +0800
Fix false negative in detecting writable option
net usershare info now lists ACLs with a trailing comma, breaking
nautilus-share's parsing. By using strstr, we can now detect "Everyone:F"
anywhere in the ACLs string, which allows for potentially longer ACLs
customized manually without using nautilus-share.
src/shares.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/shares.c b/src/shares.c
index ddec01b..f65f78d 100644
--- a/src/shares.c
+++ b/src/shares.c
@@ -358,9 +358,9 @@ add_key_group_to_hashes (GKeyFile *key_file, const char *group)
acl = get_string_from_key_file (key_file, group, KEY_ACL);
if (acl) {
- if (strcmp (acl, "Everyone:R") == 0)
+ if (strstr (acl, "Everyone:R"))
is_writable = FALSE;
- else if (strcmp (acl, "Everyone:F") == 0)
+ else if (strstr (acl, "Everyone:F"))
is_writable = TRUE;
else {
g_message ("unknown format for key '%s/%s' as it contains '%s'. Assuming that the share is read-only",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]