summaryrefslogtreecommitdiff
path: root/lib/userspec.c
AgeCommit message (Collapse)Author
2005-05-30(getpwnam, getgrnam, getgrgid)Paul Eggert
[!defined _POSIX_VERSION]: Remove decls; not needed these days.
2005-05-14Update FSF postal mail address.Jim Meyering
2005-03-09Include intprops.h.Paul Eggert
(TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2004-10-05Rename xclone to xmemdup. Remove obsolete xalloc macros.Paul Eggert
Remove xstrdup.c and move xstrdup implementation to xmalloc.c.
2004-08-19Don't use <alloca.h>, so that we don't use alloca onPaul Eggert
strings on unbounded length. alloca's performance benefits aren't that important here. (V_STRDUP): Remove. (parse_with_separator): New function, with most of the internals of the old parse_user_spec. Allow user to omit both user and group, for compatibility with FreeBSD. Clone only the user name, not the entire spec. Do not set *uid, *gid unless entirely successful. Avoid memory leak in some failing cases. Fix regression for USER.GROUP reported by Dmitry V. Levin in <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html> (parse_user_spec): Rewrite to use parse_with_separator.
2004-08-09Remove dependency of xalloc on error, etc.Paul Eggert
2004-07-28Include <stdbool.h>, "inttostr.h".Paul Eggert
(V_STRDUP): Don't assume the string's length fits in int. (ISDIGIT): unsigned -> unsigned int (is_number): Define only ifdef __DJGPP__; not needed elsewhere. Use bool instead of int where appropriate. Do not allow empty strings. (parse_user_spec): Parse numbers as decimal integers, even if they have a leading 0. Don't assume uids and gids fit in int.
2004-04-04Sync from gnulib.Jim Meyering
2004-03-03Don't include "posixver.h".Jim Meyering
(parse_user_spec): Fall back on USER.GROUP parsing regardless of POSIX version, as POSIX 1003.1-2001 allows that behavior as a compatible extension. Simplify code by removing a boolean int that was always nonzero if a string was nonnull.
2003-11-03wrap long copyright lineJim Meyering
2003-10-15Include "userspec.h".Jim Meyering
2003-09-13Update from gnulib.Jim Meyering
2003-07-10Include "posixver.h".Jim Meyering
(parse_user_spec): Accept `.' as a separator only in pre-POSIX-200112 mode.
2003-06-06Update from gnulib.Jim Meyering
2002-11-23Include gettext.h instead of <libintl.h>.Jim Meyering
2002-01-16add 2002 to Copyright lineJim Meyering
2002-01-16(ISDIGIT): Comment fix.Jim Meyering
2000-12-16This bug had a serious impact on chown: `chown N:M FILE' (for integerJim Meyering
N and M) would have treated it like `chown N:N FILE'. (parse_user_spec): Fix typo: s/u/g/.
2000-12-16tweak a commentJim Meyering
2000-09-21(parse_user_spec): Remove debugging printf I'd added.Jim Meyering
Argh!
2000-09-09Don't use atoi.Jim Meyering
Include sys/param.h and limits.h. Include xstrtol.h. (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define. (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define. (parse_user_spec): Use xstrtoul, not atoi when converting numeric UID, GID. Check range.
2000-08-07(same_name): Invoke xalloc_die instead of printing our own message.Jim Meyering
(parse_user_spec): Don't translate a message until just before returning, to avoid unnecessary translation.
2000-02-27(parse_user_spec): If there is no `:' but there is a `.',Jim Meyering
then first look up the entire `.'-containing string as a login name.
2000-02-12<libintl.h>: Include.Jim Meyering
(_ and N_): Define. (parse_user_spec): Mark translatable strings.
2000-02-12add FIXME comments for use of atoiJim Meyering
2000-02-12(ISDIGIT): Define it.Jim Meyering
(isdigit): Remove definition. (is_number): Use ISDIGIT, not isdigit.
1998-12-19break long lineJim Meyering
1998-12-19break long lineJim Meyering
1998-12-07ansideclifyJim Meyering
1998-05-10Don't declare strdup if it's defined as a macro.Jim Meyering
Reported by Lorne Baker.
1998-03-15Use #if, not #ifdef with HAVE_ macrosJim Meyering
1998-03-10(parse_user_spec) [__DJGPP__]: Make function knowJim Meyering
about any arbitrary user and group by pretending to be the user and to belong to the group specified in `spec_arg' argument.
1997-07-06Change some #ifdef to #if.Jim Meyering
Indent a cpp directive.
1996-07-15update FSF address in copyrightJim Meyering
1995-10-18[HAVE_ENDGRENT]: Define away endgrent.Jim Meyering
[HAVE_ENDPWENT]: Define away endpwent.
1995-08-05(isnumber): Rename to is_number.Jim Meyering
(parse_user_spec): Rename uses, too.
1995-05-13(parse_user_spec): Use strchr, not index.Jim Meyering
[!HAVE_STRING_H]: Define strchr in terms of index, not the other way around.
1994-10-02merge with 3.9hJim Meyering
1994-07-01(main): Change #ifdef TESTING to TEST.Jim Meyering
1994-07-01Include alloca directives.Jim Meyering
Replace 3 lines with V_STRDUP equivalent.
1994-07-01Rewrite.Jim Meyering
1994-03-14.Jim Meyering
1994-03-14.Jim Meyering
1993-10-26merge with 3.9aJim Meyering
1993-10-12merge with 3.8.4cJim Meyering
1993-10-06merge with 3.8.3bJim Meyering
1993-04-05* system.h [rindex, incl, bcopy, bzero]: Ditto.Jim Meyering
* userspec.c [index]: Ditto.
1992-10-31Initial revisionJim Meyering