Skip to content

Commit 97dcd0e

Browse files
committed
bug fix for ws_restore when username is in ws id
1 parent 6fc87db commit 97dcd0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ws_restore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ bool check_name(const string name, const string username, const string real_user
178178
// name has shape: username-id-timestamp
179179
// ^ search for this
180180
// as id can contain - as well, let's compare username with start of name
181-
if ((real_username != "root") && (name.rfind(real_username+"-", 0) != 0)) {
181+
if ((real_username != "root") && (name.find(real_username+"-", 0) != 0)) {
182182
cerr << "Error: only root can do this, or invalid workspace name!" << endl;
183183
return false;
184184
} else {

0 commit comments

Comments
 (0)