Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177548668
D61513.1794684841.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61513.1794684841.diff
View Options
Index: libexec/nuageinit/nuage.lua
===================================================================
--- libexec/nuageinit/nuage.lua
+++ libexec/nuageinit/nuage.lua
@@ -326,7 +326,7 @@
local pwdstr = f:read("*a")
f:close()
if pwdstr:len() ~= 0 then
- return pwdstr:match("%a+:.+:%d+:%d+:.*:(.*):.*")
+ return pwdstr:match("[^:]*:[^:]*:%d+:%d+:[^:]*:([^:]*):")
end
if not pwd.gecos then
pwd.gecos = pwd.name .. " User"
Index: libexec/nuageinit/tests/adduser.lua
===================================================================
--- libexec/nuageinit/tests/adduser.lua
+++ libexec/nuageinit/tests/adduser.lua
@@ -6,7 +6,7 @@
n.err("adduser should not accept empty value")
end
if n.adduser("plop") then
- n.err("adduser should not accept empty value")
+ n.err("adduser accepted a string (not table)")
end
local pw = {}
pw.name = "impossible_username"
@@ -14,3 +14,12 @@
if not res then
n.err("valid adduser should return a path")
end
+
+pw.name = "underscore_"
+-- Call adduser twice to test both addding and looking up an existing user.
+for i = 1, 2 do
+ local res = n.adduser(pw)
+ if not res then
+ n.err("no path returned for username ending with _")
+ end
+end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 7:34 PM (9 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41731356
Default Alt Text
D61513.1794684841.diff (1 KB)
Attached To
Mode
D61513: nuageinit: Split pw line on :s
Attached
Detach File
Event Timeline