Author: kmachalkova
Date: Tue Jan 29 18:29:06 2008
New Revision: 43982
URL: http://svn.opensuse.org/viewcvs/yast?rev=43982&view=rev
Log:
Handle backslash in username (show one to the user,
write two to the config file)
Modified:
trunk/sudo/src/Sudo.ycp
Modified: trunk/sudo/src/Sudo.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/sudo/src/Sudo.ycp?rev=43982&r1=43981&r2=43982&view=diff
==============================================================================
--- trunk/sudo/src/Sudo.ycp (original)
+++ trunk/sudo/src/Sudo.ycp Tue Jan 29 18:29:06 2008
@@ -120,7 +120,11 @@
default: {
map m = $[];
list <string> cmd = [];
+
+ if ( regexpmatch(opt_key, "^.*\\\\.*$"))
+ opt_key = regexpsub(opt_key, "^(.*)\\\\(.*)$", "\\1\\2");
m["user"] = opt_key;
+
m["host"] = wrk[1]:"";
//match "(.*)"
@@ -265,6 +269,8 @@
//Rest
foreach(map m, user_specs,{
string user = (string) m["user"]:"";
+
+ user = mergestring (splitstring(user, "\\"), "\\\\");
string host = (string) m["host"]:"";
string comment = (string) m["comment"]:"";
string rest = (string) m["run_as"]:"" + " " + (( (boolean) m["no_passwd"]:false) ? "NOPASSWD: " : "") + mergestring((list <string>)m["commands"]:[],",");
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org