cvs commit: src/sbin/mdmfs mdmfs.c

Ralf S. Engelschall rse at FreeBSD.org
Fri Nov 4 11:37:14 PST 2005


rse         2005-11-04 19:37:14 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_6)
    sbin/mdmfs           mdmfs.c 
  Log:
  MFC:
  
  | Fix parsing of mdmfs(8) option "-w <user>:<group>" in case <user> or
  | <group> is a numeric user/group ID instead of a user/group name (as
  | explicitly intended to be allowed by both the manual page and the
  | implementation).
  |
  | Before this fix, mdmfs(8) aborted:
  |
  | | # mdmfs -s 32m -w 0:0 md /var/tmp/foo
  | | Assertion failed: (mip->mi_have_uid), function extract_ugid, file /usr/src/sbin/mdmfs/mdmfs.c, line 555.
  | | Abort trap (core dumped)
  |
  | The "mi_have_[ug]id" fields were only set in case a name lookup was
  | successful. Instead they also have to be set in case the string to
  | integer conversion was successful.
  |
  | Additionally, as a result of this fix, two assertions at the end of
  | the function are now always true and hence can be just be removed. It
  | is guarrantied that both the UID and the GID are set when the function
  | returns regularily, else it would have been already bailed out with
  | usage()/exit(3) or errx(3) before.
  |
  | Spotted by:     Christoph Schug <chris at schug.net>
  
  Revision  Changes    Path
  1.23.2.1  +6 -10     src/sbin/mdmfs/mdmfs.c


More information about the cvs-src mailing list