From f1cb3ee0e7b7b244780379c71b6444974c016809 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Sat, 23 Jun 2007 07:45:17 +0000 Subject: * dbus/dbus-auth-script.c (_dbus_auth_script_run): added UNIX_ONLY and WIN_ONLY commands for auth scripts * test/data/auth/external-root.auth-script: limit execution to unix --- ChangeLog | 6 ++++++ dbus/dbus-auth-script.c | 32 ++++++++++++++++++++++++++++++++ test/data/auth/external-root.auth-script | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 58cb591f..f000a993 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-06-23 Ralf Habacker + + * dbus/dbus-auth-script.c (_dbus_auth_script_run): added UNIX_ONLY and + WIN_ONLY commands for auth scripts + * test/data/auth/external-root.auth-script: limit execution to unix + 2007-06-21 Havoc Pennington * dbus/dbus-tranport.c (auth_via_default_rules): made the verbose spam diff --git a/dbus/dbus-auth-script.c b/dbus/dbus-auth-script.c index b23fbfcb..79006b9d 100644 --- a/dbus/dbus-auth-script.c +++ b/dbus/dbus-auth-script.c @@ -324,6 +324,38 @@ _dbus_auth_script_run (const DBusString *filename) /* Ignore this comment */ goto next_iteration; } +#ifdef DBUS_WIN + else if (_dbus_string_starts_with_c_str (&line, + "WIN_ONLY")) + { + /* Ignore this line */ + goto next_iteration; + } + else if (_dbus_string_starts_with_c_str (&line, + "UNIX_ONLY")) + { + /* skip this file */ + _dbus_warn ("skipping unix only auth script\n"); + retval = TRUE; + goto out; + } +#endif +#ifdef DBUS_UNIX + else if (_dbus_string_starts_with_c_str (&line, + "UNIX_ONLY")) + { + /* Ignore this line */ + goto next_iteration; + } + else if (_dbus_string_starts_with_c_str (&line, + "WIN_ONLY")) + { + /* skip this file */ + _dbus_warn ("skipping windows only auth script\n"); + retval = TRUE; + goto out; + } +#endif else if (_dbus_string_starts_with_c_str (&line, "CLIENT")) { diff --git a/test/data/auth/external-root.auth-script b/test/data/auth/external-root.auth-script index ca5b94ac..b4c4b439 100644 --- a/test/data/auth/external-root.auth-script +++ b/test/data/auth/external-root.auth-script @@ -1,5 +1,5 @@ ## this tests we can auth EXTERNAL as ourselves, with root credentials - +UNIX_ONLY SERVER ROOT_CREDENTIALS ## 30 is ASCII '0' in hex -- cgit