~ubuntu-branches/ubuntu/precise/eglibc/precise-201308281639

« back to all changes in this revision

Viewing changes to sunrpc/netname.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-08 01:58:09 UTC
  • mfrom: (1.5.3) (288.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120208015809-ulscst7uteq3e22z
Tags: 2.15~pre6-0ubuntu10
Merge from Debian (r5151, 2.13-26).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 1997, 1998, 1999, 2002, 2007 Free Software Foundation, Inc.
 
1
/* Copyright (C) 1997-1999, 2002, 2007, 2011 Free Software Foundation, Inc.
2
2
   This file is part of the GNU C Library.
3
3
   Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
4
4
 
55
55
    netname[i - 1] = '\0';
56
56
  return 1;
57
57
}
58
 
libc_hidden_def (user2netname)
 
58
libc_hidden_nolink (user2netname, GLIBC_2_1)
59
59
 
60
60
int
61
61
host2netname (char netname[MAXNETNAMELEN + 1], const char *host,
116
116
  sprintf (netname, "%s.%s@%s", OPSYS, hostname, domainname);
117
117
  return 1;
118
118
}
 
119
#ifdef EXPORT_RPC_SYMBOLS
119
120
libc_hidden_def (host2netname)
 
121
#else
 
122
libc_hidden_nolink (host2netname, GLIBC_2_1)
 
123
#endif
120
124
 
121
125
int
122
126
getnetname (char name[MAXNETNAMELEN + 1])
131
135
    dummy = user2netname (name, uid, NULL);
132
136
  return (dummy);
133
137
}
134
 
libc_hidden_def (getnetname)
 
138
libc_hidden_nolink (getnetname, GLIBC_2_1)
135
139
 
136
140
/* Type of the lookup function for netname2user.  */
137
141
typedef int (*netname2user_function) (const char netname[MAXNETNAMELEN + 1],
181
185
 
182
186
  return status == NSS_STATUS_SUCCESS;
183
187
}
 
188
#ifdef EXPORT_RPC_SYMBOLS
184
189
libc_hidden_def (netname2user)
 
190
#else
 
191
libc_hidden_nolink (netname2user, GLIBC_2_1)
 
192
#endif
185
193
 
186
194
int
187
195
netname2host (const char netname[MAXNETNAMELEN + 1], char *hostname,
188
196
              const int hostlen)
189
197
{
190
198
  char *p1, *p2;
191
 
  char buffer[MAXNETNAMELEN + 1];
192
199
 
193
 
  p1 = strchr (buffer, '.');
 
200
  p1 = strchr (netname, '.');
194
201
  if (p1 == NULL)
195
202
    return 0;
196
203
  p1++;
208
215
 
209
216
  return 1;
210
217
}
 
218
libc_hidden_nolink (netname2host, GLIBC_2_1)