~ubuntu-branches/ubuntu/karmic/nfs-utils/karmic

« back to all changes in this revision

Viewing changes to support/nfs/nfssvc.c

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2009-06-09 10:50:33 UTC
  • mfrom: (12.1.24 karmic)
  • Revision ID: james.westby@ubuntu.com-20090609105033-4ubs7qlbykrl10dk
Tags: 1:1.2.0-2
* Merge from Ubuntu
* Rename 101-reduce-verbosity.diff to 11-532048-reduce-verbosity.patch
* Fix syslog verbosity with expired kerberos creds; closes: #532048
  11-532048-reduce-verbosity.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
        return;
117
117
}
118
118
static void
119
 
nfssvc_versbits(unsigned int ctlbits)
 
119
nfssvc_versbits(unsigned int ctlbits, int minorvers4)
120
120
{
121
121
        int fd, n, off;
122
122
        char buf[BUFSIZ], *ptr;
133
133
                else
134
134
                    off += snprintf(ptr+off, BUFSIZ - off, "-%d ", n);
135
135
        }
 
136
        n = minorvers4 >= 0 ? minorvers4 : -minorvers4;
 
137
        if (n >= NFSD_MINMINORVERS4 && n <= NFSD_MAXMINORVERS4)
 
138
                    off += snprintf(ptr+off, BUFSIZ - off, "%c4.%d",
 
139
                                    minorvers4 > 0 ? '+' : '-',
 
140
                                    n);
136
141
        snprintf(ptr+off, BUFSIZ - off, "\n");
137
142
        if (write(fd, buf, strlen(buf)) != strlen(buf)) {
138
143
                syslog(LOG_ERR, "nfssvc: Setting version failed: errno %d (%s)", 
143
148
        return;
144
149
}
145
150
int
146
 
nfssvc(int port, int nrservs, unsigned int versbits, unsigned protobits,
147
 
        char *haddr)
 
151
nfssvc(int port, int nrservs, unsigned int versbits, int minorvers4,
 
152
        unsigned protobits, char *haddr)
148
153
{
149
154
        struct nfsctl_arg       arg;
150
155
        int fd;
153
158
         * the ports get registered with portmap against correct
154
159
         * versions
155
160
         */
156
 
        nfssvc_versbits(versbits);
 
161
        nfssvc_versbits(versbits, minorvers4);
157
162
        nfssvc_setfds(port, protobits, haddr);
158
163
 
159
164
        fd = open(NFSD_THREAD_FILE, O_WRONLY);