Project

General

Profile

Bug #6037 ยป zfs-unknown-uid.diff

Xin Li, 2015-06-25 10:10 PM

View differences:

cddl/contrib/opensolaris/cmd/zfs/zfs_main.c (working copy)
4473 4473
						(void) strlcpy(
4474 4474
						    node->who_perm.who_ug_name,
4475 4475
						    nice_name, 256);
4476
					else {
4477
						/* User or group unknown */
4478
						char *sname = NULL;
4479

  
4480
						asprintf(&sname,
4481
						    "(unknown: %d)", rid);
4482

  
4483
						if (sname != NULL) {
4484
							(void) strlcpy(
4485
							    node->who_perm.who_ug_name,
4486
							    sname, 256);
4487
							free(sname);
4488
						} else
4489
							nomem();
4490
					}
4476 4491
				}
4477 4492

  
4478 4493
				uu_avl_insert(avl, node, idx);
......
4966 4981

  
4967 4982
				if (p != NULL)
4968 4983
					rid = p->pw_uid;
4969
				else {
4984
				else if (*endch != '\0') {
4970 4985
					(void) snprintf(errbuf, 256, gettext(
4971 4986
					    "invalid user %s"), curr);
4972 4987
					allow_usage(un, B_TRUE, errbuf);
......
4980 4995

  
4981 4996
				if (g != NULL)
4982 4997
					rid = g->gr_gid;
4983
				else {
4998
				else if (*endch != '\0') {
4984 4999
					(void) snprintf(errbuf, 256, gettext(
4985 5000
					    "invalid group %s"),  curr);
4986 5001
					allow_usage(un, B_TRUE, errbuf);
    (1-1/1)