summaryrefslogtreecommitdiff
path: root/usr/src/cmd/oamuser
diff options
context:
space:
mode:
authorcasper <none@none>2007-05-25 05:43:42 -0700
committercasper <none@none>2007-05-25 05:43:42 -0700
commitf48205be61a214698b763ff550ab9e657525104c (patch)
treebc63168b8468284765bb770eb48473b7a0bf980e /usr/src/cmd/oamuser
parent7387092aa96cd872b317dfab3fee34a96c681f3e (diff)
downloadillumos-joyent-f48205be61a214698b763ff550ab9e657525104c.tar.gz
PSARC 2007/064 Unified POSIX and Windows Credentials for Solaris
4994017 data structure sharing between rpcbind and libnsl leads to accidents 6549510 Need the ability to store SIDs in the Solaris cred_t 6549515 PSARC 2007/064: uid_t and gid_t to become unsigned
Diffstat (limited to 'usr/src/cmd/oamuser')
-rw-r--r--usr/src/cmd/oamuser/group/add_group.c11
-rw-r--r--usr/src/cmd/oamuser/group/gid.c15
-rw-r--r--usr/src/cmd/oamuser/user/useradd.c8
-rw-r--r--usr/src/cmd/oamuser/user/usermod.c11
4 files changed, 23 insertions, 22 deletions
diff --git a/usr/src/cmd/oamuser/group/add_group.c b/usr/src/cmd/oamuser/group/add_group.c
index fdb0b4eee8..6bc354a7bd 100644
--- a/usr/src/cmd/oamuser/group/add_group.c
+++ b/usr/src/cmd/oamuser/group/add_group.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -81,7 +80,7 @@ gid_t gid; /* gid of group to add */
while (fgets(buf, GRPBUFSIZ, etcgrp) != NULL) {
/* Check for NameService reference */
if (!newdone && (buf[0] == '+' || buf[0] == '-')) {
- (void) fprintf(etctmp, "%s::%ld:\n", group, gid);
+ (void) fprintf(etctmp, "%s::%u:\n", group, gid);
newdone = 1;
}
@@ -92,7 +91,7 @@ gid_t gid; /* gid of group to add */
(void) fclose(etcgrp);
if (!newdone) {
- (void) fprintf(etctmp, "%s::%ld:\n", group, gid);
+ (void) fprintf(etctmp, "%s::%u:\n", group, gid);
}
if (rename(GRPTMP, GROUP) < 0) {
diff --git a/usr/src/cmd/oamuser/group/gid.c b/usr/src/cmd/oamuser/group/gid.c
index 7fda7d7a1f..51f3a67242 100644
--- a/usr/src/cmd/oamuser/group/gid.c
+++ b/usr/src/cmd/oamuser/group/gid.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -19,11 +18,15 @@
*
* CDDL HEADER END
*/
+/*
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
-#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */
+#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5 */
#include <sys/types.h>
#include <stdio.h>
@@ -64,7 +67,7 @@ findnextgid()
"r")) == NULL)
return (-1);
- if (fscanf(fptr, "%ld\n", &next) == EOF) {
+ if (fscanf(fptr, "%u\n", &next) == EOF) {
(void) pclose(fptr);
return (DEFRID + 1);
}
@@ -98,7 +101,7 @@ findnextgid()
gid = -1;
last = next;
- } while (fscanf(fptr, "%ld\n", &next) != EOF);
+ } while (fscanf(fptr, "%u\n", &next) != EOF);
(void) pclose(fptr);
diff --git a/usr/src/cmd/oamuser/user/useradd.c b/usr/src/cmd/oamuser/user/useradd.c
index 2b3ebb1056..ae497ca531 100644
--- a/usr/src/cmd/oamuser/user/useradd.c
+++ b/usr/src/cmd/oamuser/user/useradd.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -557,7 +557,7 @@ char *argv[];
/* set gid flag */
nargv[argindex++] = "-g";
- (void) sprintf(gidstring, "%ld", gid);
+ (void) sprintf(gidstring, "%u", gid);
nargv[argindex++] = gidstring;
/* shell */
@@ -577,7 +577,7 @@ char *argv[];
/* set uid flag */
nargv[argindex++] = "-u";
- (void) sprintf(uidstring, "%ld", uid);
+ (void) sprintf(uidstring, "%u", uid);
nargv[argindex++] = uidstring;
if (oflag) nargv[argindex++] = "-o";
@@ -641,7 +641,7 @@ char *argv[];
"user id");
exit(EX_ID_EXISTS);
}
- (void) sprintf(uidstring, "%ld", uid);
+ (void) sprintf(uidstring, "%u", uid);
}
break;
diff --git a/usr/src/cmd/oamuser/user/usermod.c b/usr/src/cmd/oamuser/user/usermod.c
index 5b623b07e8..9e98927ada 100644
--- a/usr/src/cmd/oamuser/user/usermod.c
+++ b/usr/src/cmd/oamuser/user/usermod.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -587,7 +586,7 @@ char **argv;
if (group) {
/* set gid flag */
nargv[argindex++] = "-g";
- (void) sprintf(gidstring, "%ld", gid);
+ (void) sprintf(gidstring, "%u", gid);
nargv[argindex++] = gidstring;
}
@@ -608,7 +607,7 @@ char **argv;
if (uidstr) { /* set uid flag */
nargv[argindex++] = "-u";
- (void) sprintf(uidstring, "%ld", uid);
+ (void) sprintf(uidstring, "%u", uid);
nargv[argindex++] = uidstring;
}