Jian pointed out that this loop can cycle infinitely when the string
contains a ','.
Also, fix typo in manpage that shows a trailing ',' in one example.
Reported-by: Jian Li <jiali@redhat.com>
Signed-off-by: Jeff Layton <jlayton@samba.org>
.br
setcifsacl -S "ACL:CIFSTESTDOM\\Administrator:0x0/0x0/FULL,
.br
-ACL:CIFSTESTDOM\\user2:0x0/0x0/FULL," <file_name>
+ACL:CIFSTESTDOM\\user2:0x0/0x0/FULL" <file_name>
.PP
.SH "NOTES"
.PP
const char *current;
current = aces;
- while((current = strchr(current, ',')))
+ while((current = strchr(current, ','))) {
+ ++current;
++num;
+ }
return num;
}