Due to an error, the file name created by mangling the user ID was not
using the suffix that was supposed to make it unique. Therefore, user's
names made of several consecutive non alphanumeric characters were not
unique.
The error manifested itself as an error message saying that the
_.user_unsort file could not be sorted. It occurred after the first
user assigned to the _ file name had been sorted and its file deleted.
Therefore any subsequent user sharing the _ file name would fail.
This patch also makes sure no original user name might possibly ends up
being the same as a mangled name.
}
}
if (j==0) filename[j++]='_'; //don't leave a file name empty
+ flen=j;
filename[j]='\0';
- flen=i-1;
count=0;
for (group=first_user_group ; group ; group=group->next) {
lastuser=(group->next) ? group->nusers : group->nusers-1;
for (i=0 ; i<lastuser ; i++) {
if (strcasecmp(filename,group->list[i].filename)==0) {
- clen=sprintf(cstr,"-%04X",count++);
+ clen=sprintf(cstr,"+%X",count++);
if (flen+clen<MAX_USER_FNAME_LEN)
strcpy(filename+flen,cstr);
else